#ifndef CAMERA_H_
#define CAMERA_H_
+#include <stdbool.h>
+
#include "color.h"
-#include "math/point.h"
+#include "game/sprite_font.h"
+#include "math/vec.h"
#include "math/rect.h"
#include "math/triangle.h"
-typedef struct camera_t camera_t;
+typedef struct {
+ bool debug_mode;
+ bool blackwhite_mode;
+ Vec2f position;
+ float scale;
+ SDL_Renderer *renderer;
+ Sprite_font *font;
+} Camera;
+
+Camera create_camera(SDL_Renderer *renderer,
+ Sprite_font *font);
+
+int camera_clear_background(const Camera *camera,
+ Color color);
+
+int camera_fill_rect(const Camera *camera,
+ Rect rect,
+ Color color);
+
+int camera_draw_rect(const Camera *camera,
+ Rect rect,
+ Color color);
+
+int camera_draw_rect_screen(const Camera *camera,
+ Rect rect,
+ Color color);
+
+int camera_draw_thicc_rect_screen(const Camera *camera,
+ Rect rect,
+ Color color,
+ float thiccness);
+
+int camera_draw_line(const Camera *camera,
+ Vec2f begin, Vec2f end,
+ Color color);
+
+int camera_draw_triangle(Camera *camera,
+ Triangle t,
+ Color color);
+
+int camera_fill_triangle(const Camera *camera,
+ Triangle t,
+ Color color);
+
+int camera_render_text(const Camera *camera,
+ const char *text,
+ Vec2f size,
+ Color color,
+ Vec2f position);
+
+int camera_render_text_screen(const Camera *camera,
+ const char *text,
+ Vec2f size,
+ Color color,
+ Vec2f position);
-camera_t *create_camera_from_renderer(SDL_Renderer *renderer);
-void destroy_camera(camera_t *camera);
+Rect camera_text_boundary_box(const Camera *camera,
+ Vec2f position,
+ Vec2f scale,
+ const char *text);
-int camera_clear_background(const camera_t *camera,
- color_t color);
+int camera_render_debug_text(const Camera *camera,
+ const char *text,
+ Vec2f position);
-void camera_present(const camera_t *camera);
+int camera_render_debug_rect(const Camera *camera,
+ Rect rect,
+ Color color);
-int camera_fill_rect(const camera_t *camera,
- rect_t rect,
- color_t color);
+void camera_center_at(Camera *camera, Vec2f position);
+void camera_scale(Camera *came, float scale);
-int camera_draw_rect(const camera_t * camera,
- rect_t rect,
- color_t color);
+void camera_toggle_debug_mode(Camera *camera);
+void camera_disable_debug_mode(Camera *camera);
-int camera_draw_triangle(const camera_t *camera,
- triangle_t t,
- color_t color);
+int camera_is_point_visible(const Camera *camera, Vec2f p);
+int camera_is_text_visible(const Camera *camera,
+ Vec2f size,
+ Vec2f position,
+ const char *text);
-int camera_fill_triangle(const camera_t *camera,
- triangle_t t,
- color_t color);
+Rect camera_view_port(const Camera *camera);
-void camera_center_at(camera_t *camera, point_t position);
+Rect camera_view_port_screen(const Camera *camera);
-void camera_toggle_debug_mode(camera_t *camera);
+Vec2f camera_map_screen(const Camera *camera,
+ Sint32 x, Sint32 y);
-void camera_toggle_blackwhite_mode(camera_t *camera);
+Vec2f camera_point(const Camera *camera, const Vec2f p);
+Rect camera_rect(const Camera *camera, const Rect rect);
-int camera_is_point_visible(const camera_t *camera, point_t p);
+int camera_fill_rect_screen(const Camera *camera,
+ Rect rect,
+ Color color);
-rect_t camera_view_port(const camera_t *camera);
+const Sprite_font *camera_font(const Camera *camera);
#endif // CAMERA_H_