LWJGL Forum

Programming => OpenGL => Topic started by: CodeBunny on February 10, 2011, 20:14:49

Title: A question about VRAM management
Post by: CodeBunny on February 10, 2011, 20:14:49
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());
Title: Re: A question about VRAM management
Post by: Matthias on February 10, 2011, 21:20:06
That's the OpenGL way. And it also applies to VBOs, Shaders etc.
Title: Re: A question about VRAM management
Post by: Evil-Devil on February 10, 2011, 22:25:02
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 : /
Title: Re: A question about VRAM management
Post by: CodeBunny on February 11, 2011, 12:25:29
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()?