Use a fixed back buffer for proper resolution in fullscreen mode

This commit is contained in:
kappaOne 2012-11-30 23:24:12 +00:00
parent b72cdb3064
commit b3b5e95bf4
1 changed files with 10 additions and 0 deletions

View File

@ -457,8 +457,18 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow(JNIE
[window_info->window setContentView:window_info->view];
// disable any fixed backbuffer size to allow resizing
CGLContextObj cgcontext = (CGLContextObj)[[window_info->view openGLContext] CGLContextObj];
CGLDisable(cgcontext, kCGLCESurfaceBackingSize);
}
else {
// set a fixed backbuffer size for fullscreen
CGLContextObj cgcontext = (CGLContextObj)[[window_info->view openGLContext] CGLContextObj];
GLint dim[2] = {width, height};
CGLSetParameter(cgcontext, kCGLCPSurfaceBackingSize, dim);
CGLEnable(cgcontext, kCGLCESurfaceBackingSize);
// enter fullscreen mode
[window_info->view enterFullScreenMode: [NSScreen mainScreen] withOptions: nil ];
window_info->window = [window_info->view window];