Code: Select all
// create the renderer object for the GUI
CEGUI::OpenGLRenderer* myRenderer = new CEGUI::OpenGLRenderer(NULL);
// create the GUI system object (singleton)
new CEGUI::System(myRenderer);
// Load the Taharez scheme
CEGUI::SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");
// create a window
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
// Sets the passed window heirachy as the root (does not destroy the old one, just doesn't use it.
// We can just switch between window heirachies by calling 'setGUISheet')
CEGUI::System::getSingleton().setGUISheet(myRoot);
// create a window of type FrameWindow using the "Taharez" widget set
CEGUI::FrameWindow* fWnd = (CEGUI::FrameWindow*) wmgr.createWindow("TaharezLook/FrameWindow", "testWindow");
// attatch the window to the heirachy we created above
myRoot->addChildWindow(fWnd);
// set the window's initial position and size
fWnd->setPosition( CEGUI::Point(0.25f, 0.25f) );
fWnd->setSize( CEGUI::Size(0.5f, 0.5f) );
// set the caption of the window's title bar
fWnd->setText("Hello World!");
This is what I have so far, most of it just straight from the first 3 tutorials.
The program crashes when I attempt to run it with an "unusual termination" error. I've stepped through, line by line and found that I get an CEGUI::InvalidRequestException at the line where I call 'loadScheme'.
I have copied all the TaharezLook files from the CEGUI SDK folder, into the folder where the IDE (VC++ 2005 Express) sets the environment when running apps from inside the IDE, which is the same place that I've copied the CEGUI dll's.
If I remove the 'loadScheme' function call, I get a CEGUI::UnknownObjectException at the 'createWindow' call where I attempt to create a window using the TaharezLook scheme, which actually prompted me to insert the 'loadScheme' call.
I'm not really sure of what else I should be trying.
Edit:: Aha!! Log files are useful!

I took a look at the log file, and as anyone else here would probably be able to tell me, CEGUI attempted to load all the other assests that are required for a GUI, such as an image set. Unfortunately it attempted to load it from the "../datafiles/imagesets/" directory.
I'm assuming that I don't actually need to load things from there. Is it possible to change this directory, so I can just copy all the assests for a particular project into it's own directory and reference everything from there? I mean, without editing the XML files?
Or would it ultimately be easier to just create my own schemes for each project and use them?