Updated to use CGL as opposed to AGL
This commit is contained in:
parent
985c601df9
commit
5afb350aa0
|
@ -40,6 +40,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "RenderingContext.h"
|
#include "RenderingContext.h"
|
||||||
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
#include <OpenGL/OpenGL.h>
|
||||||
|
|
||||||
RenderingContext::RenderingContext()
|
RenderingContext::RenderingContext()
|
||||||
{
|
{
|
||||||
|
@ -49,6 +51,7 @@ bool RenderingContext::createDisplay( int width, int height, int bpp, int freq
|
||||||
{
|
{
|
||||||
printf("Creating display");
|
printf("Creating display");
|
||||||
|
|
||||||
|
|
||||||
CGDisplayCapture( kCGDirectMainDisplay ) ;
|
CGDisplayCapture( kCGDirectMainDisplay ) ;
|
||||||
CGDisplaySwitchToMode( kCGDirectMainDisplay,
|
CGDisplaySwitchToMode( kCGDirectMainDisplay,
|
||||||
CGDisplayBestModeForParameters( kCGDirectMainDisplay,
|
CGDisplayBestModeForParameters( kCGDirectMainDisplay,
|
||||||
|
@ -96,7 +99,7 @@ void RenderingContext::swap()
|
||||||
{
|
{
|
||||||
// swap the rendering buffer
|
// swap the rendering buffer
|
||||||
//
|
//
|
||||||
CGLFlushDrawable( contextObj )
|
CGLFlushDrawable( contextObj );
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderingContext::makeContextCurrent()
|
void RenderingContext::makeContextCurrent()
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
|
|
||||||
#include "extgl.h"
|
#include "extgl.h"
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
#include <OpenGL/OpenGL.h>
|
||||||
|
|
||||||
class RenderingContext
|
class RenderingContext
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "org_lwjgl_input_Mouse.h"
|
#include "org_lwjgl_input_Mouse.h"
|
||||||
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: org_lwjgl_input_Mouse
|
* 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
|
JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate
|
||||||
(JNIEnv * env, jclass clazz)
|
(JNIEnv * env, jclass clazz)
|
||||||
{
|
{
|
||||||
|
CGDisplayHideCursor( kCGDirectMainDisplay ) ;
|
||||||
|
CGDisplayMoveCursorToPoint( kCGDirectMainDisplay, CGPointZero ) ;
|
||||||
|
|
||||||
|
CGAssociateMouseAndMouseCursorPosition( FALSE ) ;
|
||||||
|
|
||||||
|
|
||||||
return JNI_TRUE;
|
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
|
JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy
|
||||||
(JNIEnv * env, jclass clazz)
|
(JNIEnv * env, jclass clazz)
|
||||||
{
|
{
|
||||||
|
CGAssociateMouseAndMouseCursorPosition( TRUE ) ;
|
||||||
|
|
||||||
|
CGDisplayShowCursor( kCGDirectMainDisplay ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue