Unable to send null pointer (or zero) to glTexSubImage()
Brought to you by:
mcfletch
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)())