Commit 11202c1a authored by Georg Schaefer's avatar Georg Schaefer
Browse files

Merge branch 'develop' into feature/physics/collision_data

parents 2136c33b e428e426
# placeholder[Name des Spiels]
– entstanden bei der GameDevelopmentWeek im Sommersemester 2015
### Lizenzen
Alle Lizenzen befinden sich in der Datei `LICENSE.md`
### Pre-build
* ausführen der Datei `build_deps{.sh|.bat}` mit dem Parameter `linux` oder `windows`
* ausführen von `premake5`
//****************************************
// by Benjamin 'Albsi' Albsmeier
// input/input.hpp for GDW SS15
// mouse and keyboard input
//****************************************
#include <map>
#include <SDL.h>
#include <glm/glm.hpp>
......@@ -12,24 +17,51 @@ namespace gdw{
input(engine& engine);
~input();
/**updates the keys and computes the SDL_Events
* should called for every event*/
void update(const SDL_Event &event);
/**resets some data
* should called once per game loop, at the end*/
void reset();
/**Returns true every frame, as long as the key is down.*/
int isKeyDown(SDL_Keycode key);
/**Returns true once the key is pressed*/
bool isKeyPressed(SDL_Keycode key);
/**Returns true once the key is released*/
bool isKeyReleased(SDL_Keycode key);
/**Returns true every frame, as long as the mouse button is down.*/
int isMouseButtonDown(int button);
/**Returns true once the mouse button is pressed*/
bool isMouseButtonPressed(int button);
/**Returns true once the mouse button is released*/
bool isMouseButtonReleased(int button);
/**Returns a glm::vec2 with the x and y motion of the mouse wheel
* y is the motion a nomal mouse wheel can perform*/
glm::vec2 mouseWheel()noexcept{return mousePos_;};
/**x motion of the mouse wheel*/
int mouseWheelX()noexcept{return mouseWheel_.x;};
/**y motion of the mouse wheel*/
int mouseWheelY()noexcept{return mouseWheel_.y;};
/**returns a glm::vec2 with the x and y position of the mouse cursor*/
glm::vec2 mousePos()noexcept{return mousePos_;};
/**returns x position of the mouse cursor*/
int mousePosX()noexcept{return mousePos_.x;};
/**returns y position of the mouse cursor*/
int mousePosY()noexcept{return mousePos_.y;};
private:
const Uint8 *keyState_;
glm::vec2 mousePos_;
......
//****************************************
// by Benjamin 'Albsi' Albsmeier
// input/input.cpp for GDW SS15
//****************************************
#include "input/input.hpp"
namespace gdw{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment