PDA

View Full Version : Check if there is an active context?



HardCoder
06-09-2013, 05:42 AM
How would one do this?

I'm on python 3.2 with a 32bit machine and Windows 7 OS

Dan Bartlett
06-09-2013, 09:19 AM
You can use wglGetCurrentContext (http://msdn.microsoft.com/en-us/library/windows/desktop/dd374383(v=vs.85).aspx) or equivalent to figure out which OpenGL context is current on the thread that called wglGetCurrentContext. If it returns NULL there is no current OpenGL context on that thread.