Saving state for multiple calls

Jun 21, 2013 at 12:55 AM
I'm tracking my own pipeline state to reduce API calls.
I see that there is a way to get the DrawText call to restore state after it has finished.
However, if I have, say, 20 DrawText calls to make, is there a way to save the state before the first one, issue the 20 calls, then restore the state?

Thank you,
Michael Stone
Jun 21, 2013 at 9:26 PM
There's no public function for it in the interfaces, but if you use the source there's the CFW1StateSaver class that can save and restore the state. Combine with using the FW1_IMMEDIATECALL or the FW1_CONSTANTSPREPARED, FW1_BUFFERSPREPARED, and FW1_STATEPREPARED flags when calling DrawText to achieve that behavior.
Jun 21, 2013 at 9:43 PM
Ooh, lovely!
Thank you.