]> git.lizzy.rs Git - nothing.git/blob - src/game/camera.h
fdfa989f35b2f8ab20b025162a1e1ad2b9b5a897
[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 int camera_render_debug_text(Camera *camera,
57                              const char *text,
58                              Vec position);
59
60 int camera_render_debug_rect(Camera *camera,
61                              Rect rect,
62                              Color color);
63
64 void camera_center_at(Camera *camera, Point position);
65 void camera_scale(Camera *came, float scale);
66
67 void camera_toggle_debug_mode(Camera *camera);
68 void camera_disable_debug_mode(Camera *camera);
69
70 void camera_toggle_blackwhite_mode(Camera *camera);
71
72 int camera_is_point_visible(const Camera *camera, Point p);
73 int camera_is_text_visible(const Camera *camera,
74                            Vec size,
75                            Vec position,
76                            const char *text);
77
78 Rect camera_view_port(const Camera *camera);
79
80 Rect camera_view_port_screen(const Camera *camera);
81
82 Vec camera_map_screen(const Camera *camera,
83                       Sint32 x, Sint32 y);
84
85 Vec camera_point(const Camera *camera, const Vec p);
86 Rect camera_rect(const Camera *camera, const Rect rect);
87
88
89 int camera_fill_rect_screen(Camera *camera,
90                             Rect rect,
91                             Color color);
92
93 #endif  // CAMERA_H_