aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--lib/CMakeLists.txt24
-rw-r--r--tests/matrixtest.cpp2
-rw-r--r--tests/particlebodytest.cpp2
-rw-r--r--tests/windowtest.cpp2
-rw-r--r--tests/yagetest.cpp3
-rw-r--r--yage/base/camera2d.cpp2
-rw-r--r--yage/base/glslprogram.cpp2
-rw-r--r--yage/base/imageloader.cpp6
-rw-r--r--yage/base/inputmanager.cpp2
-rw-r--r--yage/base/iomanager.cpp2
-rw-r--r--yage/base/resourcemanager.cpp2
-rw-r--r--yage/base/sprite.cpp6
-rw-r--r--yage/base/spritebatch.cpp2
-rw-r--r--yage/base/texturecache.cpp4
-rw-r--r--yage/base/window.cpp2
-rw-r--r--yage/physics/body.cpp2
-rw-r--r--yage/physics/body.h4
-rw-r--r--yage/physics/particlebody.cpp2
-rw-r--r--yage/physics/particlebody.h2
-rw-r--r--yage/physics/rectanglecollider.cpp2
-rw-r--r--yage/physics/rigidbody.cpp2
-rw-r--r--yage/yage.h34
23 files changed, 65 insertions, 56 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7897ad1b..11f293dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,13 +7,13 @@ project(YetAnotherGameEngine)
set(CMAKE_CXX_STANDARD 14)
# set the test sources
-set(YAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src)
-set(YAGE_TEST_DIR ${PROJECT_SOURCE_DIR}/test)
-set(YAGE_LIBRARIES ${PROJECT_NAME})
+set(YAGE_TEST_DIR ${PROJECT_SOURCE_DIR}/tests)
# set binary directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
# find libraries
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
@@ -26,7 +26,7 @@ pkg_search_module(SDL2 REQUIRED sdl2)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/yage)
-if(ENABLE_TESTING)
+if(${ENABLE_TESTING})
# enable tests
enable_testing()
set(SIMULATION_RUNS 1000)
@@ -43,4 +43,4 @@ if(ENABLE_TESTING)
make_test(matrixtest ${SIMULATION_RUNS})
make_test(particlebodytest ${SIMULATION_RUNS})
make_test(windowtest ${SIMULATION_RUNS})
-endif(ENABLE_TESTING)
+endif()
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 3fc37c0e..0f07326f 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -5,19 +5,21 @@
# See file LICENSE for more details
# ----------------------------------------------------------------------------
-# Initializing google test
-# prevents overriding the parent project's compiler/linter settings on windows
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+if(${ENABLE_TESTING})
+ # Initializing google test
+ # prevents overriding the parent project's compiler/linter settings on windows
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-# Add googletest directly to our build. This defines
-# the gtest and gtest_main targets.
-add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/googletest")
+ # Add googletest directly to our build. This defines
+ # the gtest and gtest_main targets.
+ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/googletest")
-# The gtest/gtest_main targets carry header search path
-# dependencies automatically when using CMake 2.8.11 or
-# later. Otherwise we have to add them here ourselves.
-if (CMAKE_VERSION VERSION_LESS 2.8.11)
- include_directories("${gtest_SOURCE_DIR}/include")
+ # The gtest/gtest_main targets carry header search path
+ # dependencies automatically when using CMake 2.8.11 or
+ # later. Otherwise we have to add them here ourselves.
+ if (CMAKE_VERSION VERSION_LESS 2.8.11)
+ include_directories("${gtest_SOURCE_DIR}/include")
+ endif()
endif()
# include headers for rapidjson, no need to build it
diff --git a/tests/matrixtest.cpp b/tests/matrixtest.cpp
index b570f6d4..9cc8bccc 100644
--- a/tests/matrixtest.cpp
+++ b/tests/matrixtest.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/Math/math.h>
+#include <yage/yage.h>
#include <gtest/gtest.h>
#include <algorithm>
diff --git a/tests/particlebodytest.cpp b/tests/particlebodytest.cpp
index b359cb73..4b8c92b2 100644
--- a/tests/particlebodytest.cpp
+++ b/tests/particlebodytest.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/Physics/particlebody.h>
+#include <yage/yage.h>
#include <gtest/gtest.h>
#include <cmath>
diff --git a/tests/windowtest.cpp b/tests/windowtest.cpp
index e6739720..464d4c68 100644
--- a/tests/windowtest.cpp
+++ b/tests/windowtest.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/yage.h>
+#include <yage/yage.h>
#include <gtest/gtest.h>
TEST(Window, Open)
diff --git a/tests/yagetest.cpp b/tests/yagetest.cpp
index 8d590b4a..0b8615bc 100644
--- a/tests/yagetest.cpp
+++ b/tests/yagetest.cpp
@@ -6,10 +6,9 @@
* ----------------------------------------------------------------------------
*/
+#include <yage/yage.h>
#include <gtest/gtest.h>
-#include <YAGE/yage.h>
-
TEST(YAGE, InitQuit)
{
ASSERT_TRUE(yage::init());
diff --git a/yage/base/camera2d.cpp b/yage/base/camera2d.cpp
index 292f998a..e23b75fa 100644
--- a/yage/base/camera2d.cpp
+++ b/yage/base/camera2d.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/camera2d.h>
+#include "camera2d.h"
#include <GL/glew.h>
diff --git a/yage/base/glslprogram.cpp b/yage/base/glslprogram.cpp
index 11a3191e..131a1a28 100644
--- a/yage/base/glslprogram.cpp
+++ b/yage/base/glslprogram.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/glslprogram.h>
+#include <yage/base/glslprogram.h>
#include <fstream>
#include <stdexcept>
diff --git a/yage/base/imageloader.cpp b/yage/base/imageloader.cpp
index 812110d8..983c350e 100644
--- a/yage/base/imageloader.cpp
+++ b/yage/base/imageloader.cpp
@@ -6,9 +6,9 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/imageloader.h>
-#include <YAGE/iomanager.h>
-#include <YAGE/picopng.h>
+#include <yage/base/imageloader.h>
+#include <yage/base/iomanager.h>
+#include <yage/base/picopng.h>
#include <stdexcept>
diff --git a/yage/base/inputmanager.cpp b/yage/base/inputmanager.cpp
index d429abd7..15ff374b 100644
--- a/yage/base/inputmanager.cpp
+++ b/yage/base/inputmanager.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/inputmanager.h>
+#include <yage/base/inputmanager.h>
namespace yage
{
diff --git a/yage/base/iomanager.cpp b/yage/base/iomanager.cpp
index 93ab41c9..d5b950d6 100644
--- a/yage/base/iomanager.cpp
+++ b/yage/base/iomanager.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/iomanager.h>
+#include <yage/base/iomanager.h>
#include <fstream>
#include <stdexcept>
diff --git a/yage/base/resourcemanager.cpp b/yage/base/resourcemanager.cpp
index 473ea37e..f3f9aa20 100644
--- a/yage/base/resourcemanager.cpp
+++ b/yage/base/resourcemanager.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/resourcemanager.h>
+#include <yage/base/resourcemanager.h>
namespace yage
{
diff --git a/yage/base/sprite.cpp b/yage/base/sprite.cpp
index 68e08e5d..767e1000 100644
--- a/yage/base/sprite.cpp
+++ b/yage/base/sprite.cpp
@@ -6,9 +6,9 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/sprite.h>
-#include <YAGE/resourcemanager.h>
-#include <YAGE/vertex.h>
+#include <yage/base/sprite.h>
+#include <yage/base/resourcemanager.h>
+#include <yage/base/vertex.h>
#include <cstddef>
diff --git a/yage/base/spritebatch.cpp b/yage/base/spritebatch.cpp
index ac98130b..3aec8153 100644
--- a/yage/base/spritebatch.cpp
+++ b/yage/base/spritebatch.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/spritebatch.h>
+#include <yage/base/spritebatch.h>
#include <algorithm>
#include <stdexcept>
diff --git a/yage/base/texturecache.cpp b/yage/base/texturecache.cpp
index fda5fcd9..5d2950a3 100644
--- a/yage/base/texturecache.cpp
+++ b/yage/base/texturecache.cpp
@@ -6,8 +6,8 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/texturecache.h>
-#include <YAGE/imageloader.h>
+#include <yage/base/texturecache.h>
+#include <yage/base/imageloader.h>
namespace yage
{
diff --git a/yage/base/window.cpp b/yage/base/window.cpp
index 143b1d5d..a8b6fc02 100644
--- a/yage/base/window.cpp
+++ b/yage/base/window.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/window.h>
+#include <yage/base/window.h>
#include <GL/glew.h>
#include <iostream>
diff --git a/yage/physics/body.cpp b/yage/physics/body.cpp
index 8d38e70a..81d26699 100644
--- a/yage/physics/body.cpp
+++ b/yage/physics/body.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/Physics/body.h>
+#include <yage/physics/body.h>
#include <utility>
diff --git a/yage/physics/body.h b/yage/physics/body.h
index bd33a9ac..90682682 100644
--- a/yage/physics/body.h
+++ b/yage/physics/body.h
@@ -9,10 +9,11 @@
#ifndef YAGE_PHYSICS_BODY_H
#define YAGE_PHYSICS_BODY_H
-#include <YAGE/Math/matrix.h>
+#include <math/matrix.h>
namespace yage
{
+
class Body
{
public:
@@ -51,6 +52,7 @@ protected:
Body(Vector2d position = Vector2d(0, 0), double mass = 1,
Vector2d velocity = Vector2d(0, 0), bool gravity = false);
};
+
} // namespace yage
#endif
diff --git a/yage/physics/particlebody.cpp b/yage/physics/particlebody.cpp
index bdb81eac..3ccba546 100644
--- a/yage/physics/particlebody.cpp
+++ b/yage/physics/particlebody.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/Physics/particlebody.h>
+#include <yage/physics/particlebody.h>
#include <cmath>
#include <iostream>
diff --git a/yage/physics/particlebody.h b/yage/physics/particlebody.h
index a0b9bdad..18cfff0b 100644
--- a/yage/physics/particlebody.h
+++ b/yage/physics/particlebody.h
@@ -11,7 +11,7 @@
#include "body.h"
-#include <YAGE/Math/matrix.h>
+#include <yage/math/matrix.h>
namespace yage
{
diff --git a/yage/physics/rectanglecollider.cpp b/yage/physics/rectanglecollider.cpp
index 64887278..d9a1a6c1 100644
--- a/yage/physics/rectanglecollider.cpp
+++ b/yage/physics/rectanglecollider.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/Physics/rectanglecollider.h>
+#include <yage/physics/rectanglecollider.h>
namespace yage
{
diff --git a/yage/physics/rigidbody.cpp b/yage/physics/rigidbody.cpp
index dcab5f2f..efbef8d9 100644
--- a/yage/physics/rigidbody.cpp
+++ b/yage/physics/rigidbody.cpp
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#include <YAGE/Physics/rigidbody.h>
+#include <yage/physics/rigidbody.h>
namespace yage
{
diff --git a/yage/yage.h b/yage/yage.h
index 6157e6bf..286d4784 100644
--- a/yage/yage.h
+++ b/yage/yage.h
@@ -6,7 +6,7 @@
* ----------------------------------------------------------------------------
*/
-/** @file Includes all the headers in the main YAGE project.
+/** @file Includes all the headers in the main yage project.
*
* This does not include
*/
@@ -14,17 +14,23 @@
#ifndef YAGE_YAGE_H
#define YAGE_YAGE_H
-#include "camera2d.h"
-#include "glslprogram.h"
-#include "imageloader.h"
-#include "inputmanager.h"
-#include "iomanager.h"
-#include "picopng.h"
-#include "resourcemanager.h"
-#include "spritebatch.h"
-#include "texture.h"
-#include "vertex.h"
-#include "window.h"
+#include "base/camera2d.h"
+#include "base/glslprogram.h"
+#include "base/imageloader.h"
+#include "base/inputmanager.h"
+#include "base/iomanager.h"
+#include "base/picopng.h"
+#include "base/resourcemanager.h"
+#include "base/spritebatch.h"
+#include "base/texture.h"
+#include "base/vertex.h"
+#include "base/window.h"
+
+#include "physics/rectanglecollider.h"
+#include "physics/rigidbody.h"
+#include "physics/particlebody.h"
+#include "physics/body.h"
+
#include <SDL2/SDL.h>
@@ -38,7 +44,7 @@
namespace yage
{
-/** Initializes YAGE.
+/** Initializes yage.
*
* This is only there to initialize SDL2.
*
@@ -49,7 +55,7 @@ bool init()
return SDL_Init(SDL_INIT_VIDEO);
}
-/** Quit and cleanup YAGE
+/** Quit and cleanup yage
*
* SDL2 needs to clean itself up.
*/