Irrlicht doesn't show anything

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

Amarth
Just popping in
Just popping in
Posts: 4
Joined: Sun Apr 23, 2006 20:16

Irrlicht doesn't show anything

Postby Amarth » Sun Apr 23, 2006 20:31

Hello all,
I just started with CEGUI. I have done the first couple of tutorials, but at the end of number 3 (The Beginner Guide to Creating a CEGUI Window), nothing shows on my screen, except for an empty window. The mouse cursor isn't changed, either. No errors are generated and the log doesn't show any problems, either. Code:

Code: Select all

#include "irrlicht.h"
#include "CEGUI.h"
#include "renderers/IrrlichtRenderer/irrlichtrenderer.h"

using namespace irr;

int main(){
   IrrlichtDevice *myIrrlichtDevice =
      createDevice(video::EDT_SOFTWARE,core::dimension2d<s32>(512, 384),16,false,false,0);
   myIrrlichtDevice->setWindowCaption(L"CEGUI and the Irrlicht Engine!");
   video::IVideoDriver* myIrrlichtDriver = myIrrlichtDevice->getVideoDriver();
   scene::ISceneManager* myIrrlichtSceneManager = myIrrlichtDevice->getSceneManager();

   CEGUI::IrrlichtRenderer* myRenderer = new CEGUI::IrrlichtRenderer(myIrrlichtDevice, true);
   new CEGUI::System(myRenderer);

   CEGUI::SchemeManager::getSingleton().loadScheme("../datafiles/schemes/TaharezLook.scheme");
   CEGUI::FontManager::getSingleton().createFont("../datafiles/fonts/Commonwealth-10.font");
   CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");

   CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().loadWindowLayout("test.layout");
   CEGUI::System::getSingleton().setGUISheet(myRoot);

   while(myIrrlichtDevice->run()){
      myIrrlichtDriver->beginScene(true, true, irr::video::SColor(150,50,50,50));
      myIrrlichtSceneManager->drawAll();
      CEGUI::System::getSingleton().renderGUI();
      myIrrlichtDriver->endScene();
   }

   myIrrlichtDevice->drop();

   return(0);
}
The datafiles are set up as they should be (it throws exceptions, otherwise), and my test.layout file is

Code: Select all

<?xml version="1.0" ?>
<GUILayout>
    <Window Type="DefaultWindow" Name="root">
        <Window Type="TaharezLook/FrameWindow" Name="testWindow">
            <Property Name="UnifiedPosition" Value="{{0.25,0},{0.25,0}}" />
            <Property Name="UnifiedSize" Value="{{0.5,0},{0.5,0}}" />
            <Property Name="Text" Value="Hello World!" />
        </Window>
    </Window>
</GUILayout>
Anyone has any idea?

Another thing is that I find that 'new CEGUI::System(myRenderer);' very suspicious. Isn't that a guarantied leak?

Thank you!

Amarth
Just popping in
Just popping in
Posts: 4
Joined: Sun Apr 23, 2006 20:16

Postby Amarth » Mon Apr 24, 2006 20:44

Argh, OK, found it. Software doesn't work - needs to be OpenGL or Direct3D. Replace video::EDT_SOFTWARE with video::EDT_OPENGL and it works...

Thanks, anyway :D.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests