diff --git a/src/native/macosx/RenderingContext.cpp b/src/native/macosx/RenderingContext.cpp index 5fee274f..b757069a 100644 --- a/src/native/macosx/RenderingContext.cpp +++ b/src/native/macosx/RenderingContext.cpp @@ -40,6 +40,8 @@ */ #include "RenderingContext.h" +#include +#include RenderingContext::RenderingContext() { @@ -49,6 +51,7 @@ bool RenderingContext::createDisplay( int width, int height, int bpp, int freq { printf("Creating display"); + CGDisplayCapture( kCGDirectMainDisplay ) ; CGDisplaySwitchToMode( kCGDirectMainDisplay, CGDisplayBestModeForParameters( kCGDirectMainDisplay, @@ -96,7 +99,7 @@ void RenderingContext::swap() { // swap the rendering buffer // - CGLFlushDrawable( contextObj ) + CGLFlushDrawable( contextObj ); } void RenderingContext::makeContextCurrent() diff --git a/src/native/macosx/RenderingContext.h b/src/native/macosx/RenderingContext.h index 1b8c00e3..49f96b2d 100644 --- a/src/native/macosx/RenderingContext.h +++ b/src/native/macosx/RenderingContext.h @@ -45,11 +45,12 @@ #include "extgl.h" #include +#include class RenderingContext { public: - CGLContextObj contextObj; + CGLContextObj contextObj; WindowPtr windowPtr; Rect rect; diff --git a/src/native/macosx/org_lwjgl_input_Mouse.cpp b/src/native/macosx/org_lwjgl_input_Mouse.cpp index e792468a..77e85df3 100644 --- a/src/native/macosx/org_lwjgl_input_Mouse.cpp +++ b/src/native/macosx/org_lwjgl_input_Mouse.cpp @@ -40,6 +40,7 @@ */ #include "org_lwjgl_input_Mouse.h" +#include /* * Class: org_lwjgl_input_Mouse @@ -60,6 +61,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_initIDs JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv * env, jclass clazz) { + CGDisplayHideCursor( kCGDirectMainDisplay ) ; + CGDisplayMoveCursorToPoint( kCGDirectMainDisplay, CGPointZero ) ; + + CGAssociateMouseAndMouseCursorPosition( FALSE ) ; + + return JNI_TRUE; } @@ -90,7 +97,9 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nHasZValue(JNIEnv *env, jc JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy (JNIEnv * env, jclass clazz) { + CGAssociateMouseAndMouseCursorPosition( TRUE ) ; + CGDisplayShowCursor( kCGDirectMainDisplay ) ; }