twn_lines.c: introduction with proper impl

This commit is contained in:
veclavtalica
2025-02-28 23:50:12 +03:00
parent 844283c2fb
commit e47b761a2c
8 changed files with 124 additions and 50 deletions

View File

@ -69,9 +69,12 @@ typedef struct SpritePrimitive {
bool repeat;
} SpritePrimitive;
/* batched in place */
typedef struct LinePrimitive {
Vec2 start;
Vec2 finish;
struct LineVertex {
Vec3 position;
Color color;
} *vertices;
float thickness;
Color color;
} LinePrimitive;
@ -97,7 +100,7 @@ typedef struct TextPrimitive {
typedef enum Primitive2DType {
PRIMITIVE_2D_SPRITE,
PRIMITIVE_2D_LINE,
PRIMITIVE_2D_LINES,
PRIMITIVE_2D_RECT,
PRIMITIVE_2D_CIRCLE,
PRIMITIVE_2D_TEXT,
@ -319,7 +322,7 @@ IndexBuffer get_circle_element_buffer(void);
void render_circle(const CirclePrimitive *circle);
void render_line(const LinePrimitive *line);
void render_lines(LinePrimitive *line);
void render_rectangle(const RectPrimitive *rectangle);