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

Re: [pygame] Convert() loses alpha



> Has anyone really used pyopengl for anything except "ooo, nice, I have 2D
> sprites using OpenGL!1!!"? Is it feasible? 

Yes, I now use it exclusively for graphics operations. It provides a
lot of stuff for free.

 - alpha 
 - sprite rotations
 - sprite scaling

> Really as portable as plain
> Pygame (all texture formats, size limitations, loaders and whatnot)? 

I work on Linux at home. When I bring my code into work, where I use
WinXP, everything works as is. There is no code to deal with platform
dependencies.

> Worth
> the extra pain of dabbling with OpenGL and PyOpenGL and just having your
> sprites not show up for the game, but instead be laughing at you from some
> totally differnt dimension?

If you want full screen panning, scaling and other cpu intensive
operations, OpenGL is the way to go. There is some pain involved (when
you are first learning OpenGL), but nothing comes without cost!
Imagine 3 levels of fullscreen parralax scrolling, with alpha
blending. Such a feat is nigh impossible in pure pygame, but opengl
does it without breaking a sweat.

I've abstracted away the OpenGL API, and provided a simple interface
for creating sprites, drawing lines, polygons  and text, all using
OpenGL calls. Anything can be rotated, translated and scaled
(including the screen) by simply setting attributes on objects. Any
size image can be loaded (even non powers of 2 images) and converted
into a texture/sprite. I rarely need to work with the OpenGL API, as
I've covered just about everything I need for 2D usage.


sw.