2 April 2010 0 Comments

State objects in XNA Game Studio 4.0

The most-often-linked-to article I ever wrote is about renderstates, so it should come as no surprise that we tried to improve this area in Game Studio 4.0. There are fundamentally only two sane ways to manage renderstates: Assume nothing: explicitly set everything you depend on before drawing Assume fixed defaults: if you change anything, you must put it back when you are done Previous versions of Game Studio supported both approaches, but neither worked particularly well: Our API exposed over 70 different states, so explicitly setting them all was awkward and slow We provided StateBlock and SaveStateMode to help with the "put it back when you are done" approach, but these were extremely slow Luckily for us, our colleagues over in the native DirectX team grappled with this very issue a few years earlier, and came up with a great solution. For Game Studio 4.0, we basically just borrowed the same state objects design that is used in DirectX 10 and 11.

Read more from the original source:
State objects in XNA Game Studio 4.0

If you liked this post, buy me a Coffee.

Leave a Reply