[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] getting setup to use PyOpenGL for 2D
On Monday 28 November 2005 16:38, D. Gyimesi fired a shotgun at the keyboard
and the following appeared:
>
> I totally feel your pain Brian!
>
> Now I sucked with SDL surfaces for my tank game I decided to write an
> intermediate graphic layer in OpenGL to make it easier to use for 2D.
> But it's just suxx. GL is really for 3D. In the past I used OpenGL to
> write some tiny screensaver for me and that's all my knowledge about GL.
> Not so much, but enough to feel that GL just suxx for 2D.
<snip>
It's really not bad if you write some basic framework for handling your 2D
stuff. I like to treat it sorta like Pygame's sprite module....I'll have a
generic class that loads a texture, contains a display list with the quad
that makes up the object, has X and Y attributes, maybe a zoom attribute,
etc. It will have something like an update function (or even a seperate draw
function) that will contain the basic OpenGL rendering code. From there all I
have to do is call one or two functions of that object every cycle.
Another tip: for 2D, orthogonal matrices are your friend. :)
-Matt Bailey