Starter project for SDL2.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
447 B

  1. #ifndef IZ_RECT_H
  2. #define IZ_RECT_H
  3. #include <stdbool.h>
  4. #include "IZ_point2d.h"
  5. typedef struct {
  6. IZ_Coordinate left;
  7. IZ_Coordinate top;
  8. IZ_Coordinate right;
  9. IZ_Coordinate bottom;
  10. } IZ_Bounds;
  11. typedef struct {
  12. // top left
  13. IZ_Point2D pos;
  14. IZ_Coordinate width;
  15. IZ_Coordinate height;
  16. } IZ_Rect;
  17. IZ_Bounds IZ_RectGetBounds(IZ_Rect);
  18. bool IZ_BoundsContainPoint(IZ_Bounds, IZ_Point2D);
  19. bool IZ_BoundsCollide(IZ_Bounds, IZ_Bounds);
  20. #endif