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

Re: [pygame] Using PyOpenGL for 2D graphics



On Sun, July 15, 2007 4:12 pm, Ian Mallett wrote:
> In your call to glViewport() put in (60,60, width-120, height-120) and
> draw in the 60 pixel border.  Would that work?

Not sure, but on further experimentation I was able to adapt some code
posted on GameDev.net, to draw a flat array of 100x100 tiles that could be
scrolled and zoomed, with a 2D rectangle pasted atop the screen using
glOrtho(); all hooked up to Pygame event handling. That would be the
beginning of an OpenGL-based 2D tile engine and UI, given sufficient time
and motivation to figure out text drawing and other interface elements. I
don't think you can just draw the interface by blitting; drawing a
textured window border would probably involve four weirdly-textured quads,
for instance. Overkill!