summaryrefslogtreecommitdiff
path: root/src/powdertoyjava/OpenGLCanvasWin32.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-20 12:40:18 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-20 12:40:18 (GMT)
commit2be9c925088c16beb144dd9932202416d00ff581 (patch)
tree51f8ccbf2b0b051890c5f5d12fa28a67635c06c2 /src/powdertoyjava/OpenGLCanvasWin32.h
parent9769239af69695e9a7f8cf103a197695ecf691e0 (diff)
downloadpowder-2be9c925088c16beb144dd9932202416d00ff581.zip
powder-2be9c925088c16beb144dd9932202416d00ff581.tar.gz
OpenGL canvas for Windows, Notifications for main Game, Update checker in Client (+ other client triggered events)
Diffstat (limited to 'src/powdertoyjava/OpenGLCanvasWin32.h')
-rw-r--r--src/powdertoyjava/OpenGLCanvasWin32.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/powdertoyjava/OpenGLCanvasWin32.h b/src/powdertoyjava/OpenGLCanvasWin32.h
new file mode 100644
index 0000000..bff6b20
--- /dev/null
+++ b/src/powdertoyjava/OpenGLCanvasWin32.h
@@ -0,0 +1,35 @@
+#ifdef USE_JNI
+#import <jawt_md.h>
+
+#include <windows.h>
+#include <assert.h>
+#include <gl/gl.h>
+
+int defaultPixelFormat(PIXELFORMATDESCRIPTOR* pfd);
+
+HGLRC ensureContext(JAWT_Win32DrawingSurfaceInfo* dsi_win, HGLRC hRC);
+
+typedef struct {
+ JAWT* awt;
+ JAWT_DrawingSurface* ds;
+ JAWT_DrawingSurfaceInfo* dsi;
+ JAWT_Win32DrawingSurfaceInfo* dsi_win;
+ HGLRC hRC;
+} 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