Jump to content
  • Advertisement
Sign in to follow this  

Are you allowed to assign data to the default texture?

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

Normally, the default texture (that's texture object #0) is just blank white. Are you allowed to change that via TexImage2D to something else? I remember somebody saying that you could change the default, but I wasn't really sure how, although this is the only thing I can think of.

Share this post


Link to post
Share on other sites
Advertisement
Yes, apparently. A quick test with the following:
glBindTexture (GL_TEXTURE_2D, 0);
glTexImage2D (...);
yielded a working font! (that was what my test was on)

[edit] Hmmm, but trying to reassign texture #0 with another TexImage2D does not work for the second case although it does work for the first. So this is a debatable issue I guess. [/edit]

Hope that helped,

Share this post


Link to post
Share on other sites
Yes, you can change it. In OpenGL 1.0 there was no glBindTexture, so you had to change the default texture when you wanted to switch textures. You can still change it in subsequent versions.

Share this post


Link to post
Share on other sites
You can change the default texture ID. That was THE way to do texturing before texture objects was introduced at all; you only had one texture, and you had to upload the data every time you wanted a new texture. This was the reason you usually put glTexImage calls in display lists, as that gave the application at least a chance to put the texture data in something else than system memory for fast texture changes.

When texture objects was introduced, it was no longer necessary to handle the data yourself, as the implementation now could do it, but of course, the original behaviour still remains when the default texture ID 0 is bound.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!