Freeing textures?

BlitzMax Forums/OpenGL Module/Freeing textures?

Oddball(Posted 2005) [#1]
I'm using bglTexFromPixmap() to create my textures. Everything is working fine so far, but my question is, how are these textures then deleted from memory? I mean, does BlitzMax take care of this in a similar manner to objects, like Timage objects? Or do I have to Release them like integer object handles? Or do I need to explicitly delete them using glDeleteTextures and if so what is the correct syntax for this? Any help on this subject would be appreciated. Thanks.


Perturbatio(Posted 2005) [#2]
I would assume since it is an integer handle that you would use release to free it (and make sure you are using flushmem).


Oddball(Posted 2005) [#3]
I would assume since it is an integer handle that you would use release to free it (and make sure you are using flushmem).

Yeah. I was leaning towards that conclusion. Been doing a little testing, and Max is accepting
gldeletetextures 1,Varptr texture
and
Release texture
as both valid, but MemUsage() is not showing any differance.


ImaginaryHuman(Posted 2005) [#4]
MemUsage probably doesn't show the video ram?

Otherwise, what is that and how does it work?


N(Posted 2005) [#5]
The only way you can delete GL textures is glDeleteTextures, ala'

glDeleteTextures( 1, Varptr Name )


So, if you do Release, all you're going to do is create some screwed up memory errors.


Oddball(Posted 2005) [#6]
Cheers Noel. Additionally is there any way to monitor texture/video memory? As Angel pointed out MemUsage() doesn't show this.


Oddball(Posted 2005) [#7]
Ok got it working now. I've set up a type to take care of auto-deleting the textures with FlushMem(). Check it out Texture type.