Horde3D

Next-Generation Graphics Engine
It is currently 19.03.2024, 10:12

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 04.09.2013, 13:46 
Offline

Joined: 25.06.2013, 10:30
Posts: 4
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/trunk

Copy 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.html

When 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/JK6rgSYq

Read the comments carefully to understand what each line does, and try to run to see if it all works! :D

Good luck


Last edited by Volker on 26.11.2013, 20:52, edited 1 time in total.
updated svn url


Top
 Profile  
Reply with quote  
PostPosted: 05.09.2013, 19:39 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Thanks for this tutorial. Maybe you want to add this to the wiki.


Top
 Profile  
Reply with quote  
PostPosted: 04.10.2013, 14:26 
Offline

Joined: 04.10.2013, 14:20
Posts: 1
Thank you very much for helping me with this.

One small thing I want to share:
Code:
setx HORDE_HOME %CD%
pause
would fail if the path contains a space, the correct way should be:
Code:
setx HORDE_HOME "%CD%"
pause


Top
 Profile  
Reply with quote  
PostPosted: 13.04.2014, 13:59 
Offline

Joined: 08.04.2014, 18:23
Posts: 9
Nice job, Basez, tutorial is useful! :D I think wiki need it.)


Top
 Profile  
Reply with quote  
PostPosted: 11.05.2014, 14:54 
Offline

Joined: 01.05.2014, 08:18
Posts: 23
Why you start the Projekt with a Win32-Consoleppplication and not with a not with Win32-Projekt?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group