aboutsummaryrefslogtreecommitdiffstats
path: root/make/gl-impl-CustomCCode.c
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-08-06 04:58:31 +0000
committerKenneth Russel <[email protected]>2003-08-06 04:58:31 +0000
commit661fec76c5ccd030016d66675024ec604752ccda (patch)
treeeeb61fdea2164d358809eed4d73b6654815c01d8 /make/gl-impl-CustomCCode.c
parentd224c85aa7c2e420ffec62ce77f2ca02430f6c76 (diff)
Changed behavior of ManuallyImplement to not emit GLEmitter's dispatch
routine, but to still emit entry in proc address table. Added first implementation of glMapBufferARB; may need to reimplement due to creation of finalizable direct ByteBuffer objects each time this routine is called (which will be every frame). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@45 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/gl-impl-CustomCCode.c')
-rw-r--r--make/gl-impl-CustomCCode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/make/gl-impl-CustomCCode.c b/make/gl-impl-CustomCCode.c
new file mode 100644
index 000000000..1616353d9
--- /dev/null
+++ b/make/gl-impl-CustomCCode.c
@@ -0,0 +1,15 @@
+/* Java->C glue code:
+ * Java package: net.java.games.jogl.impl.windows.WindowsGLImpl
+ * Java method: java.nio.ByteBuffer dispatch_glMapBufferARB(int target, int access)
+ * C function: LPVOID glMapBufferARB(GLenum target, GLenum access);
+ */
+JNIEXPORT jobject JNICALL
+Java_net_java_games_jogl_impl_windows_WindowsGLImpl_dispatch_1glMapBufferARB(JNIEnv *env, jobject _unused, jint target, jint access, jint size, jlong glProcAddress) {
+ PFNGLMAPBUFFERARBPROC ptr_glMapBufferARB;
+ LPVOID _res;
+ ptr_glMapBufferARB = (PFNGLMAPBUFFERARBPROC) (intptr_t) glProcAddress;
+ assert(ptr_glMapBufferARB != NULL);
+ _res = (* ptr_glMapBufferARB) ((GLenum) target, (GLenum) access);
+ if (_res == NULL) return NULL;
+ return (*env)->NewDirectByteBuffer(env, _res, size);
+}