All pastes #635812 Raw Edit

Mine

public text v1 · immutable
#635812 ·published 2007-07-27 12:05 UTC
rendered paste body
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());
}