Re: [PyOpenGL-Users] Question on glBufferData / glBufferSubData
Brought to you by:
mcfletch
From: Walter W. <hom...@gm...> - 2014-03-16 00:11:12
|
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 > |