Reorganise files
This commit is contained in:
55
include/drawing.h
Normal file
55
include/drawing.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef DRAWING_H
|
||||
#define DRAWING_H
|
||||
|
||||
#include "aliases/aliases.h"
|
||||
#include <SDL_pixels.h>
|
||||
#include <SDL_render.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define DEFAULT_ARROWS_CAPACITY 1024
|
||||
|
||||
#define init_arrows_default(arrows) \
|
||||
init_arrows_arr(arrows, DEFAULT_ARROWS_CAPACITY)
|
||||
#define init_arrows_with_capacity(arrows, capacity) \
|
||||
init_arrows_arr(arrows, capacity)
|
||||
|
||||
typedef struct colour colour_t;
|
||||
struct colour {
|
||||
union {
|
||||
u32 abgr;
|
||||
SDL_Color colour;
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct point point_t;
|
||||
struct point {
|
||||
i32 x;
|
||||
i32 y;
|
||||
};
|
||||
|
||||
typedef struct vec2 vec2_t;
|
||||
struct vec2 {
|
||||
i32 x;
|
||||
i32 y;
|
||||
};
|
||||
|
||||
typedef struct arrow arrow_t;
|
||||
struct arrow {
|
||||
point_t origin;
|
||||
vec2_t direction;
|
||||
};
|
||||
|
||||
typedef struct arrows arrows_t;
|
||||
struct arrows {
|
||||
arrow_t *lines;
|
||||
u64 count;
|
||||
u64 capacity;
|
||||
};
|
||||
|
||||
bool init_arrows_arr(arrows_t *lines, u64 capacity);
|
||||
void add_arrow(arrows_t *lines, arrow_t ln);
|
||||
void draw_arrows(SDL_Renderer *renderer, const arrows_t *arrows,
|
||||
colour_t colour);
|
||||
void draw_arrow(SDL_Renderer *renderer, const arrow_t *arrow, colour_t colour);
|
||||
|
||||
#endif // !DRAWING_H
|
||||
Reference in New Issue
Block a user