Re: Question on glBufferData / glBufferSubData
Walter White <[email protected]> Sun, 16 Mar 2014 01:11:03 +0100
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
Hello, sorry, I guess I wrote to quickly. Both methods using glBufferSubData work as expected for a few seconds but then stop working with OpenGL.error.GLError: GLError( err = 1281, description = b'invalid value', baseOperation = glBufferSubData, I found a this bug report https://bugs.launchpad.net/pygl3display/+bug/1178470 but I am not sure if this is related. I am using Windows 7 with PyOpenGL-3.1.0b1.win-amd64-py3.3 PyOpenGL-accelerate-3.1.0b1.win-amd64-py3.3 Kind regards, Walter Am 16.03.2014 00:48, schrieb Walter White: > 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