• Advertisement

Archived

This topic is now archived and is closed to further replies.

Minimizing FullScreen App

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

I am trying to write a simple 2d wrapper for DirectX, to get acquinted with it. The problem comes when you try to minimize the application. It seems to just disappear. I don''t know if it terminated abnormally or what. It no longer is in the taskbar or running in the processes. Any ideas? I also want to make sure that the surfaces are saved when I minimize and a flag ("PAUSED" or something) is set. Help!! zourtney

Share this post


Link to post
Share on other sites
Advertisement
Coulod be a problem with your message handler or maybe your not handling lost devices properly. What does your lost device and message handler code look like?


:::Al:::
[Triple Buffer V2.0] - Resource leak imminent. Memory status: Fragile

Share this post


Link to post
Share on other sites
You must Validate the Direct3D device before starting the rendering (Begin / End). I not sure of the right syntax, but it is something like that :


// D3D device initialized at startup //
LPDIRECT3DDEVICE8 pDevice;

// Parameters to used to create the D3D Device at startup //
D3DPRESENT_PARAMETERS objPresentParameters;

// Check for device availability //
HRESULT ValidateDevice( VOID )
{
HRESULT hResult;

hResult = pDevice->TestCooperativeLevel();
if (FAILED(hResult))
{
if (hResult == D3DERR_DEVICELOST)
return (E_FAIL);

if (hResult == D3DERR_DEVICENOTRESET)
{

//*** Release objects here ***//

if (FAILED(pDevice->Reset( &objPresentParameters )))
return (E_FAIL);

ClearScreen();

//*** Reload objects here ***//

}
}

return (S_OK);
}




/* Bullmax */
-------------
Reality has many forms : good and evil, black and white, yin and yang.

Share this post


Link to post
Share on other sites
Then in your main loop, you would validate the device before rendering :


VOID MainLoop( VOID )
{
// ..... //

if (SUCCEEDED(ValidateDevice( VOID )))
{
if (SUCCEEDED(pDevice->Begin()))
{
ClearScreen();

//###[ RENDER EVERYTHING HERE ]###//

pDevice->End();
}
}

// ..... //
}




/* Bullmax */
-------------
Reality has many forms : good and evil, black and white, yin and yang.

Share this post


Link to post
Share on other sites

  • Advertisement