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

Re: [pygame] using opengl in pygame?



On Sun, 20 Jun 2004, Jacob Schwartz wrote:

> 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)?

As far as I now this is still the case.  I haven't found the wastage from
bumping your images to the next power of 2 to be an issue.  It feels a bit
crude, but I would guess that it allows the underlying calculations to be
faster.

> 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?

Why use more than one texture?  Animation shouldn't have any impact on
texture size if you blit into existing textures, where the only real limit
will be the size of the texture you're using.

-Jasper