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

Re: [pygame] Pygame vs. PyOpenGL



In the same way that pyOpenGL wraps OpenGL, pygame wraps SDL, Simple
direct media layer which is intended to be a crossplatform layer that
provides some facility for all the major elements of game programming,
i.e. audio and keyboard/mouse/joystick input, media file loading, etc.
etc.

So the scope of the components are different, you can do more types of
things with pygame than you can with pyopengl, so there's a lot of
value in pygame even if you use pyopengl

In terms of just the graphics side of things, pyOpenGL has you use the
opengl api, which means that you are interfacing with the graphics
hardware in a way that is intended to take full advantage of 3d
hardware, including arbitrary polys with textures drawn on them.
Because of this, you may have to work a bit more to get simple
operations done, and you'll have to be aware of which openGL
operations may or may not be available on certain cards (openGL very
rarely does a software implementation of anything, so if the HW isn't
there for the fancy thing you want to do, pyOpenGL will just throw an
exception)

With Pygame, SDL allows you to use hardware acceleration in certain
situations, but the SDL api only really provides untransformed blits
well (i.e. it sucks at rotation/scaling/coloring).

So while PyGame's stuff is quite easy to use and can be hardware
accelerated for great performance, if you want any kind of real-time
image transforms or other fancy stuff, it simply won't do.

Another possible negative with PyOpenGL is that not all systems have
working OpenGL drivers.

Possible negatives of using hardware acceleration (with either opengl
or sdl) is that different drivers may have bugs in various special
cases, so you may have to deal with someone elses comp crashing when
you do something that worked fine with you (rare, but very annoying to
deal with).

So my opinion is that mixing PyGame and PyOpenGL, taking full
advantage of OpenGL abilities, is best - but if you want to make sure
you have the very best compatiblity with various systems and you are
fine with not doing many cool transformed blits in your game, you'd be
better off with just using pygame.

and your etiquette is fine

On 2/24/06, Jonathan McLean <unteer@xxxxxxxxx> wrote:
> Hey guys,
>   I am new to this list, and to the developer community in general
> (most of my coding comes from server side scripting, namely php, not
> program development).  I am looking to program a python game, and I
> wish to know the differences between pyopengl and pygame.  I
> understand that at the basic level, pyopengl allows for hardware
> rendering of graphics, and pygame allows for software rendering of
> graphics.  I also know that pyopengl is simply the binding for opengl
> in python and that I would actually be programming in opengl, not
> python really.  So i guess with the foundation out of the way, what
> are some of the more in depth arguments for or against either one, or
> for or against the integration of both into the same project.
>
> Thanks,
> Unteer
>
>
>
> p.s. this is my first mailing list, so if there is some etiquette that
> I am not following, feel free to razz me.
>