Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   Managed DirectX (http://www.xtremevbtalk.com/managed-directx/)
-   -   Minimizing a windowed DirectX application (http://www.xtremevbtalk.com/managed-directx/318060-minimizing-windowed-directx-application.html)

bufer24 09-12-2010 12:43 PM

Minimizing a windowed DirectX application
 
Hi, I am wondering how do I minimize a windowed DirectX application without getting an application error. Like in various tutorials, I captured the OnDeviceLost event, but what do I have to put inside it? The application displays a simple cube without textures and it uses 1 light. There is no rendering loop running. The rendering block is called only if needed (i.e. setting viewer position, setting light color etc.).

CrashPilot 09-17-2010 07:25 AM

I knew the answer to that question, i'll get back to you when I look at my source at home this evening. As far as I recall now it has to do that the device is reset on a form resize. Minimizing does fire that event. (you can hook it from your device). And the device needs to be recreated for the adjusted form size. Also when a device is reset all of your recourses that are not managed need to be recreated. Those include vertices, lights, textures, sprites etc. Normally (for performance reasons) your recources would be unmanaged. Trying to render anything that doesn't exist will throw an error. Do you not get the same error when resizing the window by dragging the borders?

I'll post some source tonight when I get back from work.


All times are GMT -6. The time now is 04:56 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.