diff --git a/lib/generate_functions.py b/lib/generate_functions.py index 0550abb..4e3dddd 100644 --- a/lib/generate_functions.py +++ b/lib/generate_functions.py @@ -1,5 +1,4 @@ import re -import sys """ Automatic utility for generating functions, including workaround functions @@ -16,6 +15,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": @@ -75,7 +76,7 @@ def parse_header(header_name: str, output_file: str, prefix: str): func_name = result.group(2) arguments = result.group(3) - # Igoring function here because: + # Ignoring function here because: # a) C va_args are supported in Zig but I if return_type in small_structs or return_type == "float3" or return_type == "float16": continue @@ -107,7 +108,6 @@ def parse_header(header_name: str, output_file: str, prefix: str): continue # If we find variable arguments in a workaround function - # if "..." in arguments: continue zig_arguments_w = [] # arguments for the workaround function head on the zig side diff --git a/lib/raylib-wa.zig b/lib/raylib-wa.zig index 2a67763..4e0a9df 100644 --- a/lib/raylib-wa.zig +++ b/lib/raylib-wa.zig @@ -50,7 +50,7 @@ pub extern fn GetCameraMatrix2D(camera: Camera2D) Matrix; 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 WColorToInt(color: [*c]const Color) int; pub extern fn SetConfigFlags(flags: c_uint) void; pub extern fn SetTraceLogLevel(logType: c_int) void; diff --git a/lib/raylib-zig-math.zig b/lib/raylib-zig-math.zig index e9ac14c..7b7a0b2 100755 --- a/lib/raylib-zig-math.zig +++ b/lib/raylib-zig-math.zig @@ -26,9 +26,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 WMatrixLookAt(eye: [*c]const Vector3, target: [*c]const Vector3, up: [*c]const Vector3) Matrix; pub extern fn WQuaternionLength(q: [*c]const Quaternion) float; pub extern fn WQuaternionToMatrix(q: [*c]const Quaternion) Matrix;