cleaned how balls are added
[physics.git] / src / input / inputManager.cpp
index 0df4baa..ebbd72e 100644 (file)
@@ -74,14 +74,25 @@ void input::update()
 
 Vector2 input::mousePosition()
 {
-    int x;
-    int y;
-
+    int x,y;
     SDL_GetMouseState(&x, &y);
 
     return Vector2(x,y);
 }
 
+bool input::mouseLeft()
+{
+    Uint8 state = SDL_GetMouseState(NULL, NULL);
+
+    return state & SDL_BUTTON(1);
+}
+bool input::mouseRight()
+{
+    Uint8 state = SDL_GetMouseState(NULL, NULL);
+
+    return state & SDL_BUTTON(3);
+}
+
 bool input::isPressed(Uint8 key)
 {
     return keyState[key] == isP || keyState[key] == wasP;