The problem is I have to free all the resources from the card before I can reset it. How is this usually done?
Code: Select all
I have this for when recrate happens.
//Recreate
m_Renderer = new CEGUI::DirectX9Renderer(GET_APPDEVICE,0);
m_System = new CEGUI::System(m_Renderer);
CEGUI::FontManager::getSingleton().createFont("datafiles/fonts/Commonwealth-10.font");
CEGUI::SchemeManager::getSingleton().loadScheme("datafiles/schemes/TaharezLook.scheme");
CEGUI::System::getSingleton().setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook",
(CEGUI::utf8*)"MouseArrow");
Window* myRoot = WindowManager::getSingleton().loadWindowLayout("MainScreen.layout");
Code: Select all
//Free method, its not evicting everything from the card.
There must be a better method then creating/destroying...
help me.
CEGUI::FontManager::getSingleton().destroyAllFonts();
CEGUI::SchemeManager::getSingleton().unloadAllSchemes();
WindowManager::getSingleton().destroyAllWindows();
SafeDelete(m_Renderer);
SafeDelete(m_System);