// Release all the device objects (the Render Objects)... bool CD3D_Device::ReleaseDevObjects() { // Notify all RenderObjects that we're going to free the device (to give up all there device stuff) CRenderObject* pRenderObject = m_pRenderObjectList_Head; while (pRenderObject) { pRenderObject->FreeDeviceObjects(); pRenderObject = pRenderObject->GetNext(); } return true; }
// Release all the device objects (the Render Objects)... bool CD3D_Device::ReleaseDevObjects(bool bFullRelease) { //free the screen glow's resources CScreenGlowMgr::GetSingleton().FreeDeviceObjects(); // free the vertex shaders LTVertexShaderMgr::GetSingleton().FreeDeviceObjects(); // Free the pixel shaders. LTPixelShaderMgr::GetSingleton().FreeDeviceObjects(); // Free the effect shaders. LTEffectShaderMgr::GetSingleton().FreeDeviceObjects(); // Free the rendertarget textures and surfaces CRenderTargetMgr::GetSingleton().FreeDeviceObjects(); // Notify all RenderObjects that we're going to free the device (to give up all there device stuff) CRenderObject* pRenderObject = m_pRenderObjectList_Head; while (pRenderObject) { pRenderObject->FreeDeviceObjects(); pRenderObject = pRenderObject->GetNext(); } if (m_pRenderWorld) m_pRenderWorld->Release(); if( m_pEndOfFrameQuery ) { m_pEndOfFrameQuery->Release(); m_pEndOfFrameQuery = NULL; } FreeFrameTextures(); // Don't actually delete them unless we really want to if (bFullRelease) { delete m_pRenderWorld; m_pRenderWorld = 0; } return true; }