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

[pygame] PyOpenGL and win32screensaver



I am trying to get a 3D screensaver to work using PyGame, PyOpenGL and win32screensaver. There seems to be an incompatibility that I haven't been able to resolve.

Since win32screensaver invokes a special instance of pygame, I know I can't import pygame myself or use pygame.display.set_mode without extreme care. So I tried changing win32screensaver to have a configurable video_flags parameter.

So pyscr_pygame.py[86] has:
self.window = self.pygame.display.set_mode((self.width, self.height), self.video_flags)


Now I set video_flags to 0x40000002 (that's OPENGL|DOUBLEBUF, but of course I can't import pygame, so for now I just hard code it, until I get something working). Apparently the OPENGL flag is killing it. If I use the OPENGL flag, the process hangs during initialization (before the first draw is attempted).

What kind of side effect should I expect from the OPENGL flag? Any ideas/workarounds?

Should I try taking PyGame out of the loop? Neither PyOpenGL and win32screensaver actually require PyGame, but PyGame seems like it should be a convenient glue between the two. Besides, I have be able to make my PyOpenGL content work under PyGame, and I have successfully used win32screensaver with Pygame (without PyOpenGL). It would be nice to be able to do both at the same time.

Happy Everything,
- Ken Seehart