State should include at least the following:
- All settings set via
SetStreamResource() - Indices
I have a class whose Draw() function will call SetStreamResource, set Indices and eventually call DrawIndexedPrimitive(). I would like to restore the device state before Draw() returns.
I am looking for something along the lines of GDI’s SaveDC()/RestoreDC().
State blocks are the mechanism provided by the API to save and restore chunks of device state. I cover the details of state blocks in Chapter 3. Direct3D Devices from my book The Direct3D Graphics Pipeline. You can download the PDF for that chapter from the link above.