video memory management

Started by Uli, February 16, 2004, 12:19:33

Previous topic - Next topic

Uli

It think this has been asked here before, but I cannot find it, so again:  :)
How can I remove textures from video memory that are not used any longer? I think of title screens and such.
Another question: How would you handle large textures? I have a 1211x920 pixel image I need as (scrolling) background? How would you store it? I thought of dividing it into 20 256x256 pixel texture blocks.

princec

Simply call glDeleteTextures on any textures you don't want to worry about any more.

I divided the AF title screen up into 256x256 squares but in this day and age this is not necessary as nearly all modern cards can handle textures of 1024x1024. You could also render it with glDrawPixels as an arbitrarily sized rectangle but it's terribly slow usually as it has to transfer the pixels over from system RAM every frame.

ARB_texture_non_power_of_two (I think) is a useful extension allowing you to use arbitrarily sized textures. Great for title screens but not very widely supported (yet).

The bestest thing you could do really is to create a 1024x1024 texture for your title screen on the fly. That's only 3MB of texture RAM and as you say, you can discard it when the title screen goes away.

Cas :)