This tutorial will help you install and setup Horde3D using any visual Studio version completely from scratch! (I personally use VS2012) It took me hours of frustration to set up Horde3D, and to make a test project with it. I made this guide so nobody has to go through that process again
I Hope this will help newcomers like myself into the community. Please note that it is very important to follow the steps precisely, it is very easy to make a mistake which results in horde not building correctly!
First, checkout the trunk folder of Horde onto your system using SVN:
svn://svn.code.sf.net/p/horde3d/code/trunkCopy the contents of this folder into a new folder (without the hidden .svn folder) and call it something like HordeConverted. This step is useful to ensure we are not working in one of the checkouts, this way it's also easy to update the engine without overwriting your own version!
Download, install and run Cmake-gui:
http://www.cmake.org/cmake/resources/software.htmlWhen opened, select the HordeConverted folder as source folder and also where to build the binaries
Click Configure, and make sure you select the correct version of visual studio that you are using (for VS2012 its "visual studio 11" logic right?). Press Finish and Wait till it's done.
After Configuration is done, uncheck HORDE3D_BUILD_TERRAIN (very important) and press generate.
You are done its been converted to your Visual Studio Version!
Now that has been done, try and open the converted sln project (root folder: Horde3D.sln) and set Knight as startup, to see if it builds. Build and run it in release mode AND in debug mode (important to build them in both!) Does it run? Cool, what we did so far took me forever to figure out what should have been 5 minutes like you just did.
To make life easier when setting up a project, we want to tell windows where our horde folder is located. We can do this by creating a bat file. Open notepad, create a new file and enter these 2 lines:
setx HORDE_HOME %CD%
pause
save the file as "set_horde_home.bat" and put the bat file into the newly converted root folder and run it to make sure the variable $(HORDE_HOME) is recognized by visual studio. NOTE: restart visual studio afterwards!
All right, after you build Horde3D (in release mode!) it produced 2 DLL files which we are going to install into our system. This means all executables that need the horde dlls can find it on your system, which is nice! Go to (root horde converted directory)\Horde3D\Binaries\Release and copy "Horde3DUtils.dll" and "Horde3D.dll" into your system folder, it depends if you are on a 64 bit system or not:
64 bit systems: copy files to C:\Windows\system
32 bit systems: copy files to C:\Windows\System32
after copying we are done installing The Horde3D engine, we never have to do these steps again! We can start using it by setting up a project! Woohoo!
--------------------------------------------------------------------------------
** SETTING UP A PROJECT **
--------------------------------------------------------------------------------
Start Visual Studio and select new Project.
Choose Win32 Console Application (important for this example) , press next and make sure Empty project is checked!
create new file called main.cpp where we are going to paste our code in.
Before we do that, we want to include Horde in our project. We are going to make a lot of compiler changes, to make sure it builds our executable in our horde directory, so it can use its assets and DLLs. This is why we set our $(HORDE_HOME) using the bat file.
Right mouse on your project in the solution explorer and press properties. Set the noted settings below:
--------------------------
** Debug Configuration **
--------------------------
***** Configuration Properties -> General
// Character Set
Use Multi-Byte Character set
***** Configuration Properties -> C/C++ -> General
// ADDITIONAL INCLUDE DIRECTORIES:
$(HORDE_HOME)\Horde3D\Bindings\C++
$(HORDE_HOME)\Horde3D\Samples\glfw
***** Linker -> Input -> Additional Dependencies
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
$(HORDE_HOME)\Horde3D\Source\Horde3DEngine\Debug\Horde3D.lib
$(HORDE_HOME)\Horde3D\Source\Horde3DUtils\Debug\Horde3DUtils.lib
$(HORDE_HOME)\Horde3D\Samples\glfw\Debug\glfw.lib
opengl32.lib
---------------------------
** Release Configuration **
---------------------------
***** Configuration Properties -> General
// Character Set
Use Multi-Byte Character set
***** Configuration Properties -> C/C++ -> General
// ADDITIONAL INCLUDE DIRECTORIES:
$(HORDE_HOME)\Horde3D\Bindings\C++
$(HORDE_HOME)\Horde3D\Samples\glfw
// Linker -> Input -> Additional Dependencies
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
$(HORDE_HOME)\Horde3D\Source\Horde3DEngine\Release\Horde3D.lib
$(HORDE_HOME)\Horde3D\Source\Horde3DUtils\Release\Horde3DUtils.lib
$(HORDE_HOME)\Horde3D\Samples\glfw\Release\glfw.lib
opengl32.lib
The final step is to add a content folder to your project (copy the "Content" folder that comes with horde from HORDE_HOME\Horde3D\Binaries) We do this so each project has its own content folder. The content folder is where horde loads all your assets from.
Copy and paste the code found here into your main.cpp :
http://pastebin.com/JK6rgSYqRead the comments carefully to understand what each line does, and try to run to see if it all works!
Good luck