From 8ae528efe06e458e1c0bf21a95f2fc4bf30b6a27 Mon Sep 17 00:00:00 2001 From: Gregory Pierce Date: Sat, 10 May 2003 22:02:19 +0000 Subject: [PATCH] Added in double buffering and added in the capability to actually swapBuffers with CGFlushDisplay() which will copy the back to the front. --- src/native/macosx/org_lwjgl_opengl_BaseGL.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp b/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp index f4342051..c935ecda 100644 --- a/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp +++ b/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp @@ -68,14 +68,19 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate CGDisplaySwitchToMode( displayID, displayMode ); CGLPixelFormatAttribute attribs[2]; + long swapInterval; + attribs[0] = kCGLPFAFullScreen; - attribs[1] = NULL; + attribs[1] = kCGLPFADoubleBuffer; CGLChoosePixelFormat( attribs, &pixelFormatObj, &numPixelFormats ); if ( pixelFormatObj != NULL ) { CGLCreateContext( pixelFormatObj, NULL, &contextObj ); CGLDestroyPixelFormat( pixelFormatObj ); + + swapInterval = 1; + CGLSetParameter( contextObj, kCGLCPSwapInterval, &swapInterval ); } CGLSetCurrentContext( contextObj ); @@ -108,6 +113,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroyGL JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers (JNIEnv *, jobject) { + CGLFlushDrawable( contextObj ); }