Bug 235 - VBO with GL glVertexPointer with a null array
Summary: VBO with GL glVertexPointer with a null array
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: P3 normal
Assignee: Sven Gothel
Depends on:
Reported: 2006-07-09 09:32 CEST by Sven Gothel
Modified: 2010-03-24 07:49 CET (History)
0 users

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:49:19 CET

---- Reported by aaronanderson 2006-07-09 21:32:03 ----

On the JOGL GL interface there are two glVertexPointer method signatures:

void glVertexPointer(int size, int type, int stride, Buffer ptr) 
void glVertexPointer(int size, int type, int stride, long ptr_buffer_offset) 

If I issue a glBindBufferARB() right before a call to  
glVertexPointer( 3, GL.GL_DOUBLE, 0, (Buffer)null );

I get an exception:
Exception in thread "Thread-2" javax.media.opengl.GLException: 
javax.media.opengl.GLException: array vertex_buffer_object must be disabled to 
call this method
        at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:271)
        at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
        at com.sun.opengl.util.Animator.display(Animator.java:144)
        at com.sun.opengl.util.Animator$MainLoop.run(Animator.java:181)
        at java.lang.Thread.run(Thread.java:619)

However if I change the call to 
glVertexPointer( 3, GL.GL_DOUBLE, 0, 0 );

I don't get an exception and I get the desired results. I believe both calls 
are equivalent and should be treated the same.

---- Additional Comments From kbr 2006-07-09 23:50:47 ----

These overloaded routines are left distinct because of type safety and security
issues. While it is in theory possible to overload the meaning of the version
taking a Buffer in the manner described, we are not going to make this change at
this time.

--- Bug imported by sgothel@jausoft.com 2010-03-24 07:49 EDT  ---

This bug was previously known as _bug_ 235 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=235