]> git.lizzy.rs Git - nothing.git/blobdiff - src/math/rect.h
Merge pull request #924 from RIscRIpt/manual_sdl2
[nothing.git] / src / math / rect.h
index 1dd14152abdf5e40291573bcf20f293fc442433a..9b045b5cc5d5bcafd43cb19f1cd1abcebb8f6010 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef RECT_H_
 #define RECT_H_
 
-#include <SDL2/SDL.h>
+#include <SDL.h>
 
 #include "math/point.h"
 
@@ -25,6 +25,7 @@ typedef struct Line {
 
 Rect rect(float x, float y, float w, float h);
 Rect rect_from_vecs(Point position, Vec size);
+Rect rect_from_points(Point p1, Point p2);
 Rect rect_from_sdl(const SDL_Rect *rect);
 
 Rect rects_overlap_area(Rect rect1, Rect rect2);
@@ -45,4 +46,9 @@ float line_length(Line line);
 
 SDL_Rect rect_for_sdl(Rect rect);
 
+Vec rect_center(Rect rect);
+
+Vec rect_snap(Rect pivot, Rect *rect);
+Vec rect_impulse(Rect *r1, Rect *r2);
+
 #endif  // RECT_H_