Jump to content


Checking if Texture is Loaded into Memory


5 replies to this topic

#1 john

    Member

  • Members
  • PipPip
  • 84 posts

Posted 09 February 2003 - 08:46 AM

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?

#2 baldurk

    Senior Member

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 09 February 2003 - 09:36 AM

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
baldurk
He who knows not and knows that he knows not is ignorant. Teach him.
He who knows not and knows not that he knows not is a fool. Shun him.

#3 Yau

    New Member

  • Members
  • PipPip
  • 26 posts

Posted 09 February 2003 - 12:11 PM

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.

#4 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 09 February 2003 - 08:57 PM

hm.. smells like a texture manager.. not?
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#5 CyraX

    Valued Member

  • Members
  • PipPipPip
  • 144 posts

Posted 10 February 2003 - 03:35 PM

What ufnction are you using to load the memory.

#6 shezan

    New Member

  • Members
  • Pip
  • 8 posts

Posted 11 February 2003 - 02:32 AM

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 loaded in 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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users