mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
Map C pointers to Zig and functions names use Zig naming conventions
This commit is contained in:
parent
c564af4f61
commit
e29e012981
@ -11,7 +11,7 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - 2d camera");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - 2d camera");
|
||||||
|
|
||||||
var player = rl.Rectangle{ .x = 400, .y = 280, .width = 40, .height = 40 };
|
var player = rl.Rectangle{ .x = 400, .y = 280, .width = 40, .height = 40 };
|
||||||
var buildings: [MAX_BUILDINGS]rl.Rectangle = undefined;
|
var buildings: [MAX_BUILDINGS]rl.Rectangle = undefined;
|
||||||
@ -20,14 +20,14 @@ pub fn main() anyerror!void {
|
|||||||
var spacing: i32 = 0;
|
var spacing: i32 = 0;
|
||||||
|
|
||||||
for (buildings) |_, i| {
|
for (buildings) |_, i| {
|
||||||
buildings[i].width = @intToFloat(f32, rl.GetRandomValue(50, 200));
|
buildings[i].width = @intToFloat(f32, rl.getRandomValue(50, 200));
|
||||||
buildings[i].height = @intToFloat(f32, rl.GetRandomValue(100, 800));
|
buildings[i].height = @intToFloat(f32, rl.getRandomValue(100, 800));
|
||||||
buildings[i].y = screenHeight - 130 - buildings[i].height;
|
buildings[i].y = screenHeight - 130 - buildings[i].height;
|
||||||
buildings[i].x = @intToFloat(f32, -6000 + spacing);
|
buildings[i].x = @intToFloat(f32, -6000 + spacing);
|
||||||
|
|
||||||
spacing += @floatToInt(i32, buildings[i].width);
|
spacing += @floatToInt(i32, buildings[i].width);
|
||||||
|
|
||||||
buildColors[i] = rl.Color.init(@intCast(u8, rl.GetRandomValue(200, 240)), @intCast(u8, rl.GetRandomValue(200, 240)), @intCast(u8, rl.GetRandomValue(200, 250)), 255);
|
buildColors[i] = rl.Color.init(@intCast(u8, rl.getRandomValue(200, 240)), @intCast(u8, rl.getRandomValue(200, 240)), @intCast(u8, rl.getRandomValue(200, 250)), 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
var camera = rl.Camera2D{
|
var camera = rl.Camera2D{
|
||||||
@ -37,18 +37,18 @@ pub fn main() anyerror!void {
|
|||||||
.zoom = 1,
|
.zoom = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Player movement
|
// Player movement
|
||||||
if (rl.IsKeyDown(rl.KeyboardKey.KEY_RIGHT)) {
|
if (rl.isKeyDown(rl.KeyboardKey.KEY_RIGHT)) {
|
||||||
player.x += 2;
|
player.x += 2;
|
||||||
} else if (rl.IsKeyDown(rl.KeyboardKey.KEY_LEFT)) {
|
} else if (rl.isKeyDown(rl.KeyboardKey.KEY_LEFT)) {
|
||||||
player.x -= 2;
|
player.x -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,22 +56,22 @@ pub fn main() anyerror!void {
|
|||||||
camera.target = rl.Vector2.init(player.x + 20, player.y + 20);
|
camera.target = rl.Vector2.init(player.x + 20, player.y + 20);
|
||||||
|
|
||||||
// Camera rotation controls
|
// Camera rotation controls
|
||||||
if (rl.IsKeyDown(rl.KeyboardKey.KEY_A)) {
|
if (rl.isKeyDown(rl.KeyboardKey.KEY_A)) {
|
||||||
camera.rotation -= 1;
|
camera.rotation -= 1;
|
||||||
} else if (rl.IsKeyDown(rl.KeyboardKey.KEY_S)) {
|
} else if (rl.isKeyDown(rl.KeyboardKey.KEY_S)) {
|
||||||
camera.rotation += 1;
|
camera.rotation += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit camera rotation to 80 degrees (-40 to 40)
|
// Limit camera rotation to 80 degrees (-40 to 40)
|
||||||
camera.rotation = rlm.Clamp(camera.rotation, -40, 40);
|
camera.rotation = rlm.clamp(camera.rotation, -40, 40);
|
||||||
|
|
||||||
// Camera zoom controls
|
// Camera zoom controls
|
||||||
camera.zoom += rl.GetMouseWheelMove() * 0.05;
|
camera.zoom += rl.getMouseWheelMove() * 0.05;
|
||||||
|
|
||||||
camera.zoom = rlm.Clamp(camera.zoom, 0.1, 3.0);
|
camera.zoom = rlm.clamp(camera.zoom, 0.1, 3.0);
|
||||||
|
|
||||||
// Camera reset (zoom and rotation)
|
// Camera reset (zoom and rotation)
|
||||||
if (rl.IsKeyPressed(rl.KeyboardKey.KEY_R)) {
|
if (rl.isKeyPressed(rl.KeyboardKey.KEY_R)) {
|
||||||
camera.zoom = 1.0;
|
camera.zoom = 1.0;
|
||||||
camera.rotation = 0.0;
|
camera.rotation = 0.0;
|
||||||
}
|
}
|
||||||
@ -79,47 +79,47 @@ pub fn main() anyerror!void {
|
|||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
camera.begin();
|
camera.begin();
|
||||||
|
|
||||||
rl.DrawRectangle(-6000, 320, 13000, 8000, rl.Color.DARKGRAY);
|
rl.drawRectangle(-6000, 320, 13000, 8000, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
for (buildings) |building, i| {
|
for (buildings) |building, i| {
|
||||||
rl.DrawRectangleRec(building, buildColors[i]);
|
rl.drawRectangleRec(building, buildColors[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl.DrawRectangleRec(player, rl.Color.RED);
|
rl.drawRectangleRec(player, rl.Color.RED);
|
||||||
|
|
||||||
rl.DrawLine(@floatToInt(c_int, camera.target.x), -screenHeight * 10, @floatToInt(c_int, camera.target.x), screenHeight * 10, rl.Color.GREEN);
|
rl.drawLine(@floatToInt(c_int, camera.target.x), -screenHeight * 10, @floatToInt(c_int, camera.target.x), screenHeight * 10, rl.Color.GREEN);
|
||||||
rl.DrawLine(-screenWidth * 10, @floatToInt(c_int, camera.target.y), screenWidth * 10, @floatToInt(c_int, camera.target.y), rl.Color.GREEN);
|
rl.drawLine(-screenWidth * 10, @floatToInt(c_int, camera.target.y), screenWidth * 10, @floatToInt(c_int, camera.target.y), rl.Color.GREEN);
|
||||||
|
|
||||||
camera.end();
|
camera.end();
|
||||||
|
|
||||||
rl.DrawText("SCREEN AREA", 640, 10, 20, rl.Color.RED);
|
rl.drawText("SCREEN AREA", 640, 10, 20, rl.Color.RED);
|
||||||
|
|
||||||
rl.DrawRectangle(0, 0, screenWidth, 5, rl.Color.RED);
|
rl.drawRectangle(0, 0, screenWidth, 5, rl.Color.RED);
|
||||||
rl.DrawRectangle(0, 5, 5, screenHeight - 10, rl.Color.RED);
|
rl.drawRectangle(0, 5, 5, screenHeight - 10, rl.Color.RED);
|
||||||
rl.DrawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, rl.Color.RED);
|
rl.drawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, rl.Color.RED);
|
||||||
rl.DrawRectangle(0, screenHeight - 5, screenWidth, 5, rl.Color.RED);
|
rl.drawRectangle(0, screenHeight - 5, screenWidth, 5, rl.Color.RED);
|
||||||
|
|
||||||
rl.DrawRectangle(10, 10, 250, 113, rl.Fade(rl.Color.SKYBLUE, 0.5));
|
rl.drawRectangle(10, 10, 250, 113, rl.fade(rl.Color.SKYBLUE, 0.5));
|
||||||
rl.DrawRectangleLines(10, 10, 250, 113, rl.Color.BLUE);
|
rl.drawRectangleLines(10, 10, 250, 113, rl.Color.BLUE);
|
||||||
|
|
||||||
rl.DrawText("Free 2d camera controls:", 20, 20, 10, rl.Color.BLACK);
|
rl.drawText("Free 2d camera controls:", 20, 20, 10, rl.Color.BLACK);
|
||||||
rl.DrawText("- Right/Left to move Offset", 40, 40, 10, rl.Color.DARKGRAY);
|
rl.drawText("- Right/Left to move Offset", 40, 40, 10, rl.Color.DARKGRAY);
|
||||||
rl.DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, rl.Color.DARKGRAY);
|
rl.drawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, rl.Color.DARKGRAY);
|
||||||
rl.DrawText("- A / S to Rotate", 40, 80, 10, rl.Color.DARKGRAY);
|
rl.drawText("- A / S to Rotate", 40, 80, 10, rl.Color.DARKGRAY);
|
||||||
rl.DrawText("- R to reset Zoom and Rotation", 40, 100, 10, rl.Color.DARKGRAY);
|
rl.drawText("- R to reset Zoom and Rotation", 40, 100, 10, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// raylib-zig (c) Nikolas Wipper 2023
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
const rl = @import("raylib");
|
const rl = @import("raylib");
|
||||||
const rlm = @import("raylib-math");
|
|
||||||
|
|
||||||
const MAX_COLUMNS = 20;
|
const MAX_COLUMNS = 20;
|
||||||
|
|
||||||
@ -11,7 +10,7 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - 3d camera first person");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - 3d camera first person");
|
||||||
|
|
||||||
var camera = rl.Camera3D{
|
var camera = rl.Camera3D{
|
||||||
.position = rl.Vector3.init(4, 2, 4),
|
.position = rl.Vector3.init(4, 2, 4),
|
||||||
@ -26,18 +25,18 @@ pub fn main() anyerror!void {
|
|||||||
var colors: [MAX_COLUMNS]rl.Color = undefined;
|
var colors: [MAX_COLUMNS]rl.Color = undefined;
|
||||||
|
|
||||||
for (heights) |_, i| {
|
for (heights) |_, i| {
|
||||||
heights[i] = @intToFloat(f32, rl.GetRandomValue(1, 12));
|
heights[i] = @intToFloat(f32, rl.getRandomValue(1, 12));
|
||||||
positions[i] = rl.Vector3.init(@intToFloat(f32, rl.GetRandomValue(-15, 15)), heights[i] / 2.0, @intToFloat(f32, rl.GetRandomValue(-15, 15)));
|
positions[i] = rl.Vector3.init(@intToFloat(f32, rl.getRandomValue(-15, 15)), heights[i] / 2.0, @intToFloat(f32, rl.getRandomValue(-15, 15)));
|
||||||
colors[i] = rl.Color.init(@intCast(u8, rl.GetRandomValue(20, 255)), @intCast(u8, rl.GetRandomValue(10, 55)), 30, 255);
|
colors[i] = rl.Color.init(@intCast(u8, rl.getRandomValue(20, 255)), @intCast(u8, rl.getRandomValue(10, 55)), 30, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
camera.setMode(rl.CameraMode.CAMERA_FIRST_PERSON);
|
camera.setMode(rl.CameraMode.CAMERA_FIRST_PERSON);
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
camera.update();
|
camera.update();
|
||||||
@ -45,39 +44,39 @@ pub fn main() anyerror!void {
|
|||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
camera.begin();
|
camera.begin();
|
||||||
|
|
||||||
// Draw ground
|
// Draw ground
|
||||||
rl.DrawPlane(rl.Vector3.init(0, 0, 0), rl.Vector2.init(32, 32), rl.Color.LIGHTGRAY);
|
rl.drawPlane(rl.Vector3.init(0, 0, 0), rl.Vector2.init(32, 32), rl.Color.LIGHTGRAY);
|
||||||
rl.DrawCube(rl.Vector3.init(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.Color.BLUE); // Draw a blue wall
|
rl.drawCube(rl.Vector3.init(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.Color.BLUE); // Draw a blue wall
|
||||||
rl.DrawCube(rl.Vector3.init(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.Color.LIME); // Draw a green wall
|
rl.drawCube(rl.Vector3.init(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.Color.LIME); // Draw a green wall
|
||||||
rl.DrawCube(rl.Vector3.init(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, rl.Color.GOLD); // Draw a yellow wall
|
rl.drawCube(rl.Vector3.init(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, rl.Color.GOLD); // Draw a yellow wall
|
||||||
|
|
||||||
// Draw some cubes around
|
// Draw some cubes around
|
||||||
for (heights) |height, i| {
|
for (heights) |height, i| {
|
||||||
rl.DrawCube(positions[i], 2.0, height, 2.0, colors[i]);
|
rl.drawCube(positions[i], 2.0, height, 2.0, colors[i]);
|
||||||
rl.DrawCubeWires(positions[i], 2.0, height, 2.0, rl.Color.MAROON);
|
rl.drawCubeWires(positions[i], 2.0, height, 2.0, rl.Color.MAROON);
|
||||||
}
|
}
|
||||||
|
|
||||||
camera.end();
|
camera.end();
|
||||||
|
|
||||||
rl.DrawRectangle(10, 10, 220, 70, rl.Fade(rl.Color.SKYBLUE, 0.5));
|
rl.drawRectangle(10, 10, 220, 70, rl.fade(rl.Color.SKYBLUE, 0.5));
|
||||||
rl.DrawRectangleLines(10, 10, 220, 70, rl.Color.BLUE);
|
rl.drawRectangleLines(10, 10, 220, 70, rl.Color.BLUE);
|
||||||
|
|
||||||
rl.DrawText("First person camera default controls:", 20, 20, 10, rl.Color.BLACK);
|
rl.drawText("First person camera default controls:", 20, 20, 10, rl.Color.BLACK);
|
||||||
rl.DrawText("- Move with keys: W, A, S, D", 40, 40, 10, rl.Color.DARKGRAY);
|
rl.drawText("- Move with keys: W, A, S, D", 40, 40, 10, rl.Color.DARKGRAY);
|
||||||
rl.DrawText("- Mouse move to look around", 40, 60, 10, rl.Color.DARKGRAY);
|
rl.drawText("- Mouse move to look around", 40, 60, 10, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,13 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// TODO: Update your variables here
|
// TODO: Update your variables here
|
||||||
@ -22,18 +22,18 @@ pub fn main() anyerror!void {
|
|||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.WHITE);
|
rl.clearBackground(rl.Color.WHITE);
|
||||||
|
|
||||||
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.Color.LIGHTGRAY);
|
rl.drawText("Congrats! You created your first window!", 190, 200, 20, rl.Color.LIGHTGRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -8,48 +8,48 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - keyboard input");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - keyboard input");
|
||||||
|
|
||||||
var ballPosition = rl.Vector2.init(screenWidth / 2, screenHeight / 2);
|
var ballPosition = rl.Vector2.init(screenWidth / 2, screenHeight / 2);
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
if (rl.IsKeyDown(rl.KeyboardKey.KEY_RIGHT)) {
|
if (rl.isKeyDown(rl.KeyboardKey.KEY_RIGHT)) {
|
||||||
ballPosition.x += 2.0;
|
ballPosition.x += 2.0;
|
||||||
}
|
}
|
||||||
if (rl.IsKeyDown(rl.KeyboardKey.KEY_LEFT)) {
|
if (rl.isKeyDown(rl.KeyboardKey.KEY_LEFT)) {
|
||||||
ballPosition.x -= 2.0;
|
ballPosition.x -= 2.0;
|
||||||
}
|
}
|
||||||
if (rl.IsKeyDown(rl.KeyboardKey.KEY_UP)) {
|
if (rl.isKeyDown(rl.KeyboardKey.KEY_UP)) {
|
||||||
ballPosition.y -= 2.0;
|
ballPosition.y -= 2.0;
|
||||||
}
|
}
|
||||||
if (rl.IsKeyDown(rl.KeyboardKey.KEY_DOWN)) {
|
if (rl.isKeyDown(rl.KeyboardKey.KEY_DOWN)) {
|
||||||
ballPosition.y += 2.0;
|
ballPosition.y += 2.0;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
rl.DrawText("move the ball with arrow keys", 10, 10, 20, rl.Color.DARKGRAY);
|
rl.drawText("move the ball with arrow keys", 10, 10, 20, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
rl.DrawCircleV(ballPosition, 50, rl.Color.MAROON);
|
rl.drawCircleV(ballPosition, 50, rl.Color.MAROON);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -8,48 +8,48 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - mouse input");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - mouse input");
|
||||||
|
|
||||||
var ballPosition = rl.Vector2.init(-100, -100);
|
var ballPosition = rl.Vector2.init(-100, -100);
|
||||||
var ballColor = rl.Color.DARKBLUE;
|
var ballColor = rl.Color.DARKBLUE;
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
ballPosition = rl.GetMousePosition();
|
ballPosition = rl.getMousePosition();
|
||||||
ballPosition.x = @intToFloat(f32, rl.GetMouseX());
|
ballPosition.x = @intToFloat(f32, rl.getMouseX());
|
||||||
ballPosition.y = @intToFloat(f32, rl.GetMouseY());
|
ballPosition.y = @intToFloat(f32, rl.getMouseY());
|
||||||
|
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
||||||
ballColor = rl.Color.MAROON;
|
ballColor = rl.Color.MAROON;
|
||||||
} else if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
} else if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
||||||
ballColor = rl.Color.LIME;
|
ballColor = rl.Color.LIME;
|
||||||
} else if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
} else if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
||||||
ballColor = rl.Color.DARKBLUE;
|
ballColor = rl.Color.DARKBLUE;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
rl.DrawCircle(@floatToInt(c_int, ballPosition.x), @floatToInt(c_int, ballPosition.y), 50, ballColor);
|
rl.drawCircle(@floatToInt(c_int, ballPosition.x), @floatToInt(c_int, ballPosition.y), 50, ballColor);
|
||||||
//DrawCircleV(ballPosition, 40, ballColor);
|
//DrawCircleV(ballPosition, 40, ballColor);
|
||||||
|
|
||||||
rl.DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.DARKGRAY);
|
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -8,38 +8,38 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
||||||
|
|
||||||
var boxPositionY: f32 = screenHeight / 2 - 40;
|
var boxPositionY: f32 = screenHeight / 2 - 40;
|
||||||
var scrollSpeed: f32 = 4; // Scrolling speed in pixels
|
var scrollSpeed: f32 = 4; // Scrolling speed in pixels
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
boxPositionY -= (rl.GetMouseWheelMove() * scrollSpeed);
|
boxPositionY -= (rl.getMouseWheelMove() * scrollSpeed);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.WHITE);
|
rl.clearBackground(rl.Color.WHITE);
|
||||||
|
|
||||||
rl.DrawRectangle(screenWidth / 2 - 40, @floatToInt(c_int, boxPositionY), 80, 80, rl.Color.MAROON);
|
rl.drawRectangle(screenWidth / 2 - 40, @floatToInt(c_int, boxPositionY), 80, 80, rl.Color.MAROON);
|
||||||
|
|
||||||
rl.DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, rl.Color.GRAY);
|
rl.drawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, rl.Color.GRAY);
|
||||||
rl.DrawText(rl.TextFormat("Box position Y: %03i", @floatToInt(c_int, boxPositionY)), 10, 40, 20, rl.Color.LIGHTGRAY);
|
//rl.drawText(rl.textFormat("Box position Y: %03i", .{@floatToInt(c_int, boxPositionY)}), 10, 40, 20, rl.Color.LIGHTGRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
||||||
|
|
||||||
var ballPosition = rl.Vector2.init(-100, -100);
|
var ballPosition = rl.Vector2.init(-100, -100);
|
||||||
var ballColor = rl.Color.BEIGE;
|
var ballColor = rl.Color.BEIGE;
|
||||||
@ -16,34 +16,34 @@ pub fn main() anyerror!void {
|
|||||||
var touchCounter: f32 = 0;
|
var touchCounter: f32 = 0;
|
||||||
var touchPosition = rl.Vector2.init(0, 0);
|
var touchPosition = rl.Vector2.init(0, 0);
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
ballPosition = rl.GetMousePosition();
|
ballPosition = rl.getMousePosition();
|
||||||
|
|
||||||
ballColor = rl.Color.BEIGE;
|
ballColor = rl.Color.BEIGE;
|
||||||
|
|
||||||
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
if (rl.isMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
||||||
ballColor = rl.Color.MAROON;
|
ballColor = rl.Color.MAROON;
|
||||||
}
|
}
|
||||||
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
if (rl.isMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
||||||
ballColor = rl.Color.LIME;
|
ballColor = rl.Color.LIME;
|
||||||
}
|
}
|
||||||
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
if (rl.isMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
||||||
ballColor = rl.Color.DARKBLUE;
|
ballColor = rl.Color.DARKBLUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) {
|
||||||
touchCounter = 10;
|
touchCounter = 10;
|
||||||
}
|
}
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) {
|
||||||
touchCounter = 10;
|
touchCounter = 10;
|
||||||
}
|
}
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
if (rl.isMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) {
|
||||||
touchCounter = 10;
|
touchCounter = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,35 +54,35 @@ pub fn main() anyerror!void {
|
|||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
const nums = [_]i32{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
const nums = [_]i32{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||||
for (nums) |i| {
|
for (nums) |i| {
|
||||||
touchPosition = rl.GetTouchPosition(i); // Get the touch point
|
touchPosition = rl.getTouchPosition(i); // Get the touch point
|
||||||
|
|
||||||
// Make sure point is not (-1,-1) as this means there is no touch for it
|
// Make sure point is not (-1,-1) as this means there is no touch for it
|
||||||
if ((touchPosition.x >= 0) and (touchPosition.y >= 0)) {
|
if ((touchPosition.x >= 0) and (touchPosition.y >= 0)) {
|
||||||
|
|
||||||
// Draw circle and touch index number
|
// Draw circle and touch index number
|
||||||
rl.DrawCircleV(touchPosition, 34, rl.Color.ORANGE);
|
rl.drawCircleV(touchPosition, 34, rl.Color.ORANGE);
|
||||||
rl.DrawText(rl.TextFormat("%d", i), @floatToInt(c_int, touchPosition.x) - 10, @floatToInt(c_int, touchPosition.y) - 70, 40, rl.Color.BLACK);
|
//rl.drawText(rl.textFormat("%d", .{i}), @floatToInt(c_int, touchPosition.x) - 10, @floatToInt(c_int, touchPosition.y) - 70, 40, rl.Color.BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the normal mouse location
|
// Draw the normal mouse location
|
||||||
rl.DrawCircleV(ballPosition, 30 + (touchCounter * 3), ballColor);
|
rl.drawCircleV(ballPosition, 30 + (touchCounter * 3), ballColor);
|
||||||
|
|
||||||
rl.DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.DARKGRAY);
|
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.DARKGRAY);
|
||||||
rl.DrawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, rl.Color.DARKGRAY);
|
rl.drawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -12,67 +12,67 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Apply an outline to a texture");
|
rl.initWindow(screenWidth, screenHeight, "raylib [shaders] example - Apply an outline to a texture");
|
||||||
|
|
||||||
const texture: rl.Texture2D = rl.LoadTexture("resources/textures/fudesumi.png");
|
const texture: rl.Texture2D = rl.loadTexture("resources/textures/fudesumi.png");
|
||||||
|
|
||||||
const shdrOutline: rl.Shader = rl.LoadShader(0, rl.TextFormat("resources/shaders/glsl330/outline.fs", @intCast(c_int, 330)));
|
const shdrOutline: rl.Shader = rl.loadShader(null, "resources/shaders/glsl330/outline.fs");
|
||||||
|
|
||||||
var outlineSize: f32 = 2.0;
|
var outlineSize: f32 = 2.0;
|
||||||
const outlineColor = [4]f32{ 1.0, 0.0, 0.0, 1.0 }; // Normalized RED color
|
const outlineColor = [4]f32{ 1.0, 0.0, 0.0, 1.0 }; // Normalized RED color
|
||||||
const textureSize = rl.Vector2.init(@intToFloat(f32, texture.width), @intToFloat(f32, texture.height));
|
const textureSize = rl.Vector2.init(@intToFloat(f32, texture.width), @intToFloat(f32, texture.height));
|
||||||
|
|
||||||
// Get shader locations
|
// Get shader locations
|
||||||
const outlineSizeLoc = rl.GetShaderLocation(shdrOutline, "outlineSize");
|
const outlineSizeLoc = rl.getShaderLocation(shdrOutline, "outlineSize");
|
||||||
const outlineColorLoc = rl.GetShaderLocation(shdrOutline, "outlineColor");
|
const outlineColorLoc = rl.getShaderLocation(shdrOutline, "outlineColor");
|
||||||
const textureSizeLoc = rl.GetShaderLocation(shdrOutline, "textureSize");
|
const textureSizeLoc = rl.getShaderLocation(shdrOutline, "textureSize");
|
||||||
|
|
||||||
// Set shader values (they can be changed later)
|
// Set shader values (they can be changed later)
|
||||||
rl.SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_FLOAT));
|
rl.setShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_FLOAT));
|
||||||
rl.SetShaderValue(shdrOutline, outlineColorLoc, &outlineColor, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_VEC4));
|
rl.setShaderValue(shdrOutline, outlineColorLoc, &outlineColor, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_VEC4));
|
||||||
rl.SetShaderValue(shdrOutline, textureSizeLoc, &textureSize, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_VEC2));
|
rl.setShaderValue(shdrOutline, textureSizeLoc, &textureSize, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_VEC2));
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
outlineSize += rl.GetMouseWheelMove();
|
outlineSize += rl.getMouseWheelMove();
|
||||||
if (outlineSize < 1.0) outlineSize = 1.0;
|
if (outlineSize < 1.0) outlineSize = 1.0;
|
||||||
|
|
||||||
rl.SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_FLOAT));
|
rl.setShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, @enumToInt(rl.ShaderUniformDataType.SHADER_UNIFORM_FLOAT));
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
rl.BeginShaderMode(shdrOutline);
|
rl.beginShaderMode(shdrOutline);
|
||||||
|
|
||||||
rl.DrawTexture(texture, @divFloor(rl.GetScreenWidth(), 2) - @divFloor(texture.width, 2), -30, rl.Color.WHITE);
|
rl.drawTexture(texture, @divFloor(rl.getScreenWidth(), 2) - @divFloor(texture.width, 2), -30, rl.Color.WHITE);
|
||||||
|
|
||||||
rl.EndShaderMode();
|
rl.endShaderMode();
|
||||||
|
|
||||||
rl.DrawText("Shader-based\ntexture\noutline", 10, 10, 20, rl.Color.GRAY);
|
rl.drawText("Shader-based\ntexture\noutline", 10, 10, 20, rl.Color.GRAY);
|
||||||
|
|
||||||
rl.DrawText(rl.TextFormat("Outline size: %i px", @floatToInt(i32, outlineSize)), 10, 120, 20, rl.Color.MAROON);
|
//rl.drawText(rl.textFormat("Outline size: %i px", @floatToInt(i32, outlineSize)), 10, 120, 20, rl.Color.MAROON);
|
||||||
|
|
||||||
rl.DrawFPS(710, 10);
|
rl.drawFPS(710, 10);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.UnloadTexture(texture);
|
rl.unloadTexture(texture);
|
||||||
rl.UnloadShader(shdrOutline);
|
rl.unloadShader(shdrOutline);
|
||||||
|
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,11 @@ pub fn main() anyerror!void {
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
rl.InitAudioDevice(); // Initialize audio device
|
rl.initAudioDevice(); // Initialize audio device
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylib [texture] example - sprite anim");
|
rl.initWindow(screenWidth, screenHeight, "raylib [texture] example - sprite anim");
|
||||||
|
|
||||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
const scarfy: rl.Texture2D = rl.LoadTexture("resources/textures/scarfy.png"); // Texture loading
|
const scarfy: rl.Texture2D = rl.loadTexture("resources/textures/scarfy.png"); // Texture loading
|
||||||
|
|
||||||
const position = rl.Vector2.init(350.0, 280.0);
|
const position = rl.Vector2.init(350.0, 280.0);
|
||||||
var frameRec = rl.Rectangle{ .x = 0.0, .y = 0.0, .width = @intToFloat(f32, @divFloor(scarfy.width, 6)), .height = @intToFloat(f32, scarfy.height) };
|
var frameRec = rl.Rectangle{ .x = 0.0, .y = 0.0, .width = @intToFloat(f32, @divFloor(scarfy.width, 6)), .height = @intToFloat(f32, scarfy.height) };
|
||||||
@ -25,11 +25,11 @@ pub fn main() anyerror!void {
|
|||||||
var framesCounter: u8 = 0;
|
var framesCounter: u8 = 0;
|
||||||
var framesSpeed: u8 = 8; // Number of spritesheet frames shown by second
|
var framesSpeed: u8 = 8; // Number of spritesheet frames shown by second
|
||||||
|
|
||||||
rl.SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
while (!rl.WindowShouldClose()) { // Detect window close button or ESC key
|
while (!rl.windowShouldClose()) { // Detect window close button or ESC key
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
framesCounter += 1;
|
framesCounter += 1;
|
||||||
@ -44,9 +44,9 @@ pub fn main() anyerror!void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Control frames speed
|
// Control frames speed
|
||||||
if (rl.IsKeyPressed(rl.KeyboardKey.KEY_RIGHT)) {
|
if (rl.isKeyPressed(rl.KeyboardKey.KEY_RIGHT)) {
|
||||||
framesSpeed += 1;
|
framesSpeed += 1;
|
||||||
} else if (rl.IsKeyPressed(rl.KeyboardKey.KEY_LEFT)) {
|
} else if (rl.isKeyPressed(rl.KeyboardKey.KEY_LEFT)) {
|
||||||
framesSpeed -= 1;
|
framesSpeed -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,37 +60,37 @@ pub fn main() anyerror!void {
|
|||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
rl.BeginDrawing();
|
rl.beginDrawing();
|
||||||
|
|
||||||
rl.ClearBackground(rl.Color.RAYWHITE);
|
rl.clearBackground(rl.Color.RAYWHITE);
|
||||||
|
|
||||||
rl.DrawTexture(scarfy, 15, 40, rl.Color.WHITE);
|
rl.drawTexture(scarfy, 15, 40, rl.Color.WHITE);
|
||||||
rl.DrawRectangleLines(15, 40, scarfy.width, scarfy.height, rl.Color.LIME);
|
rl.drawRectangleLines(15, 40, scarfy.width, scarfy.height, rl.Color.LIME);
|
||||||
rl.DrawRectangleLines(15 + @floatToInt(i32, frameRec.x), 40 + @floatToInt(i32, frameRec.y), @floatToInt(i32, frameRec.width), @floatToInt(i32, frameRec.height), rl.Color.RED);
|
rl.drawRectangleLines(15 + @floatToInt(i32, frameRec.x), 40 + @floatToInt(i32, frameRec.y), @floatToInt(i32, frameRec.width), @floatToInt(i32, frameRec.height), rl.Color.RED);
|
||||||
|
|
||||||
rl.DrawText("FRAME SPEED: ", 165, 210, 10, rl.Color.DARKGRAY);
|
rl.drawText("FRAME SPEED: ", 165, 210, 10, rl.Color.DARKGRAY);
|
||||||
rl.DrawText(rl.TextFormat("%02i FPS", framesSpeed), 575, 210, 10, rl.Color.DARKGRAY);
|
//rl.drawText(rl.textFormat("%02i FPS", .{framesSpeed}), 575, 210, 10, rl.Color.DARKGRAY);
|
||||||
rl.DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, rl.Color.DARKGRAY);
|
rl.drawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, rl.Color.DARKGRAY);
|
||||||
|
|
||||||
for ([_]u32{0} ** MAX_FRAME_SPEED) |_, i| {
|
for ([_]u32{0} ** MAX_FRAME_SPEED) |_, i| {
|
||||||
if (i < framesSpeed) {
|
if (i < framesSpeed) {
|
||||||
rl.DrawRectangle(250 + 21 * @intCast(c_int, i), 205, 20, 20, rl.Color.RED);
|
rl.drawRectangle(250 + 21 * @intCast(c_int, i), 205, 20, 20, rl.Color.RED);
|
||||||
}
|
}
|
||||||
rl.DrawRectangleLines(250 + 21 * @intCast(c_int, i), 205, 20, 20, rl.Color.MAROON);
|
rl.drawRectangleLines(250 + 21 * @intCast(c_int, i), 205, 20, 20, rl.Color.MAROON);
|
||||||
}
|
}
|
||||||
|
|
||||||
rl.DrawTextureRec(scarfy, frameRec, position, rl.Color.WHITE); // Draw part of the texture
|
rl.drawTextureRec(scarfy, frameRec, position, rl.Color.WHITE); // Draw part of the texture
|
||||||
|
|
||||||
rl.DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, rl.Color.GRAY);
|
rl.drawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, rl.Color.GRAY);
|
||||||
|
|
||||||
rl.EndDrawing();
|
rl.endDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
rl.UnloadTexture(scarfy); // Texture unloading
|
rl.unloadTexture(scarfy); // Texture unloading
|
||||||
|
|
||||||
rl.CloseWindow(); // Close window and OpenGL context
|
rl.closeWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,12 @@ C_TO_ZIG = {
|
|||||||
"unsigned int": "c_uint",
|
"unsigned int": "c_uint",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZIGGIFY = {
|
||||||
|
"c_int": "i32",
|
||||||
|
"c_long": "i64",
|
||||||
|
"c_uint": "u32"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Some c types have a different sizes on different systems
|
# Some c types have a different sizes on different systems
|
||||||
# and zig knows that so we tell it to get the system specific size for us
|
# and zig knows that so we tell it to get the system specific size for us
|
||||||
@ -29,6 +35,51 @@ def c_to_zig_type(c: str) -> str:
|
|||||||
return const + c
|
return const + c
|
||||||
|
|
||||||
|
|
||||||
|
def ziggify_type(name: str, t: str) -> str:
|
||||||
|
NO_STRINGS = ["data", "fileData", "compData"]
|
||||||
|
|
||||||
|
single = ["value", "ptr", "bytesRead", "compDataSize", "dataSize", "outputSize", "camera", "collisionPoint", "image", "colorCount", "dst", "texture", "srcPtr", "dstPtr", "count", "codepointSize", "utf8Size", "position", "mesh", "materialCount", "material", "model", "animCount", "wave", "v1", "v2", "outAxis", "outAngle"]
|
||||||
|
multi = ["data", "compData", "points", "frames", "fileData", "colors", "pixels", "fontChars", "chars", "recs", "codepoints", "textList", "transforms", "animations", "samples"]
|
||||||
|
|
||||||
|
if t.startswith("[*c]") and name not in single and name not in multi:
|
||||||
|
if (t == "[*c]const u8" or t == "[*c]u8") and name not in NO_STRINGS: # strings are multis
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise ValueError(f"{t} {name} not classified")
|
||||||
|
|
||||||
|
pre = ""
|
||||||
|
while t.startswith("[*c]"):
|
||||||
|
t = t[4:]
|
||||||
|
if name in single:
|
||||||
|
pre += "*"
|
||||||
|
else:
|
||||||
|
pre += "[]"
|
||||||
|
|
||||||
|
if t in ZIGGIFY:
|
||||||
|
t = ZIGGIFY[t]
|
||||||
|
|
||||||
|
return pre + t
|
||||||
|
|
||||||
|
|
||||||
|
def add_namespace_to_type(t: str) -> str:
|
||||||
|
pre = ""
|
||||||
|
while t.startswith("[*c]"):
|
||||||
|
t = t[4:]
|
||||||
|
pre += "[*c]"
|
||||||
|
|
||||||
|
if t.startswith("const "):
|
||||||
|
t = t[6:]
|
||||||
|
pre += "const "
|
||||||
|
|
||||||
|
if t[0].isupper():
|
||||||
|
t = "rl." + t
|
||||||
|
|
||||||
|
if t in ["float3", "float16"]:
|
||||||
|
t = "rlm." + t
|
||||||
|
|
||||||
|
return pre + t
|
||||||
|
|
||||||
|
|
||||||
def fix_pointer(name: str, t: str):
|
def fix_pointer(name: str, t: str):
|
||||||
pre = ""
|
pre = ""
|
||||||
while name.startswith("*"):
|
while name.startswith("*"):
|
||||||
@ -63,9 +114,14 @@ def fix_enums(arg_name, arg_type, func_name):
|
|||||||
return arg_type
|
return arg_type
|
||||||
|
|
||||||
|
|
||||||
def parse_header(header_name: str, output_file: str, prefix: str, *args: str):
|
def convert_name_case(name):
|
||||||
|
return name[:1].lower() + name[1:] if name else ''
|
||||||
|
|
||||||
|
|
||||||
|
def parse_header(header_name: str, output_file: str, ext_file: str, prefix: str, *args: str):
|
||||||
header = open(header_name, mode="r")
|
header = open(header_name, mode="r")
|
||||||
zig_heads = []
|
ext_heads = []
|
||||||
|
zig_funcs = []
|
||||||
zig_types = set()
|
zig_types = set()
|
||||||
|
|
||||||
leftover = ""
|
leftover = ""
|
||||||
@ -112,37 +168,65 @@ def parse_header(header_name: str, output_file: str, prefix: str, *args: str):
|
|||||||
return_type = c_to_zig_type(return_type)
|
return_type = c_to_zig_type(return_type)
|
||||||
func_name, return_type = fix_pointer(func_name, return_type)
|
func_name, return_type = fix_pointer(func_name, return_type)
|
||||||
|
|
||||||
|
zig_c_arguments = []
|
||||||
zig_arguments = []
|
zig_arguments = []
|
||||||
|
zig_call_args = []
|
||||||
for arg in arguments.split(", "):
|
for arg in arguments.split(", "):
|
||||||
if arg == "void":
|
if arg == "void":
|
||||||
break
|
break
|
||||||
if arg == "...":
|
if arg == "...":
|
||||||
zig_arguments.append("...")
|
zig_c_arguments.append("...")
|
||||||
continue
|
continue
|
||||||
# everything but the last element (for stuff like "const Vector3")
|
# everything but the last element (for stuff like "const Vector3")
|
||||||
arg_type = " ".join(arg.split(" ")[0:-1])
|
arg_type = " ".join(arg.split(" ")[0:-1])
|
||||||
arg_name = arg.split(" ")[-1] # last element should be the name
|
arg_name = arg.split(" ")[-1] # last element should be the name
|
||||||
arg_type = fix_enums(arg_name, arg_type, func_name)
|
arg_type = fix_enums(arg_name, arg_type, func_name)
|
||||||
|
|
||||||
|
if arg_name == "type": arg_name = "ty"
|
||||||
|
|
||||||
arg_type = c_to_zig_type(arg_type)
|
arg_type = c_to_zig_type(arg_type)
|
||||||
arg_name, arg_type = fix_pointer(arg_name, arg_type)
|
arg_name, arg_type = fix_pointer(arg_name, arg_type)
|
||||||
|
zig_type = ziggify_type(arg_name, arg_type)
|
||||||
|
|
||||||
zig_types.add(arg_type.replace("const ", ""))
|
is_rl_type = arg_type[0].isupper()
|
||||||
zig_arguments.append(arg_name + ": " + arg_type) # put everything together
|
|
||||||
|
zig_types.add(arg_type)
|
||||||
|
zig_c_arguments.append(arg_name + ": " + add_namespace_to_type(arg_type)) # put everything together
|
||||||
|
zig_arguments.append(arg_name + ": " + zig_type)
|
||||||
|
if arg_type == zig_type:
|
||||||
|
zig_call_args.append(arg_name)
|
||||||
|
else:
|
||||||
|
if arg_type.startswith("[*c]"):
|
||||||
|
zig_call_args.append(f"@ptrCast({arg_type}, {arg_name})")
|
||||||
|
else:
|
||||||
|
zig_call_args.append(f"@as({arg_type}, {arg_name})")
|
||||||
|
zig_c_arguments = ", ".join(zig_c_arguments)
|
||||||
|
|
||||||
|
ext_ret = add_namespace_to_type(return_type)
|
||||||
|
ext_heads.append(f"pub extern \"c\" fn {func_name}({zig_c_arguments}) {ext_ret};")
|
||||||
|
|
||||||
|
zig_name = convert_name_case(func_name)
|
||||||
|
|
||||||
|
# Todo: ziggify return type
|
||||||
zig_arguments = ", ".join(zig_arguments)
|
zig_arguments = ", ".join(zig_arguments)
|
||||||
zig_heads.append("pub extern fn " + func_name + "(" + zig_arguments + ") " + return_type + ";")
|
zig_call_args = ", ".join(zig_call_args)
|
||||||
|
|
||||||
prelude = str()
|
if func_name in ["TextFormat", "LoadShader", "LoadShaderFromMemory"]:
|
||||||
|
continue
|
||||||
|
zig_funcs.append(f"pub fn {zig_name}({zig_arguments}) {return_type}" + " {\n " + ("return " if return_type != "void" else "") + f"cdef.{func_name}({zig_call_args});" + "\n}")
|
||||||
|
|
||||||
for imp in args:
|
prelude = open(args[0], mode="r").read()
|
||||||
prelude += open(imp, mode="r").read()
|
ext_prelude = open(args[1], mode="r").read()
|
||||||
|
|
||||||
|
ext_header = open(ext_file, mode="w")
|
||||||
|
print(ext_prelude, file=ext_header)
|
||||||
|
print("\n".join(ext_heads), file=ext_header)
|
||||||
|
|
||||||
zig_header = open(output_file, mode="w")
|
zig_header = open(output_file, mode="w")
|
||||||
print(prelude, file=zig_header)
|
print(prelude, file=zig_header)
|
||||||
|
print("\n\n".join(zig_funcs), file=zig_header)
|
||||||
print("\n".join(zig_heads), file=zig_header)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parse_header("../raylib/src/raylib.h", "raylib-zig.zig", "RLAPI ", "raylib-zig-types.zig")
|
parse_header("../raylib/src/raylib.h", "raylib-zig.zig", "raylib-zig-ext.zig", "RLAPI ", "preludes/raylib-zig-prelude.zig", "preludes/raylib-zig-ext-prelude.zig")
|
||||||
parse_header("../raylib/src/raymath.h", "raylib-zig-math.zig", "RMAPI ", "raylib-zig-math-prelude.zig")
|
parse_header("../raylib/src/raymath.h", "raylib-zig-math.zig", "raylib-zig-math-ext.zig", "RMAPI ", "preludes/raylib-zig-math-prelude.zig", "preludes/raylib-zig-math-ext-prelude.zig")
|
||||||
|
3
lib/preludes/raylib-zig-ext-prelude.zig
Normal file
3
lib/preludes/raylib-zig-ext-prelude.zig
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
|
const rl = @import("raylib-zig.zig");
|
4
lib/preludes/raylib-zig-math-ext-prelude.zig
Normal file
4
lib/preludes/raylib-zig-math-ext-prelude.zig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
|
const rl = @import("raylib-zig.zig");
|
||||||
|
const rlm = @import("raylib-zig-math.zig");
|
@ -1,6 +1,7 @@
|
|||||||
// raylib-zig (c) Nikolas Wipper 2023
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
const rl = @import("raylib-zig.zig");
|
const rl = @import("raylib-zig.zig");
|
||||||
|
const cdef = @import("raylib-zig-math-ext.zig");
|
||||||
|
|
||||||
const Matrix = rl.Matrix;
|
const Matrix = rl.Matrix;
|
||||||
const Quaternion = rl.Quaternion;
|
const Quaternion = rl.Quaternion;
|
@ -106,59 +106,59 @@ pub const Image = extern struct {
|
|||||||
format: PixelFormat,
|
format: PixelFormat,
|
||||||
|
|
||||||
pub fn init(fileName: [*c]const u8) Image {
|
pub fn init(fileName: [*c]const u8) Image {
|
||||||
return rl.LoadImage(fileName);
|
return rl.loadImage(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn initRaw(fileName: *const []u8, width: c_int, height: c_int, format: PixelFormat, headerSize: c_int) Image {
|
pub fn initRaw(fileName: *const []u8, width: c_int, height: c_int, format: PixelFormat, headerSize: c_int) Image {
|
||||||
return rl.LoadImageRaw(@as([*c]const u8, fileName), width, height, format, headerSize);
|
return rl.loadImageRaw(fileName, width, height, format, headerSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn initText(text: *const []u8, fontSize: c_int, color: Color) Image {
|
pub fn initText(text: *const []u8, fontSize: c_int, color: Color) Image {
|
||||||
return rl.ImageText(@as([*c]const u8, text), fontSize, color);
|
return rl.imageText(text, fontSize, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn initTextEx(font: Font, text: *const []u8, fontSize: f32, spacing: f32, tint: Color) Image {
|
pub fn initTextEx(font: Font, text: *const []u8, fontSize: f32, spacing: f32, tint: Color) Image {
|
||||||
return rl.ImageTextEx(font, @as([*c]const u8, text), fontSize, spacing, tint);
|
return rl.imageTextEx(font, text, fontSize, spacing, tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn copy(image: Image) Image {
|
pub fn copy(image: Image) Image {
|
||||||
return rl.ImageCopy(image);
|
return rl.imageCopy(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn copyRec(image: Image, rec: Rectangle) Image {
|
pub fn copyRec(image: Image, rec: Rectangle) Image {
|
||||||
return rl.ImageFromImage(image, rec);
|
return rl.imageFromImage(image, rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genColor(width: c_int, height: c_int, color: Color) Image {
|
pub fn genColor(width: c_int, height: c_int, color: Color) Image {
|
||||||
return rl.GenImageColor(width, height, color);
|
return rl.genImageColor(width, height, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genGradientV(width: c_int, height: c_int, top: Color, bottom: Color) Image {
|
pub fn genGradientV(width: c_int, height: c_int, top: Color, bottom: Color) Image {
|
||||||
return rl.GenImageGradientV(width, height, top, bottom);
|
return rl.genImageGradientV(width, height, top, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genGradientH(width: c_int, height: c_int, left: Color, right: Color) Image {
|
pub fn genGradientH(width: c_int, height: c_int, left: Color, right: Color) Image {
|
||||||
return rl.GenImageGradientH(width, height, left, right);
|
return rl.genImageGradientH(width, height, left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genGradientRadial(width: c_int, height: c_int, density: f32, inner: Color, outer: Color) Image {
|
pub fn genGradientRadial(width: c_int, height: c_int, density: f32, inner: Color, outer: Color) Image {
|
||||||
return rl.GenImageGradientRadial(width, height, density, inner, outer);
|
return rl.genImageGradientRadial(width, height, density, inner, outer);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genChecked(width: c_int, height: c_int, checksX: c_int, checksY: c_int, col1: Color, col2: Color) Image {
|
pub fn genChecked(width: c_int, height: c_int, checksX: c_int, checksY: c_int, col1: Color, col2: Color) Image {
|
||||||
return rl.GenImageChecked(width, height, checksX, checksY, col1, col2);
|
return rl.genImageChecked(width, height, checksX, checksY, col1, col2);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genWhiteNoise(width: c_int, height: c_int, factor: f32) Image {
|
pub fn genWhiteNoise(width: c_int, height: c_int, factor: f32) Image {
|
||||||
return rl.GenImageWhiteNoise(width, height, factor);
|
return rl.genImageWhiteNoise(width, height, factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn genCellular(width: c_int, height: c_int, tileSize: c_int) Image {
|
pub fn genCellular(width: c_int, height: c_int, tileSize: c_int) Image {
|
||||||
return rl.GenImageCellular(width, height, tileSize);
|
return rl.genImageCellular(width, height, tileSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn useAsWindowIcon(self: Image) void {
|
pub fn useAsWindowIcon(self: Image) void {
|
||||||
rl.SetWindowIcon(self);
|
rl.setWindowIcon(self);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -178,11 +178,11 @@ pub const RenderTexture = extern struct {
|
|||||||
depth: Texture,
|
depth: Texture,
|
||||||
|
|
||||||
pub fn begin(self: RenderTexture2D) void {
|
pub fn begin(self: RenderTexture2D) void {
|
||||||
rl.BeginTextureMode(self);
|
rl.beginTextureMode(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn end(_: RenderTexture2D) void {
|
pub fn end(_: RenderTexture2D) void {
|
||||||
rl.EndTextureMode();
|
rl.endTextureMode();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
pub const RenderTexture2D = RenderTexture;
|
pub const RenderTexture2D = RenderTexture;
|
||||||
@ -221,23 +221,23 @@ pub const Camera3D = extern struct {
|
|||||||
projection: CameraProjection,
|
projection: CameraProjection,
|
||||||
|
|
||||||
pub fn begin(self: Camera3D) void {
|
pub fn begin(self: Camera3D) void {
|
||||||
rl.BeginMode3D(self);
|
rl.beginMode3D(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(self: *Camera3D) void {
|
pub fn update(self: *Camera3D) void {
|
||||||
rl.UpdateCamera(@as([*c]Camera3D, self));
|
rl.updateCamera(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getMatrix(self: Camera3D) Matrix {
|
pub fn getMatrix(self: Camera3D) Matrix {
|
||||||
return rl.GetCameraMatrix(self);
|
return rl.getCameraMatrix(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setMode(self: Camera3D, mode: CameraMode) void {
|
pub fn setMode(self: Camera3D, mode: CameraMode) void {
|
||||||
rl.SetCameraMode(self, mode);
|
rl.setCameraMode(self, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn end(_: Camera3D) void {
|
pub fn end(_: Camera3D) void {
|
||||||
rl.EndMode3D();
|
rl.endMode3D();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
pub const Camera = Camera3D;
|
pub const Camera = Camera3D;
|
||||||
@ -249,15 +249,15 @@ pub const Camera2D = extern struct {
|
|||||||
zoom: f32,
|
zoom: f32,
|
||||||
|
|
||||||
pub fn begin(self: Camera2D) void {
|
pub fn begin(self: Camera2D) void {
|
||||||
rl.BeginMode2D(self);
|
rl.beginMode2D(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getMatrix(self: Camera2D) Matrix {
|
pub fn getMatrix(self: Camera2D) Matrix {
|
||||||
return rl.GetCameraMatrix2D(self);
|
return rl.getCameraMatrix2D(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn end(_: Camera2D) void {
|
pub fn end(_: Camera2D) void {
|
||||||
rl.EndMode2D();
|
rl.endMode2D();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -279,11 +279,11 @@ pub const Mesh = extern struct {
|
|||||||
vboId: [*c]c_uint,
|
vboId: [*c]c_uint,
|
||||||
|
|
||||||
pub fn draw(self: Mesh, material: Material, transform: Matrix) void {
|
pub fn draw(self: Mesh, material: Material, transform: Matrix) void {
|
||||||
rl.DrawMesh(self, material, transform);
|
rl.drawMesh(self, material, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn drawInstanced(self: Mesh, material: Material, transforms: []const Matrix) void {
|
pub fn drawInstanced(self: Mesh, material: Material, transforms: []const Matrix) void {
|
||||||
rl.DrawMeshInstanced(self, material, @as([*c]const Matrix, transforms), transforms.len);
|
rl.drawMeshInstanced(self, material, transforms, transforms.len);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -292,11 +292,11 @@ pub const Shader = extern struct {
|
|||||||
locs: [*c]c_int,
|
locs: [*c]c_int,
|
||||||
|
|
||||||
pub fn activate(self: Shader) void {
|
pub fn activate(self: Shader) void {
|
||||||
rl.BeginShaderMode(self);
|
rl.beginShaderMode(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deactivate(_: Shader) void {
|
pub fn deactivate(_: Shader) void {
|
||||||
rl.EndShaderMode();
|
rl.endShaderMode();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -335,27 +335,27 @@ pub const Model = extern struct {
|
|||||||
bindPose: [*c]Transform,
|
bindPose: [*c]Transform,
|
||||||
|
|
||||||
pub fn init(fileName: [*c]const u8) Model {
|
pub fn init(fileName: [*c]const u8) Model {
|
||||||
return rl.LoadModel(fileName);
|
return rl.loadModel(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn initFromMesh(mesh: Mesh) Model {
|
pub fn initFromMesh(mesh: Mesh) Model {
|
||||||
return rl.LoadModelFromMesh(mesh);
|
return rl.loadModelFromMesh(mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn draw(self: Mesh, position: Vector3, scale: f32, tint: Color) void {
|
pub fn draw(self: Mesh, position: Vector3, scale: f32, tint: Color) void {
|
||||||
return rl.DrawMesh(self, position, scale, tint);
|
return rl.drawMesh(self, position, scale, tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn drawEx(self: Mesh, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) void {
|
pub fn drawEx(self: Mesh, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) void {
|
||||||
return rl.DrawMeshEx(self, position, rotationAxis, rotationAngle, scale, tint);
|
return rl.drawMeshEx(self, position, rotationAxis, rotationAngle, scale, tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn drawWires(self: Mesh, position: Vector3, scale: f32, tint: Color) void {
|
pub fn drawWires(self: Mesh, position: Vector3, scale: f32, tint: Color) void {
|
||||||
return rl.DrawMeshWires(self, position, scale, tint);
|
return rl.drawMeshWires(self, position, scale, tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn drawWiresEx(self: Mesh, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) void {
|
pub fn drawWiresEx(self: Mesh, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) void {
|
||||||
return rl.DrawMeshWiresEx(self, position, rotationAxis, rotationAngle, scale, tint);
|
return rl.drawMeshWiresEx(self, position, rotationAxis, rotationAngle, scale, tint);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -809,9 +809,9 @@ pub const LoadFileTextCallback = ?fn ([*c]const u8) callconv(.C) [*c]u8;
|
|||||||
pub const SaveFileTextCallback = ?fn ([*c]const u8, [*c]u8) callconv(.C) bool;
|
pub const SaveFileTextCallback = ?fn ([*c]const u8, [*c]u8) callconv(.C) bool;
|
||||||
pub const AudioCallback = ?*const fn (?*anyopaque, c_uint) callconv(.C) void;
|
pub const AudioCallback = ?*const fn (?*anyopaque, c_uint) callconv(.C) void;
|
||||||
|
|
||||||
pub const RAYLIB_VERSION_MAJOR = @as(c_int, 4);
|
pub const RAYLIB_VERSION_MAJOR = @as(i32, 4);
|
||||||
pub const RAYLIB_VERSION_MINOR = @as(c_int, 5);
|
pub const RAYLIB_VERSION_MINOR = @as(i32, 5);
|
||||||
pub const RAYLIB_VERSION_PATCH = @as(c_int, 0);
|
pub const RAYLIB_VERSION_PATCH = @as(i32, 0);
|
||||||
pub const RAYLIB_VERSION = "4.5-dev";
|
pub const RAYLIB_VERSION = "4.5-dev";
|
||||||
|
|
||||||
pub const MAX_TOUCH_POINTS = 10;
|
pub const MAX_TOUCH_POINTS = 10;
|
||||||
@ -822,3 +822,33 @@ pub const MATERIAL_MAP_DIFFUSE = MaterialMapIndex.MATERIAL_MAP_ALBEDO;
|
|||||||
pub const MATERIAL_MAP_SPECULAR = MaterialMapIndex.MATERIAL_MAP_METALNESS;
|
pub const MATERIAL_MAP_SPECULAR = MaterialMapIndex.MATERIAL_MAP_METALNESS;
|
||||||
pub const SHADER_LOC_MAP_DIFFUSE = ShaderLocationIndex.SHADER_LOC_MAP_ALBEDO;
|
pub const SHADER_LOC_MAP_DIFFUSE = ShaderLocationIndex.SHADER_LOC_MAP_ALBEDO;
|
||||||
pub const SHADER_LOC_MAP_SPECULAR = ShaderLocationIndex.SHADER_LOC_MAP_METALNESS;
|
pub const SHADER_LOC_MAP_SPECULAR = ShaderLocationIndex.SHADER_LOC_MAP_METALNESS;
|
||||||
|
|
||||||
|
const cdef = @import("raylib-zig-ext.zig");
|
||||||
|
|
||||||
|
pub fn textFormat(text: []const u8, args: anytype) [*c]const u8 {
|
||||||
|
return @call(.{}, cdef.TextFormat, .{@ptrCast([*c]const u8, text)} ++ args);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn loadShader(vsFileName: ?[]const u8, fsFileName: ?[]const u8) Shader {
|
||||||
|
var vsFileNameFinal = @as([*c]const u8, 0);
|
||||||
|
var fsFileNameFinal = @as([*c]const u8, 0);
|
||||||
|
if (vsFileName) |vsFileNameSure| {
|
||||||
|
vsFileNameFinal = @ptrCast([*c]const u8, vsFileNameSure);
|
||||||
|
}
|
||||||
|
if (fsFileName) |fsFileNameSure| {
|
||||||
|
fsFileNameFinal = @ptrCast([*c]const u8, fsFileNameSure);
|
||||||
|
}
|
||||||
|
return cdef.LoadShader(vsFileNameFinal, fsFileNameFinal);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn loadShaderFromMemory(vsCode: ?[]const u8, fsCode: ?[]const u8) Shader {
|
||||||
|
var vsCodeFinal = @as([*c]const u8, 0);
|
||||||
|
var fsCodeFinal = @as([*c]const u8, 0);
|
||||||
|
if (vsCode) |vsCodeSure| {
|
||||||
|
vsCodeFinal = @ptrCast([*c]const u8, vsCodeSure);
|
||||||
|
}
|
||||||
|
if (fsCode) |fsCodeSure| {
|
||||||
|
fsCodeFinal = @ptrCast([*c]const u8, fsCodeSure);
|
||||||
|
}
|
||||||
|
return cdef.LoadShaderFromMemory(vsCodeFinal, fsCodeFinal);
|
||||||
|
}
|
514
lib/raylib-zig-ext.zig
Normal file
514
lib/raylib-zig-ext.zig
Normal file
@ -0,0 +1,514 @@
|
|||||||
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
|
const rl = @import("raylib-zig.zig");
|
||||||
|
|
||||||
|
pub extern "c" fn InitWindow(width: c_int, height: c_int, title: [*c]const u8) void;
|
||||||
|
pub extern "c" fn WindowShouldClose() bool;
|
||||||
|
pub extern "c" fn CloseWindow() void;
|
||||||
|
pub extern "c" fn IsWindowReady() bool;
|
||||||
|
pub extern "c" fn IsWindowFullscreen() bool;
|
||||||
|
pub extern "c" fn IsWindowHidden() bool;
|
||||||
|
pub extern "c" fn IsWindowMinimized() bool;
|
||||||
|
pub extern "c" fn IsWindowMaximized() bool;
|
||||||
|
pub extern "c" fn IsWindowFocused() bool;
|
||||||
|
pub extern "c" fn IsWindowResized() bool;
|
||||||
|
pub extern "c" fn IsWindowState(flag: c_uint) bool;
|
||||||
|
pub extern "c" fn SetWindowState(flags: c_uint) void;
|
||||||
|
pub extern "c" fn ClearWindowState(flags: c_uint) void;
|
||||||
|
pub extern "c" fn ToggleFullscreen() void;
|
||||||
|
pub extern "c" fn MaximizeWindow() void;
|
||||||
|
pub extern "c" fn MinimizeWindow() void;
|
||||||
|
pub extern "c" fn RestoreWindow() void;
|
||||||
|
pub extern "c" fn SetWindowIcon(image: rl.Image) void;
|
||||||
|
pub extern "c" fn SetWindowTitle(title: [*c]const u8) void;
|
||||||
|
pub extern "c" fn SetWindowPosition(x: c_int, y: c_int) void;
|
||||||
|
pub extern "c" fn SetWindowMonitor(monitor: c_int) void;
|
||||||
|
pub extern "c" fn SetWindowMinSize(width: c_int, height: c_int) void;
|
||||||
|
pub extern "c" fn SetWindowSize(width: c_int, height: c_int) void;
|
||||||
|
pub extern "c" fn SetWindowOpacity(opacity: f32) void;
|
||||||
|
pub extern "c" fn GetWindowHandle() *anyopaque;
|
||||||
|
pub extern "c" fn GetScreenWidth() c_int;
|
||||||
|
pub extern "c" fn GetScreenHeight() c_int;
|
||||||
|
pub extern "c" fn GetRenderWidth() c_int;
|
||||||
|
pub extern "c" fn GetRenderHeight() c_int;
|
||||||
|
pub extern "c" fn GetMonitorCount() c_int;
|
||||||
|
pub extern "c" fn GetCurrentMonitor() c_int;
|
||||||
|
pub extern "c" fn GetMonitorPosition(monitor: c_int) rl.Vector2;
|
||||||
|
pub extern "c" fn GetMonitorWidth(monitor: c_int) c_int;
|
||||||
|
pub extern "c" fn GetMonitorHeight(monitor: c_int) c_int;
|
||||||
|
pub extern "c" fn GetMonitorPhysicalWidth(monitor: c_int) c_int;
|
||||||
|
pub extern "c" fn GetMonitorPhysicalHeight(monitor: c_int) c_int;
|
||||||
|
pub extern "c" fn GetMonitorRefreshRate(monitor: c_int) c_int;
|
||||||
|
pub extern "c" fn GetWindowPosition() rl.Vector2;
|
||||||
|
pub extern "c" fn GetWindowScaleDPI() rl.Vector2;
|
||||||
|
pub extern "c" fn GetMonitorName(monitor: c_int) [*c]const u8;
|
||||||
|
pub extern "c" fn SetClipboardText(text: [*c]const u8) void;
|
||||||
|
pub extern "c" fn GetClipboardText() [*c]const u8;
|
||||||
|
pub extern "c" fn EnableEventWaiting() void;
|
||||||
|
pub extern "c" fn DisableEventWaiting() void;
|
||||||
|
pub extern "c" fn SwapScreenBuffer() void;
|
||||||
|
pub extern "c" fn PollInputEvents() void;
|
||||||
|
pub extern "c" fn WaitTime(seconds: f64) void;
|
||||||
|
pub extern "c" fn ShowCursor() void;
|
||||||
|
pub extern "c" fn HideCursor() void;
|
||||||
|
pub extern "c" fn IsCursorHidden() bool;
|
||||||
|
pub extern "c" fn EnableCursor() void;
|
||||||
|
pub extern "c" fn DisableCursor() void;
|
||||||
|
pub extern "c" fn IsCursorOnScreen() bool;
|
||||||
|
pub extern "c" fn ClearBackground(color: rl.Color) void;
|
||||||
|
pub extern "c" fn BeginDrawing() void;
|
||||||
|
pub extern "c" fn EndDrawing() void;
|
||||||
|
pub extern "c" fn BeginMode2D(camera: rl.Camera2D) void;
|
||||||
|
pub extern "c" fn EndMode2D() void;
|
||||||
|
pub extern "c" fn BeginMode3D(camera: rl.Camera3D) void;
|
||||||
|
pub extern "c" fn EndMode3D() void;
|
||||||
|
pub extern "c" fn BeginTextureMode(target: rl.RenderTexture2D) void;
|
||||||
|
pub extern "c" fn EndTextureMode() void;
|
||||||
|
pub extern "c" fn BeginShaderMode(shader: rl.Shader) void;
|
||||||
|
pub extern "c" fn EndShaderMode() void;
|
||||||
|
pub extern "c" fn BeginBlendMode(mode: c_int) void;
|
||||||
|
pub extern "c" fn EndBlendMode() void;
|
||||||
|
pub extern "c" fn BeginScissorMode(x: c_int, y: c_int, width: c_int, height: c_int) void;
|
||||||
|
pub extern "c" fn EndScissorMode() void;
|
||||||
|
pub extern "c" fn BeginVrStereoMode(config: rl.VrStereoConfig) void;
|
||||||
|
pub extern "c" fn EndVrStereoMode() void;
|
||||||
|
pub extern "c" fn LoadVrStereoConfig(device: rl.VrDeviceInfo) rl.VrStereoConfig;
|
||||||
|
pub extern "c" fn UnloadVrStereoConfig(config: rl.VrStereoConfig) void;
|
||||||
|
pub extern "c" fn LoadShader(vsFileName: [*c]const u8, fsFileName: [*c]const u8) rl.Shader;
|
||||||
|
pub extern "c" fn LoadShaderFromMemory(vsCode: [*c]const u8, fsCode: [*c]const u8) rl.Shader;
|
||||||
|
pub extern "c" fn GetShaderLocation(shader: rl.Shader, uniformName: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn GetShaderLocationAttrib(shader: rl.Shader, attribName: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn SetShaderValue(shader: rl.Shader, locIndex: c_int, value: *const anyopaque, uniformType: c_int) void;
|
||||||
|
pub extern "c" fn SetShaderValueV(shader: rl.Shader, locIndex: c_int, value: *const anyopaque, uniformType: c_int, count: c_int) void;
|
||||||
|
pub extern "c" fn SetShaderValueMatrix(shader: rl.Shader, locIndex: c_int, mat: rl.Matrix) void;
|
||||||
|
pub extern "c" fn SetShaderValueTexture(shader: rl.Shader, locIndex: c_int, texture: rl.Texture2D) void;
|
||||||
|
pub extern "c" fn UnloadShader(shader: rl.Shader) void;
|
||||||
|
pub extern "c" fn GetMouseRay(mousePosition: rl.Vector2, camera: rl.Camera) rl.Ray;
|
||||||
|
pub extern "c" fn GetCameraMatrix(camera: rl.Camera) rl.Matrix;
|
||||||
|
pub extern "c" fn GetCameraMatrix2D(camera: rl.Camera2D) rl.Matrix;
|
||||||
|
pub extern "c" fn GetWorldToScreen(position: rl.Vector3, camera: rl.Camera) rl.Vector2;
|
||||||
|
pub extern "c" fn GetScreenToWorld2D(position: rl.Vector2, camera: rl.Camera2D) rl.Vector2;
|
||||||
|
pub extern "c" fn GetWorldToScreenEx(position: rl.Vector3, camera: rl.Camera, width: c_int, height: c_int) rl.Vector2;
|
||||||
|
pub extern "c" fn GetWorldToScreen2D(position: rl.Vector2, camera: rl.Camera2D) rl.Vector2;
|
||||||
|
pub extern "c" fn SetTargetFPS(fps: c_int) void;
|
||||||
|
pub extern "c" fn GetFPS() c_int;
|
||||||
|
pub extern "c" fn GetFrameTime() f32;
|
||||||
|
pub extern "c" fn GetTime() f64;
|
||||||
|
pub extern "c" fn GetRandomValue(min: c_int, max: c_int) c_int;
|
||||||
|
pub extern "c" fn SetRandomSeed(seed: c_uint) void;
|
||||||
|
pub extern "c" fn TakeScreenshot(fileName: [*c]const u8) void;
|
||||||
|
pub extern "c" fn SetConfigFlags(flags: c_uint) void;
|
||||||
|
pub extern "c" fn TraceLog(logLevel: c_int, text: [*c]const u8, ...) void;
|
||||||
|
pub extern "c" fn SetTraceLogLevel(logLevel: c_int) void;
|
||||||
|
pub extern "c" fn MemAlloc(size: c_uint) *anyopaque;
|
||||||
|
pub extern "c" fn MemRealloc(ptr: *anyopaque, size: c_uint) *anyopaque;
|
||||||
|
pub extern "c" fn MemFree(ptr: *anyopaque) void;
|
||||||
|
pub extern "c" fn OpenURL(url: [*c]const u8) void;
|
||||||
|
pub extern "c" fn SetLoadFileDataCallback(callback: rl.LoadFileDataCallback) void;
|
||||||
|
pub extern "c" fn SetSaveFileDataCallback(callback: rl.SaveFileDataCallback) void;
|
||||||
|
pub extern "c" fn SetLoadFileTextCallback(callback: rl.LoadFileTextCallback) void;
|
||||||
|
pub extern "c" fn SetSaveFileTextCallback(callback: rl.SaveFileTextCallback) void;
|
||||||
|
pub extern "c" fn LoadFileData(fileName: [*c]const u8, bytesRead: [*c]c_uint) [*c]u8;
|
||||||
|
pub extern "c" fn UnloadFileData(data: [*c]u8) void;
|
||||||
|
pub extern "c" fn SaveFileData(fileName: [*c]const u8, data: *anyopaque, bytesToWrite: c_uint) bool;
|
||||||
|
pub extern "c" fn ExportDataAsCode(data: [*c]const u8, size: c_uint, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn LoadFileText(fileName: [*c]const u8) [*c]u8;
|
||||||
|
pub extern "c" fn UnloadFileText(text: [*c]u8) void;
|
||||||
|
pub extern "c" fn SaveFileText(fileName: [*c]const u8, text: [*c]u8) bool;
|
||||||
|
pub extern "c" fn FileExists(fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn DirectoryExists(dirPath: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn IsFileExtension(fileName: [*c]const u8, ext: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn GetFileLength(fileName: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn GetFileExtension(fileName: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn GetFileName(filePath: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn GetFileNameWithoutExt(filePath: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn GetDirectoryPath(filePath: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn GetPrevDirectoryPath(dirPath: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn GetWorkingDirectory() [*c]const u8;
|
||||||
|
pub extern "c" fn GetApplicationDirectory() [*c]const u8;
|
||||||
|
pub extern "c" fn ChangeDirectory(dir: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn IsPathFile(path: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn LoadDirectoryFiles(dirPath: [*c]const u8) rl.FilePathList;
|
||||||
|
pub extern "c" fn LoadDirectoryFilesEx(basePath: [*c]const u8, filter: [*c]const u8, scanSubdirs: bool) rl.FilePathList;
|
||||||
|
pub extern "c" fn UnloadDirectoryFiles(files: rl.FilePathList) void;
|
||||||
|
pub extern "c" fn IsFileDropped() bool;
|
||||||
|
pub extern "c" fn LoadDroppedFiles() rl.FilePathList;
|
||||||
|
pub extern "c" fn UnloadDroppedFiles(files: rl.FilePathList) void;
|
||||||
|
pub extern "c" fn GetFileModTime(fileName: [*c]const u8) c_long;
|
||||||
|
pub extern "c" fn CompressData(data: [*c]const u8, dataSize: c_int, compDataSize: [*c]c_int) [*c]u8;
|
||||||
|
pub extern "c" fn DecompressData(compData: [*c]const u8, compDataSize: c_int, dataSize: [*c]c_int) [*c]u8;
|
||||||
|
pub extern "c" fn EncodeDataBase64(data: [*c]const u8, dataSize: c_int, outputSize: [*c]c_int) [*c]u8;
|
||||||
|
pub extern "c" fn DecodeDataBase64(data: [*c]const u8, outputSize: [*c]c_int) [*c]u8;
|
||||||
|
pub extern "c" fn IsKeyPressed(key: rl.KeyboardKey) bool;
|
||||||
|
pub extern "c" fn IsKeyDown(key: rl.KeyboardKey) bool;
|
||||||
|
pub extern "c" fn IsKeyReleased(key: rl.KeyboardKey) bool;
|
||||||
|
pub extern "c" fn IsKeyUp(key: rl.KeyboardKey) bool;
|
||||||
|
pub extern "c" fn SetExitKey(key: rl.KeyboardKey) void;
|
||||||
|
pub extern "c" fn GetKeyPressed() c_int;
|
||||||
|
pub extern "c" fn GetCharPressed() c_int;
|
||||||
|
pub extern "c" fn IsGamepadAvailable(gamepad: c_int) bool;
|
||||||
|
pub extern "c" fn GetGamepadName(gamepad: c_int) [*c]const u8;
|
||||||
|
pub extern "c" fn IsGamepadButtonPressed(gamepad: c_int, button: rl.GamepadButton) bool;
|
||||||
|
pub extern "c" fn IsGamepadButtonDown(gamepad: c_int, button: rl.GamepadButton) bool;
|
||||||
|
pub extern "c" fn IsGamepadButtonReleased(gamepad: c_int, button: rl.GamepadButton) bool;
|
||||||
|
pub extern "c" fn IsGamepadButtonUp(gamepad: c_int, button: rl.GamepadButton) bool;
|
||||||
|
pub extern "c" fn GetGamepadButtonPressed() c_int;
|
||||||
|
pub extern "c" fn GetGamepadAxisCount(gamepad: c_int) c_int;
|
||||||
|
pub extern "c" fn GetGamepadAxisMovement(gamepad: c_int, axis: c_int) f32;
|
||||||
|
pub extern "c" fn SetGamepadMappings(mappings: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn IsMouseButtonPressed(button: rl.MouseButton) bool;
|
||||||
|
pub extern "c" fn IsMouseButtonDown(button: rl.MouseButton) bool;
|
||||||
|
pub extern "c" fn IsMouseButtonReleased(button: rl.MouseButton) bool;
|
||||||
|
pub extern "c" fn IsMouseButtonUp(button: rl.MouseButton) bool;
|
||||||
|
pub extern "c" fn GetMouseX() c_int;
|
||||||
|
pub extern "c" fn GetMouseY() c_int;
|
||||||
|
pub extern "c" fn GetMousePosition() rl.Vector2;
|
||||||
|
pub extern "c" fn GetMouseDelta() rl.Vector2;
|
||||||
|
pub extern "c" fn SetMousePosition(x: c_int, y: c_int) void;
|
||||||
|
pub extern "c" fn SetMouseOffset(offsetX: c_int, offsetY: c_int) void;
|
||||||
|
pub extern "c" fn SetMouseScale(scaleX: f32, scaleY: f32) void;
|
||||||
|
pub extern "c" fn GetMouseWheelMove() f32;
|
||||||
|
pub extern "c" fn GetMouseWheelMoveV() rl.Vector2;
|
||||||
|
pub extern "c" fn SetMouseCursor(cursor: c_int) void;
|
||||||
|
pub extern "c" fn GetTouchX() c_int;
|
||||||
|
pub extern "c" fn GetTouchY() c_int;
|
||||||
|
pub extern "c" fn GetTouchPosition(index: c_int) rl.Vector2;
|
||||||
|
pub extern "c" fn GetTouchPointId(index: c_int) c_int;
|
||||||
|
pub extern "c" fn GetTouchPointCount() c_int;
|
||||||
|
pub extern "c" fn SetGesturesEnabled(flags: c_uint) void;
|
||||||
|
pub extern "c" fn IsGestureDetected(gesture: rl.Gestures) bool;
|
||||||
|
pub extern "c" fn GetGestureDetected() c_int;
|
||||||
|
pub extern "c" fn GetGestureHoldDuration() f32;
|
||||||
|
pub extern "c" fn GetGestureDragVector() rl.Vector2;
|
||||||
|
pub extern "c" fn GetGestureDragAngle() f32;
|
||||||
|
pub extern "c" fn GetGesturePinchVector() rl.Vector2;
|
||||||
|
pub extern "c" fn GetGesturePinchAngle() f32;
|
||||||
|
pub extern "c" fn SetCameraMode(camera: rl.Camera, mode: rl.CameraMode) void;
|
||||||
|
pub extern "c" fn UpdateCamera(camera: [*c]rl.Camera) void;
|
||||||
|
pub extern "c" fn SetCameraPanControl(keyPan: c_int) void;
|
||||||
|
pub extern "c" fn SetCameraAltControl(keyAlt: c_int) void;
|
||||||
|
pub extern "c" fn SetCameraSmoothZoomControl(keySmoothZoom: c_int) void;
|
||||||
|
pub extern "c" fn SetCameraMoveControls(keyFront: c_int, keyBack: c_int, keyRight: c_int, keyLeft: c_int, keyUp: c_int, keyDown: c_int) void;
|
||||||
|
pub extern "c" fn SetShapesTexture(texture: rl.Texture2D, source: rl.Rectangle) void;
|
||||||
|
pub extern "c" fn DrawPixel(posX: c_int, posY: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawPixelV(position: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLine(startPosX: c_int, startPosY: c_int, endPosX: c_int, endPosY: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLineV(startPos: rl.Vector2, endPos: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLineEx(startPos: rl.Vector2, endPos: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLineBezier(startPos: rl.Vector2, endPos: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLineBezierQuad(startPos: rl.Vector2, endPos: rl.Vector2, controlPos: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLineBezierCubic(startPos: rl.Vector2, endPos: rl.Vector2, startControlPos: rl.Vector2, endControlPos: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawLineStrip(points: [*c]rl.Vector2, pointCount: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircle(centerX: c_int, centerY: c_int, radius: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircleSector(center: rl.Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircleSectorLines(center: rl.Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircleGradient(centerX: c_int, centerY: c_int, radius: f32, color1: rl.Color, color2: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircleV(center: rl.Vector2, radius: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircleLines(centerX: c_int, centerY: c_int, radius: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawEllipse(centerX: c_int, centerY: c_int, radiusH: f32, radiusV: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawEllipseLines(centerX: c_int, centerY: c_int, radiusH: f32, radiusV: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRing(center: rl.Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRingLines(center: rl.Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangle(posX: c_int, posY: c_int, width: c_int, height: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleV(position: rl.Vector2, size: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleRec(rec: rl.Rectangle, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectanglePro(rec: rl.Rectangle, origin: rl.Vector2, rotation: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleGradientV(posX: c_int, posY: c_int, width: c_int, height: c_int, color1: rl.Color, color2: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleGradientH(posX: c_int, posY: c_int, width: c_int, height: c_int, color1: rl.Color, color2: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleGradientEx(rec: rl.Rectangle, col1: rl.Color, col2: rl.Color, col3: rl.Color, col4: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleLines(posX: c_int, posY: c_int, width: c_int, height: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleLinesEx(rec: rl.Rectangle, lineThick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleRounded(rec: rl.Rectangle, roundness: f32, segments: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRectangleRoundedLines(rec: rl.Rectangle, roundness: f32, segments: c_int, lineThick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTriangle(v1: rl.Vector2, v2: rl.Vector2, v3: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTriangleLines(v1: rl.Vector2, v2: rl.Vector2, v3: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTriangleFan(points: [*c]rl.Vector2, pointCount: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTriangleStrip(points: [*c]rl.Vector2, pointCount: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawPoly(center: rl.Vector2, sides: c_int, radius: f32, rotation: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawPolyLines(center: rl.Vector2, sides: c_int, radius: f32, rotation: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawPolyLinesEx(center: rl.Vector2, sides: c_int, radius: f32, rotation: f32, lineThick: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn CheckCollisionRecs(rec1: rl.Rectangle, rec2: rl.Rectangle) bool;
|
||||||
|
pub extern "c" fn CheckCollisionCircles(center1: rl.Vector2, radius1: f32, center2: rl.Vector2, radius2: f32) bool;
|
||||||
|
pub extern "c" fn CheckCollisionCircleRec(center: rl.Vector2, radius: f32, rec: rl.Rectangle) bool;
|
||||||
|
pub extern "c" fn CheckCollisionPointRec(point: rl.Vector2, rec: rl.Rectangle) bool;
|
||||||
|
pub extern "c" fn CheckCollisionPointCircle(point: rl.Vector2, center: rl.Vector2, radius: f32) bool;
|
||||||
|
pub extern "c" fn CheckCollisionPointTriangle(point: rl.Vector2, p1: rl.Vector2, p2: rl.Vector2, p3: rl.Vector2) bool;
|
||||||
|
pub extern "c" fn CheckCollisionPointPoly(point: rl.Vector2, points: [*c]rl.Vector2, pointCount: c_int) bool;
|
||||||
|
pub extern "c" fn CheckCollisionLines(startPos1: rl.Vector2, endPos1: rl.Vector2, startPos2: rl.Vector2, endPos2: rl.Vector2, collisionPoint: [*c]rl.Vector2) bool;
|
||||||
|
pub extern "c" fn CheckCollisionPointLine(point: rl.Vector2, p1: rl.Vector2, p2: rl.Vector2, threshold: c_int) bool;
|
||||||
|
pub extern "c" fn GetCollisionRec(rec1: rl.Rectangle, rec2: rl.Rectangle) rl.Rectangle;
|
||||||
|
pub extern "c" fn LoadImage(fileName: [*c]const u8) rl.Image;
|
||||||
|
pub extern "c" fn LoadImageRaw(fileName: [*c]const u8, width: c_int, height: c_int, format: c_int, headerSize: c_int) rl.Image;
|
||||||
|
pub extern "c" fn LoadImageAnim(fileName: [*c]const u8, frames: [*c]c_int) rl.Image;
|
||||||
|
pub extern "c" fn LoadImageFromMemory(fileType: [*c]const u8, fileData: [*c]const u8, dataSize: c_int) rl.Image;
|
||||||
|
pub extern "c" fn LoadImageFromTexture(texture: rl.Texture2D) rl.Image;
|
||||||
|
pub extern "c" fn LoadImageFromScreen() rl.Image;
|
||||||
|
pub extern "c" fn UnloadImage(image: rl.Image) void;
|
||||||
|
pub extern "c" fn ExportImage(image: rl.Image, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn ExportImageAsCode(image: rl.Image, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn GenImageColor(width: c_int, height: c_int, color: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn GenImageGradientV(width: c_int, height: c_int, top: rl.Color, bottom: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn GenImageGradientH(width: c_int, height: c_int, left: rl.Color, right: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn GenImageGradientRadial(width: c_int, height: c_int, density: f32, inner: rl.Color, outer: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn GenImageChecked(width: c_int, height: c_int, checksX: c_int, checksY: c_int, col1: rl.Color, col2: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn GenImageWhiteNoise(width: c_int, height: c_int, factor: f32) rl.Image;
|
||||||
|
pub extern "c" fn GenImagePerlinNoise(width: c_int, height: c_int, offsetX: c_int, offsetY: c_int, scale: f32) rl.Image;
|
||||||
|
pub extern "c" fn GenImageCellular(width: c_int, height: c_int, tileSize: c_int) rl.Image;
|
||||||
|
pub extern "c" fn GenImageText(width: c_int, height: c_int, text: [*c]const u8) rl.Image;
|
||||||
|
pub extern "c" fn ImageCopy(image: rl.Image) rl.Image;
|
||||||
|
pub extern "c" fn ImageFromImage(image: rl.Image, rec: rl.Rectangle) rl.Image;
|
||||||
|
pub extern "c" fn ImageText(text: [*c]const u8, fontSize: c_int, color: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn ImageTextEx(font: rl.Font, text: [*c]const u8, fontSize: f32, spacing: f32, tint: rl.Color) rl.Image;
|
||||||
|
pub extern "c" fn ImageFormat(image: [*c]rl.Image, newFormat: c_int) void;
|
||||||
|
pub extern "c" fn ImageToPOT(image: [*c]rl.Image, fill: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageCrop(image: [*c]rl.Image, crop: rl.Rectangle) void;
|
||||||
|
pub extern "c" fn ImageAlphaCrop(image: [*c]rl.Image, threshold: f32) void;
|
||||||
|
pub extern "c" fn ImageAlphaClear(image: [*c]rl.Image, color: rl.Color, threshold: f32) void;
|
||||||
|
pub extern "c" fn ImageAlphaMask(image: [*c]rl.Image, alphaMask: rl.Image) void;
|
||||||
|
pub extern "c" fn ImageAlphaPremultiply(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageBlurGaussian(image: [*c]rl.Image, blurSize: c_int) void;
|
||||||
|
pub extern "c" fn ImageResize(image: [*c]rl.Image, newWidth: c_int, newHeight: c_int) void;
|
||||||
|
pub extern "c" fn ImageResizeNN(image: [*c]rl.Image, newWidth: c_int, newHeight: c_int) void;
|
||||||
|
pub extern "c" fn ImageResizeCanvas(image: [*c]rl.Image, newWidth: c_int, newHeight: c_int, offsetX: c_int, offsetY: c_int, fill: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageMipmaps(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageDither(image: [*c]rl.Image, rBpp: c_int, gBpp: c_int, bBpp: c_int, aBpp: c_int) void;
|
||||||
|
pub extern "c" fn ImageFlipVertical(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageFlipHorizontal(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageRotateCW(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageRotateCCW(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageColorTint(image: [*c]rl.Image, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageColorInvert(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageColorGrayscale(image: [*c]rl.Image) void;
|
||||||
|
pub extern "c" fn ImageColorContrast(image: [*c]rl.Image, contrast: f32) void;
|
||||||
|
pub extern "c" fn ImageColorBrightness(image: [*c]rl.Image, brightness: c_int) void;
|
||||||
|
pub extern "c" fn ImageColorReplace(image: [*c]rl.Image, color: rl.Color, replace: rl.Color) void;
|
||||||
|
pub extern "c" fn LoadImageColors(image: rl.Image) [*c]rl.Color;
|
||||||
|
pub extern "c" fn LoadImagePalette(image: rl.Image, maxPaletteSize: c_int, colorCount: [*c]c_int) [*c]rl.Color;
|
||||||
|
pub extern "c" fn UnloadImageColors(colors: [*c]rl.Color) void;
|
||||||
|
pub extern "c" fn UnloadImagePalette(colors: [*c]rl.Color) void;
|
||||||
|
pub extern "c" fn GetImageAlphaBorder(image: rl.Image, threshold: f32) rl.Rectangle;
|
||||||
|
pub extern "c" fn GetImageColor(image: rl.Image, x: c_int, y: c_int) rl.Color;
|
||||||
|
pub extern "c" fn ImageClearBackground(dst: [*c]rl.Image, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawPixel(dst: [*c]rl.Image, posX: c_int, posY: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawPixelV(dst: [*c]rl.Image, position: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawLine(dst: [*c]rl.Image, startPosX: c_int, startPosY: c_int, endPosX: c_int, endPosY: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawLineV(dst: [*c]rl.Image, start: rl.Vector2, end: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawCircle(dst: [*c]rl.Image, centerX: c_int, centerY: c_int, radius: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawCircleV(dst: [*c]rl.Image, center: rl.Vector2, radius: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawCircleLines(dst: [*c]rl.Image, centerX: c_int, centerY: c_int, radius: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawCircleLinesV(dst: [*c]rl.Image, center: rl.Vector2, radius: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawRectangle(dst: [*c]rl.Image, posX: c_int, posY: c_int, width: c_int, height: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawRectangleV(dst: [*c]rl.Image, position: rl.Vector2, size: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawRectangleRec(dst: [*c]rl.Image, rec: rl.Rectangle, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawRectangleLines(dst: [*c]rl.Image, rec: rl.Rectangle, thick: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDraw(dst: [*c]rl.Image, src: rl.Image, srcRec: rl.Rectangle, dstRec: rl.Rectangle, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawText(dst: [*c]rl.Image, text: [*c]const u8, posX: c_int, posY: c_int, fontSize: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn ImageDrawTextEx(dst: [*c]rl.Image, font: rl.Font, text: [*c]const u8, position: rl.Vector2, fontSize: f32, spacing: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn LoadTexture(fileName: [*c]const u8) rl.Texture2D;
|
||||||
|
pub extern "c" fn LoadTextureFromImage(image: rl.Image) rl.Texture2D;
|
||||||
|
pub extern "c" fn LoadTextureCubemap(image: rl.Image, layout: c_int) rl.TextureCubemap;
|
||||||
|
pub extern "c" fn LoadRenderTexture(width: c_int, height: c_int) rl.RenderTexture2D;
|
||||||
|
pub extern "c" fn UnloadTexture(texture: rl.Texture2D) void;
|
||||||
|
pub extern "c" fn UnloadRenderTexture(target: rl.RenderTexture2D) void;
|
||||||
|
pub extern "c" fn UpdateTexture(texture: rl.Texture2D, pixels: *const anyopaque) void;
|
||||||
|
pub extern "c" fn UpdateTextureRec(texture: rl.Texture2D, rec: rl.Rectangle, pixels: *const anyopaque) void;
|
||||||
|
pub extern "c" fn GenTextureMipmaps(texture: [*c]rl.Texture2D) void;
|
||||||
|
pub extern "c" fn SetTextureFilter(texture: rl.Texture2D, filter: c_int) void;
|
||||||
|
pub extern "c" fn SetTextureWrap(texture: rl.Texture2D, wrap: c_int) void;
|
||||||
|
pub extern "c" fn DrawTexture(texture: rl.Texture2D, posX: c_int, posY: c_int, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextureV(texture: rl.Texture2D, position: rl.Vector2, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextureEx(texture: rl.Texture2D, position: rl.Vector2, rotation: f32, scale: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextureRec(texture: rl.Texture2D, source: rl.Rectangle, position: rl.Vector2, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTexturePro(texture: rl.Texture2D, source: rl.Rectangle, dest: rl.Rectangle, origin: rl.Vector2, rotation: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextureNPatch(texture: rl.Texture2D, nPatchInfo: rl.NPatchInfo, dest: rl.Rectangle, origin: rl.Vector2, rotation: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn Fade(color: rl.Color, alpha: f32) rl.Color;
|
||||||
|
pub extern "c" fn ColorToInt(color: rl.Color) c_int;
|
||||||
|
pub extern "c" fn ColorNormalize(color: rl.Color) rl.Vector4;
|
||||||
|
pub extern "c" fn ColorFromNormalized(normalized: rl.Vector4) rl.Color;
|
||||||
|
pub extern "c" fn ColorToHSV(color: rl.Color) rl.Vector3;
|
||||||
|
pub extern "c" fn ColorFromHSV(hue: f32, saturation: f32, value: f32) rl.Color;
|
||||||
|
pub extern "c" fn ColorTint(color: rl.Color, tint: rl.Color) rl.Color;
|
||||||
|
pub extern "c" fn ColorBrightness(color: rl.Color, factor: f32) rl.Color;
|
||||||
|
pub extern "c" fn ColorContrast(color: rl.Color, contrast: f32) rl.Color;
|
||||||
|
pub extern "c" fn ColorAlpha(color: rl.Color, alpha: f32) rl.Color;
|
||||||
|
pub extern "c" fn ColorAlphaBlend(dst: rl.Color, src: rl.Color, tint: rl.Color) rl.Color;
|
||||||
|
pub extern "c" fn GetColor(hexValue: c_uint) rl.Color;
|
||||||
|
pub extern "c" fn GetPixelColor(srcPtr: *anyopaque, format: c_int) rl.Color;
|
||||||
|
pub extern "c" fn SetPixelColor(dstPtr: *anyopaque, color: rl.Color, format: c_int) void;
|
||||||
|
pub extern "c" fn GetPixelDataSize(width: c_int, height: c_int, format: c_int) c_int;
|
||||||
|
pub extern "c" fn GetFontDefault() rl.Font;
|
||||||
|
pub extern "c" fn LoadFont(fileName: [*c]const u8) rl.Font;
|
||||||
|
pub extern "c" fn LoadFontEx(fileName: [*c]const u8, fontSize: c_int, fontChars: [*c]c_int, glyphCount: c_int) rl.Font;
|
||||||
|
pub extern "c" fn LoadFontFromImage(image: rl.Image, key: rl.Color, firstChar: c_int) rl.Font;
|
||||||
|
pub extern "c" fn LoadFontFromMemory(fileType: [*c]const u8, fileData: [*c]const u8, dataSize: c_int, fontSize: c_int, fontChars: [*c]c_int, glyphCount: c_int) rl.Font;
|
||||||
|
pub extern "c" fn LoadFontData(fileData: [*c]const u8, dataSize: c_int, fontSize: c_int, fontChars: [*c]c_int, glyphCount: c_int, ty: c_int) [*c]rl.GlyphInfo;
|
||||||
|
pub extern "c" fn GenImageFontAtlas(chars: [*c]const rl.GlyphInfo, recs: [*c][*c]rl.Rectangle, glyphCount: c_int, fontSize: c_int, padding: c_int, packMethod: c_int) rl.Image;
|
||||||
|
pub extern "c" fn UnloadFontData(chars: [*c]rl.GlyphInfo, glyphCount: c_int) void;
|
||||||
|
pub extern "c" fn UnloadFont(font: rl.Font) void;
|
||||||
|
pub extern "c" fn ExportFontAsCode(font: rl.Font, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn DrawFPS(posX: c_int, posY: c_int) void;
|
||||||
|
pub extern "c" fn DrawText(text: [*c]const u8, posX: c_int, posY: c_int, fontSize: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextEx(font: rl.Font, text: [*c]const u8, position: rl.Vector2, fontSize: f32, spacing: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextPro(font: rl.Font, text: [*c]const u8, position: rl.Vector2, origin: rl.Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextCodepoint(font: rl.Font, codepoint: c_int, position: rl.Vector2, fontSize: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTextCodepoints(font: rl.Font, codepoints: [*c]const c_int, count: c_int, position: rl.Vector2, fontSize: f32, spacing: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn MeasureText(text: [*c]const u8, fontSize: c_int) c_int;
|
||||||
|
pub extern "c" fn MeasureTextEx(font: rl.Font, text: [*c]const u8, fontSize: f32, spacing: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn GetGlyphIndex(font: rl.Font, codepoint: c_int) c_int;
|
||||||
|
pub extern "c" fn GetGlyphInfo(font: rl.Font, codepoint: c_int) rl.GlyphInfo;
|
||||||
|
pub extern "c" fn GetGlyphAtlasRec(font: rl.Font, codepoint: c_int) rl.Rectangle;
|
||||||
|
pub extern "c" fn LoadUTF8(codepoints: [*c]const c_int, length: c_int) [*c]u8;
|
||||||
|
pub extern "c" fn UnloadUTF8(text: [*c]u8) void;
|
||||||
|
pub extern "c" fn LoadCodepoints(text: [*c]const u8, count: [*c]c_int) [*c]c_int;
|
||||||
|
pub extern "c" fn UnloadCodepoints(codepoints: [*c]c_int) void;
|
||||||
|
pub extern "c" fn GetCodepointCount(text: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn GetCodepoint(text: [*c]const u8, codepointSize: [*c]c_int) c_int;
|
||||||
|
pub extern "c" fn GetCodepointNext(text: [*c]const u8, codepointSize: [*c]c_int) c_int;
|
||||||
|
pub extern "c" fn GetCodepointPrevious(text: [*c]const u8, codepointSize: [*c]c_int) c_int;
|
||||||
|
pub extern "c" fn CodepointToUTF8(codepoint: c_int, utf8Size: [*c]c_int) [*c]const u8;
|
||||||
|
pub extern "c" fn TextCopy(dst: [*c]u8, src: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn TextIsEqual(text1: [*c]const u8, text2: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn TextLength(text: [*c]const u8) c_uint;
|
||||||
|
pub extern "c" fn TextFormat(text: [*c]const u8, ...) [*c]const u8;
|
||||||
|
pub extern "c" fn TextSubtext(text: [*c]const u8, position: c_int, length: c_int) [*c]const u8;
|
||||||
|
pub extern "c" fn TextReplace(text: [*c]u8, replace: [*c]const u8, by: [*c]const u8) [*c]u8;
|
||||||
|
pub extern "c" fn TextInsert(text: [*c]const u8, insert: [*c]const u8, position: c_int) [*c]u8;
|
||||||
|
pub extern "c" fn TextJoin(textList: [*c][*c]const u8, count: c_int, delimiter: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn TextSplit(text: [*c]const u8, delimiter: u8, count: [*c]c_int) [*c][*c]const u8;
|
||||||
|
pub extern "c" fn TextAppend(text: [*c]u8, append: [*c]const u8, position: [*c]c_int) void;
|
||||||
|
pub extern "c" fn TextFindIndex(text: [*c]const u8, find: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn TextToUpper(text: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn TextToLower(text: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn TextToPascal(text: [*c]const u8) [*c]const u8;
|
||||||
|
pub extern "c" fn TextToInteger(text: [*c]const u8) c_int;
|
||||||
|
pub extern "c" fn DrawLine3D(startPos: rl.Vector3, endPos: rl.Vector3, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawPoint3D(position: rl.Vector3, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCircle3D(center: rl.Vector3, radius: f32, rotationAxis: rl.Vector3, rotationAngle: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTriangle3D(v1: rl.Vector3, v2: rl.Vector3, v3: rl.Vector3, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawTriangleStrip3D(points: [*c]rl.Vector3, pointCount: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCube(position: rl.Vector3, width: f32, height: f32, length: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCubeV(position: rl.Vector3, size: rl.Vector3, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCubeWires(position: rl.Vector3, width: f32, height: f32, length: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCubeWiresV(position: rl.Vector3, size: rl.Vector3, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawSphere(centerPos: rl.Vector3, radius: f32, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawSphereEx(centerPos: rl.Vector3, radius: f32, rings: c_int, slices: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawSphereWires(centerPos: rl.Vector3, radius: f32, rings: c_int, slices: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCylinder(position: rl.Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCylinderEx(startPos: rl.Vector3, endPos: rl.Vector3, startRadius: f32, endRadius: f32, sides: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCylinderWires(position: rl.Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCylinderWiresEx(startPos: rl.Vector3, endPos: rl.Vector3, startRadius: f32, endRadius: f32, sides: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCapsule(startPos: rl.Vector3, endPos: rl.Vector3, radius: f32, slices: c_int, rings: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawCapsuleWires(startPos: rl.Vector3, endPos: rl.Vector3, radius: f32, slices: c_int, rings: c_int, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawPlane(centerPos: rl.Vector3, size: rl.Vector2, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawRay(ray: rl.Ray, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawGrid(slices: c_int, spacing: f32) void;
|
||||||
|
pub extern "c" fn LoadModel(fileName: [*c]const u8) rl.Model;
|
||||||
|
pub extern "c" fn LoadModelFromMesh(mesh: rl.Mesh) rl.Model;
|
||||||
|
pub extern "c" fn UnloadModel(model: rl.Model) void;
|
||||||
|
pub extern "c" fn UnloadModelKeepMeshes(model: rl.Model) void;
|
||||||
|
pub extern "c" fn GetModelBoundingBox(model: rl.Model) rl.BoundingBox;
|
||||||
|
pub extern "c" fn DrawModel(model: rl.Model, position: rl.Vector3, scale: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawModelEx(model: rl.Model, position: rl.Vector3, rotationAxis: rl.Vector3, rotationAngle: f32, scale: rl.Vector3, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawModelWires(model: rl.Model, position: rl.Vector3, scale: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawModelWiresEx(model: rl.Model, position: rl.Vector3, rotationAxis: rl.Vector3, rotationAngle: f32, scale: rl.Vector3, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawBoundingBox(box: rl.BoundingBox, color: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawBillboard(camera: rl.Camera, texture: rl.Texture2D, position: rl.Vector3, size: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawBillboardRec(camera: rl.Camera, texture: rl.Texture2D, source: rl.Rectangle, position: rl.Vector3, size: rl.Vector2, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn DrawBillboardPro(camera: rl.Camera, texture: rl.Texture2D, source: rl.Rectangle, position: rl.Vector3, up: rl.Vector3, size: rl.Vector2, origin: rl.Vector2, rotation: f32, tint: rl.Color) void;
|
||||||
|
pub extern "c" fn UploadMesh(mesh: [*c]rl.Mesh, dynamic: bool) void;
|
||||||
|
pub extern "c" fn UpdateMeshBuffer(mesh: rl.Mesh, index: c_int, data: *const anyopaque, dataSize: c_int, offset: c_int) void;
|
||||||
|
pub extern "c" fn UnloadMesh(mesh: rl.Mesh) void;
|
||||||
|
pub extern "c" fn DrawMesh(mesh: rl.Mesh, material: rl.Material, transform: rl.Matrix) void;
|
||||||
|
pub extern "c" fn DrawMeshInstanced(mesh: rl.Mesh, material: rl.Material, transforms: [*c]const rl.Matrix, instances: c_int) void;
|
||||||
|
pub extern "c" fn ExportMesh(mesh: rl.Mesh, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn GetMeshBoundingBox(mesh: rl.Mesh) rl.BoundingBox;
|
||||||
|
pub extern "c" fn GenMeshTangents(mesh: [*c]rl.Mesh) void;
|
||||||
|
pub extern "c" fn GenMeshPoly(sides: c_int, radius: f32) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshPlane(width: f32, length: f32, resX: c_int, resZ: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshCube(width: f32, height: f32, length: f32) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshSphere(radius: f32, rings: c_int, slices: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshHemiSphere(radius: f32, rings: c_int, slices: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshCylinder(radius: f32, height: f32, slices: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshCone(radius: f32, height: f32, slices: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshTorus(radius: f32, size: f32, radSeg: c_int, sides: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshKnot(radius: f32, size: f32, radSeg: c_int, sides: c_int) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshHeightmap(heightmap: rl.Image, size: rl.Vector3) rl.Mesh;
|
||||||
|
pub extern "c" fn GenMeshCubicmap(cubicmap: rl.Image, cubeSize: rl.Vector3) rl.Mesh;
|
||||||
|
pub extern "c" fn LoadMaterials(fileName: [*c]const u8, materialCount: [*c]c_int) [*c]rl.Material;
|
||||||
|
pub extern "c" fn LoadMaterialDefault() rl.Material;
|
||||||
|
pub extern "c" fn UnloadMaterial(material: rl.Material) void;
|
||||||
|
pub extern "c" fn SetMaterialTexture(material: [*c]rl.Material, mapType: c_int, texture: rl.Texture2D) void;
|
||||||
|
pub extern "c" fn SetModelMeshMaterial(model: [*c]rl.Model, meshId: c_int, materialId: c_int) void;
|
||||||
|
pub extern "c" fn LoadModelAnimations(fileName: [*c]const u8, animCount: [*c]c_uint) [*c]rl.ModelAnimation;
|
||||||
|
pub extern "c" fn UpdateModelAnimation(model: rl.Model, anim: rl.ModelAnimation, frame: c_int) void;
|
||||||
|
pub extern "c" fn UnloadModelAnimation(anim: rl.ModelAnimation) void;
|
||||||
|
pub extern "c" fn UnloadModelAnimations(animations: [*c]rl.ModelAnimation, count: c_uint) void;
|
||||||
|
pub extern "c" fn IsModelAnimationValid(model: rl.Model, anim: rl.ModelAnimation) bool;
|
||||||
|
pub extern "c" fn CheckCollisionSpheres(center1: rl.Vector3, radius1: f32, center2: rl.Vector3, radius2: f32) bool;
|
||||||
|
pub extern "c" fn CheckCollisionBoxes(box1: rl.BoundingBox, box2: rl.BoundingBox) bool;
|
||||||
|
pub extern "c" fn CheckCollisionBoxSphere(box: rl.BoundingBox, center: rl.Vector3, radius: f32) bool;
|
||||||
|
pub extern "c" fn GetRayCollisionSphere(ray: rl.Ray, center: rl.Vector3, radius: f32) rl.RayCollision;
|
||||||
|
pub extern "c" fn GetRayCollisionBox(ray: rl.Ray, box: rl.BoundingBox) rl.RayCollision;
|
||||||
|
pub extern "c" fn GetRayCollisionMesh(ray: rl.Ray, mesh: rl.Mesh, transform: rl.Matrix) rl.RayCollision;
|
||||||
|
pub extern "c" fn GetRayCollisionTriangle(ray: rl.Ray, p1: rl.Vector3, p2: rl.Vector3, p3: rl.Vector3) rl.RayCollision;
|
||||||
|
pub extern "c" fn GetRayCollisionQuad(ray: rl.Ray, p1: rl.Vector3, p2: rl.Vector3, p3: rl.Vector3, p4: rl.Vector3) rl.RayCollision;
|
||||||
|
pub extern "c" fn InitAudioDevice() void;
|
||||||
|
pub extern "c" fn CloseAudioDevice() void;
|
||||||
|
pub extern "c" fn IsAudioDeviceReady() bool;
|
||||||
|
pub extern "c" fn SetMasterVolume(volume: f32) void;
|
||||||
|
pub extern "c" fn LoadWave(fileName: [*c]const u8) rl.Wave;
|
||||||
|
pub extern "c" fn LoadWaveFromMemory(fileType: [*c]const u8, fileData: [*c]const u8, dataSize: c_int) rl.Wave;
|
||||||
|
pub extern "c" fn LoadSound(fileName: [*c]const u8) rl.Sound;
|
||||||
|
pub extern "c" fn LoadSoundFromWave(wave: rl.Wave) rl.Sound;
|
||||||
|
pub extern "c" fn UpdateSound(sound: rl.Sound, data: *const anyopaque, sampleCount: c_int) void;
|
||||||
|
pub extern "c" fn UnloadWave(wave: rl.Wave) void;
|
||||||
|
pub extern "c" fn UnloadSound(sound: rl.Sound) void;
|
||||||
|
pub extern "c" fn ExportWave(wave: rl.Wave, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn ExportWaveAsCode(wave: rl.Wave, fileName: [*c]const u8) bool;
|
||||||
|
pub extern "c" fn PlaySound(sound: rl.Sound) void;
|
||||||
|
pub extern "c" fn StopSound(sound: rl.Sound) void;
|
||||||
|
pub extern "c" fn PauseSound(sound: rl.Sound) void;
|
||||||
|
pub extern "c" fn ResumeSound(sound: rl.Sound) void;
|
||||||
|
pub extern "c" fn PlaySoundMulti(sound: rl.Sound) void;
|
||||||
|
pub extern "c" fn StopSoundMulti() void;
|
||||||
|
pub extern "c" fn GetSoundsPlaying() c_int;
|
||||||
|
pub extern "c" fn IsSoundPlaying(sound: rl.Sound) bool;
|
||||||
|
pub extern "c" fn SetSoundVolume(sound: rl.Sound, volume: f32) void;
|
||||||
|
pub extern "c" fn SetSoundPitch(sound: rl.Sound, pitch: f32) void;
|
||||||
|
pub extern "c" fn SetSoundPan(sound: rl.Sound, pan: f32) void;
|
||||||
|
pub extern "c" fn WaveCopy(wave: rl.Wave) rl.Wave;
|
||||||
|
pub extern "c" fn WaveCrop(wave: [*c]rl.Wave, initSample: c_int, finalSample: c_int) void;
|
||||||
|
pub extern "c" fn WaveFormat(wave: [*c]rl.Wave, sampleRate: c_int, sampleSize: c_int, channels: c_int) void;
|
||||||
|
pub extern "c" fn LoadWaveSamples(wave: rl.Wave) [*c]f32;
|
||||||
|
pub extern "c" fn UnloadWaveSamples(samples: [*c]f32) void;
|
||||||
|
pub extern "c" fn LoadMusicStream(fileName: [*c]const u8) rl.Music;
|
||||||
|
pub extern "c" fn LoadMusicStreamFromMemory(fileType: [*c]const u8, data: [*c]const u8, dataSize: c_int) rl.Music;
|
||||||
|
pub extern "c" fn UnloadMusicStream(music: rl.Music) void;
|
||||||
|
pub extern "c" fn PlayMusicStream(music: rl.Music) void;
|
||||||
|
pub extern "c" fn IsMusicStreamPlaying(music: rl.Music) bool;
|
||||||
|
pub extern "c" fn UpdateMusicStream(music: rl.Music) void;
|
||||||
|
pub extern "c" fn StopMusicStream(music: rl.Music) void;
|
||||||
|
pub extern "c" fn PauseMusicStream(music: rl.Music) void;
|
||||||
|
pub extern "c" fn ResumeMusicStream(music: rl.Music) void;
|
||||||
|
pub extern "c" fn SeekMusicStream(music: rl.Music, position: f32) void;
|
||||||
|
pub extern "c" fn SetMusicVolume(music: rl.Music, volume: f32) void;
|
||||||
|
pub extern "c" fn SetMusicPitch(music: rl.Music, pitch: f32) void;
|
||||||
|
pub extern "c" fn SetMusicPan(music: rl.Music, pan: f32) void;
|
||||||
|
pub extern "c" fn GetMusicTimeLength(music: rl.Music) f32;
|
||||||
|
pub extern "c" fn GetMusicTimePlayed(music: rl.Music) f32;
|
||||||
|
pub extern "c" fn LoadAudioStream(sampleRate: c_uint, sampleSize: c_uint, channels: c_uint) rl.AudioStream;
|
||||||
|
pub extern "c" fn UnloadAudioStream(stream: rl.AudioStream) void;
|
||||||
|
pub extern "c" fn UpdateAudioStream(stream: rl.AudioStream, data: *const anyopaque, frameCount: c_int) void;
|
||||||
|
pub extern "c" fn IsAudioStreamProcessed(stream: rl.AudioStream) bool;
|
||||||
|
pub extern "c" fn PlayAudioStream(stream: rl.AudioStream) void;
|
||||||
|
pub extern "c" fn PauseAudioStream(stream: rl.AudioStream) void;
|
||||||
|
pub extern "c" fn ResumeAudioStream(stream: rl.AudioStream) void;
|
||||||
|
pub extern "c" fn IsAudioStreamPlaying(stream: rl.AudioStream) bool;
|
||||||
|
pub extern "c" fn StopAudioStream(stream: rl.AudioStream) void;
|
||||||
|
pub extern "c" fn SetAudioStreamVolume(stream: rl.AudioStream, volume: f32) void;
|
||||||
|
pub extern "c" fn SetAudioStreamPitch(stream: rl.AudioStream, pitch: f32) void;
|
||||||
|
pub extern "c" fn SetAudioStreamPan(stream: rl.AudioStream, pan: f32) void;
|
||||||
|
pub extern "c" fn SetAudioStreamBufferSizeDefault(size: c_int) void;
|
||||||
|
pub extern "c" fn SetAudioStreamCallback(stream: rl.AudioStream, callback: rl.AudioCallback) void;
|
||||||
|
pub extern "c" fn AttachAudioStreamProcessor(stream: rl.AudioStream, processor: rl.AudioCallback) void;
|
||||||
|
pub extern "c" fn DetachAudioStreamProcessor(stream: rl.AudioStream, processor: rl.AudioCallback) void;
|
116
lib/raylib-zig-math-ext.zig
Normal file
116
lib/raylib-zig-math-ext.zig
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
|
const rl = @import("raylib-zig.zig");
|
||||||
|
const rlm = @import("raylib-zig-math.zig");
|
||||||
|
|
||||||
|
pub extern "c" fn Clamp(value: f32, min: f32, max: f32) f32;
|
||||||
|
pub extern "c" fn Lerp(start: f32, end: f32, amount: f32) f32;
|
||||||
|
pub extern "c" fn Normalize(value: f32, start: f32, end: f32) f32;
|
||||||
|
pub extern "c" fn Remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32;
|
||||||
|
pub extern "c" fn Wrap(value: f32, min: f32, max: f32) f32;
|
||||||
|
pub extern "c" fn FloatEquals(x: f32, y: f32) c_int;
|
||||||
|
pub extern "c" fn Vector2Zero() rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2One() rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Add(v1: rl.Vector2, v2: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2AddValue(v: rl.Vector2, add: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Subtract(v1: rl.Vector2, v2: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2SubtractValue(v: rl.Vector2, sub: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Length(v: rl.Vector2) f32;
|
||||||
|
pub extern "c" fn Vector2LengthSqr(v: rl.Vector2) f32;
|
||||||
|
pub extern "c" fn Vector2DotProduct(v1: rl.Vector2, v2: rl.Vector2) f32;
|
||||||
|
pub extern "c" fn Vector2Distance(v1: rl.Vector2, v2: rl.Vector2) f32;
|
||||||
|
pub extern "c" fn Vector2DistanceSqr(v1: rl.Vector2, v2: rl.Vector2) f32;
|
||||||
|
pub extern "c" fn Vector2Angle(v1: rl.Vector2, v2: rl.Vector2) f32;
|
||||||
|
pub extern "c" fn Vector2Scale(v: rl.Vector2, scale: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Multiply(v1: rl.Vector2, v2: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Negate(v: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Divide(v1: rl.Vector2, v2: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Normalize(v: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Transform(v: rl.Vector2, mat: rl.Matrix) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Lerp(v1: rl.Vector2, v2: rl.Vector2, amount: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Reflect(v: rl.Vector2, normal: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Rotate(v: rl.Vector2, angle: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2MoveTowards(v: rl.Vector2, target: rl.Vector2, maxDistance: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Invert(v: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Clamp(v: rl.Vector2, min: rl.Vector2, max: rl.Vector2) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2ClampValue(v: rl.Vector2, min: f32, max: f32) rl.Vector2;
|
||||||
|
pub extern "c" fn Vector2Equals(p: rl.Vector2, q: rl.Vector2) c_int;
|
||||||
|
pub extern "c" fn Vector3Zero() rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3One() rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Add(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3AddValue(v: rl.Vector3, add: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Subtract(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3SubtractValue(v: rl.Vector3, sub: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Scale(v: rl.Vector3, scalar: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Multiply(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3CrossProduct(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Perpendicular(v: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Length(v: rl.Vector3) f32;
|
||||||
|
pub extern "c" fn Vector3LengthSqr(v: rl.Vector3) f32;
|
||||||
|
pub extern "c" fn Vector3DotProduct(v1: rl.Vector3, v2: rl.Vector3) f32;
|
||||||
|
pub extern "c" fn Vector3Distance(v1: rl.Vector3, v2: rl.Vector3) f32;
|
||||||
|
pub extern "c" fn Vector3DistanceSqr(v1: rl.Vector3, v2: rl.Vector3) f32;
|
||||||
|
pub extern "c" fn Vector3Angle(v1: rl.Vector3, v2: rl.Vector3) f32;
|
||||||
|
pub extern "c" fn Vector3Negate(v: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Divide(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Normalize(v: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3OrthoNormalize(v1: [*c]rl.Vector3, v2: [*c]rl.Vector3) void;
|
||||||
|
pub extern "c" fn Vector3Transform(v: rl.Vector3, mat: rl.Matrix) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3RotateByQuaternion(v: rl.Vector3, q: rl.Quaternion) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3RotateByAxisAngle(v: rl.Vector3, axis: rl.Vector3, angle: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Lerp(v1: rl.Vector3, v2: rl.Vector3, amount: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Reflect(v: rl.Vector3, normal: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Min(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Max(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Barycenter(p: rl.Vector3, a: rl.Vector3, b: rl.Vector3, c: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Unproject(source: rl.Vector3, projection: rl.Matrix, view: rl.Matrix) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3ToFloatV(v: rl.Vector3) rlm.float3;
|
||||||
|
pub extern "c" fn Vector3Invert(v: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Clamp(v: rl.Vector3, min: rl.Vector3, max: rl.Vector3) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3ClampValue(v: rl.Vector3, min: f32, max: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn Vector3Equals(p: rl.Vector3, q: rl.Vector3) c_int;
|
||||||
|
pub extern "c" fn Vector3Refract(v: rl.Vector3, n: rl.Vector3, r: f32) rl.Vector3;
|
||||||
|
pub extern "c" fn MatrixDeterminant(mat: rl.Matrix) f32;
|
||||||
|
pub extern "c" fn MatrixTrace(mat: rl.Matrix) f32;
|
||||||
|
pub extern "c" fn MatrixTranspose(mat: rl.Matrix) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixInvert(mat: rl.Matrix) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixIdentity() rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixAdd(left: rl.Matrix, right: rl.Matrix) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixSubtract(left: rl.Matrix, right: rl.Matrix) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixMultiply(left: rl.Matrix, right: rl.Matrix) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixTranslate(x: f32, y: f32, z: f32) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixRotate(axis: rl.Vector3, angle: f32) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixRotateX(angle: f32) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixRotateY(angle: f32) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixRotateZ(angle: f32) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixRotateXYZ(angle: rl.Vector3) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixRotateZYX(angle: rl.Vector3) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixScale(x: f32, y: f32, z: f32) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixFrustum(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixPerspective(fovy: f64, aspect: f64, near: f64, far: f64) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixOrtho(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixLookAt(eye: rl.Vector3, target: rl.Vector3, up: rl.Vector3) rl.Matrix;
|
||||||
|
pub extern "c" fn MatrixToFloatV(mat: rl.Matrix) rlm.float16;
|
||||||
|
pub extern "c" fn QuaternionAdd(q1: rl.Quaternion, q2: rl.Quaternion) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionAddValue(q: rl.Quaternion, add: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionSubtract(q1: rl.Quaternion, q2: rl.Quaternion) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionSubtractValue(q: rl.Quaternion, sub: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionIdentity() rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionLength(q: rl.Quaternion) f32;
|
||||||
|
pub extern "c" fn QuaternionNormalize(q: rl.Quaternion) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionInvert(q: rl.Quaternion) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionMultiply(q1: rl.Quaternion, q2: rl.Quaternion) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionScale(q: rl.Quaternion, mul: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionDivide(q1: rl.Quaternion, q2: rl.Quaternion) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionLerp(q1: rl.Quaternion, q2: rl.Quaternion, amount: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionNlerp(q1: rl.Quaternion, q2: rl.Quaternion, amount: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionSlerp(q1: rl.Quaternion, q2: rl.Quaternion, amount: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionFromVector3ToVector3(from: rl.Vector3, to: rl.Vector3) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionFromMatrix(mat: rl.Matrix) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionToMatrix(q: rl.Quaternion) rl.Matrix;
|
||||||
|
pub extern "c" fn QuaternionFromAxisAngle(axis: rl.Vector3, angle: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionToAxisAngle(q: rl.Quaternion, outAxis: [*c]rl.Vector3, outAngle: [*c]f32) void;
|
||||||
|
pub extern "c" fn QuaternionFromEuler(pitch: f32, yaw: f32, roll: f32) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionToEuler(q: rl.Quaternion) rl.Vector3;
|
||||||
|
pub extern "c" fn QuaternionTransform(q: rl.Quaternion, mat: rl.Matrix) rl.Quaternion;
|
||||||
|
pub extern "c" fn QuaternionEquals(p: rl.Quaternion, q: rl.Quaternion) c_int;
|
@ -1,6 +1,7 @@
|
|||||||
// raylib-zig (c) Nikolas Wipper 2023
|
// raylib-zig (c) Nikolas Wipper 2023
|
||||||
|
|
||||||
const rl = @import("raylib-zig.zig");
|
const rl = @import("raylib-zig.zig");
|
||||||
|
const cdef = @import("raylib-zig-math-ext.zig");
|
||||||
|
|
||||||
const Matrix = rl.Matrix;
|
const Matrix = rl.Matrix;
|
||||||
const Quaternion = rl.Quaternion;
|
const Quaternion = rl.Quaternion;
|
||||||
@ -16,114 +17,446 @@ pub const float16 = extern struct {
|
|||||||
v: [16]f32,
|
v: [16]f32,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub extern fn Clamp(value: f32, min: f32, max: f32) f32;
|
pub fn clamp(value: f32, min: f32, max: f32) f32 {
|
||||||
pub extern fn Lerp(start: f32, end: f32, amount: f32) f32;
|
return cdef.Clamp(value, min, max);
|
||||||
pub extern fn Normalize(value: f32, start: f32, end: f32) f32;
|
}
|
||||||
pub extern fn Remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32;
|
|
||||||
pub extern fn Wrap(value: f32, min: f32, max: f32) f32;
|
pub fn lerp(start: f32, end: f32, amount: f32) f32 {
|
||||||
pub extern fn FloatEquals(x: f32, y: f32) c_int;
|
return cdef.Lerp(start, end, amount);
|
||||||
pub extern fn Vector2Zero() Vector2;
|
}
|
||||||
pub extern fn Vector2One() Vector2;
|
|
||||||
pub extern fn Vector2Add(v1: Vector2, v2: Vector2) Vector2;
|
pub fn normalize(value: f32, start: f32, end: f32) f32 {
|
||||||
pub extern fn Vector2AddValue(v: Vector2, add: f32) Vector2;
|
return cdef.Normalize(value, start, end);
|
||||||
pub extern fn Vector2Subtract(v1: Vector2, v2: Vector2) Vector2;
|
}
|
||||||
pub extern fn Vector2SubtractValue(v: Vector2, sub: f32) Vector2;
|
|
||||||
pub extern fn Vector2Length(v: Vector2) f32;
|
pub fn remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32 {
|
||||||
pub extern fn Vector2LengthSqr(v: Vector2) f32;
|
return cdef.Remap(value, inputStart, inputEnd, outputStart, outputEnd);
|
||||||
pub extern fn Vector2DotProduct(v1: Vector2, v2: Vector2) f32;
|
}
|
||||||
pub extern fn Vector2Distance(v1: Vector2, v2: Vector2) f32;
|
|
||||||
pub extern fn Vector2DistanceSqr(v1: Vector2, v2: Vector2) f32;
|
pub fn wrap(value: f32, min: f32, max: f32) f32 {
|
||||||
pub extern fn Vector2Angle(v1: Vector2, v2: Vector2) f32;
|
return cdef.Wrap(value, min, max);
|
||||||
pub extern fn Vector2Scale(v: Vector2, scale: f32) Vector2;
|
}
|
||||||
pub extern fn Vector2Multiply(v1: Vector2, v2: Vector2) Vector2;
|
|
||||||
pub extern fn Vector2Negate(v: Vector2) Vector2;
|
pub fn floatEquals(x: f32, y: f32) c_int {
|
||||||
pub extern fn Vector2Divide(v1: Vector2, v2: Vector2) Vector2;
|
return cdef.FloatEquals(x, y);
|
||||||
pub extern fn Vector2Normalize(v: Vector2) Vector2;
|
}
|
||||||
pub extern fn Vector2Transform(v: Vector2, mat: Matrix) Vector2;
|
|
||||||
pub extern fn Vector2Lerp(v1: Vector2, v2: Vector2, amount: f32) Vector2;
|
pub fn vector2Zero() Vector2 {
|
||||||
pub extern fn Vector2Reflect(v: Vector2, normal: Vector2) Vector2;
|
return cdef.Vector2Zero();
|
||||||
pub extern fn Vector2Rotate(v: Vector2, angle: f32) Vector2;
|
}
|
||||||
pub extern fn Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2;
|
|
||||||
pub extern fn Vector2Invert(v: Vector2) Vector2;
|
pub fn vector2One() Vector2 {
|
||||||
pub extern fn Vector2Clamp(v: Vector2, min: Vector2, max: Vector2) Vector2;
|
return cdef.Vector2One();
|
||||||
pub extern fn Vector2ClampValue(v: Vector2, min: f32, max: f32) Vector2;
|
}
|
||||||
pub extern fn Vector2Equals(p: Vector2, q: Vector2) c_int;
|
|
||||||
pub extern fn Vector3Zero() Vector3;
|
pub fn vector2Add(v1: Vector2, v2: Vector2) Vector2 {
|
||||||
pub extern fn Vector3One() Vector3;
|
return cdef.Vector2Add(v1, v2);
|
||||||
pub extern fn Vector3Add(v1: Vector3, v2: Vector3) Vector3;
|
}
|
||||||
pub extern fn Vector3AddValue(v: Vector3, add: f32) Vector3;
|
|
||||||
pub extern fn Vector3Subtract(v1: Vector3, v2: Vector3) Vector3;
|
pub fn vector2AddValue(v: Vector2, add: f32) Vector2 {
|
||||||
pub extern fn Vector3SubtractValue(v: Vector3, sub: f32) Vector3;
|
return cdef.Vector2AddValue(v, add);
|
||||||
pub extern fn Vector3Scale(v: Vector3, scalar: f32) Vector3;
|
}
|
||||||
pub extern fn Vector3Multiply(v1: Vector3, v2: Vector3) Vector3;
|
|
||||||
pub extern fn Vector3CrossProduct(v1: Vector3, v2: Vector3) Vector3;
|
pub fn vector2Subtract(v1: Vector2, v2: Vector2) Vector2 {
|
||||||
pub extern fn Vector3Perpendicular(v: Vector3) Vector3;
|
return cdef.Vector2Subtract(v1, v2);
|
||||||
pub extern fn Vector3Length(v: Vector3) f32;
|
}
|
||||||
pub extern fn Vector3LengthSqr(v: Vector3) f32;
|
|
||||||
pub extern fn Vector3DotProduct(v1: Vector3, v2: Vector3) f32;
|
pub fn vector2SubtractValue(v: Vector2, sub: f32) Vector2 {
|
||||||
pub extern fn Vector3Distance(v1: Vector3, v2: Vector3) f32;
|
return cdef.Vector2SubtractValue(v, sub);
|
||||||
pub extern fn Vector3DistanceSqr(v1: Vector3, v2: Vector3) f32;
|
}
|
||||||
pub extern fn Vector3Angle(v1: Vector3, v2: Vector3) f32;
|
|
||||||
pub extern fn Vector3Negate(v: Vector3) Vector3;
|
pub fn vector2Length(v: Vector2) f32 {
|
||||||
pub extern fn Vector3Divide(v1: Vector3, v2: Vector3) Vector3;
|
return cdef.Vector2Length(v);
|
||||||
pub extern fn Vector3Normalize(v: Vector3) Vector3;
|
}
|
||||||
pub extern fn Vector3OrthoNormalize(v1: [*c]Vector3, v2: [*c]Vector3) void;
|
|
||||||
pub extern fn Vector3Transform(v: Vector3, mat: Matrix) Vector3;
|
pub fn vector2LengthSqr(v: Vector2) f32 {
|
||||||
pub extern fn Vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3;
|
return cdef.Vector2LengthSqr(v);
|
||||||
pub extern fn Vector3RotateByAxisAngle(v: Vector3, axis: Vector3, angle: f32) Vector3;
|
}
|
||||||
pub extern fn Vector3Lerp(v1: Vector3, v2: Vector3, amount: f32) Vector3;
|
|
||||||
pub extern fn Vector3Reflect(v: Vector3, normal: Vector3) Vector3;
|
pub fn vector2DotProduct(v1: Vector2, v2: Vector2) f32 {
|
||||||
pub extern fn Vector3Min(v1: Vector3, v2: Vector3) Vector3;
|
return cdef.Vector2DotProduct(v1, v2);
|
||||||
pub extern fn Vector3Max(v1: Vector3, v2: Vector3) Vector3;
|
}
|
||||||
pub extern fn Vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) Vector3;
|
|
||||||
pub extern fn Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3;
|
pub fn vector2Distance(v1: Vector2, v2: Vector2) f32 {
|
||||||
pub extern fn Vector3ToFloatV(v: Vector3) float3;
|
return cdef.Vector2Distance(v1, v2);
|
||||||
pub extern fn Vector3Invert(v: Vector3) Vector3;
|
}
|
||||||
pub extern fn Vector3Clamp(v: Vector3, min: Vector3, max: Vector3) Vector3;
|
|
||||||
pub extern fn Vector3ClampValue(v: Vector3, min: f32, max: f32) Vector3;
|
pub fn vector2DistanceSqr(v1: Vector2, v2: Vector2) f32 {
|
||||||
pub extern fn Vector3Equals(p: Vector3, q: Vector3) c_int;
|
return cdef.Vector2DistanceSqr(v1, v2);
|
||||||
pub extern fn Vector3Refract(v: Vector3, n: Vector3, r: f32) Vector3;
|
}
|
||||||
pub extern fn MatrixDeterminant(mat: Matrix) f32;
|
|
||||||
pub extern fn MatrixTrace(mat: Matrix) f32;
|
pub fn vector2Angle(v1: Vector2, v2: Vector2) f32 {
|
||||||
pub extern fn MatrixTranspose(mat: Matrix) Matrix;
|
return cdef.Vector2Angle(v1, v2);
|
||||||
pub extern fn MatrixInvert(mat: Matrix) Matrix;
|
}
|
||||||
pub extern fn MatrixIdentity() Matrix;
|
|
||||||
pub extern fn MatrixAdd(left: Matrix, right: Matrix) Matrix;
|
pub fn vector2Scale(v: Vector2, scale: f32) Vector2 {
|
||||||
pub extern fn MatrixSubtract(left: Matrix, right: Matrix) Matrix;
|
return cdef.Vector2Scale(v, scale);
|
||||||
pub extern fn MatrixMultiply(left: Matrix, right: Matrix) Matrix;
|
}
|
||||||
pub extern fn MatrixTranslate(x: f32, y: f32, z: f32) Matrix;
|
|
||||||
pub extern fn MatrixRotate(axis: Vector3, angle: f32) Matrix;
|
pub fn vector2Multiply(v1: Vector2, v2: Vector2) Vector2 {
|
||||||
pub extern fn MatrixRotateX(angle: f32) Matrix;
|
return cdef.Vector2Multiply(v1, v2);
|
||||||
pub extern fn MatrixRotateY(angle: f32) Matrix;
|
}
|
||||||
pub extern fn MatrixRotateZ(angle: f32) Matrix;
|
|
||||||
pub extern fn MatrixRotateXYZ(angle: Vector3) Matrix;
|
pub fn vector2Negate(v: Vector2) Vector2 {
|
||||||
pub extern fn MatrixRotateZYX(angle: Vector3) Matrix;
|
return cdef.Vector2Negate(v);
|
||||||
pub extern fn MatrixScale(x: f32, y: f32, z: f32) 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 fn vector2Divide(v1: Vector2, v2: Vector2) Vector2 {
|
||||||
pub extern fn MatrixOrtho(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix;
|
return cdef.Vector2Divide(v1, v2);
|
||||||
pub extern fn MatrixLookAt(eye: Vector3, target: Vector3, up: Vector3) Matrix;
|
}
|
||||||
pub extern fn MatrixToFloatV(mat: Matrix) float16;
|
|
||||||
pub extern fn QuaternionAdd(q1: Quaternion, q2: Quaternion) Quaternion;
|
pub fn vector2Normalize(v: Vector2) Vector2 {
|
||||||
pub extern fn QuaternionAddValue(q: Quaternion, add: f32) Quaternion;
|
return cdef.Vector2Normalize(v);
|
||||||
pub extern fn QuaternionSubtract(q1: Quaternion, q2: Quaternion) Quaternion;
|
}
|
||||||
pub extern fn QuaternionSubtractValue(q: Quaternion, sub: f32) Quaternion;
|
|
||||||
pub extern fn QuaternionIdentity() Quaternion;
|
pub fn vector2Transform(v: Vector2, mat: Matrix) Vector2 {
|
||||||
pub extern fn QuaternionLength(q: Quaternion) f32;
|
return cdef.Vector2Transform(v, mat);
|
||||||
pub extern fn QuaternionNormalize(q: Quaternion) Quaternion;
|
}
|
||||||
pub extern fn QuaternionInvert(q: Quaternion) Quaternion;
|
|
||||||
pub extern fn QuaternionMultiply(q1: Quaternion, q2: Quaternion) Quaternion;
|
pub fn vector2Lerp(v1: Vector2, v2: Vector2, amount: f32) Vector2 {
|
||||||
pub extern fn QuaternionScale(q: Quaternion, mul: f32) Quaternion;
|
return cdef.Vector2Lerp(v1, v2, amount);
|
||||||
pub extern fn QuaternionDivide(q1: Quaternion, q2: Quaternion) Quaternion;
|
}
|
||||||
pub extern fn QuaternionLerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;
|
|
||||||
pub extern fn QuaternionNlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;
|
pub fn vector2Reflect(v: Vector2, normal: Vector2) Vector2 {
|
||||||
pub extern fn QuaternionSlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;
|
return cdef.Vector2Reflect(v, normal);
|
||||||
pub extern fn QuaternionFromVector3ToVector3(from: Vector3, to: Vector3) Quaternion;
|
}
|
||||||
pub extern fn QuaternionFromMatrix(mat: Matrix) Quaternion;
|
|
||||||
pub extern fn QuaternionToMatrix(q: Quaternion) Matrix;
|
pub fn vector2Rotate(v: Vector2, angle: f32) Vector2 {
|
||||||
pub extern fn QuaternionFromAxisAngle(axis: Vector3, angle: f32) Quaternion;
|
return cdef.Vector2Rotate(v, angle);
|
||||||
pub extern fn QuaternionToAxisAngle(q: Quaternion, outAxis: [*c]Vector3, outAngle: [*c]f32) void;
|
}
|
||||||
pub extern fn QuaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion;
|
|
||||||
pub extern fn QuaternionToEuler(q: Quaternion) Vector3;
|
pub fn vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2 {
|
||||||
pub extern fn QuaternionTransform(q: Quaternion, mat: Matrix) Quaternion;
|
return cdef.Vector2MoveTowards(v, target, maxDistance);
|
||||||
pub extern fn QuaternionEquals(p: Quaternion, q: Quaternion) c_int;
|
}
|
||||||
|
|
||||||
|
pub fn vector2Invert(v: Vector2) Vector2 {
|
||||||
|
return cdef.Vector2Invert(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector2Clamp(v: Vector2, min: Vector2, max: Vector2) Vector2 {
|
||||||
|
return cdef.Vector2Clamp(v, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector2ClampValue(v: Vector2, min: f32, max: f32) Vector2 {
|
||||||
|
return cdef.Vector2ClampValue(v, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector2Equals(p: Vector2, q: Vector2) c_int {
|
||||||
|
return cdef.Vector2Equals(p, q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Zero() Vector3 {
|
||||||
|
return cdef.Vector3Zero();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3One() Vector3 {
|
||||||
|
return cdef.Vector3One();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Add(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Add(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3AddValue(v: Vector3, add: f32) Vector3 {
|
||||||
|
return cdef.Vector3AddValue(v, add);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Subtract(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Subtract(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3SubtractValue(v: Vector3, sub: f32) Vector3 {
|
||||||
|
return cdef.Vector3SubtractValue(v, sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Scale(v: Vector3, scalar: f32) Vector3 {
|
||||||
|
return cdef.Vector3Scale(v, scalar);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Multiply(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Multiply(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3CrossProduct(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3CrossProduct(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Perpendicular(v: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Perpendicular(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Length(v: Vector3) f32 {
|
||||||
|
return cdef.Vector3Length(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3LengthSqr(v: Vector3) f32 {
|
||||||
|
return cdef.Vector3LengthSqr(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3DotProduct(v1: Vector3, v2: Vector3) f32 {
|
||||||
|
return cdef.Vector3DotProduct(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Distance(v1: Vector3, v2: Vector3) f32 {
|
||||||
|
return cdef.Vector3Distance(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3DistanceSqr(v1: Vector3, v2: Vector3) f32 {
|
||||||
|
return cdef.Vector3DistanceSqr(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Angle(v1: Vector3, v2: Vector3) f32 {
|
||||||
|
return cdef.Vector3Angle(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Negate(v: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Negate(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Divide(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Divide(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Normalize(v: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Normalize(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3OrthoNormalize(v1: *Vector3, v2: *Vector3) void {
|
||||||
|
cdef.Vector3OrthoNormalize(@ptrCast([*c]Vector3, v1), @ptrCast([*c]Vector3, v2));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Transform(v: Vector3, mat: Matrix) Vector3 {
|
||||||
|
return cdef.Vector3Transform(v, mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3 {
|
||||||
|
return cdef.Vector3RotateByQuaternion(v, q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3RotateByAxisAngle(v: Vector3, axis: Vector3, angle: f32) Vector3 {
|
||||||
|
return cdef.Vector3RotateByAxisAngle(v, axis, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Lerp(v1: Vector3, v2: Vector3, amount: f32) Vector3 {
|
||||||
|
return cdef.Vector3Lerp(v1, v2, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Reflect(v: Vector3, normal: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Reflect(v, normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Min(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Min(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Max(v1: Vector3, v2: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Max(v1, v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Barycenter(p, a, b, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3 {
|
||||||
|
return cdef.Vector3Unproject(source, projection, view);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3ToFloatV(v: Vector3) float3 {
|
||||||
|
return cdef.Vector3ToFloatV(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Invert(v: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Invert(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Clamp(v: Vector3, min: Vector3, max: Vector3) Vector3 {
|
||||||
|
return cdef.Vector3Clamp(v, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3ClampValue(v: Vector3, min: f32, max: f32) Vector3 {
|
||||||
|
return cdef.Vector3ClampValue(v, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Equals(p: Vector3, q: Vector3) c_int {
|
||||||
|
return cdef.Vector3Equals(p, q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vector3Refract(v: Vector3, n: Vector3, r: f32) Vector3 {
|
||||||
|
return cdef.Vector3Refract(v, n, r);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixDeterminant(mat: Matrix) f32 {
|
||||||
|
return cdef.MatrixDeterminant(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixTrace(mat: Matrix) f32 {
|
||||||
|
return cdef.MatrixTrace(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixTranspose(mat: Matrix) Matrix {
|
||||||
|
return cdef.MatrixTranspose(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixInvert(mat: Matrix) Matrix {
|
||||||
|
return cdef.MatrixInvert(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixIdentity() Matrix {
|
||||||
|
return cdef.MatrixIdentity();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixAdd(left: Matrix, right: Matrix) Matrix {
|
||||||
|
return cdef.MatrixAdd(left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixSubtract(left: Matrix, right: Matrix) Matrix {
|
||||||
|
return cdef.MatrixSubtract(left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixMultiply(left: Matrix, right: Matrix) Matrix {
|
||||||
|
return cdef.MatrixMultiply(left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixTranslate(x: f32, y: f32, z: f32) Matrix {
|
||||||
|
return cdef.MatrixTranslate(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixRotate(axis: Vector3, angle: f32) Matrix {
|
||||||
|
return cdef.MatrixRotate(axis, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixRotateX(angle: f32) Matrix {
|
||||||
|
return cdef.MatrixRotateX(angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixRotateY(angle: f32) Matrix {
|
||||||
|
return cdef.MatrixRotateY(angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixRotateZ(angle: f32) Matrix {
|
||||||
|
return cdef.MatrixRotateZ(angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixRotateXYZ(angle: Vector3) Matrix {
|
||||||
|
return cdef.MatrixRotateXYZ(angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixRotateZYX(angle: Vector3) Matrix {
|
||||||
|
return cdef.MatrixRotateZYX(angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixScale(x: f32, y: f32, z: f32) Matrix {
|
||||||
|
return cdef.MatrixScale(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixFrustum(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix {
|
||||||
|
return cdef.MatrixFrustum(left, right, bottom, top, near, far);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixPerspective(fovy: f64, aspect: f64, near: f64, far: f64) Matrix {
|
||||||
|
return cdef.MatrixPerspective(fovy, aspect, near, far);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixOrtho(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix {
|
||||||
|
return cdef.MatrixOrtho(left, right, bottom, top, near, far);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixLookAt(eye: Vector3, target: Vector3, up: Vector3) Matrix {
|
||||||
|
return cdef.MatrixLookAt(eye, target, up);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn matrixToFloatV(mat: Matrix) float16 {
|
||||||
|
return cdef.MatrixToFloatV(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionAdd(q1: Quaternion, q2: Quaternion) Quaternion {
|
||||||
|
return cdef.QuaternionAdd(q1, q2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionAddValue(q: Quaternion, add: f32) Quaternion {
|
||||||
|
return cdef.QuaternionAddValue(q, add);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionSubtract(q1: Quaternion, q2: Quaternion) Quaternion {
|
||||||
|
return cdef.QuaternionSubtract(q1, q2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionSubtractValue(q: Quaternion, sub: f32) Quaternion {
|
||||||
|
return cdef.QuaternionSubtractValue(q, sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionIdentity() Quaternion {
|
||||||
|
return cdef.QuaternionIdentity();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionLength(q: Quaternion) f32 {
|
||||||
|
return cdef.QuaternionLength(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionNormalize(q: Quaternion) Quaternion {
|
||||||
|
return cdef.QuaternionNormalize(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionInvert(q: Quaternion) Quaternion {
|
||||||
|
return cdef.QuaternionInvert(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionMultiply(q1: Quaternion, q2: Quaternion) Quaternion {
|
||||||
|
return cdef.QuaternionMultiply(q1, q2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionScale(q: Quaternion, mul: f32) Quaternion {
|
||||||
|
return cdef.QuaternionScale(q, mul);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionDivide(q1: Quaternion, q2: Quaternion) Quaternion {
|
||||||
|
return cdef.QuaternionDivide(q1, q2);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionLerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion {
|
||||||
|
return cdef.QuaternionLerp(q1, q2, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionNlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion {
|
||||||
|
return cdef.QuaternionNlerp(q1, q2, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionSlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion {
|
||||||
|
return cdef.QuaternionSlerp(q1, q2, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionFromVector3ToVector3(from: Vector3, to: Vector3) Quaternion {
|
||||||
|
return cdef.QuaternionFromVector3ToVector3(from, to);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionFromMatrix(mat: Matrix) Quaternion {
|
||||||
|
return cdef.QuaternionFromMatrix(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionToMatrix(q: Quaternion) Matrix {
|
||||||
|
return cdef.QuaternionToMatrix(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionFromAxisAngle(axis: Vector3, angle: f32) Quaternion {
|
||||||
|
return cdef.QuaternionFromAxisAngle(axis, angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionToAxisAngle(q: Quaternion, outAxis: *Vector3, outAngle: *f32) void {
|
||||||
|
cdef.QuaternionToAxisAngle(q, @ptrCast([*c]Vector3, outAxis), @ptrCast([*c]f32, outAngle));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion {
|
||||||
|
return cdef.QuaternionFromEuler(pitch, yaw, roll);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionToEuler(q: Quaternion) Vector3 {
|
||||||
|
return cdef.QuaternionToEuler(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionTransform(q: Quaternion, mat: Matrix) Quaternion {
|
||||||
|
return cdef.QuaternionTransform(q, mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn quaternionEquals(p: Quaternion, q: Quaternion) c_int {
|
||||||
|
return cdef.QuaternionEquals(p, q);
|
||||||
|
}
|
||||||
|
2641
lib/raylib-zig.zig
2641
lib/raylib-zig.zig
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user