Page 1 of 1

Can't understand where problem is

Posted: Sat Nov 11, 2006 15:29
by vasmann
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

There is some problem with loading tga under debug profile

Posted: Sat Nov 11, 2006 18:24
by vasmann
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?

Problem was really in debug versions of dll's

Posted: Sat Nov 11, 2006 19:27
by vasmann
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?

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

Posted: Sun Nov 12, 2006 16:56
by Pompei2
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 ?

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

Posted: Mon Nov 13, 2006 09:24
by vasmann
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.

Posted: Mon Nov 13, 2006 10:25
by CrazyEddie
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.

Posted: Mon Nov 13, 2006 11:19
by vasmann
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

Posted: Tue Nov 14, 2006 09:12
by CrazyEddie
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

Posted: Tue Nov 14, 2006 14:29
by CrazyEddie
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.