Re: [PyOpenGL-Users] Attempt to retrieve context when no valid context - repost
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2009-04-24 18:19:58
|
Mads Ipsen wrote: ... > I am running an app in a PyQt based QGLWidget. If the window is minimized, > and the method for rendering the object that should be displayed is > called, I get the error 'OpenGL.error.Error: Attempt to retrieve context > when no > valid context' (included below), when glColorPointerd() is called. > This is actually *not* really a necessary operation for any situation where you have retained a pointer to your data and avoided any data-copy operations, but if GetCurrentContext() is returning null you're likely going to blow up at some point anyway. > Is there: > > * a way to check whether a valid context is set? > OpenGL.platform.CurrentContextIsValid() -> bool > * force the context to be set? > This is windowing-system dependent, you will likely find something like self.setCurrent() in your QGLWidget, it may not work when the window is minimized, however. I'm a bit surprised that the widget is calling the draw callback without doing a setCurrent(), would be more likely that it just can't get the context to be current when it's not on-screen. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |