Jump to content
  • Advertisement
Sign in to follow this  
cdcastro

OpenGL OpenGL ES reloading textures

This topic is 3271 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there! I'm working with OpenGL ES and my system does not have enough VRAM so what I am doing is keeping the textures in RAM and unloading/reloading as necessary. The problem is that it does not work. When I unload, reloading gives me a blank texture. It renders the quads white. I added glGetError after all opengl calls of the process and did not find any errors. And I'm getting desperate. Here's a streamlined version of what I'm doing. I kept only the opengl calls, from deleting the textures to loading them again. Before deleting they work fine. After, blank square: // deleting glDeleteTextures(m_uiTextures, (GLuint*)m_pTexture); sdelete [] m_pTexture; m_pTexture = 0; // reloading m_pTexture = (void**)snew GLuint[m_uiTextures]; glGenTextures(m_uiTextures, (GLuint*)m_pTexture); glBindTexture(GL_TEXTURE_2D,m_pTexture[0]); glTexImage2D(GL_TEXTURE_2D, whole_bunch_of_parameters); I then set the filter mode and the wrap mode. Can you see something wrong? Any help would be appreciated. Cheers, Cesar

Share this post


Link to post
Share on other sites
Advertisement
I looked at that page, went through my algorithms and everything seemed fine. I then noticed because I was saving the texture state locally, my system thought the texture was already with the correct filter mode. I reset the filter mode at unload, just to force the update on load, and it worked.

Thanks for the help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!