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

Re: [pygame] Convert() loses alpha



On Mon, 4 Oct 2004, Simon Wittber wrote:

>> 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.

Sounds promising. I noticed that at least Debian unstable has PyOpenGL
packages nowadays, so it shouldn't be such a big added dependency.

>> 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.

Ok. Have you tried the engine with tile based maps? We have fairly big
maps along with a fair amount of extra "layers" of information (sprites,
labels, windows, lines, misc graphics). This scrolled pretty ok on an old
P2-333 (one tile at a time scrolling), but smoother scrolling would be fun
to have. :)

>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.

Ok, I know the basics of OpenGL, but I don't really like dabbling with
plain OpenGL anymore, I prefer something built on top of it. Is your API
available for download?

-- 

                  - "What're quantum mechanics?"
        - "I don't know. People who repair quantums, I suppose."
                                               -- Terry Pratchett, in Eric