diff --git a/.gitignore b/.gitignore index e6ee760..c42359d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ tests/ backup* start.bat __pycache__ -build/examples/arms_race \ No newline at end of file +build/examples/arms_race +raylib.py \ No newline at end of file diff --git a/build.bat b/build.bat index e81dba9..2d8bf99 100644 --- a/build.bat +++ b/build.bat @@ -5,5 +5,5 @@ bld --dont_compile_core cd build core_main.exe examples/game2d.core bld --dont_compile_core --link=vendor/raylib/windows/raylibdll.lib -rem a.exe +rem build\generated_main.exe cd .. diff --git a/build/examples/game2d.core b/build/examples/game2d.core index f69aebf..3cf4e02 100644 --- a/build/examples/game2d.core +++ b/build/examples/game2d.core @@ -61,6 +61,9 @@ Add :: (a: *Array($T), item: T) a.data = realloc(a.data, SizeOf(T) * a.cap->U64) a.data[a.len++] = item +Memes :: (a: S32, ...) + pass + main :: (): int guys: Array(Guy) Add(&guys, {pos = {100, 100}}) @@ -69,6 +72,7 @@ main :: (): int SetTargetFPS(60) for !WindowShouldClose() + Y := GetScreenHeight() g := guys.data if IsKeyDown(KEY_W);; g.pos.y -= 2 if IsKeyDown(KEY_S);; g.pos.y += 2 @@ -77,8 +81,10 @@ main :: (): int BeginDrawing() - ClearBackground({100}) + ClearBackground(RAYWHITE) + DrawFPS(0, 0) DrawText("Testing and stuff", 100, 100, 20, RAYWHITE) + DrawCube({0,0,0}, 10, 10, 10, BLACK) for i := 0, i < guys.len, i += 1 it := guys.data + i DrawCircleV(it.pos, 16, MAROON) diff --git a/build/modules/raylib.core b/build/modules/raylib.core index fc63d13..8c00da9 100644 --- a/build/modules/raylib.core +++ b/build/modules/raylib.core @@ -14,10 +14,13 @@ ClearBackground :: #foreign (color: Color) DrawCircle :: #foreign (centerX: int, centerY: int, radius: F32, color: Color) DrawCircleV :: #foreign (center: Vector2, radius: F32, color: Color) +DrawCube :: #foreign (position: Vector3, width: F32, height: F32, length: F32, color: Color) + DrawFPS :: #foreign (posX: int, posY: int) DrawText :: #foreign (text: *char, posX: int, posY: int, fontSize: int, color: Color) - +GetScreenWidth :: #foreign (): int +GetScreenHeight :: #foreign (): int IsKeyDown :: #foreign (key: int): Bool IsKeyPressed :: #foreign (key: int): Bool