diff --git a/Bin/DLL/GamePhysics_x86D.exp b/Bin/DLL/GamePhysics_x86D.exp
new file mode 100644
index 00000000..0cea5aa6
Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.exp differ
diff --git a/Bin/DLL/PLACEHOLDER b/Bin/DLL/PLACEHOLDER
deleted file mode 100644
index e69de29b..00000000
diff --git a/Code/DanBias.sln b/Code/DanBias.sln
index 609eedd3..2e047aee 100644
--- a/Code/DanBias.sln
+++ b/Code/DanBias.sln
@@ -29,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tester", "Tester\Tester.vcxproj", "{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
@@ -175,6 +177,7 @@ Global
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64
+ {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32
@@ -190,6 +193,18 @@ Global
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.ActiveCfg = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.Build.0 = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.ActiveCfg = Debug|x64
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.Build.0 = Debug|x64
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.ActiveCfg = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Code/DanBiasGame/DanBiasGame.vcxproj b/Code/DanBiasGame/DanBiasGame.vcxproj
new file mode 100644
index 00000000..88181e55
--- /dev/null
+++ b/Code/DanBiasGame/DanBiasGame.vcxproj
@@ -0,0 +1,193 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}
+ Win32Proj
+ DanBiasGame
+
+
+
+ Application
+ true
+ v110
+ Unicode
+
+
+ Application
+ true
+ v110
+ Unicode
+
+
+ Application
+ false
+ v110
+ true
+ Unicode
+
+
+ Application
+ false
+ v110
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)D
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+ true
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)D
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+ false
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+ false
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ true
+ true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ true
+ true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+ {b1195bb9-b3a5-47f0-906c-8dea384d1520}
+
+
+ {7e3990d2-3d94-465c-b58d-64a74b3ecf9b}
+
+
+ {f10cbc03-9809-4cba-95d8-327c287b18ee}
+
+
+ {4285bd3f-3c6c-4670-b7af-a29afef5f6a8}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Code/DanBiasGame/DanBiasMaincpp.cpp b/Code/DanBiasGame/DanBiasMaincpp.cpp
new file mode 100644
index 00000000..688a916f
--- /dev/null
+++ b/Code/DanBiasGame/DanBiasMaincpp.cpp
@@ -0,0 +1,302 @@
+//--------------------------------------------------------------------------------------
+// File: TemplateMain.cpp
+//
+// BTH-D3D-Template
+//
+// Copyright (c) Stefan Petersson 2011. All rights reserved.
+//--------------------------------------------------------------------------------------
+#define NOMINMAX
+#include
+
+#include "DllInterfaces/GFXAPI.h"
+#include "IGame.h"
+
+#include "L_inputClass.h"
+
+// debug window include
+#include
+#include
+#include
+#include
+
+
+
+
+//--------------------------------------------------------------------------------------
+// Global Variables
+//--------------------------------------------------------------------------------------
+HINSTANCE g_hInst = NULL;
+HWND g_hWnd = NULL;
+
+GameLogic::IGame* game;
+InputClass* inputObj;
+
+
+//--------------------------------------------------------------------------------------
+// Forward declarations
+//--------------------------------------------------------------------------------------
+HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow );
+LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+HRESULT Render(float deltaTime);
+HRESULT Update(float deltaTime);
+HRESULT InitGame();
+HRESULT CleanUp();
+
+
+
+//--------------------------------------------------------------------------------------
+// Entry point to the program. Initializes everything and goes into a message processing
+// loop. Idle time is used to render the scene.
+//--------------------------------------------------------------------------------------
+
+void SetStdOutToNewConsole()
+{
+ // allocate a console for this app
+ AllocConsole();
+
+ // redirect unbuffered STDOUT to the console
+ HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
+ int fileDescriptor = _open_osfhandle((intptr_t)consoleHandle, _O_TEXT);
+ FILE *fp = _fdopen( fileDescriptor, "w" );
+ *stdout = *fp;
+ setvbuf( stdout, NULL, _IONBF, 0 );
+
+ // give the console window a nicer title
+
+ SetConsoleTitle(L"Debug Output");
+
+ // give the console window a bigger buffer size
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ if ( GetConsoleScreenBufferInfo(consoleHandle, &csbi) )
+ {
+ COORD bufferSize;
+ bufferSize.X = csbi.dwSize.X;
+ bufferSize.Y = 50;
+ SetConsoleScreenBufferSize(consoleHandle, bufferSize);
+ }
+}
+
+int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
+{
+ BOOL success = SetDllDirectory(L"..\\..\\DLL");
+ if (success == 0)
+ {
+ return 0;
+ }
+
+
+ if( FAILED( InitWindow( hInstance, nCmdShow ) ) )
+ return 0;
+
+ if( FAILED( InitGame() ) )
+ return 0;
+
+ __int64 cntsPerSec = 0;
+ QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec);
+ float secsPerCnt = 1.0f / (float)cntsPerSec;
+
+ __int64 prevTimeStamp = 0;
+ QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp);
+
+ //debug window
+ //SetStdOutToNewConsole();
+
+ // Main message loop
+ MSG msg = {0};
+ while(WM_QUIT != msg.message)
+ {
+ if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE) )
+ {
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+ else
+ {
+ __int64 currTimeStamp = 0;
+ QueryPerformanceCounter((LARGE_INTEGER*)&currTimeStamp);
+ float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt;
+
+ //render
+ Update(dt);
+ Render(dt);
+
+ prevTimeStamp = currTimeStamp;
+ }
+ }
+ CleanUp();
+ return (int) msg.wParam;
+}
+
+//--------------------------------------------------------------------------------------
+// Register class and create window
+//--------------------------------------------------------------------------------------
+HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow )
+{
+ // Register class
+ WNDCLASSEX wcex;
+ wcex.cbSize = sizeof(WNDCLASSEX);
+ wcex.style = CS_HREDRAW | CS_VREDRAW;
+ wcex.lpfnWndProc = WndProc;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = 0;
+ wcex.hInstance = hInstance;
+ wcex.hIcon = 0;
+ wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ wcex.lpszMenuName = NULL;
+ wcex.lpszClassName = L"BTH_D3D_Template";
+ wcex.hIconSm = 0;
+ if( !RegisterClassEx(&wcex) )
+ return E_FAIL;
+
+ // Adjust and create window
+ g_hInst = hInstance;
+ RECT rc = { 0, 0, 1024, 768 };
+ AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );
+
+ if(!(g_hWnd = CreateWindow(
+ L"BTH_D3D_Template",
+ L"BTH - Direct3D 11.0 Template",
+ WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ rc.right - rc.left,
+ rc.bottom - rc.top,
+ NULL,
+ NULL,
+ hInstance,
+ NULL)))
+ {
+ return E_FAIL;
+ }
+
+ ShowWindow( g_hWnd, nCmdShow );
+
+ return S_OK;
+}
+
+
+HRESULT InitGame()
+{
+ inputObj = new InputClass;
+ if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768))
+ {
+ MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK);
+ return false;
+ }
+ if(Oyster::Graphics::API::Init(g_hWnd, false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess)
+ return E_FAIL;
+
+
+ game = new GameLogic::IGame();
+ game->Init();
+ game->StartGame();
+
+
+
+ return S_OK;
+}
+HRESULT Update(float deltaTime)
+{
+ inputObj->Update();
+ GameLogic::keyInput key = GameLogic::keyInput_none;
+
+ if(inputObj->IsKeyPressed(DIK_W))
+ {
+ key = GameLogic::keyInput_W;
+ }
+ else if(inputObj->IsKeyPressed(DIK_A))
+ {
+ key = GameLogic::keyInput_A;
+ }
+ else if(inputObj->IsKeyPressed(DIK_S))
+ {
+ key = GameLogic::keyInput_S;
+ }
+ else if(inputObj->IsKeyPressed(DIK_D))
+ {
+ key = GameLogic::keyInput_D;
+ }
+
+ game->Update(key);
+
+ return S_OK;
+}
+
+HRESULT Render(float deltaTime)
+{
+ int isPressed = 0;
+ if(inputObj->IsKeyPressed(DIK_A))
+ {
+ isPressed = 1;
+ //std::cout<<"test";
+ }
+
+ // test view and projection matrix
+ Oyster::Math::Float3 dir = Oyster::Math::Float3(0,0,-1);
+ Oyster::Math::Float3 up =Oyster::Math::Float3(0,1,0);
+ Oyster::Math::Float3 pos = Oyster::Math::Float3(0, 0, 100);
+
+ Oyster::Math::Float4x4 view =Oyster::Math3D::OrientationMatrix_LookAtDirection(dir, up, pos);
+ view = view.GetInverse();
+
+ Oyster::Math::Float4x4 proj = Oyster::Math3D::ProjectionMatrix_Perspective(3.14f/2, 1024/768, 1, 1000);
+
+ Oyster::Graphics::API::NewFrame(view, proj);
+
+ game->Render();
+ wchar_t title[255];
+ swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed));
+ SetWindowText(g_hWnd, title);
+
+ Oyster::Graphics::API::EndFrame();
+
+ return S_OK;
+}
+
+HRESULT CleanUp()
+{
+
+ if(game)
+ {
+ delete game;
+ game = NULL;
+ }
+ return S_OK;
+}
+//--------------------------------------------------------------------------------------
+// Called every time the application receives a message
+//--------------------------------------------------------------------------------------
+LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+ PAINTSTRUCT ps;
+ HDC hdc;
+
+ switch (message)
+ {
+ case WM_PAINT:
+ hdc = BeginPaint(hWnd, &ps);
+ EndPaint(hWnd, &ps);
+ break;
+
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+
+ case WM_KEYDOWN:
+
+ switch(wParam)
+ {
+ case VK_ESCAPE:
+ PostQuitMessage(0);
+ break;
+ }
+ break;
+
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+
+ return 0;
+}
+
diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/GameLogic/CollisionManager.cpp
new file mode 100644
index 00000000..253056cc
--- /dev/null
+++ b/Code/GameLogic/CollisionManager.cpp
@@ -0,0 +1,82 @@
+#include "CollisionManager.h"
+
+
+
+namespace GameLogic
+{
+
+ namespace CollisionManager
+ {
+
+
+
+
+ void ColisionEvent(Oyster::Physics::ICustomBody &obj1, Oyster::Physics::ICustomBody &obj2)
+ {
+
+
+ //Object *realObj1 = refManager.GetMap(obj1);
+ //Object *realObj2 = refManager.GetMap(obj2);
+ //
+ //switch(realObj1->GetType())
+ //{
+ //case Object::OBJECT_TYPE_PLAYER:
+
+ // if (realObj2->GetType() == Object::OBJECT_TYPE_BOX )
+ // {
+ //CollisionManager::PlayerVBox(*((Player*)realObj1),*((DynamicObject*)realObj2));
+ // }
+
+ // break;
+ //case Object::OBJECT_TYPE_BOX:
+
+ // if (realObj2->GetType() == Object::OBJECT_TYPE_PLAYER)
+ // {
+ // CollisionManager::PlayerVBox(*((Player*)realObj2),*((DynamicObject*)realObj1));
+ // }
+
+ // break;
+ //}
+
+ }
+
+ void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj)
+ {
+ Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyPlayer));
+ Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj);
+
+ switch (realObj->GetType())
+ {
+ case Object::OBJECT_TYPE_BOX:
+ PlayerVBox(*player,(*(DynamicObject*) realObj));
+ break;
+ case Object::OBJECT_TYPE_PLAYER:
+
+ break;
+ }
+
+ //spela ljud? ta skada? etc etc
+ }
+
+ void PlayerVBox(Player &player, DynamicObject &box)
+ {
+ //spela ljud? ta skada? etc etc
+ }
+
+ void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj)
+ {
+ DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyBox));
+ Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj);
+
+ switch (realObj->GetType())
+ {
+ case Object::OBJECT_TYPE_BOX:
+
+ break;
+ case Object::OBJECT_TYPE_PLAYER:
+ PlayerVBox(*(Player*)realObj,*box);
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Code/GameLogic/CollisionManager.h b/Code/GameLogic/CollisionManager.h
new file mode 100644
index 00000000..878d6f25
--- /dev/null
+++ b/Code/GameLogic/CollisionManager.h
@@ -0,0 +1,27 @@
+#ifndef COLLISIONMANAGER_H
+#define COLLISIONMANAGER_H
+
+#include "Object.h"
+#include "PhysicsAPI.h"
+#include "RefManager.h"
+#include "DynamicObject.h"
+#include "Player.h"
+
+namespace GameLogic
+{
+
+ namespace CollisionManager
+ {
+ void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj);
+ void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj);
+
+
+
+ void PlayerVBox(Player &player, DynamicObject &box);
+ void BoxVBox(DynamicObject &box1, DynamicObject &box2);
+
+ };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/DynamicObject.cpp b/Code/GameLogic/DynamicObject.cpp
new file mode 100644
index 00000000..ec175f59
--- /dev/null
+++ b/Code/GameLogic/DynamicObject.cpp
@@ -0,0 +1,21 @@
+#include "DynamicObject.h"
+
+using namespace GameLogic;
+using namespace Oyster::Physics;
+using namespace Utility::DynamicMemory;
+
+DynamicObject::DynamicObject(void)
+{
+ rigidBody = API::Instance().CreateSimpleRigidBody();
+ API::Instance().AddObject(rigidBody);
+}
+
+
+DynamicObject::~DynamicObject(void)
+{
+}
+
+void DynamicObject::Update()
+{
+ //updatera objectet
+}
\ No newline at end of file
diff --git a/Code/GameLogic/DynamicObject.h b/Code/GameLogic/DynamicObject.h
new file mode 100644
index 00000000..2d6ffdc8
--- /dev/null
+++ b/Code/GameLogic/DynamicObject.h
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef DYNAMICOBJECT_H
+#define DYNAMICOBJECT_H
+
+#include "Object.h"
+
+namespace GameLogic
+{
+
+
+ class DynamicObject : public Object
+ {
+
+ public:
+ DynamicObject(void);
+ ~DynamicObject(void);
+
+ void Update();
+
+ };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Game.cpp b/Code/GameLogic/Game.cpp
new file mode 100644
index 00000000..6d6d367d
--- /dev/null
+++ b/Code/GameLogic/Game.cpp
@@ -0,0 +1,35 @@
+#include "Game.h"
+using namespace GameLogic;
+
+Game::Game(void)
+{
+
+}
+
+
+Game::~Game(void)
+{
+ //SAFE_DELETE(player);
+ if(player)
+ {
+ delete player;
+ player = NULL;
+ }
+}
+
+void Game::Init()
+{
+ player = new Player();
+}
+void Game::StartGame()
+{
+
+}
+void Game::Update(keyInput keyPressed)
+{
+ player->Update(keyPressed);
+}
+void Game::Render()
+{
+ player->Render();
+}
\ No newline at end of file
diff --git a/Code/GameLogic/Game.h b/Code/GameLogic/Game.h
new file mode 100644
index 00000000..ab2e57e5
--- /dev/null
+++ b/Code/GameLogic/Game.h
@@ -0,0 +1,31 @@
+#ifndef GAME_H
+#define GAME_H
+
+#include "Level.h"
+#include "Player.h"
+#include "IGame.h"
+
+namespace GameLogic
+{
+
+
+ class Game
+ {
+ public:
+ Game();
+ ~Game();
+
+ void Init();
+ void StartGame();
+ void Update(keyInput keyPressed);
+ void Render();
+
+
+ private:
+ Level* level;
+ Player* player;
+
+
+ };
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/GameLogic.vcxproj b/Code/GameLogic/GameLogic.vcxproj
index 900f0834..e4e48526 100644
--- a/Code/GameLogic/GameLogic.vcxproj
+++ b/Code/GameLogic/GameLogic.vcxproj
@@ -24,30 +24,30 @@
- StaticLibrary
+ DynamicLibrary
true
v110
- MultiByte
+ Unicode
- StaticLibrary
+ DynamicLibrary
true
v110
- MultiByte
+ Unicode
- StaticLibrary
+ DynamicLibrary
false
v110
true
- MultiByte
+ Unicode
- StaticLibrary
+ DynamicLibrary
false
v110
true
- MultiByte
+ Unicode
@@ -66,34 +66,41 @@
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
+ .dll
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
Level3
Disabled
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -101,10 +108,12 @@
Level3
Disabled
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -114,12 +123,14 @@
true
true
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
true
true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
@@ -129,21 +140,34 @@
true
true
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
true
true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
{104fa3e9-94d9-4e1d-a941-28a03bc8a095}
+ false
+ true
+ false
+ false
+ false
+
+
+ {7e3990d2-3d94-465c-b58d-64a74b3ecf9b}
{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}
+
+ {0ec83e64-230e-48ef-b08c-6ac9651b4f82}
+
{f10cbc03-9809-4cba-95d8-327c287b18ee}
@@ -151,6 +175,29 @@
{4285bd3f-3c6c-4670-b7af-a29afef5f6a8}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Code/GameLogic/GameLogic.vcxproj.filters b/Code/GameLogic/GameLogic.vcxproj.filters
index d7ef6a1a..38b2d5fa 100644
--- a/Code/GameLogic/GameLogic.vcxproj.filters
+++ b/Code/GameLogic/GameLogic.vcxproj.filters
@@ -14,4 +14,65 @@
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
\ No newline at end of file
diff --git a/Code/GameLogic/GameMode.cpp b/Code/GameLogic/GameMode.cpp
new file mode 100644
index 00000000..0eddb7f9
--- /dev/null
+++ b/Code/GameLogic/GameMode.cpp
@@ -0,0 +1,15 @@
+#include "GameMode.h"
+
+using namespace GameLogic;
+
+
+GameMode::GameMode(void)
+{
+
+}
+
+
+GameMode::~GameMode(void)
+{
+
+}
diff --git a/Code/GameLogic/GameMode.h b/Code/GameLogic/GameMode.h
new file mode 100644
index 00000000..42273946
--- /dev/null
+++ b/Code/GameLogic/GameMode.h
@@ -0,0 +1,22 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef GAMEMODE_H
+#define GAMEMODE_H
+
+namespace GameLogic
+{
+
+ class GameMode
+ {
+ public:
+ GameMode(void);
+ ~GameMode(void);
+ private:
+ //variabels that control what game rules the level runs on
+ };
+
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/IGame.cpp b/Code/GameLogic/IGame.cpp
new file mode 100644
index 00000000..883a9285
--- /dev/null
+++ b/Code/GameLogic/IGame.cpp
@@ -0,0 +1,45 @@
+#include "IGame.h"
+#include "Game.h"
+#include
+
+BOOL WINAPI DllMain(
+ _In_ HINSTANCE hinstDLL,
+ _In_ DWORD fdwReason,
+ _In_ LPVOID lpvReserved
+ )
+{
+
+ return TRUE;
+}
+using namespace GameLogic;
+IGame::IGame()
+{
+ gameModule = new Game();
+}
+
+
+IGame::~IGame()
+{
+ delete gameModule;
+}
+
+void IGame::Init()
+{
+ gameModule->Init();
+}
+void IGame::StartGame()
+{
+ gameModule->StartGame();
+}
+void IGame::Update(keyInput keyPressed)
+{
+ gameModule->Update(keyPressed);
+}
+void IGame::Render()
+{
+ gameModule->Render();
+}
+Game* IGame::getGameModule()
+{
+ return gameModule;
+}
\ No newline at end of file
diff --git a/Code/GameLogic/IGame.h b/Code/GameLogic/IGame.h
new file mode 100644
index 00000000..ce46b7d8
--- /dev/null
+++ b/Code/GameLogic/IGame.h
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+#ifndef IGAME_H
+#define IGAME_H
+
+#if defined GAME_DLL_EXPORT
+#define GAME_DLL_USAGE __declspec(dllexport)
+#else
+#define GAME_DLL_USAGE __declspec(dllimport)
+#endif
+
+namespace GameLogic
+{
+ class Game;
+
+ enum keyInput
+ {
+ keyInput_W,
+ keyInput_A,
+ keyInput_S,
+ keyInput_D,
+ keyInput_none
+ };
+
+ class GAME_DLL_USAGE IGame
+ {
+ private:
+ Game* gameModule;
+ public:
+ IGame();
+ ~IGame();
+
+
+ void Init();
+ void StartGame();
+ /************************************************************************/
+ /* Get key input to update the player */
+ /************************************************************************/
+ void Update(keyInput keyPressed);
+ void Render();
+ Game* getGameModule();
+ private:
+ };
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Level.cpp b/Code/GameLogic/Level.cpp
new file mode 100644
index 00000000..32fbe2d5
--- /dev/null
+++ b/Code/GameLogic/Level.cpp
@@ -0,0 +1,12 @@
+#include "Level.h"
+
+using namespace GameLogic;
+
+Level::Level(void)
+{
+}
+
+
+Level::~Level(void)
+{
+}
diff --git a/Code/GameLogic/Level.h b/Code/GameLogic/Level.h
new file mode 100644
index 00000000..b43f193d
--- /dev/null
+++ b/Code/GameLogic/Level.h
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef LEVEL_H
+#define LEVEL_H
+
+#include "StaticObject.h"
+#include "DynamicObject.h"
+#include "GameMode.h"
+
+namespace GameLogic
+{
+
+ class Level
+ {
+
+ public:
+ Level(void);
+ ~Level(void);
+
+ private:
+ StaticObject** staticObjects;
+ int nrOfStaticObjects;
+
+ DynamicObject** dynamicObjects;
+ int nrOfDynamicObjects;
+
+ GameMode* gameMode;
+
+
+
+ };
+
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Object.cpp b/Code/GameLogic/Object.cpp
new file mode 100644
index 00000000..a83d1fb6
--- /dev/null
+++ b/Code/GameLogic/Object.cpp
@@ -0,0 +1,52 @@
+#include "Object.h"
+#include "OysterMath.h"
+#include "DllInterfaces\GFXAPI.h"
+#include "CollisionManager.h"
+
+
+using namespace GameLogic;
+
+using namespace Oyster::Math;
+using namespace Oyster::Graphics::Model;
+
+using namespace Utility::DynamicMemory;
+using namespace Oyster::Physics;
+
+Object::Object(void)
+{
+
+ model = new Model();
+ model = Oyster::Graphics::API::CreateModel(L"bth.obj");
+
+ ICustomBody* temp = rigidBody = API::Instance().CreateSimpleRigidBody().Release();
+
+ rigidBody->SetCenter(Float3(50,0,0));
+ rigidBody->SetMass_KeepMomentum(30);
+ rigidBody->SetSize(Float3(2,2,2));
+ rigidBody->SetSubscription(true);
+ rigidBody->SetMomentOfInertiaTensor_KeepMomentum(Float4x4(MomentOfInertia::CreateCuboidMatrix(30, 2, 2, 2)));
+
+
+ GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this);
+
+}
+
+
+Object::~Object(void)
+{
+
+ Oyster::Graphics::API::DeleteModel(model);
+
+}
+
+void Object::Render()
+{
+ this->rigidBody->GetOrientation(model->WorldMatrix);
+ Oyster::Graphics::API::RenderScene(model, 1);
+
+}
+
+Object::OBJECT_TYPE Object::GetType()
+{
+ return this->type;
+}
diff --git a/Code/GameLogic/Object.h b/Code/GameLogic/Object.h
new file mode 100644
index 00000000..be2f77a6
--- /dev/null
+++ b/Code/GameLogic/Object.h
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#include "PhysicsAPI.h"
+#include "DllInterfaces/GFXAPI.h"
+
+#include "Model/Model.h"
+#include "Utilities.h"
+
+
+
+namespace GameLogic
+{
+ class Object
+ {
+ public:
+ Object(void);
+ virtual ~Object(void);
+
+ enum OBJECT_TYPE
+ {
+ OBJECT_TYPE_PLAYER,
+ OBJECT_TYPE_BOX,
+ };
+
+ void Render();
+
+ OBJECT_TYPE GetType();
+
+ private:
+ OBJECT_TYPE type;
+
+ protected:
+ //either a model pointer or an ID to an arraypos filled with models that are to be rendered
+ //rigidBody
+
+ Oyster::Physics::ICustomBody *rigidBody;
+ Oyster::Graphics::Model::Model *model;
+
+ };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Player.cpp b/Code/GameLogic/Player.cpp
new file mode 100644
index 00000000..3a9ae029
--- /dev/null
+++ b/Code/GameLogic/Player.cpp
@@ -0,0 +1,56 @@
+#include "Player.h"
+#include "OysterMath.h"
+
+
+using namespace GameLogic;
+using namespace Oyster::Physics;
+using namespace Utility::DynamicMemory;
+
+
+
+
+Player::Player(void)
+ :Object()
+{
+ life = 100;
+}
+
+
+Player::~Player(void)
+{
+ delete this->rigidBody;
+}
+void Player::Update(keyInput keyPressed)
+{
+ if(keyPressed != keyInput_none)
+ {
+ Move();
+
+ if(keyPressed == keyInput_A)
+ {
+ Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.x -= 0.1;
+ rigidBody->SetCenter(pos);
+ }
+ if(keyPressed == keyInput_D)
+ {
+ Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.x += 0.1;
+ rigidBody->SetCenter(pos);
+ }
+ }
+
+}
+
+void Player::Move()
+{
+ //API::Instance().Update();
+ /*Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.x += 0.1;
+ rigidBody->SetCenter(pos);*/
+ //API::Instance().SetCenter(rigidBody, pos);
+}
+void Player::Shoot()
+{
+
+}
diff --git a/Code/GameLogic/Player.h b/Code/GameLogic/Player.h
new file mode 100644
index 00000000..7726fed4
--- /dev/null
+++ b/Code/GameLogic/Player.h
@@ -0,0 +1,39 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef PLAYER_H
+#define PLAYER_H
+
+#include "Object.h"
+#include "Weapon.h"
+#include "IGame.h"
+
+
+namespace GameLogic
+{
+
+
+ class Player : public Object
+ {
+
+ public:
+ Player(void);
+ ~Player(void);
+
+ void Update(keyInput keyPressed);
+
+ void Move();
+ void Shoot();
+
+
+ private:
+ int life;
+ Weapon *weapon;
+
+
+ };
+
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/RefManager.cpp b/Code/GameLogic/RefManager.cpp
new file mode 100644
index 00000000..a119898c
--- /dev/null
+++ b/Code/GameLogic/RefManager.cpp
@@ -0,0 +1,47 @@
+#include "RefManager.h"
+
+using namespace GameLogic;
+
+typedef std::pair mapData;
+
+RefManager* RefManager::instance = 0;
+
+RefManager::RefManager(void)
+{
+}
+
+
+RefManager::~RefManager(void)
+{
+}
+
+void RefManager::Release()
+{
+ if (instance)
+ {
+ delete instance;
+ instance = NULL;
+ }
+
+}
+
+RefManager* RefManager::getInstance( )
+{
+ if (!instance)
+ {
+ instance = new RefManager();
+ };
+ return instance;
+}
+
+Object* RefManager::GetMap(Oyster::Physics::ICustomBody &body)
+{
+ return mapper[&body];
+}
+
+void RefManager::AddMapping(Oyster::Physics::ICustomBody &body, Object &obj)
+{
+ mapper.insert(mapData(&body,&obj));
+}
+
+
diff --git a/Code/GameLogic/RefManager.h b/Code/GameLogic/RefManager.h
new file mode 100644
index 00000000..b5fd91d2
--- /dev/null
+++ b/Code/GameLogic/RefManager.h
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef REFMANAGER_H
+#define REFMANAGER_H
+
+#include