Rename data types and start implementing drawing quads in ui
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
#include <SDL2/SDL_video.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct point point_t;
|
||||
typedef struct line line_t;
|
||||
typedef struct triangle triangle_t;
|
||||
typedef struct gquad gquad_t;
|
||||
typedef struct rect rect_t;
|
||||
typedef struct window window_t;
|
||||
typedef struct point point;
|
||||
typedef struct line line;
|
||||
typedef struct triangle triangle;
|
||||
typedef struct quad quad;
|
||||
typedef struct rect rect;
|
||||
typedef struct window window;
|
||||
|
||||
struct point {
|
||||
i32 x;
|
||||
@@ -20,25 +20,25 @@ struct point {
|
||||
};
|
||||
|
||||
struct line {
|
||||
point_t p0;
|
||||
point_t p1;
|
||||
point p0;
|
||||
point p1;
|
||||
};
|
||||
|
||||
struct triangle {
|
||||
point_t p0;
|
||||
point_t p1;
|
||||
point_t p2;
|
||||
point p0;
|
||||
point p1;
|
||||
point p2;
|
||||
};
|
||||
|
||||
struct gquad {
|
||||
point_t p0;
|
||||
point_t p1;
|
||||
point_t p2;
|
||||
point_t p3;
|
||||
struct quad {
|
||||
point p0;
|
||||
point p1;
|
||||
point p2;
|
||||
point p3;
|
||||
};
|
||||
|
||||
struct rect {
|
||||
point_t topleft;
|
||||
point topleft;
|
||||
i32 w;
|
||||
i32 h;
|
||||
};
|
||||
@@ -54,7 +54,7 @@ struct window {
|
||||
SDL_Renderer *renderer;
|
||||
};
|
||||
|
||||
typedef struct colour colour_t;
|
||||
typedef struct colour colour;
|
||||
struct colour {
|
||||
union {
|
||||
u32 abgr;
|
||||
@@ -62,18 +62,18 @@ struct colour {
|
||||
};
|
||||
};
|
||||
|
||||
bool init_window(window_t *wnd, const char *title, u32 width, u32 height, i32 x,
|
||||
bool init_window(window *wnd, const char *title, u32 width, u32 height, i32 x,
|
||||
i32 y);
|
||||
void cleanup_window(window_t *wnd);
|
||||
void clear_window(const window_t *wnd, colour_t colour);
|
||||
void swap_buffers(const window_t *wnd);
|
||||
void draw_point(const window_t *wnd, point_t p, colour_t colour);
|
||||
void draw_line(const window_t *wnd, const line_t *ln, colour_t colour);
|
||||
void draw_triangle(const window_t *wnd, triangle_t triangle, colour_t colour);
|
||||
void fill_triangle(const window_t *wnd, triangle_t triangle, colour_t colour);
|
||||
void draw_gquad(const window_t *wnd, gquad_t gquad, colour_t colour);
|
||||
void fill_gquad(const window_t *wnd, gquad_t gquad, colour_t colour);
|
||||
void draw_rect(const window_t *wnd, rect_t rect, colour_t colour);
|
||||
void fill_rect(const window_t *wnd, rect_t rect, colour_t colour);
|
||||
void cleanup_window(window *wnd);
|
||||
void clear_window(const window *wnd, colour colour);
|
||||
void swap_buffers(const window *wnd);
|
||||
void draw_point(const window *wnd, point p, colour colour);
|
||||
void draw_line(const window *wnd, const line *ln, colour colour);
|
||||
void draw_triangle(const window *wnd, triangle triangle, colour colour);
|
||||
void fill_triangle(const window *wnd, triangle triangle, colour colour);
|
||||
void draw_quad(const window *wnd, quad qd, colour colour);
|
||||
void fill_quad(const window *wnd, quad qd, colour colour);
|
||||
void draw_rect(const window *wnd, rect rec, colour colour);
|
||||
void fill_rect(const window *wnd, rect rec, colour colour);
|
||||
|
||||
#endif // !WINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user