[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame error unable to reset window for OpenGL context



There are sometimes difficulties changing a window set up for using pygame into one used for PyOpenGL, or vice-versa.  The error you're getting implies this sort of error--are you accidentally using the wrong window?  PyOpenGL might just not like being in a subprocess, or being quit in a subprocess.

>>> import pygame
>>> from pygame.locals import *
>>> from OpenGL.GL import *
>>> pygame.init()
(6, 0)
>>> pygame.display.set_mode((100,100),OPENGL|DOUBLEBUF)
<Surface(100x100x32 SW)>
>>> pygame.display.quit()
>>> pygame.display.set_mode((100,100),OPENGL|DOUBLEBUF)
<Surface(100x100x32 SW)>
>>> pygame.display.quit()

As this shows, it is perfectly possible to build an OpenGL window several times, but subprocesses might put a different spin on it.

Ian