Jump to content
  • Advertisement
Sign in to follow this  
keinmann

DX11 Device lost in D3D11/SlimDX

This topic is 2828 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

Excuse my ignorance on this topic, but SlimDX and D3D11 is probably only two weeks old to me or less. And I cannot figure out what the heck you do about the device lost issue in D3D11. I looked in the samples, and read the Sample.cs class's code. It has some code that calls TestCooperativeLevel when you're using D3D9, but it has nothing such for D3D10 (and of course, we only have 1 sample for D3D11, the MiniTri, which is just the bare butt basics). I also searched the documentation, and found nothing but D3D9 stuff. I just Googled it, and still can't find anything, and can't even find anything in the MS DX documentation. :P

My only guess is that calls like SwapChain.Present(...) or other methods return a Result that lets you know the device was lost. But I can't find what that result IS, if it even exists. Can someone show me the light, and give me a general idea of what I need to do in SlimDX using D3D11?

EDIT: Ahhh... Maybe I've found it? SlimDX.DXGI.ResultCode? Is this what I need to compare to return result of SwapChain/Device calls? If that's right, please give me any tips. I've barely lost my SlimDX/DX11 virginity, so bear with me. :) For instance, I know SlimDX's default behavior throws exceptions on failures, but should I use Configuration to change that, or use the default C# error handling convention (try/catch/finally) and adjust accordingly?

[Edited by - keinmann on October 21, 2010 2:10:38 AM]

Share this post


Link to post
Share on other sites
Advertisement
Really? Then that's great news to me. Can anyone confirm this? I just found this page on DXGI error constants:

http://msdn.microsoft.com/en-us/library/bb509553%28v=VS.85%29.aspx

You'll notice that there is absolutely NO device lost. And now I get what the Sample.cs class in the SlimDX samples means when it says if the device is lost, you can automatically assume the DX9 context. So I'm guessing there is no more device lost!

If that's right, now I'm wondering how I need to think of and design things. I've been told it's a bad idea to implement some sort of event system for things like this. Can anyone tell me any more about this general topic? I'm itching to learn more and do it right!

EDIT: Oh how embarrassing! It's true, there's no more "lost device" concept in 10/11, hahaha. Forgive me, I come straight from 9 and XNA where that was a serious thing! :)

[Edited by - keinmann on October 21, 2010 11:44:40 AM]

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!