MrBinny
This is a brief article on how to set up your visual studio c++ 2015 environment so that you can begin poking around the Voxel Farm Engine and possibly write your own unit tests to get a foothold on the API. If you are an intermediate programmer then you probably already know how to do this, if you're new then this might be helpful if you're stuck and will give you start at diving into the API. (Don't forget to read the documentation... VoxelFarm Studio has written docs in the VF_SDK_2.0.3.106_MD\Documentation to get an overview of how the engine works.) I am using Visual Studio C++ 2015 vanilla (updates not installed, recently update 3 came out and I have not updated), windows 10, Voxel Studio SDK 2.0.3.106, Windows 10.


Step #1. Start a new visual studio project.

Step #2. Tell Visual Studio where the header files are located. Right click on your solution and go to properties. Go to Configuration Properties -> C/C++ -> General.
In the field for "Additional Include Directories" add the path to the folder Engine.CPP from the Voxel Farm SDK. For example "C:\Voxel Studio SDK\sdk_2.0.3.106\VF_SDK_2.0.3.106_MD\Engine.CPP" (it depends on where you installed them.)

Step #3. Tell Visual Studio where the static libraries are (the *.lib files.) This can be done by going to Configuration Properties -> Linker -> General  and in the path for "Additional Library Directories" add the path to where the libraries are located.

If you are building for a 64 bit machine they will be in the lib/x64 folder. For example "C:\Voxel Studio SDK\sdk_2.0.3.106\VF_SDK_2.0.3.106_MD\lib\x64"

Step #4. Tell Visual Studio which library to use. Go to Configuration Properties -> Linker ->Input
and in the Additional Dependencies field specify the *.lib ; classes, methods, functions, and variables in the library that you're using will require references to specific library files, for the purpose of this article we're just using the VoxelFarmLibrary.

Now this depends on which build you're doing, the library is different for the Debug build vs the release. If you are building your project in Debug mode then add VoxelFarmLibrary_DEBUG.lib, if you are building your project in Release mode then simply add VoxelFarmLibrary.lib; in fact it would be a good idea to set up the project for both release and debug (so this means going through the steps above for the debug build, and then again for the release build; simply specify VoxelFarmLibrary.lib for release, and VoxelFarmLibrary_DEBUG.lib for debug during the step and you should be able to build the project for one or the other.)

Step #5. At this point you can add #include "VoxelLayer.h", and #include "Generator.h" then declare a VoxelFarm generator object; source code below.

//------------------------------  cut ---------------------------//

#include "stdafx.h"
#include <iostream>
#include <string>
#include "VoxelLayer.h"
#include "Generator.h"

 

int main(int argc, char* argv[])
{

VoxelFarm::CGenerator generator;

//-- Pause the console see the output --//
std::cout << "End of Line." << std::endl;
std::string name;
std::cin >> name;
return 0;
}

/*
1. Remember to tell the compiler where the header files are located
2. Remember to tell the compiler where the static libraries are located
3. Remember to tell the compiler which static libraries to use.
*/

//------------------------------------- cut ---------------------------//

The code should compile and run without issue.

Step #6. Cut and paste the source code from VoxelFarmDemoSimple.cpp located in the C:\Voxel Studio SDK\sdk_2.0.3.106\VF_SDK_2.0.3.106_MD\Demo.Simple folder. It should compile and run without error

Step #7. Explore the API and the dependencies, write your own unit tests to see if the code behaves as you expect. Brush up on your C++ if you're rusty. Good luck.


0 0