Jump to content
  • Advertisement
Sign in to follow this  
liam_g

State block changes (dx8.1 to 9.0c)

This topic is 4927 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, folks, Some of the state block stuff has disappeared between dx8.1 and dx9.0c. Specifically, I'm looking at dx8.1 code that uses DeleteStateBlock, CaptureStateBlock, and ApplyStateBlock. Can anyone point me to some info on how to accomplish what these methods were doing, now that they no longer appear in the sdk?? Respectfully,

Share this post


Link to post
Share on other sites
Advertisement
CreateStateBlock() now gives you back a COM object (IDirect3DStateBlock9) rather than a handle;

IDirect3DStateBlock9 has 3 methods itself:

IDirect3DStateBlock9::Apply()
IDirect3DStateBlock9::Capture()
IDirect3DStateBlock9::GetDevice()


IDirect3DStateBlock9 is inherited from IUnknown so also provides:

IUnknown::AddRef()
IUnknown::QueryInterface()
IUnknown::Release()


So:

d3dDevice->DeleteStateBlock(stateblockHandle) == stateblock->Release()
d3dDevice->CaptureStateBlock(stateblockHandle) == stateblock->Capture()
d3dDevice->ApplyStateBlock(stateblockHandle) == stateblock->Apply()


HTH

Share this post


Link to post
Share on other sites
Simon, thank you so much. That's perfect, and I appreciate you taking the time to help a newbie!

Cheers,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!