Free/Recreate

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Aiursrage2k
Just popping in
Just popping in
Posts: 3
Joined: Fri Dec 16, 2005 19:31

Free/Recreate

Postby Aiursrage2k » Fri Dec 16, 2005 19:38

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

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Free/Recreate

Postby lindquist » Sat Dec 17, 2005 15:05

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...


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests