apply CL/GL interop patch for mac, thx to jaekwon for patch.

This commit is contained in:
kappa1 2011-10-06 20:16:37 +00:00
parent ca428342d3
commit a6fafde5e3
3 changed files with 25 additions and 1 deletions

View file

@ -38,6 +38,9 @@
*/
#import <jni.h>
#import <OpenGL/CGLCurrent.h>
#import <OpenGL/CGLTypes.h>
#import <OpenGL/CGLDevice.h>
#import <Cocoa/Cocoa.h>
#import "org_lwjgl_opengl_MacOSXContextImplementation.h"
#import "context.h"
@ -78,6 +81,16 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nCre
return context_handle;
}
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_getCGLShareGroup
(JNIEnv *env, jclass clazz, jobject context_handle) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
MacOSXContext *context_info = (MacOSXContext *)(*env)->GetDirectBufferAddress(env, context_handle);
CGLContextObj cgl_context = [context_info->context CGLContextObj];
CGLShareGroupObj share_group = CGLGetShareGroup(cgl_context);
[pool release];
return share_group;
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXContextImplementation_nSwapBuffers
(JNIEnv *env, jclass clazz, jobject context_handle) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];