Re: [PyOpenGL-Users] settingOpenGL.ERROR_CHECKING to False has strange consequence on function loadi
Brought to you by:
mcfletch
From: rndblnch <rnd...@gm...> - 2014-02-21 15:23:57
|
rndblnch <rndblnch <at> gmail.com> writes: > ok, i think i have made progress in my understanding of the problem. > regarding extension loading, there is one place where the > OpenGL.ERROR_CHECKING flag changes the code path taken, it is in > OpenGL/extensions.py, line 163: the glGetString call will fail silently on > OpenGL 3+ if error checking is not enabled, while it will raise an exception > if error checking is enabled. > in this later case, the alternate code path provided in the except clause > will correctly fetch the extensions. > > maybe a fix would be to explicitly check for error after the glGetString call? looks like this was it, the following patch fixes the problem for me: === modified file 'OpenGL/extensions.py' --- OpenGL/extensions.py 2014-01-30 20:32:21 +0000 +++ OpenGL/extensions.py 2014-02-21 15:21:36 +0000 @@ -156,11 +156,13 @@ if not platform.PLATFORM.CurrentContextIsValid(): return False from OpenGL.raw.GL._types import GLint - from OpenGL.raw.GL.VERSION.GL_1_1 import glGetString + from OpenGL.raw.GL.VERSION.GL_1_1 import glGetString, glGetError from OpenGL.raw.GL.VERSION.GL_1_1 import GL_EXTENSIONS from OpenGL import error try: extensions = glGetString( GL_EXTENSIONS ) + if glGetError(): + raise error.GLError() if extensions: extensions = extensions.split() else: renaud |