summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jamroot.jam22
-rw-r--r--application/main.cpp16
-rw-r--r--gfx/inputHandler.h (renamed from application/inputHandler.h)5
-rw-r--r--gfx/manualCameraController.cpp (renamed from application/manualCameraController.cpp)0
-rw-r--r--gfx/manualCameraController.h (renamed from application/manualCameraController.h)0
-rw-r--r--utility/special_members.hpp6
6 files changed, 35 insertions, 14 deletions
diff --git a/Jamroot.jam b/Jamroot.jam
index 9b79df6..0c030aa 100644
--- a/Jamroot.jam
+++ b/Jamroot.jam
@@ -14,8 +14,8 @@ project : requirements
<variant>debug:<warnings>extra
<variant>debug:<warnings-as-errors>on
<variant>release:<lto>on
- <toolset>tidy:<exclude>bin/gfx/gl/shaders/fs-basicShader.h
- <toolset>tidy:<exclude>bin/gfx/gl/shaders/vs-basicShader.h
+ <toolset>tidy:<exclude>gfx/gl/shaders/fs-basicShader.h
+ <toolset>tidy:<exclude>gfx/gl/shaders/vs-basicShader.h
<toolset>tidy:<checkxx>boost-*
<toolset>tidy:<checkxx>bugprone-*
<toolset>tidy:<checkxx>clang-*
@@ -45,14 +45,24 @@ actions xxd.i
}
IMPORT $(__name__) : xxd.i : : xxd.i ;
-exe test :
+exe iliketrains :
+ application/main.cpp
+ :
+ <library>ilt
+ <include>.
+ <include>utility
+ <include>lib
+ ;
+
+lib ilt :
[ glob-tree *.cpp *.c *.vs *.fs : bin ]
:
+ <variant>release:<link>static
<include>.
<include>utility
<include>lib
- <library>sdl2
- <library>glew
- <library>pthread
+ <library>sdl2/<link>shared
+ <library>glew/<link>shared
+ <library>pthread/<link>shared
<use>stb
;
diff --git a/application/main.cpp b/application/main.cpp
index b2c2a5e..94a3b0f 100644
--- a/application/main.cpp
+++ b/application/main.cpp
@@ -1,16 +1,16 @@
-#include "game/terrain.h"
-#include "gfx/window.h"
-#include "inputHandler.h"
-#include "manualCameraController.h"
#include <SDL2/SDL.h>
#include <chrono>
#include <collection.hpp>
+#include <game/terrain.h>
#include <game/world.h>
#include <game/worldobject.h>
#include <gfx/camera_controller.h>
#include <gfx/gl/camera.h>
#include <gfx/gl/shader.h>
+#include <gfx/inputHandler.h>
+#include <gfx/manualCameraController.h>
#include <gfx/renderable.h>
+#include <gfx/window.h>
#include <memory>
#include <special_members.hpp>
#include <vector>
@@ -53,7 +53,7 @@ public:
return false;
}
- void
+ int
run()
{
Collection<Window> windows;
@@ -92,6 +92,8 @@ public:
}
t_start = t_end;
}
+
+ return 0;
}
private:
@@ -111,7 +113,5 @@ private:
int
main(int, char **)
{
- std::make_shared<SDL_Application>()->run();
-
- return 0;
+ return std::make_shared<SDL_Application>()->run();
}
diff --git a/application/inputHandler.h b/gfx/inputHandler.h
index bcb900b..5b426c7 100644
--- a/application/inputHandler.h
+++ b/gfx/inputHandler.h
@@ -1,12 +1,17 @@
#ifndef INPUT_HANDLER_H
#define INPUT_HANDLER_H
+#include <special_members.hpp>
+
union SDL_Event;
class InputHandler {
public:
+ InputHandler() = default;
virtual ~InputHandler() = default;
+ DEFAULT_MOVE_COPY(InputHandler);
+
virtual bool handleInput(SDL_Event &) = 0;
};
diff --git a/application/manualCameraController.cpp b/gfx/manualCameraController.cpp
index 36f3312..36f3312 100644
--- a/application/manualCameraController.cpp
+++ b/gfx/manualCameraController.cpp
diff --git a/application/manualCameraController.h b/gfx/manualCameraController.h
index 112ec5c..112ec5c 100644
--- a/application/manualCameraController.h
+++ b/gfx/manualCameraController.h
diff --git a/utility/special_members.hpp b/utility/special_members.hpp
index f396813..0d63f58 100644
--- a/utility/special_members.hpp
+++ b/utility/special_members.hpp
@@ -9,4 +9,10 @@
TYPE(TYPE &&) = delete; \
void operator=(TYPE &&) = delete
+#define DEFAULT_MOVE_COPY(TYPE) \
+ TYPE(const TYPE &) = default; \
+ TYPE(TYPE &&) = default; \
+ TYPE & operator=(const TYPE &) = default; \
+ TYPE & operator=(TYPE &&) = default
+
#endif