Checking if Texture is Loaded into Memory

3c6597370b476903ed475f70b4b3ce31
0
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.

0684f9d33f52fa189aad7ac9e8c87510
0
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

D046712cf3efd2c2d7840c4c51d28669
0
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.

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Feb 09, 2003 at 20:57

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

590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Feb 10, 2003 at 15:35

What ufnction are you using to load the memory.

685e5533937482e6804a686ef5210c99
0
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