   Render state management
  How do you all manage render state changes?  I made an object on the RAII principle, that resets the render state for all states I'm likely to change, back to default values when the render method of each object ends (and the render state objects goes out of scope).  I'm pretty sure this wouldn't work so well if you have thousands of objects to draw though (I've only got a few dozen).  I can see from D3D debug output that D3D ignores redundant state changes anyway, so I'm thinking the cost of resetting all render states is pretty minimal.Is there a general principle to apply for this?   
  DirectX 9 or 10?   ;  Using Dx9.  Unfortunately our customers have some rather ancient systems :(.   