glDeleteTextures

Silly question ahead…

does anyone use that? I mean the driver cares about swapping around the stuff wich isn’t needed and swapping back is for sure faster than reloading textures from the Java side.

Or maybe I should just try something in between… like only trashing the huge memory hogs (eg skyboxes)?

Hm… I really don’t know :stuck_out_tongue:

[quote]I mean the driver cares about swapping around the stuff wich isn’t needed and swapping back is for sure faster than reloading textures from the Java side.
[/quote]
Really ?
I didn’t know that :stuck_out_tongue:

Hum, I use glDeleteTextures when changing the game scene. For example when the first level is completed and there’s no need to go back, I delete the level (it frees memory…) and load the new level with a loading screen…

Else, I don’t really use it…

Chman

I use glDeleteTextures for cleanup… but really it’s totally unnecessary for games:

loadEverything();
playGame();
System.exit(0);

Cas :slight_smile:

I would hope that the driver would clean up textures when the display context that they’re associated with is deleted/disposed of, in much the same way any half decent OS will recover memory not deleted when a program terminates.

Given the buggy states of some drivers though, I’m not sure how likely it is.

I clean up my resources as best as I can too, but I believe that if the OS doesn’t clean up my stuff automatically, it’s a bug - you can’t have a decent general purpose OS trusting clients to clean up after them. After all, processes crash all the time, not cleaning up after them. A possible exception is interprocess resources like shared mem and the like.

  • elias