This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src/powdertoyjava/OpenGLCanvasMacOS.h
2012-06-04 12:21:07 +01:00

35 lines
1.0 KiB
Objective-C

#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