3d
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user