]> git.lizzy.rs Git - nothing.git/blob - src/game/camera.h
(#824) Introduce UndoHistory
[nothing.git] / src / game / camera.h
1 #ifndef CAMERA_H_
2 #define CAMERA_H_
3
4 #include "color.h"
5 #include "game/sprite_font.h"
6 #include "math/point.h"
7 #include "math/rect.h"
8 #include "math/triangle.h"
9
10 typedef struct Camera Camera;
11
12 Camera *create_camera(SDL_Renderer *renderer,
13                       Sprite_font *font);
14 void destroy_camera(Camera *camera);
15
16 int camera_clear_background(Camera *camera,
17                             Color color);
18
19 int camera_fill_rect(Camera *camera,
20                      Rect rect,
21                      Color color);
22
23 int camera_draw_rect(Camera *camera,
24                      Rect rect,
25                      Color color);
26
27 int camera_draw_rect_screen(Camera *camera,
28                             Rect rect,
29                             Color color);
30
31 int camera_draw_thicc_rect_screen(Camera *camera,
32                                   Rect rect,
33                                   Color color,
34                                   float thiccness);
35
36 int camera_draw_triangle(Camera *camera,
37                          Triangle t,
38                          Color color);
39
40 int camera_fill_triangle(Camera *camera,
41                          Triangle t,
42                          Color color);
43
44 int camera_render_text(Camera *camera,
45                        const char *text,
46                        Vec size,
47                        Color color,
48                        Vec position);
49
50 int camera_render_text_screen(Camera *camera,
51                               const char *text,
52                               Vec size,
53                               Color color,
54                               Vec position);
55
56 Rect camera_text_boundary_box(const Camera *camera,
57                               Vec position,
58                               Vec scale,
59                               const char *text);
60
61 int camera_render_debug_text(Camera *camera,
62                              const char *text,
63                              Vec position);
64
65 int camera_render_debug_rect(Camera *camera,
66                              Rect rect,
67                              Color color);
68
69 void camera_center_at(Camera *camera, Point position);
70 void camera_scale(Camera *came, float scale);
71
72 void camera_toggle_debug_mode(Camera *camera);
73 void camera_disable_debug_mode(Camera *camera);
74
75 void camera_toggle_blackwhite_mode(Camera *camera);
76
77 int camera_is_point_visible(const Camera *camera, Point p);
78 int camera_is_text_visible(const Camera *camera,
79                            Vec size,
80                            Vec position,
81                            const char *text);
82
83 Rect camera_view_port(const Camera *camera);
84
85 Rect camera_view_port_screen(const Camera *camera);
86
87 Vec camera_map_screen(const Camera *camera,
88                       Sint32 x, Sint32 y);
89
90 Vec camera_point(const Camera *camera, const Vec p);
91 Rect camera_rect(const Camera *camera, const Rect rect);
92
93 int camera_fill_rect_screen(Camera *camera,
94                             Rect rect,
95                             Color color);
96
97 const Sprite_font *camera_font(const Camera *camera);
98
99 #endif  // CAMERA_H_