Thread: [PyOpenGL-Users] BUG (?) Exceptions not working?
Brought to you by:
mcfletch
From: Ian M. <geo...@gm...> - 2010-02-05 00:03:36
|
Hi, So I've been trying to debug some code, and it now occurs to me that PyOpenGL's method of redirecting OpenGL error flags to the console as tracebacks simply isn't working. Absolute nonsense goes unchallenged: glClear(GL_BLEND|GL_TEXTURE_2D) glViewport(0,0,-800,-600) glBegin(GL_QUADS) glClear(GL_DEPTH_BUFFER_BIT) glEnd() etc. I really REALLY need to be aware of opengl errors to debug various problems with framebuffers/shaders/etc. What's going on? PyOpenGL 3.0.1b2 Thanks, Ian |
From: Alejandro S. <as...@gm...> - 2010-02-05 22:34:24
|
Hi Ian, On Thu, Feb 4, 2010 at 10:03 PM, Ian Mallett <geo...@gm...> wrote: > Hi, > > So I've been trying to debug some code, and it now occurs to me that > PyOpenGL's method of redirecting OpenGL error flags to the console as > tracebacks simply isn't working. > > Absolute nonsense goes unchallenged: > > glClear(GL_BLEND|GL_TEXTURE_2D) > > glViewport(0,0,-800,-600) > > glBegin(GL_QUADS) > glClear(GL_DEPTH_BUFFER_BIT) > glEnd() > > etc. > > I really REALLY need to be aware of opengl errors to debug various problems > with framebuffers/shaders/etc. What's going on? > > PyOpenGL 3.0.1b2 > > I've noticed that you actually need a valid OpenGL context in order to be able to detect gl errors. I modified your example slightly and seems to be throwing errors now: Negative Viewport dimensions: >>> import pygame >>> from OpenGL.GL import * >>> pygame.init() (6, 0) >>> pygame.display.set_mode((100,100), pygame.OPENGL) <Surface(100x100x32 SW)> >>> glViewport(0,0,-800,-800) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/OpenGL/error.py", line 194, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 1281, description = 'invalid value', baseOperation = glViewport, cArguments = (0, 0, -800, -800) ) >>> glViewport(0,0,800,800) Calling glClear between glBegin()...glEnd() block: >>> glBegin(GL_QUADS) >>> glClear(GL_DEPTH_BUFFER_BIT) >>> glEnd() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/OpenGL/GL/exceptional.py", line 55, in glEnd return simple.glEnd( ) File "/usr/lib/python2.5/site-packages/OpenGL/error.py", line 194, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 1282, description = 'invalid operation', baseOperation = glEnd, cArguments = () ) Let me know how it goes. Best regards, Alejandro.- > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > |
From: Mike C. F. <mcf...@vr...> - 2010-02-06 13:10:38
|
Ian Mallett wrote: > Hi, > > Just to clarify, the code presented was an excerpt. I was actually > using variations with the file attached for testing. > > Interestingly, the code you did /doesn't/ crash for me: > > >>> import pygame > >>> from OpenGL.GL import * > >>> pygame.init() > (6, 0) > >>> pygame.display.set_mode((100,100), pygame.OPENGL) > <Surface(100x100x32 SW)> > >>> glViewport(0,0,-800,-800) > >>> glBegin(GL_QUADS) > >>> glClear(GL_DEPTH_BUFFER_BIT) > >>> glEnd() > >>> > > Ideas? > Thanks, > Ian Can you tell me platform, card, etceteras? That sounds like a bug, if you've got a context you should be getting the glCheckError() function running, but there is platform-specific code to guard against getting protection faults if you call a function before there's a context. I'm not likely to get any time to work on PyOpenGL before the conference, but it's beginning to look like I'll be spending at least one full day of the sprints on it, so if there are things that need addressing, now's the time to bring them to my attention. Take care, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Ian M. <geo...@gm...> - 2010-02-06 16:09:13
|
On Sat, Feb 6, 2010 at 5:01 AM, Mike C. Fletcher <mcf...@vr...>wrote: > Can you tell me platform, card, etceteras? > Windows Vista Home Premium (32 bit) (SP2) Intel Core 2 Duo 2.4 GHz 4 GB RAM NVIDIA GeForce 8400M GS |
From: Ian M. <geo...@gm...> - 2010-02-21 04:56:46
|
Hah--I fixed it! Turns out, the problem was the card--specifically the error reporting option. Because my current display control panel didn't have the error reporting option, I installed a previous display driver, which also installs a version of the display control panel that includes the error reporting option. I then turned error reporting *off*, which actually turns it on. Well then. Thanks! -Ian |