Hey guys, does jogl have support for vbos on MAC OS X yet? 10.3.4 has added the vbo extension, but i cant seem to get the vbo working. I get a java.lang.UnsatisfiedLinkError: dispatch_glMapBufferARO exception. thanks
I can verify the VBO’s DO work in the lastest Mac OS update.
You are having a diffrent problem, sorry
Mayeb using MapBuffer is the problem.
When i run the vertexBufferObject.java demo i get:
java.lang.UnsatisfiedLinkError: dispatch_glMapBufferARB
at net.java.games.jogl.impl.macosx.MacOSXGLImpl.dispatch_glMapBufferARB(Native Method)
at net.java.games.jogl.impl.macosx.MacOSXGLImpl.glMapBufferARB(MacOSXGLImpl.java:33467)
at VertexBufferObject.allocateBigArray(VertexBufferObject.java:687)
at VertexBufferObject.access$2(VertexBufferObject.java:678)
at VertexBufferObject$VBOListener.init(VertexBufferObject.java:311)
at net.java.games.jogl.impl.GLDrawableHelper.init(GLDrawableHelper.java:68)
at net.java.games.jogl.GLCanvas$InitAction.run(GLCanvas.java:191)
at net.java.games.jogl.impl.macosx.MacOSXGLContext.makeCurrent(MacOSXGLContext.java:163)
at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.makeCurrent(MacOSXOnscreenGLContext.java:137)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:232)
at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.invokeGL(MacOSXOnscreenGLContext.java:84)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:186)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:74)
at net.java.games.jogl.Animator$1.run(Animator.java:104)
at java.lang.Thread.run(Thread.java:552)
it craps out on the following line:
bigArrayVBOBytes = gl.glMapBufferARB(GL.GL_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB);
what could be the problem? thx
this error implys that the vbo method: glMapBufferARB (also tried glMapBuffer) isn’t in the native library that is linked? I’m using the lastest build of the libjogl.jnilib and jogl.jar (Jun 10th). The other methods seem to have no problem (glBindBuffer, glUnmapBuffer, glBufferData ). I’ve wrote some Objective-C code i wrote the VBO’s work fine. I’m assuming its something wrong with the libjogl.jnilib.
shawnkendall, u verified that VBO’s do work, but are u using MapBuffer?? I would try to build the JOGL myself and look at the jni code that is generated, but i cant justify spending time here at work just to build it (i build it at home, but its on PC). thanks for any help
oops just realized that the generated code is avaibled with nightly builds. after further inspection of the MacOSXGLImpl_JNI.c (June 10 build), the mapBuffer is there. but whats wierd is that the glue code for the windowsGLImpl is there as well:
Java_net_java_games_jogl_impl_windows_WindowsGLImpl_dispatch_1glMapBuffer
Java_net_java_games_jogl_impl_windows_WindowsGLImpl_dispatch_1glMapBufferARB
in addtion to:
Java_net_java_games_jogl_impl_x11_X11GLImpl_dispatch_1glMapBuffer
Java_net_java_games_jogl_impl_x11_X11GLImpl_dispatch_1glMapBufferARB
more weird is the prefix for these two functions:
Java_net_java_games_jogl_impl_x11_X11GLImpl_dispatch_1
Shouldn’t it be:
Java_net_java_games_jogl_impl_macosx_MacOSXGLImpl_dispatch_1
(like the rest of the functions)?
Well i just quickley made the following changes to MacOSXGLImpl_JNI.c and rebuilt the libjogl.jnilib and the mapBuffer functions work properly now. So here are the changes that need to be made from:
JNIEXPORT jlong JNICALL Java_net_java_games_jogl_impl_x11_X11GLImpl_dispatch_1glMapBuffer(JNIEnv env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERPROC ptr_glMapBuffer;
LPVOID _res;
ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
assert(ptr_glMapBuffer != NULL);
_res = ( ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
return (jlong) (intptr_t) _res;
}
JNIEXPORT jlong JNICALL
Java_net_java_games_jogl_impl_x11_X11GLImpl_dispatch_1glMapBufferARB(JNIEnv env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERARBPROC ptr_glMapBufferARB;
LPVOID _res;
ptr_glMapBufferARB = (PFNGLMAPBUFFERARBPROC) (intptr_t) glProcAddress;
assert(ptr_glMapBufferARB != NULL);
_res = ( ptr_glMapBufferARB) ((GLenum) target, (GLenum) access);
return (jlong) (intptr_t) _res;
}
Correct:
JNIEXPORT jlong JNICALL Java_net_java_games_jogl_impl_macosx_MacOSXGLImpl_dispatch_1glMapBuffer(JNIEnv env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERPROC ptr_glMapBuffer;
LPVOID _res;
ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
assert(ptr_glMapBuffer != NULL);
_res = ( ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
return (jlong) (intptr_t) _res;
}
JNIEXPORT jlong JNICALL
Java_net_java_games_jogl_impl_macosx_MacOSXGLImpl_dispatch_1glMapBufferARB(JNIEnv env, jobject _unused, jint target, jint access, jlong glProcAddress) {
PFNGLMAPBUFFERARBPROC ptr_glMapBufferARB;
LPVOID _res;
ptr_glMapBufferARB = (PFNGLMAPBUFFERARBPROC) (intptr_t) glProcAddress;
assert(ptr_glMapBufferARB != NULL);
_res = ( ptr_glMapBufferARB) ((GLenum) target, (GLenum) access);
return (jlong) (intptr_t) _res;
}