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

View File

@ -45,6 +45,7 @@
#include "extgl.h"
#include <ApplicationServices/ApplicationServices.h>
#include <OpenGL/OpenGL.h>
class RenderingContext
{

View File

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