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

Re: [pygame] using opengl in pygame?



Hey,
A few years back I took a long hard look at using OpenGL/Direct3D to do my 2d graphics as opposed to using a more classical 2d library such as DirectDraw or SDL (or allegro). I ended up using Direct Draw (and now, pygame's SDL wrapper) for a few reasons, and I'm wondering how many (if any) of them are still valid.

If they are not valid, I may seriously consider switching to an OpenGL graphics layer for my next project. (Though, sadly my old notebook which I mostly develop on will not be able to run the app. Oh well, its not longer 1998.)

The first one was the restriction on texture sizes allowed in video memory, and the (then) small amount of video memory.
I found it inconvenient at the very least for all images I loaded to have to have width/height sizes as specific powers of two (using a non power of two caused unecisary memory waste, or just plain didnt work). Is this still the case? ...
if so, are there clever ways around it (besides having to create all spritesheets etc in those exact dimensions)?

The other restriction was on the major performance hit if something couldn't fit into video memory. I may remember incorrectly, what I recall is that if a texture was loaded into system ram (not direct video memory) and it had to be used a lot it would be amazingly slow to work with.
This would come up quite a lot as I wanted to use a LOT of different sprite animation frames in my game (not just one or two cheezy sphere images and rotate them around as in most OpenGL) and they would quickly devour most of the on card video ram.
I am guessing that the introduction of AGP video cards has killed this second problem entirely?

Anyway, some input and corrections on my misconceptions would be great :)
- Jacob