glTexEnvi question

Started by
3 comments, last by Brother Bob 18 years, 4 months ago
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
Advertisement
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
glPushAttrib(GL_TEXTURE_BIT) beforehand and glPopAttrib() afterwards?
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
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