Skip to content

SpexGuy/OnlineBoardGame

Repository files navigation


Instructions for creating a VS2012 Project (Rev. 2.4)

Depending on your experience with VS2012, this should take 1-2 hours to set up.
I recommend creating a backup of the project directory after each step.

PART 1: Bullet to the head

	Download glm, freeglut, GLFW, DevIL, glew, and Bullet. They can be found at:
		http://sourceforge.net/projects/ogl-math/files/
		http://www.transmissionzero.co.uk/software/freeglut-devel/
		http://sourceforge.net/projects/glfw/files/glfw/3.0.4/glfw-3.0.4.bin.WIN32.zip/download
		http://sourceforge.net/projects/openil/files/DevIL%20Windows%20SDK/1.7.8/DevIL-SDK-x86-1.7.8.zip/download
		http://sourceforge.net/projects/glew/files/glew/1.10.0/glew-1.10.0-win32.zip/download
		http://code.google.com/p/bullet/downloads/detail?name=bullet-2.82-r2704.zip&can=2&q=
	The directories you put them in will henceforth be denoted as $GLM, $FREEGLUT, $GLFW, $DEVIL, $GLEW, and $BULLET, respectively.
	(note the difference between GLFW and GLEW)

	Run $BULLET/build/vs2010.bat to build bullet.

	In the libraries you downloaded, find glfw3.dll, freeglut.dll, DevIL.dll, ILU.dll, ILUT.dll, and glew32.dll, and copy them to OnlineBoardGame/Debug. (you may need to create this folder)


	Go to File->New->Project
	Select Empty Project
	Name the solution OnlineBoardGame and the project OBGCore
	Click ok

	right-click(solution)->Add->Existing Project
	select $BULLET/build/vs2010/LinearMath.vcxproj
	right-click(solution)->Add->Existing Project
	select $BULLET/build/vs2010/BulletCollision.vcxproj
	right-click(solution)->Add->Existing Project
	select $BULLET/build/vs2010/BulletDynamics.vcxproj

	right-click(OBGCore)->Properties->Common Properties->Framework and References->Add New Reference
	Check all three projects
	Configuration Properties->C/C++->General
	Change Configuration (top-left) to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
	Apply all changes

	For each bullet library, $BLIB,
		right-click($BLIB)->Properties->Configuration Properties->C/C++->Code Generation
		Set Configuration (top-left) to Debug
		Change Runtime Library from /MTd to /MDd
		Apply
		Set Configuration (top-left) to Release
		Change Runtime Library from /MT to /MD
		Apply

	right-click(solution)->Update Projects

	**** SANITY CHECK ****
	create a file in OBGCore with the following code:

		#include "btBulletDynamicsCommon.h"
		int main(int argc, char* argv[]){
			btBoxShape * box = new btBoxShape(btVector3(1,1,1));
			delete box;
			return 0;
		}

	Ensure that your project builds and runs successfully (it should just pop up a console for a second)
	Once it works, delete that file

	right-click(OBGCore)->Properties->Configuration Properties->General
	Change Configuration to All Configurations
	Change Configuration Type from Application to Static Library
	Apply

	right-click(solution)->Add->New Project
	Select Test->Native Unit Test Practice
	Name the new project OBGCoreTests.
	delete unittest1.cpp

	right-click(OBGCoreTests)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGCore
	Apply
	Click Configuration Properties
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		OnlineBoardGame/OBGCore
	Go to Linker->Input
	Edit Additional Dependencies; add:
		ws2_32.lib
	Apply




PART 2: Graphicsing

	right-click(solution)->Add->New Project
	Select Empty Project
	Name the new project OBGGraphics.

	right-click(OBGGraphics)->Properties->Configuration Properties->General
	Set Configuration to All Configurations
	Go to C/C++->General
	Edit Additional Include Directories; add:
		$GLEW/include
		$DEVIL/include
		$GLM
		$GLFW/include
		$FREEGLUT/include
	Apply

	right-click(OBGGraphics)->Properties->Configuration Properties->General
	Change Configuration to All Configurations
	Change Configuration Type from Application to Static Library
	Apply




PART 3: The Server Project

	right-click(solution)->Add->New Project
	Select Empty Project
	Name the new project OBGServer.

	right-click(OBGServer)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGCore

	Go to C/C++->General
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		OnlineBoardGame/OBGCore
	Go to Linker->Input
	Edit Additional Dependencies; add:
		ws2_32.lib
	Apply

	right-click(OBGServer)->Set as StartUp Project
	Repeat the sanity check from Part 1 for this project.

	right-click(OBGServer)->Properties->Configuration Properties->General
	Change Configuration to All Configurations
	Change Configuration Type from Application to Static Library
	Apply
	
	right-click(solution)->Add->New Project
	Select Test->Native Unit Test Practice
	Name the new project OBGServerTests.
	delete unittest1.cpp

	right-click(OBGServerTests)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGServer
	Apply
	Click Configuration Properties
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		OnlineBoardGame/OBGCore
		OnlineBoardGame/OBGServer
	Go to Linker->Input
	Edit Additional Dependencies; add:
		ws2_32.lib
	Apply

	right-click(solution)->Add->New Project
	Select Empty Project
	Name the new project OBGServerRunner.

	right-click(OBGServerRunner)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGServer
	Apply
	Click Configuration Properties
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		OnlineBoardGame/OBGCore
		OnlineBoardGame/OBGServer
	Go to Linker->Input
	Edit Additional Dependencies; add:
		ws2_32.lib
	Apply




