Re: settingOpenGL.ERROR_CHECKING to Fa lse has strange consequence on function loading
rndblnch <[email protected]> Fri, 21 Feb 2014 15:23:24 +0000 (UTC)
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
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
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net