diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-31 09:24:44 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-05-31 09:24:44 (GMT) |
| commit | e0c9dab8cb981172c5de81f5963e28db67f1b295 (patch) | |
| tree | dd78e82f54a7ed87915a7d5100437cd42ac0c415 /src/powdertoyjava/OpenGLCanvasMacOS.h | |
| parent | 708d52bcc5f0e13fa6540751e2402ccfdf02bec7 (diff) | |
| download | powder-e0c9dab8cb981172c5de81f5963e28db67f1b295.zip powder-e0c9dab8cb981172c5de81f5963e28db67f1b295.tar.gz | |
Move more SDL dependancies out of program, OpenGLCanvas for JNI and JNI methods.
Diffstat (limited to 'src/powdertoyjava/OpenGLCanvasMacOS.h')
| -rw-r--r-- | src/powdertoyjava/OpenGLCanvasMacOS.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/powdertoyjava/OpenGLCanvasMacOS.h b/src/powdertoyjava/OpenGLCanvasMacOS.h new file mode 100644 index 0000000..3f3d68f --- /dev/null +++ b/src/powdertoyjava/OpenGLCanvasMacOS.h @@ -0,0 +1,33 @@ +#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
\ No newline at end of file |
