#ifndef DRAW_H
#define DRAW_H

struct renderer_canvas;
struct font;
struct renderer_startup_receipt;
struct font_startup_receipt;

#define DRAW_SPRITE_PARAMS(...) ((struct draw_sprite_params) { \
    .tint = COLOR_WHITE, \
    .clip = CLIP_ALL, \
    __VA_ARGS__ \
})

struct draw_sprite_params {
    struct sprite_tag sprite;
    struct clip_rect clip;
    u32 tint;
};

struct draw_startup_receipt { i32 _; };
struct draw_startup_receipt draw_startup(struct renderer_startup_receipt *renderer_sr,
                                         struct font_startup_receipt *font_sr);

void draw_sprite_quad(struct renderer_canvas *canvas, struct draw_sprite_params params, struct quad quad);
void draw_sprite_rect(struct renderer_canvas *canvas, struct draw_sprite_params params, struct rect rect);

void draw_solid_poly(struct renderer_canvas *canvas, struct v2_array array, u32 color);
void draw_solid_circle(struct renderer_canvas *canvas, struct v2 pos, f32 radius, u32 color, u32 detail);
void draw_solid_quad(struct renderer_canvas *canvas, struct quad quad, u32 color);
void draw_solid_rect(struct renderer_canvas *canvas, struct rect rect, u32 color);

void draw_solid_line(struct renderer_canvas *canvas, struct v2 start, struct v2 end, f32 thickness, u32 color);
void draw_solid_ray(struct renderer_canvas *canvas, struct v2 start, struct v2 ray, f32 thickness, u32 color);
void draw_solid_poly_line(struct renderer_canvas *canvas, struct v2_array array, b32 loop, f32 thickness, u32 color);
void draw_solid_quad_line(struct renderer_canvas *canvas, struct quad quad, f32 thickness, u32 color);
void draw_solid_rect_line(struct renderer_canvas *canvas, struct rect rect, f32 thickness, u32 color);
void draw_solid_arrow_line(struct renderer_canvas *canvas, struct v2 start, struct v2 end, f32 thickness, f32 arrowhead_height, u32 color);
void draw_solid_arrow_ray(struct renderer_canvas *canvas, struct v2 pos, struct v2 rel, f32 thickness, f32 arrowhead_height, u32 color);

void draw_text(struct renderer_canvas *canvas, struct font *font, struct v2 pos, struct string str);
void draw_text_ex(struct renderer_canvas *canvas, struct font *font, struct v2 pos, f32 scale, struct string str);

#endif
