Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I will assume you are using C++ for the purposes of my answers, but if you can afford to use C#, XNA (<a href="http://creators.xna.com/" rel="noreferrer">http://creators.xna.com/</a>) is an excellent game platform that handles all of these issues for you.</p> <p>1] </p> <p>This article is helpful for windows events in the window procedure to detect when a window loses or gains focus, you could handle this on your main window: <a href="http://www.functionx.com/win32/Lesson05.htm" rel="noreferrer">http://www.functionx.com/win32/Lesson05.htm</a>. Also, check out the WM_ACTIVATEAPP message here: <a href="http://msdn.microsoft.com/en-us/library/ms632614(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms632614(VS.85).aspx</a></p> <p>2]</p> <ul> <li><p>The graphics device is lost when the application loses focus from full screen mode. Microsoft offers an article on how to handle this: <a href="http://msdn.microsoft.com/en-us/library/bb174717(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/bb174717(VS.85).aspx</a> This article also has a lost device tutorial: <a href="http://www.codesampler.com/dx9src/dx9src_6.htm" rel="noreferrer">http://www.codesampler.com/dx9src/dx9src_6.htm</a></p></li> <li><p>DirectInput can also have a device lost error state, here is a link about that: <a href="http://www.toymaker.info/Games/html/directinput.html" rel="noreferrer">http://www.toymaker.info/Games/html/directinput.html</a></p></li> <li><p>DirectSound can also have a device lost error state, this article has code that handles that: <a href="http://www.eastcoastgames.com/directx/chapter2.html" rel="noreferrer">http://www.eastcoastgames.com/directx/chapter2.html</a></p></li> </ul> <p>3]</p> <p>I would make sure to never disable Alt-Tab. You probably want minimal CPU load while the application is not active because the user probably Alt-Tabbed because they want to do something else, so you could completely pause the application, or reduce the frames rendered per second. If the application is minimzed, you of course don't need to render anything either. After thinking about a network game, my best solution is that you should still reduce the frames rendered per second as well as the amount of network packets handled, possibly even throwing away many of the packets that come in until the game is re-activated.</p> <p>4]</p> <p>Honestly I would just stick to DirectX 9.0c (or DirectX 10 if you want to limit your target operating system to Vista and newer) if at all possible :)</p> <p>Finally, the DirectX sdk has numerous tutorials and samples: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-4453-8641-1eee9e21b282&amp;displaylang=en" rel="noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-4453-8641-1eee9e21b282&amp;displaylang=en</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload