aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-06-21 13:11:37 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-06-21 13:11:37 +0100
commit77c2f920442b7b73cd3f1f94c3362948c7fb2a5d (patch)
treeacb39ebf2b271500208c52ae7894178499152fff /include
parent6b974b64e447610f8b5340817ffd4a3513d4f3d1 (diff)
downloadYAGE-77c2f920442b7b73cd3f1f94c3362948c7fb2a5d.tar.gz
YAGE-77c2f920442b7b73cd3f1f94c3362948c7fb2a5d.zip
Creating general includes for easier use
Diffstat (limited to 'include')
-rw-r--r--include/YAGE/Math/math.hpp6
-rw-r--r--include/YAGE/Math/matrix.hpp22
-rw-r--r--include/YAGE/Physics/physics.hpp11
-rw-r--r--include/YAGE/yage.hpp39
4 files changed, 76 insertions, 2 deletions
diff --git a/include/YAGE/Math/math.hpp b/include/YAGE/Math/math.hpp
new file mode 100644
index 00000000..201bf3cb
--- /dev/null
+++ b/include/YAGE/Math/math.hpp
@@ -0,0 +1,6 @@
+#ifndef YAGE_MATH_HPP
+#define YAGE_MATH_HPP
+
+#include "matrix.hpp"
+
+#endif
diff --git a/include/YAGE/Math/matrix.hpp b/include/YAGE/Math/matrix.hpp
index 47bb6d60..5a753616 100644
--- a/include/YAGE/Math/matrix.hpp
+++ b/include/YAGE/Math/matrix.hpp
@@ -155,8 +155,6 @@ public:
data_=std::move(out);
return *this;
}
-
-
};
template<int M, int N, class T>
@@ -194,6 +192,26 @@ Matrix<M, N, T> operator+(const T &lhs, Matrix<M, N, T> rhs)
}
template<int M, int N, class T>
+Matrix<M, N, T> operator-(Matrix<M, N, T> lhs, const T &rhs)
+{
+ for(auto &data : lhs)
+ {
+ data-=rhs;
+ }
+ return lhs;
+}
+
+template<int M, int N, class T>
+Matrix<M, N, T> operator-(const T &lhs, Matrix<M, N, T> rhs)
+{
+ for(auto &data : rhs)
+ {
+ data=lhs-data;
+ }
+ return rhs;
+}
+
+template<int M, int N, class T>
std::ostream& operator<<(std::ostream &os, const Matrix<M, N, T> &mat)
{
return os<<mat.toString();
diff --git a/include/YAGE/Physics/physics.hpp b/include/YAGE/Physics/physics.hpp
new file mode 100644
index 00000000..efcbefe4
--- /dev/null
+++ b/include/YAGE/Physics/physics.hpp
@@ -0,0 +1,11 @@
+#ifndef YAGE_PHYSICS_HPP
+#define YAGE_PHYSICS_HPP
+
+#include "body.hpp"
+#include "collider.hpp"
+#include "collisionbody.hpp"
+#include "particlebody.hpp"
+#include "rectanglecollider.hpp"
+#include "rigidbody.hpp"
+
+#endif
diff --git a/include/YAGE/yage.hpp b/include/YAGE/yage.hpp
new file mode 100644
index 00000000..cec03d00
--- /dev/null
+++ b/include/YAGE/yage.hpp
@@ -0,0 +1,39 @@
+#ifndef YAGE_HPP
+#define YAGE_HPP
+
+#include "camera2d.hpp"
+#include "glslprogram.hpp"
+#include "imageloader.hpp"
+#include "inputmanager.hpp"
+#include "iomanager.hpp"
+#include "picopng.hpp"
+#include "resourcemanager.hpp"
+#include "spritebatch.hpp"
+#include "texture.hpp"
+#include "vertex.hpp"
+#include "window.hpp"
+
+#include <SDL2/SDL.h>
+
+#include <stdexcept>
+
+namespace yage
+{
+
+bool init()
+{
+ if(SDL_Init(SDL_INIT_VIDEO))
+ {
+ return false;
+ }
+ return true;
+}
+
+void quit()
+{
+ SDL_Quit();
+}
+
+};
+
+#endif