Can't understand where problem is

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

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

Can't understand where problem is

Postby vasmann » Sat Nov 11, 2006 15:29

Hello. I am newbie in CEGUI and trying to understand how to use it. I created new test project, initialized OpenGL context (under windows os).
Then I use such code

Code: Select all

void initResources()
   {
      m_GUIRenderer = new CEGUI::OpenGLRenderer(0);
      m_GUISystem =new CEGUI::System(m_GUIRenderer);

      CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
         (CEGUI::System::getSingleton().getResourceProvider());

      rp->setResourceGroupDirectory("schemes", "./datafiles/schemes/");
      rp->setResourceGroupDirectory("imagesets", "./datafiles/imagesets/");
      rp->setResourceGroupDirectory("fonts", "./datafiles/fonts/");
      rp->setResourceGroupDirectory("layouts", "./datafiles/layouts/");
      rp->setResourceGroupDirectory("looknfeels", "./datafiles/looknfeel/");
      rp->setResourceGroupDirectory("lua_scripts", "./datafiles/lua_scripts/");

      CEGUI::Imageset::setDefaultResourceGroup("imagesets");
      CEGUI::Font::setDefaultResourceGroup("fonts");
      CEGUI::Scheme::setDefaultResourceGroup("schemes");
      CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
      CEGUI::WindowManager::setDefaultResourceGroup("layouts");
      CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
   }
void initDefaultResources()
   {
        Imageset::setDefaultResourceGroup("imagesets");
        Font::setDefaultResourceGroup("fonts");
        Scheme::setDefaultResourceGroup("schemes");
        WidgetLookManager::setDefaultResourceGroup("looknfeels");
        WindowManager::setDefaultResourceGroup("layouts");
        ScriptModule::setDefaultResourceGroup("lua_scripts");
   }
void initBaseGUI()
   {
      try
      {
         FontManager::getSingleton().createFont("Commonwealth-10.font");
      }
      catch(Exception& e)
      {
         MessageBox(e.getMessage().c_str(), e.getMessage().c_str());
      }
      try
      {
         WidgetLookManager::getSingleton().parseLookNFeelSpecification("TaharezLook.looknfeel");
      }
      catch(Exception& e)
      {
         MessageBox(e.getMessage().c_str(), e.getMessage().c_str());
      }
      try
      {
         SchemeManager::getSingleton().loadScheme("TaharezLookWidgets.scheme");
      }
      catch(Exception& e)
      {
         MessageBox(e.getMessage().c_str(), e.getMessage().c_str());
      }

      WindowManager& winMgr = WindowManager::getSingleton();

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


      FrameWindow* wnd = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window");
      root->addChildWindow(wnd);
      wnd->setPosition(UVector2(cegui_reldim(0.25f), cegui_reldim( 0.25f)));
      wnd->setSize(UVector2(cegui_reldim(0.5f), cegui_reldim( 0.5f)));
      wnd->setMaxSize(UVector2(cegui_reldim(1.0f), cegui_reldim( 1.0f)));
      wnd->setMinSize(UVector2(cegui_reldim(0.1f), cegui_reldim( 0.1f)));
      wnd->setText("Hello World!");
      
   }
   void OnRender(void)
   {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glLoadIdentity(); // Load identity matrix
drawScene();
      m_GUISystem->renderGUI();   
      glFinish();
   }

And I see mine scene is rendering but there is no GUI.
And there is another problem - no one tga is loaded with message: "
Imageset::xmlHandler::startElement - An unexpected error occurred while creating a Texture object from file 'TaharezLook.tga'
"
No exception is handled which means that all resources loaded properly.
Scene is very simple - just the cube .
Please help me.
Thank you

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

There is some problem with loading tga under debug profile

Postby vasmann » Sat Nov 11, 2006 18:24

It seem that something wrong with debug version of library which loads tgas - because I've set profile release (MS Studio Express) and all works fine, but I need debug profile too, could sombody help?

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

Problem was really in debug versions of dll's

Postby vasmann » Sat Nov 11, 2006 19:27

As I supposed.
I downloaded sources of CEGUI and dependencies pack, built solution for MS Studio Express and rebuilt debug/release version, and replaced old *.lib and *.dll files with new ones - and voila - all works fine.
Thank you all.

PS: May be it is better to insert in binary package of CEGUI new versions of libraries - to same problems?

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Re: Problem was really in debug versions of dll's

Postby Pompei2 » Sun Nov 12, 2006 16:56

vasmann wrote:PS: May be it is better to insert in binary package of CEGUI new versions of libraries - to same problems?


That's a good point, i think it would be very appreciated to have compiled .lib , .dll files in the package, a lot of users fear to compile libraries :) Don't know what's the dev's opinion about that ?

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

Re: Problem was really in debug versions of dll's

Postby vasmann » Mon Nov 13, 2006 09:24

Pompei2 wrote:
vasmann wrote:PS: May be it is better to insert in binary package of CEGUI new versions of libraries - to same problems?


That's a good point, i think it would be very appreciated to have compiled .lib , .dll files in the package, a lot of users fear to compile libraries :) Don't know what's the dev's opinion about that ?


I guess it is not a fear, it is the simplest way :-) and if you distribute binary packages - and I downloaded it - all I know that I trust you - dll's and libs should correctly work on my machine - but it doesn't, and as I am newbie in CEGUI I thought that I do some thing wrong and spent one day to understand that it was not mine misstake.

There is no any problem to download sources and dependencies and recompile it, but why do more if it is already done :-)

Thank you.

PS: Good work guys - I love CEGUI from first look at it.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Nov 13, 2006 10:25

Hi guys.

I'm not 100% sure what the issue is you were having :oops:

Are you saying there is an issue with the latest 0.5.0 SDKs in debug mode?

CE.

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

Postby vasmann » Mon Nov 13, 2006 11:19

CrazyEddie wrote:Hi guys.

I'm not 100% sure what the issue is you were having :oops:

Are you saying there is an issue with the latest 0.5.0 SDKs in debug mode?

CE.


Yep.
I downloaded binary package (not sources) of 0.5 and it didn't work in debug profile. After I've downloaded sources and dependencies - I rebuilt all (debug and release profiles) replaced result dll and lib files and all works.
Thank you

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Nov 14, 2006 09:12

Ok, thanks for the info - I'll test this out and if needed upload a fixed package.

[Edit]
I can confirm this is an issue with the precompiled packages :evil:
[/Edit]
CE

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Nov 14, 2006 14:29

I have now issued a new set of binary packages under the label of 0.5.0b.

Thanks again for bringing this up (since, nobody else did!)

CE.


Return to “Help”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 20 guests