From 77c2f920442b7b73cd3f1f94c3362948c7fb2a5d Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 21 Jun 2017 13:11:37 +0100 Subject: Creating general includes for easier use --- include/YAGE/Math/math.hpp | 6 ++++++ include/YAGE/Math/matrix.hpp | 22 ++++++++++++++++++++-- include/YAGE/Physics/physics.hpp | 11 +++++++++++ include/YAGE/yage.hpp | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 include/YAGE/Math/math.hpp create mode 100644 include/YAGE/Physics/physics.hpp create mode 100644 include/YAGE/yage.hpp (limited to 'include') 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 @@ -193,6 +191,26 @@ Matrix operator+(const T &lhs, Matrix rhs) return rhs; } +template +Matrix operator-(Matrix lhs, const T &rhs) +{ + for(auto &data : lhs) + { + data-=rhs; + } + return lhs; +} + +template +Matrix operator-(const T &lhs, Matrix rhs) +{ + for(auto &data : rhs) + { + data=lhs-data; + } + return rhs; +} + template std::ostream& operator<<(std::ostream &os, const Matrix &mat) { 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 + +#include + +namespace yage +{ + +bool init() +{ + if(SDL_Init(SDL_INIT_VIDEO)) + { + return false; + } + return true; +} + +void quit() +{ + SDL_Quit(); +} + +}; + +#endif -- cgit