diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/ReadMe.md b/ReadMe.md old mode 100644 new mode 100755 index b5711ea..dae961b --- a/ReadMe.md +++ b/ReadMe.md @@ -1,6 +1,6 @@ # raylib-zig Manually tweaked, auto generated [raylib](https://github.com/raysan5/raylib) bindings for zig.
-Be aware these bindings are for the 2.5.0 release of raylib. 2.6.0 bindings will follow soon. +Bindings tested onn raylib version 2.6 ## Example Basically we can copy the default example with some minor changes: diff --git a/build.zig b/build.zig old mode 100644 new mode 100755 index e362ffa..06071c4 --- a/build.zig +++ b/build.zig @@ -72,9 +72,9 @@ pub fn build(b: *Builder) void const inputMouseWheelStep = b.step("input_mouse_wheel", "Mouse wheel input"); inputMouseWheelStep.dependOn(&runInputMouseWheel.step); - const runInputMouseWheel = inputMouseWheel.run(); - const inputMouseWheelStep = b.step("input_mouse_wheel", "Mouse wheel input"); - inputMouseWheelStep.dependOn(&runInputMouseWheel.step); + const runInputMultitouch = inputMultitouch.run(); + const inputMultitouchStep = b.step("input_multitouch", "Multitouch (duh)"); + inputMultitouchStep.dependOn(&runInputMultitouch.step); const run2DCamera = twoDCamera.run(); const twoDCameraStep = b.step("2d_camera", "Shows the functionality of a 2D camera"); diff --git a/examples/ReadMe.md b/examples/ReadMe.md old mode 100644 new mode 100755 diff --git a/examples/core/2d_camera.zig b/examples/core/2d_camera.zig old mode 100644 new mode 100755 diff --git a/examples/core/basic_window.zig b/examples/core/basic_window.zig old mode 100644 new mode 100755 diff --git a/examples/core/input_keys.zig b/examples/core/input_keys.zig old mode 100644 new mode 100755 diff --git a/examples/core/input_mouse.zig b/examples/core/input_mouse.zig old mode 100644 new mode 100755 diff --git a/examples/core/input_mouse_wheel.zig b/examples/core/input_mouse_wheel.zig old mode 100644 new mode 100755 diff --git a/examples/core/input_multitouch.zig b/examples/core/input_multitouch.zig old mode 100644 new mode 100755 index 072bf17..6068ef4 --- a/examples/core/input_multitouch.zig +++ b/examples/core/input_multitouch.zig @@ -19,7 +19,7 @@ pub fn main() anyerror!void var ballPosition = Vector2 { .x = -100.0, .y = -100.0 }; var ballColor = BEIGE; - var touchCounter: i32 = 0; + var touchCounter: f32 = 0; var touchPosition = Vector2 { .x = 0.0, .y = 0.0 }; SetTargetFPS(60); // Set our game to run at 60 frames-per-second @@ -34,15 +34,15 @@ pub fn main() anyerror!void ballColor = BEIGE; - if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON)) { ballColor = MAROON }; - if (IsMouseButtonDown(MouseButton.MOUSE_MIDDLE_BUTTON)) { ballColor = LIME }; - if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON)) { ballColor = DARKBLUE }; + if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON)) { ballColor = MAROON; } + if (IsMouseButtonDown(MouseButton.MOUSE_MIDDLE_BUTTON)) { ballColor = LIME; } + if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON)) { ballColor = DARKBLUE; } - if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON)) { touchCounter = 10 }; - if (IsMouseButtonPressed(MouseButton.MOUSE_MIDDLE_BUTTON)) { touchCounter = 10 }; - if (IsMouseButtonPressed(MouseButton.MOUSE_RIGHT_BUTTON)) { touchCounter = 10 }; + if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON)) { touchCounter = 10; } + if (IsMouseButtonPressed(MouseButton.MOUSE_MIDDLE_BUTTON)) { touchCounter = 10; } + if (IsMouseButtonPressed(MouseButton.MOUSE_RIGHT_BUTTON)) { touchCounter = 10; } - if (touchCounter > 0) { touchCounter -= 1; }; + if (touchCounter > 0) { touchCounter -= 1; } //---------------------------------------------------------------------------------- // Draw @@ -51,16 +51,17 @@ pub fn main() anyerror!void ClearBackground(RAYWHITE); - // Multitouch - for (int i = 0; i < MAX_TOUCH_POINTS; ++i) + const nums = [_]i32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + for (nums) |i| { touchPosition = GetTouchPosition(i); // Get the touch point - if ((touchPosition.x >= 0) && (touchPosition.y >= 0)) // Make sure point is not (-1,-1) as this means there is no touch for it + if ((touchPosition.x >= 0) and (touchPosition.y >= 0)) // Make sure point is not (-1,-1) as this means there is no touch for it { // Draw circle and touch index number - DrawCircleV(touchPosition, 34, ORANGE); - DrawText(FormatText("%d", i), touchPosition.x - 10, touchPosition.y - 70, 40, BLACK); + DrawCircle(@floatToInt(c_int, touchPosition.x), @floatToInt(c_int, touchPosition.y), 34, ORANGE); + //DrawCircleV(touchPosition, 34, ORANGE); + DrawText(FormatText(c"%d", i), @floatToInt(c_int, touchPosition.x) - 10, @floatToInt(c_int, touchPosition.y) - 70, 40, BLACK); } } diff --git a/examples/models/models_loading.zig b/examples/models/models_loading.zig old mode 100644 new mode 100755 diff --git a/lib/raylib-zig-math.zig b/lib/raylib-zig-math.zig old mode 100644 new mode 100755 diff --git a/lib/raylib-zig.zig b/lib/raylib-zig.zig old mode 100644 new mode 100755