• Advertisement

Archived

This topic is now archived and is closed to further replies.

freeing ram from the texture

This topic is 5063 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 people, maybe someone would like explain me how glDeleteTextures (...) works, because i have problems with memory when i load all the textures to my game. It is because i am using high quality bmp files and it takes a lot of space plz help

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
glDeleteTextures just tells the OpenGL implementation that the specified texture-id won''t be needed anymore (so it will eventually remove the texturedata).
Doesn''t really matter which format you load your textures from, it''s the format that they''re stored in on the gl-implementation that matters. You should check if you can get away with using texture-compression when you send the texture-data.
Do you really need all of your textures all the time?
How about mipmaps?

Share this post


Link to post
Share on other sites
that is the problem: i don''t want to load all the textures on to the memory and i am trying to free this memory, but glDeleteTextures(...) doesn''t want to help me
i just have different display functions that i am swiching between and i want to change the background textures
how i could free the texture from ram every time i load new screen?

Share this post


Link to post
Share on other sites
Hrm, I''m not sure if this is what your doing, but it might be so I''ll say it anyway.

(Also, someone correct me if I''m wrong on this)

After you load the image file from wherever, and into application memory, for example, I use SDL mostly so I''d load my texture image into an SDL_Surface struct.

I then take the SDL_Surface and pass it to OpenGL using glTexture2D(), after this my texture data is transferred to OpenGL (I''m assuming on most machines, it ends up on graphics card ram)

After that, I can safely delete my SDL_Surface, freeing up a bit of ram, since the texture that OpenGL is using, is now being taken care of by OpenGL itself..

I hope that makes sense..

Share this post


Link to post
Share on other sites
I''ve solved this problem diffrently but thanks a lot for helping

simas

Share this post


Link to post
Share on other sites

  • Advertisement