#132 missing error when glGenTextures() prior to GL init

open
nobody
None
5
2005-04-21
2005-04-21
Maciej Kalisiak
No

PyOpenGL does not raise an exception when glGenTextures() is
called before OpenGL is properly initialized, and it should (e.g.,
before any other OpenGL calls, such ones instantiating an OpenGL
window). Instead an invalid texture name is returned... usually 0 on
first invocation, and 1075671244 on subsequent calls.

This makes one's own bugs hard to catch (e.g., I've been bitten more
than once, when the glGenTextures() call is buried deep within the
constructor of a distant ancestor class, and the object is then
erroneously instantiated at the top of the module in global scope, an
action that would be otherwise harmless and sensible.)

Discussion