freeing ram from the texture
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
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?
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?
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?
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?
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..
(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..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement