Page 1 of 1
running irrlicht in visual c++
Posted: Tue Oct 27, 2009 4:32 pm
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
Posted: Wed Oct 28, 2009 2:28 pm
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.
Posted: Wed Oct 28, 2009 8:17 pm
by leoballoqui
Posted: Thu Oct 29, 2009 3:47 pm
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
Posted: Thu Oct 29, 2009 4:46 pm
by leoballoqui
Thank's a lot again man, you have been a great help. You should change your nick name to "F1"
Posted: Fri Oct 30, 2009 1:15 pm
by Psan
Lol
I'm a noob here actually.
Posted: Wed Nov 04, 2009 11:43 pm
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.
Posted: Thu Nov 05, 2009 4:59 pm
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.
Posted: Thu Nov 05, 2009 7:10 pm
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