From 3d19112b2a81828af7b8559dd9ff108eeed36bee Mon Sep 17 00:00:00 2001 From: Garrett Hale Date: Fri, 27 Nov 2020 15:17:50 -0600 Subject: [PATCH 1/3] macosx not in zig 0.7 build extern fn GetTime() uses f64 --- lib.zig | 2 +- lib/raylib-wa.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.zig b/lib.zig index 3de1e8c..4e853aa 100644 --- a/lib.zig +++ b/lib.zig @@ -29,7 +29,7 @@ pub fn Pkg(pkgdir: comptime []const u8) type { exe.addIncludeDir(pkgdir ++ "/raylib/src/external/glfw/deps/mingw"); exe.addCSourceFile(pkgdir ++ "/raylib/src/rglfw.c", raylibFlags); }, - .macosx => { + .macos => { std.debug.warn("Compiling raylib is unsupported on macOS. Please add '-Dsystem-raylib=true' to your build command to use your system raylib.\n", .{}); std.os.exit(1); }, diff --git a/lib/raylib-wa.zig b/lib/raylib-wa.zig index 170f9a4..8dff39b 100644 --- a/lib/raylib-wa.zig +++ b/lib/raylib-wa.zig @@ -55,7 +55,7 @@ pub extern fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) Vector2; pub extern fn SetTargetFPS(fps: c_int) void; pub extern fn GetFPS() c_int; pub extern fn GetFrameTime() f32; -pub extern fn GetTime() double; +pub extern fn GetTime() f64; pub extern fn ColorToInt(color: Color) c_int; pub extern fn ColorNormalize(color: Color) Vector4; pub extern fn ColorFromNormalized(normalized: Vector4) Color; From 813cdfe4f3cd35dc4d483228b6b7ecebbfb005bf Mon Sep 17 00:00:00 2001 From: Garrett Hale Date: Fri, 27 Nov 2020 17:51:59 -0600 Subject: [PATCH 2/3] set matrix math to use f64 instead of double --- lib/raylib-zig-math.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/raylib-zig-math.zig b/lib/raylib-zig-math.zig index c47b0ea..2d3f18e 100755 --- a/lib/raylib-zig-math.zig +++ b/lib/raylib-zig-math.zig @@ -58,9 +58,9 @@ pub extern fn MatrixRotateY(angle: f32) Matrix; pub extern fn MatrixRotateZ(angle: f32) Matrix; pub extern fn MatrixScale(x: f32, y: f32, z: f32) Matrix; pub extern fn MatrixMultiply(left: Matrix, right: Matrix) Matrix; -pub extern fn MatrixFrustum(left: double, right: double, bottom: double, top: double, near: double, far: double) Matrix; -pub extern fn MatrixPerspective(fovy: double, aspect: double, near: double, far: double) Matrix; -pub extern fn MatrixOrtho(left: double, right: double, bottom: double, top: double, near: double, far: double) Matrix; +pub extern fn MatrixFrustum(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix; +pub extern fn MatrixPerspective(fovy: f64, aspect: f64, near: f64, far: f64) Matrix; +pub extern fn MatrixOrtho(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix; pub extern fn MatrixLookAt(eye: Vector3, target: Vector3, up: Vector3) Matrix; pub extern fn MatrixToFloatV(mat: Matrix) float16; pub extern fn QuaternionIdentity() Quaternion; From c26f12bc9af55eab946337f59e777a3dc9e1bb9e Mon Sep 17 00:00:00 2001 From: Nikolas <32980656+Not-Nik@users.noreply.github.com> Date: Sun, 29 Nov 2020 11:34:01 +0100 Subject: [PATCH 3/3] Update generate_functions.py --- lib/generate_functions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/generate_functions.py b/lib/generate_functions.py index d31c9c3..4e965f5 100644 --- a/lib/generate_functions.py +++ b/lib/generate_functions.py @@ -13,6 +13,8 @@ def c_to_zig_type(t: str) -> str: t = t.replace("const ", "") if t == "float": t = "f32" + if t == "double": + t = "f64" if t == "int": t = "c_int" if t == "unsigned int":