• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by dukester · Apr 08, 2013 at 05:42 PM · fullscreendevice

How to handle D3D device lost?

I'm using a plugin that allocates some d3d resources (plugin not written by me).

Plugin lets me invalidate these resources before toggling full screen, and re-creating them after the toggle is done. This works fine when I'm in control of the toggle.

There are three scenarios where I run into problems (but the cause is basically the same):

1) After Alt-Tabbing out of application, the D3D device is lost, and when trying to Alt-Tab in again, Unity cannot reset the device so it hangs.

2) Unity reacts to Alt-Enter keyboard shortcut by toggling full screen without giving me any notification (that I know of). Since it cannot reset the D3D device, it crashes.

3) When running in windowed mode, dragging the window also apparently resets the d3d device. Again, a problem and a crash.

Is there a way for me to get notified of these situations by Unity so I can release the resources that are preventing the device from resetting?

We do have OnPreRender(), OnPostRender(), OnApplicationPause() and stuff.

Is there something like OnScreenChange()?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by pain_gwar · Oct 04, 2013 at 09:14 AM

Know it's late but maybe this could help (not working for me)

http://answers.unity3d.com/questions/224356/graphics-device-lost-direct-3d.html

(Sorry for the wrong link....)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Oct 04, 2013 at 09:21 AM 0
Share

Uhm, you posted a link to this question :). It was probably a copy&paste error. Please edit your answer and include the right link

avatar image dukester · Oct 04, 2013 at 11:29 AM 0
Share

Thank you for trying to help. However, the issues are quite unrelated. They both concern lost D3D device, but for completely different reasons. Btw, I believe the issue you linked has been fixed since then, so implementing that "solution" will probably not fix any of the problems you might be having. As for my issue, it was eventually fixed by the plugin author, though I still think Unity toggling fullscreen when a user presses Alt-Enter without notifying the program prior to the toggle is a terrible behavior.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to show Status bar while keeping the status bar hidden in Android 1 Answer

Unity: Reading /dev/usb/hiddev 0 Answers

Standalone application fullscreen 3 Answers

Play movie in full screen 1 Answer

Fullscreen WebPlayer crash (white screen) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges