A question about VRAM management

Started by CodeBunny, February 10, 2011, 20:14:49

Previous topic - Next topic

CodeBunny

How should I manage VRAM in LWJGL? Every time I want to get rid of a texture, do I have to manually wipe it from OpenGL? If so, what's the best way of doing this?

Currently I use:
GL11.glDeleteTextures(texture.getTextureID());

Matthias

That's the OpenGL way. And it also applies to VBOs, Shaders etc.

Evil-Devil

Yea, you have it all the way by foot alone. A often used aproach is the reference counting. Write a resource manger that keeps track of each resource usage and free it when it isn't used anymore. Unfortunately that sounds easier than it is : /

CodeBunny

Yah, I thought about that, but it also could be useful to keep textures in memory for later use.

What's the appropriate OpenAL call? alDeleteBuffers()?