Question on glBufferData / glBufferSubData

Walter White <[email protected]> Sun, 16 Mar 2014 00:48:21 +0100
Newsgroups gmane.comp.python.opengl.user
Message-ID <[email protected]>
Hello,

I have a question about PyOpenGL and hope that you can help me.

I am a little bit confused about the follwing.

This works fine:

glBufferData(GL_ARRAY_BUFFER, ADT.arrayByteCount(npData), 	
              ADT.voidDataPointer(npData), GL_STATIC_DRAW)

This also works fine:

glBufferSubData(GL_ARRAY_BUFFER, 0, ADT.arrayByteCount(npData), npData)

But using this results in OpenGL Error 1281 Invalid Type after a few
seconds:

glBufferSubData(GL_ARRAY_BUFFER, 0, ADT.arrayByteCount(npData), 
ADT.voidDataPointer(npData))

I don't understand why using ADT.voidDataPointer(npData) in the
latter does not work as the specification states the that
the type is a void pointer to the data array in both functions:

void glBufferSubData(GLenum target,  GLintptr offset,  GLsizeiptr size, 
  const GLvoid * data);

void glBufferData(GLenum target,  GLsizeiptr size,  const GLvoid * data, 
  GLenum usage);

Kind regards,
Walter

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net