Fix bugs in cli

This commit is contained in:
nub31
2025-08-18 16:29:41 +02:00
parent b8c69b5583
commit 860e1fd0e4
4 changed files with 53 additions and 47 deletions

View File

@@ -1,34 +1,49 @@
// c
extern func puts(text: cstring)
interface Test
// raylib
extern func InitWindow(width: i32, height: i32, title: cstring)
extern func CloseWindow()
extern func WindowShouldClose(): bool
extern func BeginDrawing()
extern func EndDrawing()
extern func ClearBackground(color: Color)
extern func DrawCircle(centerX: i32, centerY: i32, radius: f32, color: Color)
struct Color
{
func print()
func test()
r: u8
g: u8
b: u8
a: u8
}
struct Human : Test
struct Vector2
{
name: cstring
x: f32
y: f32
}
func print()
{
puts(this.name)
}
func test()
{
puts("test")
}
struct Vector3
{
x: f32
y: f32
z: f32
}
func main(args: []cstring): i64
{
let human: Human = struct {
name = "oliver"
InitWindow(800, 600, "Hello from nub!")
while !WindowShouldClose()
{
BeginDrawing()
ClearBackground(struct { r = 55 g = 55 b = 55 a = 255 })
DrawCircle(400, 300, 50, struct { r = 255 g = 255 b = 0 a = 0 })
EndDrawing()
}
human.print()
human.test()
CloseWindow()
return 0
}