   DX10 Application freeze
  Hi,I'm having some trouble with my small dx10 application. It's at the moment an application that rappidly changes the screen color. The application seems to run fine, but from the moment it get's clompletly obscured by an other window, and I then bring it back up to the front, it freezes for the time it's been obscurred.When I disable all my dx stuff, the application behaves like it should, but when I reenable this, the problem arrises.My current dx sdk version is march 2008.thanks in advance!Laurens   
  Without the code of your game loop its basically impossible to make a guess. :P   ;  this is the code:MainLoop function:void CApplication::RunApplication(){float colClear[4] = {RandFloat(), RandFloat(), RandFloat(), 1.0f};m_pRenderCore->Clear(colClear);m_pRenderCore->Present();}And this is what is in the function calls:void CRenderCore::Clear(const float* color){m_pDevice->ClearRenderTargetView(m_pRenderTargetView, color);}void CRenderCore::Present(){HRESULT hr = S_OK;if(!m_pSwapChain){return;}hr = m_pSwapChain->Present(0, 0);if(FAILED(hr)){CInfoQueue::GetInfoQueue()->AddMessage(EERROR, L"Render core present has failed");}};Quote:Original post by LaurensBrockthis is the code:MainLoop function:void CApplication::RunApplication(){float colClear[4] = {RandFloat(), RandFloat(), RandFloat(), 1.0f};m_pRenderCore->Clear(colClear);m_pRenderCore->Present();}And this is what is in the function calls:void CRenderCore::Clear(const float* color){m_pDevice->ClearRenderTargetView(m_pRenderTargetView, color);}void CRenderCore::Present(){HRESULT hr = S_OK;if(!m_pSwapChain){return;}hr = m_pSwapChain->Present(0, 0);if(FAILED(hr)){CInfoQueue::GetInfoQueue()->AddMessage(EERROR, L"Render core present has failed");}}RunApplication how and when and how many times is called?   ;  Well this is the main while app loopwhile(!done){//pVP is a pointer to a class that handles all the windows messageswhile(!done && pVP->HasMessages()){if(pVP->Pump() == false){done = true;}}//START SENDING TO APPLICATIONswitch(pSM->GetCurrentState()){case EWinMain_INITIALISE:{//Run Initialise codeInitialiseApplication();break;}case EWinMain_APPRUNNING:{//Run Update CodeRunApplication();break;}case EWinMain_ERROR:{done = true;break;}default:{//Code should never come heredone = true;break;}}}return 0;this is the code for all the windows messagesbool CWindowsViewport::HasMessages(){MSG msg;    if( 0 == PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ) ){// There weren't any messagesreturn false;}return true;}bool CWindowsViewport::Pump(){MSG msg;PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE );if( WM_QUIT == msg.message )return false;TranslateMessage( &msg );    DispatchMessage( &msg );return true;}LRESULT CWindowsViewport::HandleWindowsMessages(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){switch( message ) {case WM_CREATE:{m_hWND = hWnd;return 0;}case WM_PAINT:{// don't do anything.ValidateRect( hWnd, NULL );return 0;}case WM_ERASEBKGND:{return 0;}case WM_DESTROY:{PostQuitMessage(0);return 0;}default:{return DefWindowProc(hWnd, message, wParam, lParam);}}return 0;};  Sorry i don't see any errors in this code...if you post an executable of this app I can test it on my machine and tell you if it gives the same problem...   ;  http://www.megaupload.com/?d=V7SKG2TY   ;  Ok, i've figured out, it is a normal behaviour. I didn't understand correctly your question at the beginning (i thought your app was stalling somewhere).When the application is completely occluded DirectX10 return DXGI_STATUS_OCCLUDED on the Present and does not execute the present because useless.   ;  thanks!I got to solve that problem now too thanks to your replyhr = m_pSwapChain->Present(0, 0);if(hr == DXGI_STATUS_OCCLUDED){Sleep(20);}this doesn't make my application freeze anymore   