diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/YAGE/Math/math.hpp | 6 | ||||
-rw-r--r-- | include/YAGE/Math/matrix.hpp | 22 | ||||
-rw-r--r-- | include/YAGE/Physics/physics.hpp | 11 | ||||
-rw-r--r-- | include/YAGE/yage.hpp | 39 |
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 |