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

Re: [pygame] Using PyOpenGL for 2D graphics



Using openGL for 2D allows you to take advantage of 3D graphics cards for smooth scrolling and zooming, or to tilt otherwise 2D game boards into 2D. I also suspect that it'll let you handle more objects on the screen at once (especially if they're duplicates), although I haven't done comparison tests for this.

I posted some code along these lines several years ago, extended from something that Bob Ippolito had posted earlier. Search through the archives and you should come across something. If there is enough interest, I can also post my more recent code, but it's a bit more special case, lacking in simple examples, and probably more involved than someone new to OpenGL is looking for (it includes things like texture tiling, texture animation, billboarding, display list optimization, etc).

The NeHe tutorials are pretty good (even though their programming style is weak). You only really need the first 10 or so to get started; afterwards you can look at the later ones and still follow what they're doing, even if they aren't in Python.

-Jasper

Ian Mallett wrote:
Try looking at glOrtho2D() or something like that... Why do you want to use PyOpenGL for 2D-ness? It's much better suited to 3D stuff. I've always found it easier to use pygame for 2D games. Oh, and ummm... Don't tell Silicon Graphics, but I've found pygame is much much faster at 2D.

On 7/7/07, *Charles Joseph Christie II* <sonicbhoc@xxxxxxxxx <mailto:sonicbhoc@xxxxxxxxx>> wrote:

    So, I'm trying to find a single good newbie tutorial for using
    PyOpenGL for 2D
    graphics. I haven't found a single one yet, although I have found
    a few that
    focus on C++. Some people recommended that I take a look at the NEHE
    tutorials that were re-coded in python on the python page, but
    those only go
    from 1 to 10. Does anyone know where I could find a good starting
    point (it
    doesn't have to be a super-noobish tutorial, just something to give me
    examples on how to start) for using PyOpenGL in conjunction with
    Pygame for
    making something?