Page 1 of 1

xwWidgets, Irrlicht & VC++ 2005

Posted: Wed Aug 16, 2006 6:16 pm
by KevinCain
Like many people, I was excited to see how Nico managed to wrap a lovely wxWidgets GUI around Irrlicht with his IrrEdit 0.3 project (http://irredit.irrlicht3d.org/index.html).

On his blog, he offers a quick howto on the integration process: http://www.irrlicht3d.org/pivot/entry.php?id=347. However, while the two approaches he writes about make perfect sense, I was hoping to see a bit of concrete code to make the steps a little clearer.

Has anyone using VC++ 2005 managed to successfully get wxWidgets and Irrlicht to play nice with each other?

If anyone could share wx/Irrlicht 'hello world' code for a similar system, I'd be a very happy fellow.

A few details on my environment follow:

- wxWidgets version: wxPack_v2.6.3.25. I'm currently using Ryan Pusztai's Aug 8 2006 wxWidgets package--i.e., I did NOT build from source.

- IDE: Code::Blocks v1.0 rev 2821 (itself built on wx2.6.3)

- Irrlicht version: Irrlicht v1.1

- Compiler: VC++ 2005 Express

- OS: Windows XO-64 running on a 64-bit Athlon chip

Many thanks to the wonderful denizens of the Irrlicht forums,

-Kevin

Posted: Thu Aug 17, 2006 3:08 pm
by zenaku
Here's how I did it in Lua:

http://irrlua.sourceforge.net/14.wxWindow.lua

Unfortunately the latest versions of irrlua and wxLua are incompatible and it doesn't work anymore. IrrLua is lua 5.1. wxLua is lua 5.0 and statically linked.

The main trick I had to do to make it work was to make wxWidgets somehow process window messages. I couldnt' find any exposed methods to do it so I call wxFrame::Refresh() in the irrlicht rendering loop. It's a hack but it works. You probably won't have to do that as it was a wxLua issue, not wxWidgets.

The other important item is of course passing the wxFrame's window handle to createDeviceEx().

Code: Select all

local param = irr.SIrrlichtCreationParameters()

	param.WindowId = irr.cast.void_to_Number(win:GetHandle())
	param.DriverType = irr.video.EDT_OPENGL
	param.WindowSize = irr.core.dimension2d(200,200)
	device = irr.createDeviceEx(param)
Sorry the example is not C++ but it should be pretty straightforward to convert it from Lua. The sample is actually a conversion from the c++ project 14.win32window. You could probably copy that project and modify it according to the sample above.

Performance of wxWidgets & Irrlicht?

Posted: Thu Aug 17, 2006 7:59 pm
by KevinCain
zenaku wrote:Sorry the example is not C++ but it should be pretty straightforward to convert it from Lua. The sample is actually a conversion from the c++ project 14.win32window. You could probably copy that project and modify it according to the sample above.
Thanks, zenaku, and no worries about C++ vs. Lua code, I saw from your site that you're a proponent of that language!

Did you encounter any negative performance aspects integrating Irrlicht with wxWidgets (i.e., speed)?

Thanks again for your notes!

-Kevin

Re: Performance of wxWidgets & Irrlicht?

Posted: Thu Aug 17, 2006 9:49 pm
by zenaku
KevinCain wrote:
zenaku wrote:Sorry the example is not C++ but it should be pretty straightforward to convert it from Lua. The sample is actually a conversion from the c++ project 14.win32window. You could probably copy that project and modify it according to the sample above.
Thanks, zenaku, and no worries about C++ vs. Lua code, I saw from your site that you're a proponent of that language!

Did you encounter any negative performance aspects integrating Irrlicht with wxWidgets (i.e., speed)?

Thanks again for your notes!

-Kevin
Nope not at all. wxWidgets is event based, so it's not doing much with the CPU. It shouldn't be any more intensive than using win32, Qt, or any othe r windowing system really.

GUI recommendations? (wxWidgets / Irrlicht)

Posted: Fri Aug 18, 2006 6:15 am
by KevinCain
Thanks, zenaku!

I'm interested to see if any C++ folks have any wise words about approaching a GUI using wxWidgets. As I noted above, Nico's results are quite encouraging, so I surprised not to see more activity on this topic in the forums. (Of course, I could be looking in the wrong spots!)

If anybody has a few lines to write on the subject, that could help.

-Kevin

Posted: Wed Nov 22, 2006 1:21 pm
by arixion
I always wondered why the functionality was not extended to linux...