Hello Guest

A question about VRAM management

  • 3 Replies
  • 5937 Views
A question about VRAM management
« 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:
Code: [Select]
GL11.glDeleteTextures(texture.getTextureID());

Re: A question about VRAM management
« Reply #1 on: February 10, 2011, 21:20:06 »
That's the OpenGL way. And it also applies to VBOs, Shaders etc.

Re: A question about VRAM management
« Reply #2 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 : /

Re: A question about VRAM management
« Reply #3 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()?