carry your own "shadow" state around if you are worried, Wrap the relevent
OpenGL calls with your own methods, and in those methods maintain state; add
lightweight queries (to your shadow state) as needed
jbw
I guess reseting state every time is a nonissue for you.
...so all you need to do is remember the state!
> it needs to setup them anew
> each time, wasting some precious time. I'd like to ask for some ideas on
> how to remedy this. Is there a way?
Don't know what you're expecting but the state
needs to be set. In my experience you'll never
get it 100% perfect.
--
<\___/>
/ O O \
\_____/ FTB.
http://www.topaz3d.com/ - New 3D editor for real time simulation
Huh? Your "wrapped" functions can test to see if the current state is
already set, and do nothing if that's the case, "saving" state setting.
jbw
> Don't know what you're expecting but the state
> needs to be set. In my experience you'll never
> get it 100% perfect.
You are correct. I'll just set all texture units to "meaningful" state
defaults at startup. All objects who don't conform will just have to set
their non-default state and reset it to default after rendering.
If each object is responsible for setting the state it needs to be drawn,
it does not have to reset the state to defaults. Your proposal is "safe",
but you have a lot of state changes you might not really need to do.
Consider sorting your objects to minimize state changes. For a given
set of states, set the states and then draw all objects with those states.
--
Dave Eberly
http://www.geometrictools.com