Learning Irrlicht

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Learning Irrlicht

by Neuromancer » Sun Feb 17, 2013 23:49

I figured out how to compile http://forum.minetest.net/viewtopic.php?id=4665 Minetest, and I figured out how to get debugging http://forum.minetest.net/viewtopic.php?id=4703 working in Minetest. However once I got inside the debugger, I was quickly overwhelmed by the complexity of learning C++ and all the components. So here's an attempt to tackle learning Minetest in smaller chunks. I'm going to start off by learning the basics of using Irrlicht. Irrlicht is the 3D graphics engine that Minetest uses to display its graphics. Here's a step by step guide on learning it. I'll be working thorough this using Visual Studio, but hopefully most of it will be relevant to other environments.

-First you need to download the irrlicht SDK. You can do that here:
http://irrlicht.sourceforge.net/downloads/
-Next, take the folder from the zip file (irrlicht-1.8) and put it in your projects folder (C:\Users\x\Projects)
-Now start working through the tutorials. They are described here:
http://irrlicht.sourceforge.net/tutorials/
And their source code is here:
C:\Users\x\Projects\irrlicht-1.8\examples
-We'll start by doing the first tutorial. (you could just open the solution that comes with the SDK, but it means you don't know all the steps involved
in setting up a new project from scratch, so we'll do it the hard way)
-start up visual C++ 2010 Express.
-File> New> Project
-Win32> Win32 Console Application
-Name: irrLichtTutorial1
-Click OK>
-The Win32 Wizard will come up. Click Next> Finish.
-Go to tutorials here http://irrlicht.sourceforge.net/tutorials/
-click on the 1.Hello World Tutorial.
-The beginning of this Tutorial shows German screenshots and is out of date for VS2010.
-To let the compiler find the irrlicht.h header file, right click the project> Properties>Configuration Properties>C++
-Click on: Additional Include Directories, <click on down arrow>, Edit, Folder with star (new line), "..."
-navigate to the include folder inside the IRRLICHT folder C:\Users\x\Projects\irrlicht-1.8\include.
-click ok.
-click on linker> Additional Library Directories>, , <click on down arrow>, Edit, Folder with star (new line), "..."
-navigate to your equivalent of C:\Users\x\Projects\irrlicht-1.8\lib\Win32-visualStudio
Even though I have a 64 bit operating system (the 64 folder caused errors for me), select folder> OK> OK
-Then go ahead and paste the code from the tutorial webpage into your irrLichtTutorial1.cpp file.
-you may get the following errors:
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>c:\users\x\documents\visual studio 2010\Projects\irrLichtTutorial1\Debug\irrLichtTutorial1.exe : fatal error LNK1120: 2 unresolved externals
-copy the following line #include "stdafx.h"
-then copy all the code from the sample main.cpp over your irrLichtTutorial1.cpp file.
-then paste the line #include "stdafx.h" in the top line of your irrLichtTutorial1.cpp file.
-it will compile, but when you try to run you will get the following error:
"The program can't start because Irrlicht.dll is missing from your computer. Try reinstalling the program to fix this problem."
-Copy C:\Users\x\Projects\irrlicht-1.8\bin\Win32-VisualStudio\Irrlicht.dll to
C:\Users\x\Documents\Visual Studio 2010\Projects\irrLichtTutorial1\Debug
-now there won't be an error in the popup, but in the output panel you will see the following error:
Could not load mesh, because file could not be opened: : ../../media/sydney.md2
The program '[6832] irrLichtTutorial1.exe: Native' has exited with code 1 (0x1).
-To solve this, copy the folder C:\Users\x\Projects\irrlicht-1.8\media\sydney.md2
to C:\Users\x\Documents\Visual Studio 2010\Projects
and it works!
Last edited by Neuromancer on Wed Feb 20, 2013 03:23, edited 1 time in total.
 

Return to Minetest Engine

Who is online

Users browsing this forum: No registered users and 22 guests

cron