Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?
renesd at gmail.com
Mon Dec 8 05:26:36 CET 2008
PyOpenGL also has a raw module which includes python bindings closer
to the C calls... however mostly you want to use the nicer more
pythonic versions of functions.
Recent pyopengl 3.x versions have been optimized for speed, including
optional C level optimizations. So I imagine they are faster than
pyglets wrappers(profiling/testing needed). PyOpenGL is also used a
lot more by non-game people, so a wider array of functions are used.
It's very unfortunate that pyglet and pyopengl don't share code...
however recent versions of pyopengl tried to reuse some of pyglets
code... not sure how much has been shared though. Maybe at some point
they will come together.
For now pyglet has created a fork in the python+opengl community,
where the same code can't be reused automatically between the two as
the opengl wrappers are slightly different. However it's not terribly
difficult to port code from one to the other, as some projects have
pygame doesn't require opengl be supported by the video card - it can
use many different video drivers to get the job done. It's nice to be
able to avoid using the 3D parts of gfx cards if you can - to reduce
power consumption, and make your game run on more computers.
pygame is also much more portable, has more people using it, has more
developers, and a stable API. Code you wrote 5 years ago will most
likely still work. Code you wrote for older versions of pyglet will
not work without changes.
pygame is simpler to learn, since it doesn't require you to know how
to create classes or functions. Whereas pyglet requires you to sub
class to do anything.
* disclaimer - I'm a pygame developer, and have in the past
contributed to pyopengl - so obviously I prefer pygame and pyopengl.
On Dec 8, 12:53 pm, alex23 <wuwe... at gmail.com> wrote:
> On Dec 8, 11:23 am, excor... at gmail.com wrote:
> > Does pyglet use PyOpenGL as its OpenGL wrapper? If not, any idea why?
> > Seems like it would be a fairly substantial duplication of effort.
> Taken from:http://groups.google.com/group/pyglet-users/msg/832b15389fccd28d
> >> IIRC pyglet tries to minimize dependencies, so PyOpenGL won't be
> >> used. However, pyglet's wrapping of OpenGL isn't meant to be
> >> complete; it's only what pyglet itself uses. You'll need to use
> >> PyOpenGL for the rest.
> > That was more or less the original plan. pyglet wraps OpenGL at the
> > lowest level, so it only provides glVertex3f, glVertex2d, etc.,
> > whereas PyOpenGL also provides polymorphic functions such as glVertex.
> > pyglet provides all of the error-checking functionalities that
> > PyOpenGL does (though these can be disabled for performance). At
> > last check, pyglet was significantly faster than PyOpenGL 3, but
> > slower than PyOpenGL 2.
More information about the Python-list