Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texture object reloads

Started by MARS_999 Sep 7, 2005 at 2:46 AM 2 replies 850+ views
Original Post
MARS_999
MARS_999
I am not sure on this, but if I setup like 10 texture objects and I later want to reload data into them can I just reload the new data into the same object names or do I have to delete those objects first and then reload the new data into the same names? Thanks
MARS_999
MARS_999
Nevermind, I just deleted the object and reloaded it into the same one. Just seems the right way to do it...
Kalidor
Kalidor
Quote:
Original post by MARS_999
I am not sure on this, but if I setup like 10 texture objects and I later want to reload data into them can I just reload the new data into the same object names or do I have to delete those objects first and then reload the new data into the same names? Thanks
You can overwrite an existing texture if it is the currently bound texture. glTexImage* will create a new texture in it's place. If you just want to change the texture data and nothing else (internal format, texture dimensions, and border will remain unchanged) you can use glTexSubImage*. You can also use glTexSubImage* to change all the texture data or just a subregion of it.

For more info, read the OpenGL Spec.
MARS_999
MARS_999
Yeah thats the issue I will not know due to the user will select the texture that they want to use. So looks like I made the right decision in deleteing the object and just reload it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.