glTexEnvi question
Hi all
how to reset the next lines to it's default values?
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE);
thanks for any help
GL_MODULATE is the default, but why do you want to restore the state? Just make sure you set all necessary states when changing the combiners setup, and it won't matter what the state was before.
well,i will be more specific.
when changing the renerstate by those function then render some stuff ,every thing is ok,after that i want to render another stuff with another renderstate
but when do this it does not work as expcted,so that i want to reset to it's default values.
so you have said,GL_MODULATE is the default, is it for GL_TEXTURE_ENV_MODE
or for GL_COMBINE_RGB_EXT?
thanks for your help
Quote:Original post by Emil_Halim
well,i will be more specific.
when changing the renerstate by those function then render some stuff ,every thing is ok,after that i want to render another stuff with another renderstate
but when do this it does not work as expcted,so that i want to reset to it's default values.
But that is exactly what I'm talking about in my first post, that you don't have to care about other states when you make sure you set everything you need. If you get strange results for the second set of stuffs, then you're obviously not setting every state you need to set. Restoring the default state every time just means you're assuming a certain state at a certain point in your program, which is not something i recommend. Instead take a look at how you set up the states for the second set to see what's missing.
But if you really want to restore every single state, do what anist suiggested.
Quote:Original post by Emil_Halim
so you have said,GL_MODULATE is the default, is it for GL_TEXTURE_ENV_MODE
or for GL_COMBINE_RGB_EXT?
thanks for your help
It's for GL_TEXTURE_ENV_MODE.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement