Irrlicht wxWidgets driver?

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
Gothi[c]
Posts: 8
Joined: Fri Mar 17, 2006 6:40 pm
Contact:

Irrlicht wxWidgets driver?

Post by Gothi[c] »

I was working on trying to get Irrlicht to show inside a wxWidgets widget on Linux. So far all methods proposed only work on windows. I tweaked the irrlicht linux driver so i could pass the x11 window & display, and commented out the x11 window creation parts. This worked to some degree. I was able to make the irrlicht window attach to my wxWidgets widget, but the rendering seemed to appear behind my widget. (Maybe wxWidgets was drawing over the irrlicht rendering? i tried disabling that by overriding OnPaint but that didn't do much).

All in all, it seemed a very hackerish way of doing things. Then I remembered wxWidgets has that opengl widget. This had me wondering if it would be possible to use the wxWidgets opengl widget, and somehow make Irrlicht render in it. It's possible to set the glx rendering context to the wxWidgets gl window, so is it possible to emit the rendering context stuff from the driver + all the window creation stuff, so all OpenGL commands are sent to the wx window? Or maybe even go further and make an irrlicht driver derived from wxWindow, with event handlers and everything?

I'll keep experimenting with this, but I would greatly appreciate help/ideas/comments on my stupidity/etc...
Gothi[c]
Posts: 8
Joined: Fri Mar 17, 2006 6:40 pm
Contact:

Post by Gothi[c] »

It worked :)
I created my own irrlicht driver which doesn't create it's own x11 context and window, and I used wxWidgets' GL canvas ->SetCurrent() to set the rendering context. I have a rotating cube working sofar. Now i'll have to see if i can port the events.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Good news!
Just don't forget to keep the Irrlicht code style because even so I don't think it will be accepted into the core library - MAYBE - us users could use it a lot.
Also I think it won't be accepted because Irrlicht doesn't use external libraries so if you can somehow make it like #define compile with WxWidget and it will work it might actually get in :wink:
Anyway I'd like to see it finished and working as bugless as it can be :)
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Gothi[c]
Posts: 8
Joined: Fri Mar 17, 2006 6:40 pm
Contact:

Post by Gothi[c] »

Yep, I did add a #define so you can add a compiler switch to compile in the wx stuff.
I haven't had much time lately, but I'm still working on the events.
I'll upload here when finished.
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

how is it comming along ?
cheshirekow
Posts: 105
Joined: Mon Jul 27, 2009 4:06 pm
Location: Cambridge, MA

Post by cheshirekow »

I had the exact same thought that you did, about passing around the glcontext used by wxWidgets. I'd love to see the code you have so far. Can you post it? Or at least pm me with it?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Try to check out the new beginScene version first. With Irrlicht 1.7 you can pass an ExposedVideo struct, which holds the window, context, etc. This should work from within Irrlicht.
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

hybrid can you elaborate a little more, i'ts kind of confusing hehe.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can pass in the OpenGL context and window together in this struct. This should be enough to let Irrlicht automatically change the context. Just note, that you will have to create the contexts shared if you also exchange ressources among the contexts.
netpipe
Posts: 670
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Post by netpipe »

still no luck getting this to work with wx... maybe its cursed.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
Post Reply