Menu

#243 Unable to send null pointer (or zero) to glTexSubImage()

v3.0.0
open
GL (74)
5
2011-11-24
2011-11-24
No

When updating a texture from a PBO, the value for pixels is an offset into the PBO.

This cannot be done using the pythonic API in PyOpenGL. (it fails to convert None to an array, and a zero-int is treated as a small array, yielding an gl error)

The workaround is to use the raw api thusly:

raw.GL.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, width, height, GL.GL_BGR, GL.GL_UNSIGNED_BYTE, POINTER(ctypes.c_ubyte)())

Discussion


Log in to post a comment.