running irrlicht in visual c++

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
leoballoqui
Posts: 3
Joined: Tue Oct 27, 2009 4:12 pm

running irrlicht in visual c++

Post by leoballoqui »

Hi,

How can I run irrlicht in visual c++ using any version of .Net framework? Is it even possible? should I include Irrlicht as a dinamic dll?
I want to create a Windows Form Project, on which the irrlicht world would be only on a seccion of a window, and add WF controls to edit properties of the elements of the world, could that be done?

Sorry about my english

thank's
Psan
Posts: 16
Joined: Sun Oct 04, 2009 7:07 pm

Post by Psan »

Yes, you can create a child window, say a CButton of required size, and pass its handle to Irrlicht during createdevice.

Example code is there in examples that come with Irrlicht.
leoballoqui
Posts: 3
Joined: Tue Oct 27, 2009 4:12 pm

Post by leoballoqui »

thank´s a lot Psan, but do you know how can I comunicate the events between the windows form component that host the irrlicht world and the irrlicht world in fact, for example, if I set the world on a picture box and I want select one of the scene nodes and watch its properties. How can I do that by clicking on a simple picture box.

Thank´s a lot again.... :!: :!: :!: :!: :!:
Psan
Posts: 16
Joined: Sun Oct 04, 2009 7:07 pm

Post by Psan »

You will have to use PeekMessage and GetMessage to intercept the keyboard or mouse events going to the picture child window in the main drawing loop and route them to EventReceiver or handle yourself.

It's a little hacky and caused problems for me, so good luck with that. The link below has a demo project that's much better. I hope it will help you.

http://irrlicht.sourceforge.net/phpBB2/ ... p?p=133188
leoballoqui
Posts: 3
Joined: Tue Oct 27, 2009 4:12 pm

Post by leoballoqui »

Thank's a lot again man, you have been a great help. You should change your nick name to "F1" :wink:
Psan
Posts: 16
Joined: Sun Oct 04, 2009 7:07 pm

Post by Psan »

Lol :D I'm a noob here actually.
Dark Mirror
Posts: 3
Joined: Wed Nov 04, 2009 11:28 pm

Post by Dark Mirror »

Hello.
I try using Irrlicht with Visual Studio 2008. And i had two porblems.
1. When I simply uncomment the string #include <irrlicht.h> in my main header file or in my main .cpp file I receive following errors:

IReferenceCounted.h(116) : error C3862: 'irr::IReferenceCounted::drop': cannot compile an unmanaged function with /clr:pure or /clr:safe
Inline native assembly not supported in managed code

IReferenceCounted.h(124) : error C3821: 'irr::IReferenceCounted::~IReferenceCounted': managed type or function cannot be used in an unmanaged function
Inline native assembly not supported in managed code

IReferenceCounted.h(124) : error C3642: 'void *irr::IReferenceCounted::__delDtor(unsigned int)' : cannot call a function with __clrcall calling convention from native code

IReferenceCounted.h(116) : error C3645: 'irr::IReferenceCounted::drop' : __clrcall cannot be used on functions compiled to native code

2. I really don't understand where I should place the code from the example to get its working with my existing Windows Form Project.
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Irrlicht is a C++ library. Not a C#.
There are some .NET wrappers for Irrlicht but afaik there aren't actively developed any more.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Dark Mirror
Posts: 3
Joined: Wed Nov 04, 2009 11:28 pm

Post by Dark Mirror »

Sylence wrote:Irrlicht is a C++ library. Not a C#.
There are some .NET wrappers for Irrlicht but afaik there aren't actively developed any more.
Yes, I'm really noob in Windows programming - I don't use C# (I really have never use it willingly). So, do you mean that it's standart of Visual Studio? And I could write some of working code thinking that this is C++, but that was C#?
So, I have checked. I even haven't open category of C# files in VS Wizards.

Update: I assume that the problem is somewhere in that I try to include Irrlicht into a header file. I retry to add #include <irrlicht.h> to main.cpp and receive

warning C4627: '#include <irrlicht.h>': skipped when looking for precompiled header use
Add directive to 'stdafx.h' or rebuild precompiled header
Post Reply