mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
Update to raylib 4.2/zig 9.1
This commit is contained in:
parent
b8018afc90
commit
723c77688c
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
Manually tweaked, auto generated [raylib](https://github.com/raysan5/raylib) bindings for zig.
|
Manually tweaked, auto generated [raylib](https://github.com/raysan5/raylib) bindings for zig.
|
||||||
|
|
||||||
Bindings tested on raylib version 4.0.0-dev and Zig 0.9.0
|
Bindings tested on raylib version 4.2.0 and Zig 0.9.1
|
||||||
|
|
||||||
Thanks to jessrud, mbcrocci, rcorre, Gertkeno and sacredbirdman for their contributions to this binding.
|
Thanks to @jessrud, @mbcrocci, @franciscod, @Gertkeno, @alanoliveira, @sacredbirdman, @rcorre and @Ivan-Velickovic for their contributions to this binding.
|
||||||
|
|
||||||
The binding currently only supports a subset of raylib. For more information read [here](#technical-restrictions).
|
The binding currently only supports a subset of raylib. For more information read [here](#technical-restrictions).
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ pub fn main() anyerror!void
|
|||||||
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_LEFT_BUTTON)) { ballColor = rl.MAROON; }
|
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) { ballColor = rl.MAROON; }
|
||||||
else if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_MIDDLE_BUTTON)) { ballColor = rl.LIME; }
|
else if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) { ballColor = rl.LIME; }
|
||||||
else if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_RIGHT_BUTTON)) { ballColor = rl.DARKBLUE; }
|
else if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) { ballColor = rl.DARKBLUE; }
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
@ -34,13 +34,13 @@ pub fn main() anyerror!void
|
|||||||
|
|
||||||
ballColor = rl.BEIGE;
|
ballColor = rl.BEIGE;
|
||||||
|
|
||||||
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_LEFT_BUTTON)) { ballColor = rl.MAROON; }
|
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_LEFT)) { ballColor = rl.MAROON; }
|
||||||
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_MIDDLE_BUTTON)) { ballColor = rl.LIME; }
|
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) { ballColor = rl.LIME; }
|
||||||
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_RIGHT_BUTTON)) { ballColor = rl.DARKBLUE; }
|
if (rl.IsMouseButtonDown(rl.MouseButton.MOUSE_BUTTON_RIGHT)) { ballColor = rl.DARKBLUE; }
|
||||||
|
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_LEFT_BUTTON)) { touchCounter = 10; }
|
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_LEFT)) { touchCounter = 10; }
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_MIDDLE_BUTTON)) { touchCounter = 10; }
|
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_MIDDLE)) { touchCounter = 10; }
|
||||||
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_RIGHT_BUTTON)) { touchCounter = 10; }
|
if (rl.IsMouseButtonPressed(rl.MouseButton.MOUSE_BUTTON_RIGHT)) { touchCounter = 10; }
|
||||||
|
|
||||||
if (touchCounter > 0) { touchCounter -= 1; }
|
if (touchCounter > 0) { touchCounter -= 1; }
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
@ -42,6 +42,8 @@ def fix_pointer(name: str, t: str):
|
|||||||
t = "*const anyopaque"
|
t = "*const anyopaque"
|
||||||
elif t == "[*c]void":
|
elif t == "[*c]void":
|
||||||
t = "*anyopaque"
|
t = "*anyopaque"
|
||||||
|
elif len(pre) == 0:
|
||||||
|
t = t.replace("const ", "")
|
||||||
return name, t
|
return name, t
|
||||||
|
|
||||||
|
|
||||||
@ -139,5 +141,6 @@ def parse_header(header_name: str, output_file: str, prefix: str):
|
|||||||
print("\n".join(zig_functions), file=zigheader)
|
print("\n".join(zig_functions), file=zigheader)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
parse_header("raylib.h", "raylib-wa.zig", "RLAPI ")
|
parse_header("raylib.h", "raylib-wa.zig", "RLAPI ")
|
||||||
parse_header("raymath.h", "raylib-zig-math.zig", "RMAPI ")
|
parse_header("raymath.h", "raylib-zig-math.zig", "RMAPI ")
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const rl = @import("raylib-zig.zig");
|
const rl = @import("raylib-zig.zig");
|
||||||
|
|
||||||
|
const AudioCallback = rl.AudioCallback;
|
||||||
const AudioStream = rl.AudioStream;
|
const AudioStream = rl.AudioStream;
|
||||||
const BoneInfo = rl.BoneInfo;
|
const BoneInfo = rl.BoneInfo;
|
||||||
const BoundingBox = rl.BoundingBox;
|
const BoundingBox = rl.BoundingBox;
|
||||||
@ -8,6 +9,7 @@ const Camera2D = rl.Camera2D;
|
|||||||
const Camera3D = rl.Camera3D;
|
const Camera3D = rl.Camera3D;
|
||||||
const CameraMode = rl.CameraMode;
|
const CameraMode = rl.CameraMode;
|
||||||
const Color = rl.Color;
|
const Color = rl.Color;
|
||||||
|
const FilePathList = rl.FilePathList;
|
||||||
const Font = rl.Font;
|
const Font = rl.Font;
|
||||||
const GamepadButton = rl.GamepadButton;
|
const GamepadButton = rl.GamepadButton;
|
||||||
const Gestures = rl.Gestures;
|
const Gestures = rl.Gestures;
|
||||||
@ -48,6 +50,7 @@ const VrStereoConfig = rl.VrStereoConfig;
|
|||||||
const Wave = rl.Wave;
|
const Wave = rl.Wave;
|
||||||
const char = rl.char;
|
const char = rl.char;
|
||||||
const rAudioBuffer = rl.rAudioBuffer;
|
const rAudioBuffer = rl.rAudioBuffer;
|
||||||
|
const rAudioProcessor = rl.rAudioProcessor;
|
||||||
|
|
||||||
pub extern fn InitWindow(width: c_int, height: c_int, title: [*c]const u8) void;
|
pub extern fn InitWindow(width: c_int, height: c_int, title: [*c]const u8) void;
|
||||||
pub extern fn WindowShouldClose() bool;
|
pub extern fn WindowShouldClose() bool;
|
||||||
@ -91,9 +94,11 @@ pub extern fn GetWindowScaleDPI() Vector2;
|
|||||||
pub extern fn GetMonitorName(monitor: c_int) [*c]const u8;
|
pub extern fn GetMonitorName(monitor: c_int) [*c]const u8;
|
||||||
pub extern fn SetClipboardText(text: [*c]const u8) void;
|
pub extern fn SetClipboardText(text: [*c]const u8) void;
|
||||||
pub extern fn GetClipboardText() [*c]const u8;
|
pub extern fn GetClipboardText() [*c]const u8;
|
||||||
|
pub extern fn EnableEventWaiting() void;
|
||||||
|
pub extern fn DisableEventWaiting() void;
|
||||||
pub extern fn SwapScreenBuffer() void;
|
pub extern fn SwapScreenBuffer() void;
|
||||||
pub extern fn PollInputEvents() void;
|
pub extern fn PollInputEvents() void;
|
||||||
pub extern fn WaitTime(ms: f32) void;
|
pub extern fn WaitTime(seconds: f64) void;
|
||||||
pub extern fn ShowCursor() void;
|
pub extern fn ShowCursor() void;
|
||||||
pub extern fn HideCursor() void;
|
pub extern fn HideCursor() void;
|
||||||
pub extern fn IsCursorHidden() bool;
|
pub extern fn IsCursorHidden() bool;
|
||||||
@ -132,9 +137,9 @@ pub extern fn GetMouseRay(mousePosition: Vector2, camera: Camera) Ray;
|
|||||||
pub extern fn GetCameraMatrix(camera: Camera) Matrix;
|
pub extern fn GetCameraMatrix(camera: Camera) Matrix;
|
||||||
pub extern fn GetCameraMatrix2D(camera: Camera2D) Matrix;
|
pub extern fn GetCameraMatrix2D(camera: Camera2D) Matrix;
|
||||||
pub extern fn GetWorldToScreen(position: Vector3, camera: Camera) Vector2;
|
pub extern fn GetWorldToScreen(position: Vector3, camera: Camera) Vector2;
|
||||||
|
pub extern fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) Vector2;
|
||||||
pub extern fn GetWorldToScreenEx(position: Vector3, camera: Camera, width: c_int, height: c_int) Vector2;
|
pub extern fn GetWorldToScreenEx(position: Vector3, camera: Camera, width: c_int, height: c_int) Vector2;
|
||||||
pub extern fn GetWorldToScreen2D(position: Vector2, camera: Camera2D) Vector2;
|
pub extern fn GetWorldToScreen2D(position: Vector2, camera: Camera2D) Vector2;
|
||||||
pub extern fn GetScreenToWorld2D(position: Vector2, camera: Camera2D) Vector2;
|
|
||||||
pub extern fn SetTargetFPS(fps: c_int) void;
|
pub extern fn SetTargetFPS(fps: c_int) void;
|
||||||
pub extern fn GetFPS() c_int;
|
pub extern fn GetFPS() c_int;
|
||||||
pub extern fn GetFrameTime() f32;
|
pub extern fn GetFrameTime() f32;
|
||||||
@ -148,6 +153,7 @@ pub extern fn SetTraceLogLevel(logLevel: c_int) void;
|
|||||||
pub extern fn MemAlloc(size: c_int) *anyopaque;
|
pub extern fn MemAlloc(size: c_int) *anyopaque;
|
||||||
pub extern fn MemRealloc(ptr: *anyopaque, size: c_int) *anyopaque;
|
pub extern fn MemRealloc(ptr: *anyopaque, size: c_int) *anyopaque;
|
||||||
pub extern fn MemFree(ptr: *anyopaque) void;
|
pub extern fn MemFree(ptr: *anyopaque) void;
|
||||||
|
pub extern fn OpenURL(url: [*c]const u8) void;
|
||||||
pub extern fn SetTraceLogCallback(callback: TraceLogCallback) void;
|
pub extern fn SetTraceLogCallback(callback: TraceLogCallback) void;
|
||||||
pub extern fn SetLoadFileDataCallback(callback: LoadFileDataCallback) void;
|
pub extern fn SetLoadFileDataCallback(callback: LoadFileDataCallback) void;
|
||||||
pub extern fn SetSaveFileDataCallback(callback: SaveFileDataCallback) void;
|
pub extern fn SetSaveFileDataCallback(callback: SaveFileDataCallback) void;
|
||||||
@ -156,6 +162,7 @@ pub extern fn SetSaveFileTextCallback(callback: SaveFileTextCallback) void;
|
|||||||
pub extern fn LoadFileData(fileName: [*c]const u8, bytesRead: [*c]c_uint) [*c]u8;
|
pub extern fn LoadFileData(fileName: [*c]const u8, bytesRead: [*c]c_uint) [*c]u8;
|
||||||
pub extern fn UnloadFileData(data: [*c]u8) void;
|
pub extern fn UnloadFileData(data: [*c]u8) void;
|
||||||
pub extern fn SaveFileData(fileName: [*c]const u8, data: *anyopaque, bytesToWrite: c_uint) bool;
|
pub extern fn SaveFileData(fileName: [*c]const u8, data: *anyopaque, bytesToWrite: c_uint) bool;
|
||||||
|
pub extern fn ExportDataAsCode(data: [*c]const u8, size: c_uint, fileName: [*c]const u8) bool;
|
||||||
pub extern fn LoadFileText(fileName: [*c]const u8) [*c]u8;
|
pub extern fn LoadFileText(fileName: [*c]const u8) [*c]u8;
|
||||||
pub extern fn UnloadFileText(text: [*c]u8) void;
|
pub extern fn UnloadFileText(text: [*c]u8) void;
|
||||||
pub extern fn SaveFileText(fileName: [*c]const u8, text: [*c]u8) bool;
|
pub extern fn SaveFileText(fileName: [*c]const u8, text: [*c]u8) bool;
|
||||||
@ -170,20 +177,19 @@ pub extern fn GetDirectoryPath(filePath: [*c]const u8) [*c]const u8;
|
|||||||
pub extern fn GetPrevDirectoryPath(dirPath: [*c]const u8) [*c]const u8;
|
pub extern fn GetPrevDirectoryPath(dirPath: [*c]const u8) [*c]const u8;
|
||||||
pub extern fn GetWorkingDirectory() [*c]const u8;
|
pub extern fn GetWorkingDirectory() [*c]const u8;
|
||||||
pub extern fn GetApplicationDirectory() [*c]const u8;
|
pub extern fn GetApplicationDirectory() [*c]const u8;
|
||||||
pub extern fn GetDirectoryFiles(dirPath: [*c]const u8, count: [*c]c_int) [*c][*c]u8;
|
|
||||||
pub extern fn ClearDirectoryFiles() void;
|
|
||||||
pub extern fn ChangeDirectory(dir: [*c]const u8) bool;
|
pub extern fn ChangeDirectory(dir: [*c]const u8) bool;
|
||||||
|
pub extern fn IsPathFile(path: [*c]const u8) bool;
|
||||||
|
pub extern fn LoadDirectoryFiles(dirPath: [*c]const u8) FilePathList;
|
||||||
|
pub extern fn LoadDirectoryFilesEx(basePath: [*c]const u8, filter: [*c]const u8, scanSubdirs: bool) FilePathList;
|
||||||
|
pub extern fn UnloadDirectoryFiles(files: FilePathList) void;
|
||||||
pub extern fn IsFileDropped() bool;
|
pub extern fn IsFileDropped() bool;
|
||||||
pub extern fn GetDroppedFiles(count: [*c]c_int) [*c][*c]u8;
|
pub extern fn LoadDroppedFiles() FilePathList;
|
||||||
pub extern fn ClearDroppedFiles() void;
|
pub extern fn UnloadDroppedFiles(files: FilePathList) void;
|
||||||
pub extern fn GetFileModTime(fileName: [*c]const u8) c_long;
|
pub extern fn GetFileModTime(fileName: [*c]const u8) c_long;
|
||||||
pub extern fn CompressData(data: [*c]const u8, dataLength: c_int, compDataLength: [*c]c_int) [*c]u8;
|
pub extern fn CompressData(data: [*c]const u8, dataSize: c_int, compDataSize: [*c]c_int) [*c]u8;
|
||||||
pub extern fn DecompressData(compData: [*c]const u8, compDataLength: c_int, dataLength: [*c]c_int) [*c]u8;
|
pub extern fn DecompressData(compData: [*c]const u8, compDataSize: c_int, dataSize: [*c]c_int) [*c]u8;
|
||||||
pub extern fn EncodeDataBase64(data: [*c]const u8, dataLength: c_int, outputLength: [*c]c_int) [*c]u8;
|
pub extern fn EncodeDataBase64(data: [*c]const u8, dataSize: c_int, outputSize: [*c]c_int) [*c]u8;
|
||||||
pub extern fn DecodeDataBase64(data: [*c]const u8, outputLength: [*c]c_int) [*c]u8;
|
pub extern fn DecodeDataBase64(data: [*c]const u8, outputSize: [*c]c_int) [*c]u8;
|
||||||
pub extern fn SaveStorageValue(position: c_uint, value: c_int) bool;
|
|
||||||
pub extern fn LoadStorageValue(position: c_uint) c_int;
|
|
||||||
pub extern fn OpenURL(url: [*c]const u8) void;
|
|
||||||
pub extern fn IsKeyPressed(key: KeyboardKey) bool;
|
pub extern fn IsKeyPressed(key: KeyboardKey) bool;
|
||||||
pub extern fn IsKeyDown(key: KeyboardKey) bool;
|
pub extern fn IsKeyDown(key: KeyboardKey) bool;
|
||||||
pub extern fn IsKeyReleased(key: KeyboardKey) bool;
|
pub extern fn IsKeyReleased(key: KeyboardKey) bool;
|
||||||
@ -213,6 +219,7 @@ pub extern fn SetMousePosition(x: c_int, y: c_int) void;
|
|||||||
pub extern fn SetMouseOffset(offsetX: c_int, offsetY: c_int) void;
|
pub extern fn SetMouseOffset(offsetX: c_int, offsetY: c_int) void;
|
||||||
pub extern fn SetMouseScale(scaleX: f32, scaleY: f32) void;
|
pub extern fn SetMouseScale(scaleX: f32, scaleY: f32) void;
|
||||||
pub extern fn GetMouseWheelMove() f32;
|
pub extern fn GetMouseWheelMove() f32;
|
||||||
|
pub extern fn GetMouseWheelMoveV() Vector2;
|
||||||
pub extern fn SetMouseCursor(cursor: c_int) void;
|
pub extern fn SetMouseCursor(cursor: c_int) void;
|
||||||
pub extern fn GetTouchX() c_int;
|
pub extern fn GetTouchX() c_int;
|
||||||
pub extern fn GetTouchY() c_int;
|
pub extern fn GetTouchY() c_int;
|
||||||
@ -458,7 +465,6 @@ pub extern fn DrawMeshInstanced(mesh: Mesh, material: Material, transforms: [*c]
|
|||||||
pub extern fn ExportMesh(mesh: Mesh, fileName: [*c]const u8) bool;
|
pub extern fn ExportMesh(mesh: Mesh, fileName: [*c]const u8) bool;
|
||||||
pub extern fn GetMeshBoundingBox(mesh: Mesh) BoundingBox;
|
pub extern fn GetMeshBoundingBox(mesh: Mesh) BoundingBox;
|
||||||
pub extern fn GenMeshTangents(mesh: [*c]Mesh) void;
|
pub extern fn GenMeshTangents(mesh: [*c]Mesh) void;
|
||||||
pub extern fn GenMeshBinormals(mesh: [*c]Mesh) void;
|
|
||||||
pub extern fn GenMeshPoly(sides: c_int, radius: f32) Mesh;
|
pub extern fn GenMeshPoly(sides: c_int, radius: f32) Mesh;
|
||||||
pub extern fn GenMeshPlane(width: f32, length: f32, resX: c_int, resZ: c_int) Mesh;
|
pub extern fn GenMeshPlane(width: f32, length: f32, resX: c_int, resZ: c_int) Mesh;
|
||||||
pub extern fn GenMeshCube(width: f32, height: f32, length: f32) Mesh;
|
pub extern fn GenMeshCube(width: f32, height: f32, length: f32) Mesh;
|
||||||
@ -485,7 +491,6 @@ pub extern fn CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox) bool;
|
|||||||
pub extern fn CheckCollisionBoxSphere(box: BoundingBox, center: Vector3, radius: f32) bool;
|
pub extern fn CheckCollisionBoxSphere(box: BoundingBox, center: Vector3, radius: f32) bool;
|
||||||
pub extern fn GetRayCollisionSphere(ray: Ray, center: Vector3, radius: f32) RayCollision;
|
pub extern fn GetRayCollisionSphere(ray: Ray, center: Vector3, radius: f32) RayCollision;
|
||||||
pub extern fn GetRayCollisionBox(ray: Ray, box: BoundingBox) RayCollision;
|
pub extern fn GetRayCollisionBox(ray: Ray, box: BoundingBox) RayCollision;
|
||||||
pub extern fn GetRayCollisionModel(ray: Ray, model: Model) RayCollision;
|
|
||||||
pub extern fn GetRayCollisionMesh(ray: Ray, mesh: Mesh, transform: Matrix) RayCollision;
|
pub extern fn GetRayCollisionMesh(ray: Ray, mesh: Mesh, transform: Matrix) RayCollision;
|
||||||
pub extern fn GetRayCollisionTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) RayCollision;
|
pub extern fn GetRayCollisionTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3) RayCollision;
|
||||||
pub extern fn GetRayCollisionQuad(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3) RayCollision;
|
pub extern fn GetRayCollisionQuad(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3) RayCollision;
|
||||||
@ -546,5 +551,8 @@ pub extern fn SetAudioStreamVolume(stream: AudioStream, volume: f32) void;
|
|||||||
pub extern fn SetAudioStreamPitch(stream: AudioStream, pitch: f32) void;
|
pub extern fn SetAudioStreamPitch(stream: AudioStream, pitch: f32) void;
|
||||||
pub extern fn SetAudioStreamPan(stream: AudioStream, pan: f32) void;
|
pub extern fn SetAudioStreamPan(stream: AudioStream, pan: f32) void;
|
||||||
pub extern fn SetAudioStreamBufferSizeDefault(size: c_int) void;
|
pub extern fn SetAudioStreamBufferSizeDefault(size: c_int) void;
|
||||||
|
pub extern fn SetAudioStreamCallback(stream: AudioStream, callback: AudioCallback) void;
|
||||||
|
pub extern fn AttachAudioStreamProcessor(stream: AudioStream, processor: AudioCallback) void;
|
||||||
|
pub extern fn DetachAudioStreamProcessor(stream: AudioStream, processor: AudioCallback) void;
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ pub extern fn Clamp(value: f32, min: f32, max: f32) f32;
|
|||||||
pub extern fn Lerp(start: f32, end: f32, amount: f32) f32;
|
pub extern fn Lerp(start: f32, end: f32, amount: f32) f32;
|
||||||
pub extern fn Normalize(value: f32, start: f32, end: f32) f32;
|
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 Remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32;
|
||||||
|
pub extern fn Wrap(value: f32, min: f32, max: f32) f32;
|
||||||
|
pub extern fn FloatEquals(x: f32, y: f32) c_int;
|
||||||
pub extern fn Vector2Zero() Vector2;
|
pub extern fn Vector2Zero() Vector2;
|
||||||
pub extern fn Vector2One() Vector2;
|
pub extern fn Vector2One() Vector2;
|
||||||
pub extern fn Vector2Add(v1: Vector2, v2: Vector2) Vector2;
|
pub extern fn Vector2Add(v1: Vector2, v2: Vector2) Vector2;
|
||||||
@ -34,6 +36,10 @@ pub extern fn Vector2Lerp(v1: Vector2, v2: Vector2, amount: f32) Vector2;
|
|||||||
pub extern fn Vector2Reflect(v: Vector2, normal: Vector2) Vector2;
|
pub extern fn Vector2Reflect(v: Vector2, normal: Vector2) Vector2;
|
||||||
pub extern fn Vector2Rotate(v: Vector2, angle: f32) Vector2;
|
pub extern fn Vector2Rotate(v: Vector2, angle: f32) Vector2;
|
||||||
pub extern fn Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2;
|
pub extern fn Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2;
|
||||||
|
pub extern fn Vector2Invert(v: Vector2) Vector2;
|
||||||
|
pub extern fn Vector2Clamp(v: Vector2, min: Vector2, max: Vector2) Vector2;
|
||||||
|
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 extern fn Vector3Zero() Vector3;
|
||||||
pub extern fn Vector3One() Vector3;
|
pub extern fn Vector3One() Vector3;
|
||||||
pub extern fn Vector3Add(v1: Vector3, v2: Vector3) Vector3;
|
pub extern fn Vector3Add(v1: Vector3, v2: Vector3) Vector3;
|
||||||
@ -56,6 +62,7 @@ pub extern fn Vector3Normalize(v: Vector3) Vector3;
|
|||||||
pub extern fn Vector3OrthoNormalize(v1: [*c]Vector3, v2: [*c]Vector3) void;
|
pub extern fn Vector3OrthoNormalize(v1: [*c]Vector3, v2: [*c]Vector3) void;
|
||||||
pub extern fn Vector3Transform(v: Vector3, mat: Matrix) Vector3;
|
pub extern fn Vector3Transform(v: Vector3, mat: Matrix) Vector3;
|
||||||
pub extern fn Vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3;
|
pub extern fn Vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3;
|
||||||
|
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 Vector3Lerp(v1: Vector3, v2: Vector3, amount: f32) Vector3;
|
||||||
pub extern fn Vector3Reflect(v: Vector3, normal: Vector3) Vector3;
|
pub extern fn Vector3Reflect(v: Vector3, normal: Vector3) Vector3;
|
||||||
pub extern fn Vector3Min(v1: Vector3, v2: Vector3) Vector3;
|
pub extern fn Vector3Min(v1: Vector3, v2: Vector3) Vector3;
|
||||||
@ -63,11 +70,15 @@ 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 Vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) Vector3;
|
||||||
pub extern fn Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3;
|
pub extern fn Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3;
|
||||||
pub extern fn Vector3ToFloatV(v: Vector3) float3;
|
pub extern fn Vector3ToFloatV(v: Vector3) float3;
|
||||||
|
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 extern fn Vector3Equals(p: Vector3, q: Vector3) c_int;
|
||||||
|
pub extern fn Vector3Refract(v: Vector3, n: Vector3, r: f32) Vector3;
|
||||||
pub extern fn MatrixDeterminant(mat: Matrix) f32;
|
pub extern fn MatrixDeterminant(mat: Matrix) f32;
|
||||||
pub extern fn MatrixTrace(mat: Matrix) f32;
|
pub extern fn MatrixTrace(mat: Matrix) f32;
|
||||||
pub extern fn MatrixTranspose(mat: Matrix) Matrix;
|
pub extern fn MatrixTranspose(mat: Matrix) Matrix;
|
||||||
pub extern fn MatrixInvert(mat: Matrix) Matrix;
|
pub extern fn MatrixInvert(mat: Matrix) Matrix;
|
||||||
pub extern fn MatrixNormalize(mat: Matrix) Matrix;
|
|
||||||
pub extern fn MatrixIdentity() Matrix;
|
pub extern fn MatrixIdentity() Matrix;
|
||||||
pub extern fn MatrixAdd(left: Matrix, right: Matrix) Matrix;
|
pub extern fn MatrixAdd(left: Matrix, right: Matrix) Matrix;
|
||||||
pub extern fn MatrixSubtract(left: Matrix, right: Matrix) Matrix;
|
pub extern fn MatrixSubtract(left: Matrix, right: Matrix) Matrix;
|
||||||
@ -77,8 +88,8 @@ pub extern fn MatrixRotate(axis: Vector3, angle: f32) Matrix;
|
|||||||
pub extern fn MatrixRotateX(angle: f32) Matrix;
|
pub extern fn MatrixRotateX(angle: f32) Matrix;
|
||||||
pub extern fn MatrixRotateY(angle: f32) Matrix;
|
pub extern fn MatrixRotateY(angle: f32) Matrix;
|
||||||
pub extern fn MatrixRotateZ(angle: f32) Matrix;
|
pub extern fn MatrixRotateZ(angle: f32) Matrix;
|
||||||
pub extern fn MatrixRotateXYZ(ang: Vector3) Matrix;
|
pub extern fn MatrixRotateXYZ(angle: Vector3) Matrix;
|
||||||
pub extern fn MatrixRotateZYX(ang: Vector3) Matrix;
|
pub extern fn MatrixRotateZYX(angle: Vector3) Matrix;
|
||||||
pub extern fn MatrixScale(x: f32, y: f32, z: f32) Matrix;
|
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 MatrixFrustum(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix;
|
||||||
pub extern fn MatrixPerspective(fovy: f64, aspect: f64, near: f64, far: f64) Matrix;
|
pub extern fn MatrixPerspective(fovy: f64, aspect: f64, near: f64, far: f64) Matrix;
|
||||||
@ -107,5 +118,6 @@ pub extern fn QuaternionToAxisAngle(q: Quaternion, outAxis: [*c]Vector3, outAngl
|
|||||||
pub extern fn QuaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion;
|
pub extern fn QuaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion;
|
||||||
pub extern fn QuaternionToEuler(q: Quaternion) Vector3;
|
pub extern fn QuaternionToEuler(q: Quaternion) Vector3;
|
||||||
pub extern fn QuaternionTransform(q: Quaternion, mat: Matrix) Quaternion;
|
pub extern fn QuaternionTransform(q: Quaternion, mat: Matrix) Quaternion;
|
||||||
|
pub extern fn QuaternionEquals(p: Quaternion, q: Quaternion) c_int;
|
||||||
|
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ pub const Mesh = extern struct {
|
|||||||
indices: [*c]c_ushort,
|
indices: [*c]c_ushort,
|
||||||
animVertices: [*c]f32,
|
animVertices: [*c]f32,
|
||||||
animNormals: [*c]f32,
|
animNormals: [*c]f32,
|
||||||
boneIds: [*c]c_int,
|
boneIds: [*c]u8,
|
||||||
boneWeights: [*c]f32,
|
boneWeights: [*c]f32,
|
||||||
vaoId: c_uint,
|
vaoId: c_uint,
|
||||||
vboId: [*c]c_uint,
|
vboId: [*c]c_uint,
|
||||||
@ -336,7 +336,7 @@ pub const BoundingBox = extern struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub const Wave = extern struct {
|
pub const Wave = extern struct {
|
||||||
sampleCount: c_uint,
|
frameCount: c_uint,
|
||||||
sampleRate: c_uint,
|
sampleRate: c_uint,
|
||||||
sampleSize: c_uint,
|
sampleSize: c_uint,
|
||||||
channels: c_uint,
|
channels: c_uint,
|
||||||
@ -344,9 +344,11 @@ pub const Wave = extern struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub const rAudioBuffer = opaque {};
|
pub const rAudioBuffer = opaque {};
|
||||||
|
pub const rAudioProcessor = opaque {};
|
||||||
|
|
||||||
pub const AudioStream = extern struct {
|
pub const AudioStream = extern struct {
|
||||||
buffer: ?*rAudioBuffer,
|
buffer: ?*rAudioBuffer,
|
||||||
|
processor: ?*rAudioProcessor,
|
||||||
sampleRate: c_uint,
|
sampleRate: c_uint,
|
||||||
sampleSize: c_uint,
|
sampleSize: c_uint,
|
||||||
channels: c_uint,
|
channels: c_uint,
|
||||||
@ -389,6 +391,12 @@ pub const VrStereoConfig = extern struct {
|
|||||||
scaleIn: [2]f32,
|
scaleIn: [2]f32,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const FilePathList = extern struct {
|
||||||
|
capacity: c_uint,
|
||||||
|
count: c_uint,
|
||||||
|
paths: [*c][*c]u8,
|
||||||
|
};
|
||||||
|
|
||||||
pub const ConfigFlags = enum(c_int) {
|
pub const ConfigFlags = enum(c_int) {
|
||||||
FLAG_FULLSCREEN_MODE = 2,
|
FLAG_FULLSCREEN_MODE = 2,
|
||||||
FLAG_WINDOW_RESIZABLE = 4,
|
FLAG_WINDOW_RESIZABLE = 4,
|
||||||
@ -403,6 +411,7 @@ pub const ConfigFlags = enum(c_int) {
|
|||||||
FLAG_WINDOW_UNFOCUSED = 2048,
|
FLAG_WINDOW_UNFOCUSED = 2048,
|
||||||
FLAG_WINDOW_TOPMOST = 4096,
|
FLAG_WINDOW_TOPMOST = 4096,
|
||||||
FLAG_WINDOW_HIGHDPI = 8192,
|
FLAG_WINDOW_HIGHDPI = 8192,
|
||||||
|
FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384,
|
||||||
FLAG_INTERLACED_HINT = 65536,
|
FLAG_INTERLACED_HINT = 65536,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -531,9 +540,13 @@ pub const KeyboardKey = enum(c_int) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub const MouseButton = enum(c_int) {
|
pub const MouseButton = enum(c_int) {
|
||||||
MOUSE_LEFT_BUTTON = 0,
|
MOUSE_BUTTON_LEFT = 0,
|
||||||
MOUSE_RIGHT_BUTTON = 1,
|
MOUSE_BUTTON_RIGHT = 1,
|
||||||
MOUSE_MIDDLE_BUTTON = 2,
|
MOUSE_BUTTON_MIDDLE = 2,
|
||||||
|
MOUSE_BUTTON_SIDE = 3,
|
||||||
|
MOUSE_BUTTON_EXTRA = 4,
|
||||||
|
MOUSE_BUTTON_FORWARD = 5,
|
||||||
|
MOUSE_BUTTON_BACK = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const MouseCursor = enum(c_int) {
|
pub const MouseCursor = enum(c_int) {
|
||||||
@ -588,10 +601,10 @@ pub const MaterialMapIndex = enum(c_int) {
|
|||||||
MATERIAL_MAP_OCCLUSION = 4,
|
MATERIAL_MAP_OCCLUSION = 4,
|
||||||
MATERIAL_MAP_EMISSION = 5,
|
MATERIAL_MAP_EMISSION = 5,
|
||||||
MATERIAL_MAP_HEIGHT = 6,
|
MATERIAL_MAP_HEIGHT = 6,
|
||||||
MATERIAL_MAP_BRDG = 7,
|
MATERIAL_MAP_CUBEMAP = 7,
|
||||||
MATERIAL_MAP_CUBEMAP = 8,
|
MATERIAL_MAP_IRRADIANCE = 8,
|
||||||
MATERIAL_MAP_IRRADIANCE = 9,
|
MATERIAL_MAP_PREFILTER = 9,
|
||||||
MATERIAL_MAP_PREFILTER = 10,
|
MATERIAL_MAP_BRDF = 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const ShaderLocationIndex = enum(c_int) {
|
pub const ShaderLocationIndex = enum(c_int) {
|
||||||
@ -696,6 +709,7 @@ pub const BlendMode = enum(c_int) {
|
|||||||
BLEND_MULTIPLIED = 2,
|
BLEND_MULTIPLIED = 2,
|
||||||
BLEND_ADD_COLORS = 3,
|
BLEND_ADD_COLORS = 3,
|
||||||
BLEND_SUBTRACT_COLORS = 4,
|
BLEND_SUBTRACT_COLORS = 4,
|
||||||
|
BLEND_ALPHA_PREMULTIPLY = 5,
|
||||||
BLEND_CUSTOM = 5,
|
BLEND_CUSTOM = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -727,9 +741,9 @@ pub const CameraProjection = enum(c_int) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub const NPatchType = enum(c_int) {
|
pub const NPatchType = enum(c_int) {
|
||||||
NPT_9PATCH = 0,
|
NPATCH_NINE_PATCH = 0,
|
||||||
NPT_3PATCH_VERTICAL = 1,
|
NPATCH_THREE_PATCH_VERTICAL = 1,
|
||||||
NPT_3PATCH_HORIZONTAL = 2,
|
NPATCH_THREE_PATCH_HORIZONTAL = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
// pub const TraceLogCallback = ?fn (c_int, [*c]const u8, [*c]struct___va_list_tag) callconv(.C) void;
|
// pub const TraceLogCallback = ?fn (c_int, [*c]const u8, [*c]struct___va_list_tag) callconv(.C) void;
|
||||||
|
2
raylib
2
raylib
@ -1 +1 @@
|
|||||||
Subproject commit 9ecbc465a934fdde9e3d69a709370a370bf193a0
|
Subproject commit d658e6772d75bce52fbe46cc9789f0b33500bc0f
|
Loading…
x
Reference in New Issue
Block a user