Checking if Texture is Loaded into Memory

john 102 Feb 09, 2003 at 08:46

I want to check my memory to see if a certain texture is loaded, and if it is, not load it into memory again. Anyone have an idea on how to check which textures have been loaded so far?

5 Replies

Please log in or register to post a reply.

baldurk 101 Feb 09, 2003 at 09:36

the best way to do it would be have a boolean flag in your code, and set it to true when the texture is loaded. I don’t know of any way to check in OpenGL if a texture is loaded

Yau 101 Feb 09, 2003 at 12:11

Maybe u can look at the OpenGl error codes. I’ve never looked at this problem before ut I’m pretty sure there’s an error code if u try to display a texture map if there isn’t actually texture loaded for it.

davepermen 101 Feb 09, 2003 at 20:57

hm.. smells like a texture manager.. not?

CyraX 101 Feb 10, 2003 at 15:35

What ufnction are you using to load the memory.

shezan 101 Feb 11, 2003 at 02:32

i’m not sure if this is what you are looking for, but glIsTexture() will determine whether the texture has been created. As to whether it is loadedin graphics memory (VRAM), i dont think this is possible because there is no function in openGL to actually instruct the driver to put the texture in VRAM (as far as i know). The only method I can think of that would force a texture into VRAM is glBindTexture() which basically makes the texture “current”. You can use glGet (i think) to retrieve the current texture