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

Re: [pygame] PyGame / PyOpenGL Example



On Wed, Feb 13, 2008 at 10:10 PM, Kris Schnee <kschnee@xxxxxxxxxx> wrote:
>  So, if I wanted to draw a GUI window across the screen, and I'd normally
>  want it to be, say, 800x200, I'd have to either split it and draw two
>  textures, or make the texture 1024x256, or just draw a polygon with
>  shading provided by OpenGL and use that as the window?
>
well I would think that in the general case redrawing the components
of the window would be the best solution - along the lines of the
third thing you mentioned - drawing a filled polygon (or maybe more
likely a quad). I don't think you'd want to use shading (i.e. lighting
off), and if you wanted to use power-of-2 textures as tiling for the
body of the window you could do that by setting the texture mode to
wrap. You could also draw window borders either by stretching or
tiling edge images.

If however you had a GUI that changed relatively little and already
performed well in Software rendering, doing the Lamina overlay
approach would probably be just as good. In fact it would be superior
if the gui overlay wasn't changing from frame to frame.

As far as whether to put your images in the next largest power-of-2
texture, or spread across multiple textures or packing multiple images
in a texture or whatever - I would say unless it sounds fun to write
the code to try one approach, the best thing is to make the problem
easy and just do the image in a larger texture thing. Then you can
optimize things later - if you need to. If you unload textures when
you don't need them (like after every level), or have fairly small art
requirements it will probably never be an issue.