PART 4: The Client Projects

	right-click(solution)->Add->New Project
	Select Empty Project
	Name the new project OBGClient.

	right-click(OBGClient)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGCore and OBGGraphics
	Apply
	Go to C/C++->General
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		$GLEW/include
		$DEVIL/include
		$GLM
		$FREEGLUT/include
		$GLFW/include
		OnlineBoardGame/OBGGraphics
		OnlineBoardGame/OBGCore
	Go to Linker->General
	Edit Additional Library Directories; add:
		$GLFW/lib-msvc110
		$GLEW/lib/Release/Win32
		$DEVIL/lib
		$FREEGLUT/lib
	Go to Linker->Input
	Edit Additional Dependencies; add:
		glfw3dll.lib
		glew32.lib
		DevIL.lib
		ILU.lib
		ILUT.lib
		freeglut.lib
		ws2_32.lib
	Apply

	**** SANITY CHECK ****
	right-click(OBGClient)->Set as StartUp Project
	Create a file with the following code:

		#include <iostream>
		#include <GL/glew.h>
		#include <GL/freeglut.h>
		#include <IL/il.h>
		#include <IL/ilu.h>
		#include <IL/ilut.h>
		#include <glm/glm.hpp>
		#include "btBulletDynamicsCommon.h"

		using namespace std;
		using namespace glm;

		int main(int argc, char *argv[]) {
			glutInit(&argc, argv);
			ilInit();
			iluInit();
			ilutInit();

			glutInitWindowSize(1024, 512);
			glutInitWindowPosition(0, 0);
			glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH);

			glutCreateWindow("Test Window");

			if (glewInit() != GLEW_OK) {
				cerr << "GLEW failed to initialize." << endl;
				char i;
				cin >> i;
				return -1;
			}

			vec3 vec = vec3(1.0f, 0.0f, 1.0f);

			btBoxShape * box = new btBoxShape(btVector3(1,1,1));
			delete box;

			cout << "SUCCESS!" << endl;
			char i;
			cin >> i;
			return 0;
		}

	Compile and run it.  Note that OBGServer will not link since it has no entry point.  You should still be able to run the program. It should have the same outcome as sanity check 2.
	Delete the source file.

	right-click(OBGClient)->Properties->Configuration Properties->General
	Change Configuration to All Configurations
	Change Configuration Type from Application to Static Library
	Apply
	
	right-click(solution)->Add->New Project
	Select Test->Native Unit Test Practice
	Name the new project OBGClientTests.
	delete unittest1.cpp

	right-click(OBGClientTests)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGClient.
	Apply
	Click Configuration Properties
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		$GLEW/include
		$DEVIL/include
		$GLM
		$FREEGLUT/include
		$GLFW/include
		OnlineBoardGame/OBGGraphics
		OnlineBoardGame/OBGCore
		OnlineBoardGame/OBGClient
	Go to Linker->General
	Edit Additional Library Directories; add:
		$GLFW/lib-msvc110
		$GLEW/lib/Release/Win32
		$DEVIL/lib
		$FREEGLUT/lib
	Go to Linker->Input
	Edit Additional Dependencies; add:
		glfw3dll.lib
		glew32.lib
		DevIL.lib
		ILU.lib
		ILUT.lib
		freeglut.lib
		ws2_32.lib
	Apply
	
	right-click(solution)->Add->New Project
	Select Empty Project
	Name the new project OBGClientRunner.
	delete unittest1.cpp

	right-click(OBGClientRunner)->Properties->Common Properties->Framework and References->Add New Reference
	Check OBGClient.
	Apply
	Click Configuration Properties
	Change Configuration to All Configurations
	Edit Additional Include Directories; add:
		$BULLET/src
		$GLEW/include
		$DEVIL/include
		$GLM
		$FREEGLUT/include
		$GLFW/include
		OnlineBoardGame/OBGGraphics
		OnlineBoardGame/OBGCore
		OnlineBoardGame/OBGClient
	Go to Linker->General
	Edit Additional Library Directories; add:
		$GLFW/lib-msvc110
		$GLEW/lib/Release/Win32
		$DEVIL/lib
		$FREEGLUT/lib
	Go to Linker->Input
	Edit Additional Dependencies; add:
		glfw3dll.lib
		glew32.lib
		DevIL.lib
		ILU.lib
		ILUT.lib
		freeglut.lib
		ws2_32.lib
	Apply





Part 6: Git the Code

	Now, checkout the git repo into OnlineBoardGame.

	For each project, right-click(project)->Add->Existing Item
	Select all cpp and header files
	DO NOT SELECT ANY .OBJ FILES!!!

	Build

	To be sure everything worked, do a clean build
	Build->Clean Solution
	Build->Build Solution

	Congratulations, you're done (finally)!




Part 7: The Final Test(s)
	
	Go to Test->Run->All Tests
	See all the green check marks
	Celebrate your triumph over visual studio project setup





	You must have a unique instance of visual studio running for each program you wish to run.
	In order to run a project, right-click on the project (OBGClient or OBGServer) and click Set as StartUp Project.


	If you want to run the project without VS, be sure to copy all non-code files into the same directory as the executable.

	Note: If you experience heavy lag, try building the projects in release mode

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages