void CWindow::OnRenderFrame() { if(!m_active || (m_graphics->GetDevice() == NULL)) return; #if _ISVISTA HRESULT result = m_graphics->GetDevice()->CheckDeviceState(m_hWnd); #else HRESULT result = m_graphics->GetDevice()->TestCooperativeLevel(); #endif if(FAILED(result)) { if(result == D3DERR_DEVICELOST) { Sleep(50); return; } else { OnLostDevice(); if(m_graphics->Reset() == D3DERR_DEVICELOST) { Sleep(50); return; } else OnResetDevice(); } } if(m_base != NULL) m_base->OnRenderFrame(m_graphics->GetDevice()); }