Embed Irrlicht in an existing GTK window

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Embed Irrlicht in an existing GTK window

Post by mandrav »

As you all know, currently Irrlicht cannot be used inside an existing GTK window (usually Linux).
Well, I have the patch for it but I don't know where to post this. Patch tracker at SF or hybrid's site?

Image
(click here for full size)

:lol:
hybrid

Post by hybrid »

I have no problems with hosting your files :D It's a permanent link with good connection and no size limits. Adding the direct link into this thread should be enough to make it available. I don't know whether the SF project pages are of any use. There are bugs announced which have been fixed for years now.
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

OK, I sent you a mail with the patch.
As a reference for everyone interested, here's how it works:

The IrrlichtDevice must be created using createDeviceEx. The WindowId member of SIrrlichtCreationParameters, must be set to point to a NULL-terminated string containing the display + ":" + windowid.

Code: Select all

    SIrrlichtCreationParameters params;

    Display* pDisplay = ...; // set this to the display
    Window winID = ...; // set this to your window id

    core::stringc winDesc = (long)pDisplay;
    winDesc += ':';
    winDesc += (int)winID;
    params.WindowId = (long)winDesc.c_str();

    params.DriverType = EDT_OPENGL;
    irr::IrrlichtDevice* pDevice = createDeviceEx(params);
That's it :)
Note that I have tested this only with OpenGL...
AndyCR
Posts: 110
Joined: Tue Nov 08, 2005 2:51 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

*breathes a big sigh of relief*

you might very possibly have just saved me tons of work! i was dreading this! thank you so much!! :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Why did you disable the window close event? This breaks functionality at least for all other applications not embedded in GTK windows. Either check for the userSuppliedWindow in this case or change behavior inside the main application.
hgc
Posts: 7
Joined: Wed Oct 11, 2006 9:05 am
Location: Madrid, Spain

Post by hgc »

Do you know how to put Irrlicht embbebded into a C++/CLI Windows Form? Could you show an example, please. I don't know how to do it...
arixion
Posts: 8
Joined: Fri Jun 02, 2006 4:16 pm

Post by arixion »

Hmmm ... why don't you put this patch into the main source tree for Irrlicht? Perhaps it could be integrated into Irrlicht 1.3 or sth?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There are several solutions what and how to store the server/display connection. This has to be fixed somehow.
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

any news on this item of intrest ? it seems there is an issue with wx window handle params too.

this might be of use though
http://gtkglext.sourceforge.net/download
Post Reply