This commit is contained in:
2026-08-03 21:11:00 +03:00
parent 8f596735e1
commit 06e41fc7da
33 changed files with 2180 additions and 356 deletions
+55
View File
@@ -0,0 +1,55 @@
package main
import rl "vendor:raylib"
Graphics :: union {
GfxNone,
GfxCircle,
GfxRect,
GfxRing,
GfxCircleLines,
GfxTexture,
}
GfxNone :: struct {}
GfxCircle :: struct {
pos: rl.Vector2,
radius: f32,
color: rl.Color,
}
GfxRect :: struct {
pos: rl.Vector2,
size: rl.Vector2,
color: rl.Color,
}
GfxRing :: struct {
pos: rl.Vector2,
inner_radius: f32,
outer_radius: f32,
color: rl.Color,
}
GfxCircleLines :: struct {
pos: rl.Vector2,
radius: f32,
color: rl.Color,
}
GfxTexture :: struct {
}
gfx_draw :: proc(pos: rl.Vector2, g: Graphics) {
#partial switch v in g {
case GfxCircle:
rl.DrawCircleV(pos + v.pos, v.radius, v.color)
case GfxRect:
rl.DrawRectangleV(pos - v.size / 2 + v.pos, v.size, v.color)
case GfxRing:
rl.DrawRing(pos + v.pos, v.inner_radius, v.outer_radius, 0, 360, 0, v.color)
case GfxCircleLines:
rl.DrawCircleLinesV(pos + v.pos, v.radius, v.color)
}
}