Runtime error loading widgets

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

ed7890
Just popping in
Just popping in
Posts: 5
Joined: Wed Dec 27, 2006 20:08

Runtime error loading widgets

Postby ed7890 » Wed Dec 27, 2006 20:25

Hi i'm making my first program using OpenGL and CEGUI using VS2003 and i'm having trouble loading the widgets. The program compiles ok but the when i run it, I get a runtime error because it cant load the widgets.

Is there something i'm missing or do i have to put the widgets in a special folder or what?
Thanks for any help.

Code: Select all

int main(int argc, char *argv[])
{

   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
   glutInitWindowSize(640, 480);
   window_id = glutCreateWindow("GLUT Loop");
   try{
      OpenGLRenderer* myRenderer = new OpenGLRenderer(512);
      new System(myRenderer);

      WindowManager winMgr = WindowManager::getSingleton();
      Window* myRoot = winMgr.createWindow("DefaultWindow", "root");
      System::getSingleton().setGUISheet(myRoot);

      SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");
      PushButton* btn = static_cast<PushButton*>(winMgr.createWindow("TaharezLook/Button", "root\mybutton"));
      myRoot->addChildWindow(btn);
      FrameWindow* frmWin = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "testWindow");
      myRoot->addChildWindow(frmWin);
      
      frmWin->setPosition( Point( 0.25f, 0.25f ) );
      frmWin->setSize( Size( 0.5f, 0.5f ) );
      frmWin->setText( "Hello World!" );
   }catch(CEGUI::Exception ex){
      MessageBox(NULL, ex.getMessage().c_str(), "Cegui exception", 0);
   }


   glutKeyboardFunc(keyFunc);

   while(keep_running)
   {
      glutMainLoopEvent();
      render();
      System::getSingleton().renderGUI();
      glutSwapBuffers();
   }
   glutDestroyWindow(window_id);
   return 0;
}

LennyH
Quite a regular
Quite a regular
Posts: 92
Joined: Thu Nov 30, 2006 20:50

Postby LennyH » Thu Dec 28, 2006 14:35

What are the specific error messages?

The simplest problem tends to come from having your datapath for finding the schemes/looknfeel/imageset wrong.

ed7890
Just popping in
Just popping in
Posts: 5
Joined: Wed Dec 27, 2006 20:08

Postby ed7890 » Thu Dec 28, 2006 18:34

It throws the exception
DefaultResource Provider::Load - TaharezLoad.Scheme does not exist

Then there a runtime error that starts with "Assertion failed"

Its must that it doesnt have the right path to find them, but i dont know how to set the path.

LennyH
Quite a regular
Quite a regular
Posts: 92
Joined: Thu Nov 30, 2006 20:50

Postby LennyH » Thu Dec 28, 2006 19:50

http://www.cegui.org.uk/wiki/index.php/ ... ialisation

Take a gander through that. When you load a scheme, worst case scenario is that you can just give the complete, absolute path to the scheme file. You should be able to give a relative path from where your executable is running from, as well.

ed7890
Just popping in
Just popping in
Posts: 5
Joined: Wed Dec 27, 2006 20:08

Postby ed7890 » Mon Jan 15, 2007 15:54

Hey i still cant get this working and its really wrecking my head.

I'm using the following to load in the .scheme file and that runtime error is gone.

Code: Select all

Scheme* sm = SchemeManager::getSingleton().loadScheme("../datafiles/schemes/TaharezLook.scheme");


But now it gives me this runtime error at that line:

Imageset::xml::startElement - An unexpected error occured while creating a Texture Object from file '../datafiles/imagesets/TaharezLook.tga'

Does anyone know what i'm doing wrong here?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Jan 16, 2007 09:00

Hi, here's another interesting link for you:
http://www.cegui.org.uk/wiki/index.php/ ... s_in_0.5.0

But i don't know i whether you use version 0.5 or 0.4. The link only applies to 0.5.

Make sure that your Imageset directory is relatively at the same location from your startup directory as the Schemes directory.

When you don't use the resource groups (the link), the paths inside your files may be relative. Otherwise they should not contain path information at all.

So please open your .Scheme and .Imageset file and have a look at the paths in there.

Good luck! :-)

ed7890
Just popping in
Just popping in
Posts: 5
Joined: Wed Dec 27, 2006 20:08

Postby ed7890 » Sun Jan 28, 2007 21:33

Hi thanks for the help but i still cant get it working, it still gives me the same error.

I'm using version 0.4. I opened the .Scheme and .Imageset files and tried paths with relative paths and no paths information and i still cant get it workin.

Any ideas? Are there any other files that are used beside the .scheme file, the .imageset file and the .tga file?

ed7890
Just popping in
Just popping in
Posts: 5
Joined: Wed Dec 27, 2006 20:08

Postby ed7890 » Mon Jan 29, 2007 14:27

Do i need a .dll file for the TarahezLook scheme for it to be loaded up properly?


Return to “Help”

Who is online

Users browsing this forum: No registered users and 24 guests