diff options
Diffstat (limited to 'src/powdertoyjava/OpenGLCanvasMacOS.h')
| -rw-r--r-- | src/powdertoyjava/OpenGLCanvasMacOS.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/powdertoyjava/OpenGLCanvasMacOS.h b/src/powdertoyjava/OpenGLCanvasMacOS.h new file mode 100644 index 0000000..cee495a --- /dev/null +++ b/src/powdertoyjava/OpenGLCanvasMacOS.h @@ -0,0 +1,35 @@ +#ifdef USE_JNI +#import <jawt_md.h> + +#import <Cocoa/Cocoa.h> +#import <AppKit/NSOpenGL.h> + +NSOpenGLPixelFormat* defaultPixelFormat(); + +NSOpenGLContext* ensureContext(NSOpenGLContext* openGLContext, NSView *view); + +typedef struct { + JAWT* awt; + JAWT_DrawingSurface* ds; + JAWT_DrawingSurfaceInfo* dsi; + JAWT_MacOSXDrawingSurfaceInfo* dsi_mac; + NSView *view; + NSOpenGLContext* openGLContext; +} ContextInfo; + +ContextInfo* getContext(JNIEnv *env, jobject canvas); + +void freeContext(JNIEnv *env, jobject canvas, ContextInfo* ci); + +#ifdef __cplusplus +extern "C" { +#endif + JNIEXPORT jboolean JNICALL Java_OpenGLCanvas_beginOpenGL(JNIEnv *env, jobject canvas); + JNIEXPORT void JNICALL Java_OpenGLCanvas_endOpenGL(JNIEnv *env, jobject canvas); + JNIEXPORT void JNICALL Java_OpenGLCanvas_updateOpenGL(JNIEnv *env, jobject canvas); + JNIEXPORT void JNICALL Java_OpenGLCanvas_allocOpenGL(JNIEnv *env, jobject canvas); + JNIEXPORT void JNICALL Java_OpenGLCanvas_releaseOpenGL(JNIEnv *env, jobject canvas); +#ifdef __cplusplus +} +#endif +#endif
\ No newline at end of file |
