Jump to content
  • Advertisement


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


reloading textures with ipicture

This topic is 5675 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

hey guys. say you are using nehe''s ipicture code and you have a group of textures declared like so GLuint texgroup[10]; and you go about loading in 10 different texutures via buildtexture and go about using them in your software via bindtexture. all is well in the land of gl. here''s what i''m after... i would like to load in 10 more textures over top of the old ones (texgroup[0] through texgroup[9]). what is the proper way to do this? do i have to release the old memory that the textures were taking up (texgroup[]) before reloading new ones over the old? how do i do this? what is the proper methodology? if i know i am going to be doing this over and over again do i have to declair the memory in a special way? thanks for any suggestions. any help would be appreciated. no code necessary (hopefully), just some pointers or perhaps some psudo. if you have code you would like to share then that would be even cooler but i''m not after your code, just a nice working chunk of my own code thanks again. jason

Share this post

Link to post
Share on other sites
I haven''t worked with the iPicture code and am new to openGL.
The way I see it though, the array of GLuint is exactly that; an array of a static type.
What I mean is, when you declare your 10 element array, you are reserving the memory which will be a fixed amount to fill with textures.

If I''m correct (and nobody else seems to want to suggest something), then you should be able to overwrite the elements with new textures without trouble.

You might want to be careful if you''re doing this a lot, that you''re correctly keeping track of which textures you''re updating and which ones hold old textures in.

Hope this helps.

Share this post

Link to post
Share on other sites

  • 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!