Skip to main content
GameDev.net gamedev.net
🔒 Locked

GetRenderState

Started by MB Mar 21, 2003 at 3:23 PM 4 replies 350+ views
Original Post
MB
MB
Is there a way to get all the render states (and the respective values) in one rush instead of retrieving every single one via GetRenderState(&STATE, value); Is the CaptureBlock method suitable? (Sorry, but the DirectX documentation in this regard is incomplete. ) An answer to this, or an hint, where to find answers, is highly appreciated (I am kind of reluctant writing a function which asks for 50 parameters) [edited by - MB on March 21, 2003 4:38:20 PM]
http://www.superfluxus.de/phpBB2
MB
MB
nobody there to answer this question? - I would be extremely thankful, since the DirectX documentation is very cryptic and I could not find any samples, neither in the DirectX samples nor via internet search.

[edited by - MB on March 22, 2003 10:46:09 AM]
http://www.superfluxus.de/phpBB2
kimryo
kimryo
How about using array...

We create world.
God create the world,we create another one.-Reference
Muhammad Haggag
Muhammad Haggag
quote:
Is there a way to get all the render states (and the respective values) in one rush instead of retrieving every single one via GetRenderState(&STATE, value);

When I needed renderstate tracking, I used an array big enough to hold all the renderstates where array[D3DRS_SOMETHING] gives you the state itself.

To fill that array, I just initialized all the states at the beginning using SetRS() and setting the corresponding array entry instead of doing GetRS() calls.
Of course, that took a while to write

quote:
Is the CaptureBlock method suitable?

This method captures device state and saves it in a "state block" (== black box). You can use the state block with ApplyStateBlock and such, but as far as I know you can't poll information out of it.


Cheers,
Muhammad Haggag

[edited by - Coder on March 22, 2003 3:33:15 PM]

MB
MB
Thanks Muhammed, you confirmed what I feared I had to do. So I gonna start writing a lot of lines
http://www.superfluxus.de/phpBB2
Muhammad Haggag
Muhammad Haggag
quote:
Thanks Muhammed, you confirmed what I feared I had to do. So I gonna start writing a lot of lines

To save your time: I believe drunken hyena (www.drunkenhyena.com) has already written such code and incorporated it into his dhEngine. His code deals with state-caching, and as far as I recall, it saves the state of the device on initialization.

You can download the code from his website, and if you find that he's removed the state-caching functionality, you can mail him for some obsolete version.

Cheers,
Muhammad Haggag

[edited by - Coder on March 22, 2003 5:46:44 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.