add line drawing
This commit is contained in:
@ -56,6 +56,13 @@ typedef struct SpritePrimitive {
|
||||
bool repeat;
|
||||
} SpritePrimitive;
|
||||
|
||||
typedef struct LinePrimitive {
|
||||
Vec2 start;
|
||||
Vec2 finish;
|
||||
float thickness;
|
||||
Color color;
|
||||
} LinePrimitive;
|
||||
|
||||
typedef struct RectPrimitive {
|
||||
Rect rect;
|
||||
Color color;
|
||||
@ -77,6 +84,7 @@ typedef struct TextPrimitive {
|
||||
|
||||
typedef enum Primitive2DType {
|
||||
PRIMITIVE_2D_SPRITE,
|
||||
PRIMITIVE_2D_LINE,
|
||||
PRIMITIVE_2D_RECT,
|
||||
PRIMITIVE_2D_CIRCLE,
|
||||
PRIMITIVE_2D_TEXT,
|
||||
@ -87,6 +95,7 @@ typedef struct Primitive2D {
|
||||
|
||||
union {
|
||||
SpritePrimitive sprite;
|
||||
LinePrimitive line;
|
||||
RectPrimitive rect;
|
||||
CirclePrimitive circle;
|
||||
TextPrimitive text;
|
||||
@ -288,6 +297,8 @@ VertexBuffer get_circle_element_buffer(void);
|
||||
|
||||
void render_circle(const CirclePrimitive *circle);
|
||||
|
||||
void render_line(const LinePrimitive *line);
|
||||
|
||||
void render_rectangle(const RectPrimitive *rectangle);
|
||||
|
||||
void finally_render_quads(Primitive2D const primitives[],
|
||||
|
Reference in New Issue
Block a user