Page 1 of 1

Free/Recreate

Posted: Fri Dec 16, 2005 19:38
by Aiursrage2k
I just started using CEGUI, its a really great GUI.

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);

Re: Free/Recreate

Posted: Sat Dec 17, 2005 15:05
by lindquist
the card?
what are you trying to do?

you should really delete in reverse order. deleteing the renderer before the system is a pretty bad move...