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 <ApplicationServices/ApplicationServices.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
|
||||
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()
|
||||
|
|
|
@ -45,11 +45,12 @@
|
|||
|
||||
#include "extgl.h"
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
|
||||
class RenderingContext
|
||||
{
|
||||
public:
|
||||
CGLContextObj contextObj;
|
||||
CGLContextObj contextObj;
|
||||
WindowPtr windowPtr;
|
||||
Rect rect;
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
*/
|
||||
|
||||
#include "org_lwjgl_input_Mouse.h"
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
/*
|
||||
* 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 ) ;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue