Creating editor which uses Irrlicht render

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
netrick
Posts: 5
Joined: Thu Dec 20, 2012 3:56 pm

Creating editor which uses Irrlicht render

Post by netrick »

Hey, I'm using Irrlicht for my game and I want to write an editor (as normal GUI app with native os look) but with Irrlicht subwindow (it's the approach that most engines use, subwindow with the game engine). However I have a question. First of all, I need it to work on linux and windows. On windows there are resources, but on linux it's a little bit more tricky. How can I integrate irrlicht subwindow to wxwidgets in cross platform way? (#ifdef for platform are ok)

Or there is better approach for writing editor? Firstly I wanted to make an editor using in-game gui (which is very convenient and offers native game look), but I encountered a very big problem. How can I call open and save file dialog from there? On windows there is a winapi function, but no luck on linux. So i came up with idea to let irrlicht manage the window and call wxwidgets to call native file browser, but it just doesn't work because even for it wx must have its window... So now I want to run separate wx process in case load/save is called, but it's tricky and hard to do cross platform way... So my question number 2, maybe not related to irrlicht, is if you know anything about whatever way to call file browse dialog from opengl app (irrlicht in this case).

Thanks!
chronologicaldot
Competition winner
Posts: 685
Joined: Mon Sep 10, 2012 8:51 am

Re: Creating editor which uses Irrlicht render

Post by chronologicaldot »

I'm not sure I understand quite what you want. First you're saying you want a look native to the OS and then you're saying you want a look native to your game.

For your open and close box: What's wrong with using irrlicht's own open and close dialog box? It should work on any OS.

Irrlicht has all kinds of GUI stuff built in already. It would probably be easiest for you to keep everything in irrlicht. If you want it to look more "native" to the OS, look at the files "IGUISkin.h", "CGUISkin.h", and "CGUISkin.cpp" (At least I think that's what they are called). The class of interest is IGUISkin: it controls the natural appearance of most GUI objects in irrlicht. More precisely, it sets up an interface that GUI elements can call in order to draw themselves. You can inherit from the abstract class IGUISkin and then pass your GUI skin class into the GUI environment via the IGUIEnvironment function setSkin() (Someone please correct me if I'm wrong on that).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Creating editor which uses Irrlicht render

Post by hybrid »

Maybe just search the forum for wxwidget integration. We have several examples reported to be working cross platform.
netrick
Posts: 5
Joined: Thu Dec 20, 2012 3:56 pm

Re: Creating editor which uses Irrlicht render

Post by netrick »

@chronologicaldot
I have 2 question and 2 ways of doing it - one with native os look, the second with native game look. Either is good for me, I just want to know which one is easiest and how to do it.

And yes, I know that irrlicht has open file dialog but AFAIK there is no file save dialog. Maybe I'm wrong? I would be glad to hear that irrlicht has save dialog too.
CuteAlien
Admin
Posts: 9687
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Creating editor which uses Irrlicht render

Post by CuteAlien »

No file-save dialog. But maybe there's one on the forum - I thought I had seen someone mention working on one before....
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Creating editor which uses Irrlicht render

Post by hybrid »

We have one or two on the patch tracker
netrick
Posts: 5
Joined: Thu Dec 20, 2012 3:56 pm

Re: Creating editor which uses Irrlicht render

Post by netrick »

Could you give me a link to save file dialog on patchtracker?

I just can't find it there...

Thanks
jeromegz
Posts: 14
Joined: Sat Aug 02, 2008 10:51 am

Re: Creating editor which uses Irrlicht render

Post by jeromegz »

Hi ; i have a little problem on compiling irrlicht + wxdevcpp editor ( a good editor for GUI ) . I have done all the code to work with wxdevcpp and irrlicht but it remain this error . Can someone fix it ?

Code: Select all

67 C:\wDev-Cpp\monprojetFrm.cpp:104 invalid conversion from 'irr::s32 {aka int}' to 'void*' [-fpermissive]
my project is on this url https://www.eslap.fr/wDev-Cpp.rar or http://www.eslap.fr/wDev-Cpp.rar . if someone can fix it , it would be pleasant that he tell the solution here . Thanks a lots

Code: Select all

monprojetFrm::monprojetFrm(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
{
    CreateGUIControls();
     IrrlichtDevice* device;
      ISceneManager* smgr;
      IVideoDriver* driver;
     wxMenu *menuFile = new wxMenu;
  // menuFile->Append( ID_EXIT, "E&xit" );
 
   wxMenuBar *menuBar = new wxMenuBar;
   menuBar->Append( menuFile, "&File" );
 
   SetMenuBar( menuBar );
   
   //Irrlicht stuff
   irr::SIrrlichtCreationParameters param;
   param.WindowSize =   irr::core::dimension2d<s32>(size.x,size.y);
 
// HERE IS THE PROBLEM
   param.WindowId =  reinterpret_cast<s32>( WxPanel->GetHandle() );
 
 
//reinterpret_cast<s32>(monprojetFrm->ID_WXPANEL1);//monprojetFrm->GetHandle() ;//reinterpret_cast<s32>(id);//reinterpret_cast<s32>((HWND)GetHandle()); // hColorButton   
   param.DriverType = video::EDT_DIRECT3D9;
 
   device = irr::createDeviceEx(param);
 
   // setup a simple 3d scene
   smgr = device->getSceneManager();
   driver = device->getVideoDriver();
 
   scene::ICameraSceneNode* cam = smgr->addCameraSceneNode();
   cam->setTarget(core::vector3df(0,0,0));
 
   scene::ISceneNodeAnimator* anim = smgr->createFlyCircleAnimator(core::vector3df(0,10,0), 30.0f);
   cam->addAnimator(anim);
   anim->drop();
 
   scene::ISceneNode* cube = smgr->addCubeSceneNode(20);
 
   cube->setMaterialTexture(0, driver->getTexture("media/rockwall.bmp"));
   cube->setMaterialFlag( video::EMF_LIGHTING, false );
   smgr->addSkyBoxSceneNode(
      driver->getTexture("media/irrlicht2_up.jpg"),
      driver->getTexture("media/irrlicht2_dn.jpg"),
      driver->getTexture("media/irrlicht2_lf.jpg"),
      driver->getTexture("media/irrlicht2_rt.jpg"),
      driver->getTexture("media/irrlicht2_ft.jpg"),
      driver->getTexture("media/irrlicht2_bk.jpg"));
}
Hello
Post Reply