Login  Register

Re: Where is glVertexAttribIPointer that doesn't take a Buffer?

Posted by Sven Gothel on Sep 02, 2012; 10:51pm
URL: https://forum.jogamp.org/Where-is-glVertexAttribIPointer-that-doesn-t-take-a-Buffer-tp4026005p4026006.html

On 09/03/2012 12:13 AM, Jeff Quigley [via jogamp] wrote:
> Hi, I was running
> gl.glVertexAttribPointer(attributeLocation, 2, GL.GL_UNSIGNED_INT, false,
> stride, 0)
> and it refused to work until I switched to GL.GL_FLOAT which seems very weird,
> and if anybody has an explanation for that then I'd be glad to hear it,

What is the phenomenon .. i.e. how you determine it's refused?
No VBO buffer bound Exception ?

> but my
> main question is something else:  In the process of fiddling with this I
> learned about glVertexAttribIPointer() which seemed like something I ought to
> try, since I was passing ints and that function seems to be specialized for
> ints or something.  But the interfaces GL4 and GL3 seem to lack
> glVertexAttribIPointer(int, int, int, int, long).  I'm using a GL3, which
> should have that method.  What's the problem?

I see, the code generation for this method doesn't match the GL3 spec,
where (both) glVertexAttribIPointer(..)'s and glVertexAttribPointer(..)'s
'void *pointer' argument is an offset to a bound VBO (GL_ARRAY_BUFFER).

GL2 spec (and the GL2/GL3 compatibility profile) define
glVertexAttribPointer(..)'s 'void *pointer' argument
either as a direct data source, _or_ as an offset if a VBO (GL_ARRAY_BUFFER) is bound.

I will earmark this, maybe you can copy/paste this email into a new bug report ?
Thank you.

+++

Interface GL2GL3:
build/jogl/gensrc/classes/javax/media/opengl/GL2GL3.java:  /** Entry point to C language function: <code> void {@native glVertexAttribIPointer}(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *  pointer); </code> <br>Part of <code>GL_VERSION_3_0</code>                                                                    
build/jogl/gensrc/classes/javax/media/opengl/GL2GL3.java:  public void glVertexAttribIPointer(int index, int size, int type, int stride, Buffer pointer);

Implementation (For all desktop profiles):
build/jogl/gensrc/classes/jogamp/opengl/gl4/GL4bcImpl.java:  /** Entry point to C language function: <code> void {@native glVertexAttribIPointer}(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *  pointer); </code> <br>Part of <code>GL_VERSION_3_0</code>
build/jogl/gensrc/classes/jogamp/opengl/gl4/GL4bcImpl.java:  public void glVertexAttribIPointer(int index, int size, int type, int stride, Buffer pointer)  { ..

+++

~Sven



signature.asc (907 bytes) Download Attachment