Problem with version 0.5

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

odenter
Just popping in
Just popping in
Posts: 4
Joined: Mon Mar 12, 2007 11:18

Problem with version 0.5

Postby odenter » Wed Mar 26, 2008 18:40

First my english in writing isn't perfect. :)

I've downloded the sdk for MSVC 9.
I want to use CEGUI with irrlicht.

So I've the following code.

Code: Select all

#include <irrlicht.h>
#include "CEGUI.h"
#include "RendererModules\IrrlichtRenderer\irrlichtrenderer.h"

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace CEGUI;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "CEGUIBase.lib")
#pragma comment(lib, "IrrlichtRenderer.lib")
#endif


int main()
{
  IrrlichtDevice *device = createDevice( video::EDT_DIRECT3D9, dimension2d<s32>(800, 600), 16,
         false, false, false, 0);

   device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

   IVideoDriver* driver = device->getVideoDriver();
   ISceneManager* smgr = device->getSceneManager();
   IGUIEnvironment* guienv = device->getGUIEnvironment();

  CEGUI::IrrlichtRenderer *cegui = new CEGUI::IrrlichtRenderer(device, true);

   while(device->run())
   {
      driver->beginScene(true, true, SColor(255,100,101,140));

      smgr->drawAll();
      guienv->drawAll();

    ::System::getSingletonPtr()->renderGUI();

      driver->endScene();
   }

   device->drop();

   return 0;
}


But I get an assert on this line

Code: Select all

    ::System::getSingletonPtr()->renderGUI();


Any advice?
Irrlicht version is 1.4

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

Postby CrazyEddie » Wed Mar 26, 2008 19:17

Hi,

You do not appear to have done all the tasks required to initialise the system; specifically, you did not create the CEGUI system object:

Code: Select all

...
// create CEGUI renderer
CEGUI::IrrlichtRenderer* renderer = new CEGUI::IrrlichtRenderer(device, true);

// create CEGUI system
new CEGUI::System( renderer );
...


That should resolve the immediate issue, though you will also need to perform some other steps too. I highly recommend you read the four Beginner tutorials.

HTH

CE
Last edited by CrazyEddie on Thu Mar 27, 2008 10:44, edited 1 time in total.

odenter
Just popping in
Just popping in
Posts: 4
Joined: Mon Mar 12, 2007 11:18

Postby odenter » Wed Mar 26, 2008 19:31

Thank's works fine.

I'll read them.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests