Page 1 of 1

A short video of Irrlicht working with other libs

Posted: Mon Aug 26, 2013 5:01 pm
by Nyx Erebos
I just wanted to share what I've done lately with Irrlicht : http://www.youtube.com/watch?v=NOFQQBR3Nug
Nothing amazing but I thought that it'd be cool show it off :mrgreen:
The libs I used are in the description.

Re: A short video of Irrlicht working with other libs

Posted: Tue Aug 27, 2013 5:04 am
by chronologicaldot
What? Nothing amazing? Aww.... Just kidding.

You've certainly tackled integration. Good job

Re: A short video of Irrlicht working with other libs

Posted: Tue Aug 27, 2013 1:06 pm
by Nyx Erebos
chronologicaldot wrote:What? Nothing amazing? Aww.... Just kidding.

You've certainly tackled integration. Good job
Thanks. I said that because all the libs are pretty well coded (and most of them are known to be working well alongside Irrlicht) so I just had to tweak the examples. The only thing that is quite annoying is when a problem or a bug is linked to many libs, it's hard to debug because there are not that much information about libs working together.

Re: A short video of Irrlicht working with other libs

Posted: Thu Aug 29, 2013 10:37 pm
by Cube_
Certainly a nice integration, I was just about to tackle CEGUI myself :3

Re: A short video of Irrlicht working with other libs

Posted: Fri Aug 30, 2013 11:38 am
by Nyx Erebos
aaammmsterdddam wrote:Certainly a nice integration, I was just about to tackle CEGUI myself :3
Just to spare you some pain, don't try to implement the tooltips with the last version of CEGUI. They don't work (at least for me and another guy from the CEGUI forum).

Re: A short video of Irrlicht working with other libs

Posted: Fri Aug 30, 2013 6:59 pm
by Cube_
Nyx Erebos wrote:
aaammmsterdddam wrote:Certainly a nice integration, I was just about to tackle CEGUI myself :3
Just to spare you some pain, don't try to implement the tooltips with the last version of CEGUI. They don't work (at least for me and another guy from the CEGUI forum).
thanks, I'll keep that in mind (didn't have any thoughts of implementing them as of now but I might get that idea)

Re: A short video of Irrlicht working with other libs

Posted: Thu Sep 05, 2013 9:29 pm
by LordJonas
Hi...

Any chance of you posting a link to the code? I'm very interested in the integration with CEGUI...

TIA

Re: A short video of Irrlicht working with other libs

Posted: Sun Sep 08, 2013 8:41 pm
by Nyx Erebos
LordJonas wrote:Any chance of you posting a link to the code? I'm very interested in the integration with CEGUI...
For now I don't want to share the whole code because it's quite poorly written :oops:

Atm my CEGUI stuff is almost all hard coded in the main, here's an excerpt :

Code: Select all

/*
     * This will create and initialise the following objects :
     *- CEGUI::IrrlichtRenderer
     *- CEGUI::IrrlichtResourceProvider
     *- CEGUI::IrrlichtImageCodec
     *- CEGUI::System
     */
    /*IrrlichtRenderer& guiRenderer = */IrrlichtRenderer::bootstrapSystem(*device);
    
    IrrlichtResourceProvider * IRprovider = static_cast<IrrlichtResourceProvider*>(System::getSingleton().getResourceProvider());
    IRprovider->setResourceGroupDirectory("schemes",resourcesPath+"schemes");
    IRprovider->setResourceGroupDirectory("imagesets",resourcesPath+"imagesets");
    IRprovider->setResourceGroupDirectory("fonts",resourcesPath+"fonts");
    IRprovider->setResourceGroupDirectory("layouts",resourcesPath+"layouts");
    IRprovider->setResourceGroupDirectory("looknfeels",resourcesPath+"looknfeel");
    IRprovider->setResourceGroupDirectory("lua_scripts",resourcesPath+"lua_scripts");
    
    ImageManager::setImagesetDefaultResourceGroup("imagesets");
    Font::setDefaultResourceGroup("fonts");
    Scheme::setDefaultResourceGroup("schemes");
    WidgetLookManager::setDefaultResourceGroup("looknfeels");
    WindowManager::setDefaultResourceGroup("layouts");
    ScriptModule::setDefaultResourceGroup("lua_scripts");
 
        CEGUI::SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
    Font* CEGUIFont = &(CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-10.font"));
    
    System::getSingleton().getDefaultGUIContext().setDefaultFont( "DejaVuSans-10" );
    System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
    System::getSingleton().getDefaultGUIContext().getMouseCursor().setVisible(true);
    
    //creating the root window which is invisible
    WindowManager& wmgr = WindowManager::getSingleton();
    Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
    System::getSingleton().getDefaultGUIContext().setRootWindow(myRoot);
    
    //menu
    Window* myMenu = wmgr.createWindow( "DefaultWindow", "menu" );
    myRoot->getRootWindow()->addChild(myMenu);
    myMenu->setVisible(false);
    myMenu->deactivate();
    
    //interface
    Window* myInterface = wmgr.createWindow( "DefaultWindow", "interface" );
    myRoot->getRootWindow()->addChild(myInterface);
 
    //creating a test window
    FrameWindow* fWnd = static_cast<FrameWindow*>(wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));
    
    //add the new window to the menu
    myMenu->addChild(fWnd);
    
    // position a quarter of the way in from the top-left of parent.
    //UDim(scale,offset) | scale in %, offset in pixels
    fWnd->setPosition( UVector2( UDim( 0.25, 0 ), UDim( 0.25, 0 ) ) );
 
    // set size to be half the size of the parent
    fWnd->setSize( USize( UDim( 0.5, 0 ), UDim( 0.5, 0 ) ) );
    fWnd->setText( "Hello World!" );
    
    //the menu window can't be modified by the mouse
    myMenu->setMousePassThroughEnabled(true);
Basically here I create the root window and then I bind to it 2 other windows, the menu window (when all the windows pop up in my video) and the interface window (the "in-game" window). Then I attach to the menu window a standard window "hello world".

To interact with the windows you need to add some code in the Irrlicht event manager (I basically have the same as in the tutorials):

Code: Select all

            case irr::KEY_KEY_0:
                    CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(0x0030);
                    return true;
                      case irr::KEY_BACK:
                    CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(CEGUI::Key::Backspace);
                    //for now the keyup is here (put it into the Irrlicht keyup)
                    CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(CEGUI::Key::Backspace);
                    return true;
For the mouse it's almost the same mechanism, when you click it triggers the Irrlicht event manager to change a mousestate struct (that you need to code and holds the mouse buttons states) and then use for example :

Code: Select all

System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(LeftButton);
Last but not least, don't forget to call :

Code: Select all

CEGUI::System::getSingleton().injectTimePulse(deltaTime*0.001);
You need to read http://www.cegui.org.uk/wiki/index.php/ ... ll_Widgets to understand how it works but it's not up to date.

I have another video focusing more on physics this time (I know the quality is pretty bad) : https://www.youtube.com/watch?v=1YYqM8z1jtU

Re: A short video of Irrlicht working with other libs

Posted: Mon Oct 07, 2013 3:29 pm
by Nyx Erebos
Another short video to show the bullet debug drawer : http://www.youtube.com/watch?v=v216aUkpf2U

Re: A short video of Irrlicht working with other libs

Posted: Mon Mar 03, 2014 4:39 pm
by Nyx Erebos
And now running on Windows :) (with a few more features, read the description for a recap).

http://www.youtube.com/watch?v=J8nFTD5s818