Texture object reloads

Started by
2 comments, last by MARS_999 18 years, 7 months ago
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
Advertisement
Nevermind, I just deleted the object and reloaded it into the same one. Just seems the right way to do it...
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.
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.

This topic is closed to new replies.

Advertisement