Question

I see that all tutorials about the pyopengl implements pygame, is posible use PyOpengl without pygame?. and if is so, then, is most faster without pygame or not?

Was it helpful?

Solution

When using pygame with opengl, pygame will handle crossplatform: window creation, key input, sound output, image loading, etc..., but pyOpenGL does the actual rendering.

Pyglet has crossplatform window creation + opengl as well: http://www.pyglet.org/

I don't believe there's much of a speed difference, in using pygame vs other solutions. But the difference will be in how you do things, that will have the biggest effect. Using numpy vs not, calling expensive functions repeatedly, like: opengl's begin/end, etc.

OTHER TIPS

PyGame's only relation to PyOpenGL is that PyGame can provide a window for PyOpenGL to render on.

Your question now is whether PyGame's windowing environment is faster than another.

In my experience, GLUT can be very slightly faster than PyGame for windowing (by comparing GLUT and SDL). wxWidgets I think is a bit slower. PyGlet isn't PyOpenGL (although it is a Python OpenGL implementation).

My recommendation: PyGame is easiest to use and provides helpful utilities besides. Use it instead of anything else; any performance differences are negligible.

When you need better windowing support, go for Qt or wxWidgets, in that order.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top