Page 1 of 2

Making my own game engine

Posted: Thu Jan 15, 2009 11:08 pm
by Wdenslow
Hey everyone. First post. :D

Recently I have been working on my own game engine. I was wondering if I could use irrlicht's source code and incorporate it into my engine. If this is possible how would i go about doing this. I am useing Visual Studio C++. I would like to use it as the renderer.

Image

Posted: Thu Jan 15, 2009 11:20 pm
by hybrid
Check example 14.

Posted: Thu Jan 15, 2009 11:30 pm
by Wdenslow
But, how would I go about doing this? I see the example. Thats exactly what I want.

Edit: Maybe I should incorporate irrEdit. I'm looking for a 3d editor window and renderer.

Posted: Fri Jan 16, 2009 12:10 am
by FuzzYspo0N
I find that creating tool pipelines instead of massive scale tools is better.things like max,maya,blender all have scripting and its easier then falling down a well.
Making a 'game engine' is a large task,and instead of spending a year on a half functional editor, look into coming up with a simple data format..pumping things out of a normal 3d app with attributes,and then loading them at run time.this is normal for most game engines.

There was an awesome talk from xna gamefest 2007,it covers a lot of information on halo3 and other game engines that use this kind of process,where creating a level editor when you can already load a level,makes things much easier.

Check the microsoft.com website and search for gamefest slides.

Hope it helps you decide

Posted: Fri Jan 16, 2009 12:13 am
by rogerborg
Wdenslow wrote:But, how would I go about doing this? I see the example. Thats exactly what I want.
And you have the source that shows you how to do it. If you have a specific question or problem, then we can help you. Without knowing more about your requirements, there's not much we can say other than that.

Wdenslow wrote:Edit: Maybe I should incorporate irrEdit. I'm looking for a 3d editor window and renderer.
IrrEdit is a separate closed source product, unless you want to pay its author for a source license. IrrEdit uses Irrlicht as its renderer, which should give you confidence that you can do likewise.

Posted: Fri Jan 16, 2009 12:30 am
by Wdenslow
I see. Thank you.

Well I want to use irrlicht in a real-time editor.

I'll let you know how i'm getting along after I understand this source code.

Posted: Fri Jan 16, 2009 3:28 pm
by Wdenslow
Hey I'm back again to give you guys another headache.

Ok, so I went through the code for example 14. There are two parts to the code; The windows specific one, and the Irrlicht specific one. Does the windows specific coding only create a window for Irrlicht to use?

Posted: Fri Jan 16, 2009 3:51 pm
by rogerborg
You can use pretty much any Window handle. Note that the example creates a (literal) "BUTTON" class Window. Presumably your editor app has a client Window with an HWND that you can tell Irrlicht to render into?

Just for laughs, here's a demonstration that you can display Irrlicht inside its own debug console window if you really wanted to.

Posted: Fri Jan 16, 2009 4:20 pm
by Acki
it's also funny to run Irrlicht inside Notepad :lol:

Posted: Fri Jan 16, 2009 5:33 pm
by Wdenslow
When building my program I get the error message:

Code: Select all

fatal error C1083: Cannot open include file: 'irrlicht.h': No such file or directory
Where is Irrlicht.h? I cannot find it. I assume I need to have this header loaded as one of my solution files.

Posted: Fri Jan 16, 2009 5:55 pm
by rogerborg
Irrlicht.h is in the Irrlicht SDK's include directory.

You'll need to set your compiler/IDE up so that it can find Irrlicht.h and also Irrlicht.lib, which is in lib\Win32-visualstudio\

This is (sort of) explained here except that the lib directory is now lib\Win32-visualstudio instead of lib\visualstudio.

Posted: Fri Jan 16, 2009 6:53 pm
by Wdenslow
So I loaded all the files like the tut showed me, but when I went to build my program I had seven build errors.
Error 1 error C3862: 'irr::IReferenceCounted::drop': cannot compile an unmanaged function with /clr:pure or /clr:safe c:\users\will\downloads\c\irrlicht-1.5\irrlicht-1.5\include\IReferenceCounted.h 116

Error 2 error C3821: 'irr::IReferenceCounted::~IReferenceCounted': managed type or function cannot be used in an unmanaged function c:\users\will\downloads\c\irrlicht-1.5\irrlicht-1.5\include\IReferenceCounted.h 124
Error 3 error C3642: 'void *irr::IReferenceCounted::__delDtor(unsigned int)' : cannot call a function with __clrcall calling convention from native code c:\users\will\downloads\c\irrlicht-1.5\irrlicht-1.5\include\IReferenceCounted.h 124
Error 4 error C3645: 'irr::IReferenceCounted::drop' : __clrcall cannot be used on functions compiled to native code c:\users\will\downloads\c\irrlicht-1.5\irrlicht-1.5\include\IReferenceCounted.h 116
Error 6 error C3641: 'CustomWndProc' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe c:\Users\Will\Downloads\C\irrlicht-1.5\irrlicht-1.5\examples\14.Win32Window\main.cpp 26
Error 7 error C2664: 'FindWindowW' : cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR' c:\Users\Will\Downloads\C\irrlicht-1.5\irrlicht-1.5\examples\14.Win32Window\main.cpp 61
Error 8 fatal error C1903: unable to recover from previous error(s); stopping compilation c:\Users\Will\Downloads\C\irrlicht-1.5\irrlicht-1.5\examples\14.Win32Window\main.cpp 61

Posted: Fri Jan 16, 2009 8:16 pm
by hybrid
You should learn to use your compiler properly before starting the actual programming stuff. You have chosen wrong settings.

Posted: Fri Jan 16, 2009 8:47 pm
by Wdenslow
hybrid wrote:You should learn to use your compiler properly before starting the actual programming stuff. You have chosen wrong settings.
How so?

Posted: Fri Jan 16, 2009 11:20 pm
by hybrid
Documentation, manuals, MSDN, google, ...