Updated to use CGL as opposed to AGL

This commit is contained in:
Gregory Pierce 2003-05-09 20:23:28 +00:00
parent 985c601df9
commit 5afb350aa0
3 changed files with 15 additions and 2 deletions

View File

@ -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()

View File

@ -45,11 +45,12 @@
#include "extgl.h" #include "extgl.h"
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#include <OpenGL/OpenGL.h>
class RenderingContext class RenderingContext
{ {
public: public:
CGLContextObj contextObj; CGLContextObj contextObj;
WindowPtr windowPtr; WindowPtr windowPtr;
Rect rect; Rect rect;

View File

@ -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 ) ;
} }