mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 03:57:29 +00:00
Update zig functions to raylib 5.0
This commit is contained in:
parent
90bb1071dc
commit
37ddb70f93
@ -21,7 +21,15 @@ ZIGGIFY = {
|
||||
"c_uint": "u32"
|
||||
}
|
||||
|
||||
|
||||
IGNORE_TYPES = [
|
||||
"[*c]Color",
|
||||
"[*c]GlyphInfo",
|
||||
"[*c]c_int",
|
||||
"[*c][*c]const u8",
|
||||
"[*c]Material",
|
||||
"[*c]ModelAnimation",
|
||||
"[*c]f32",
|
||||
]
|
||||
# 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.
|
||||
def c_to_zig_type(c: str) -> str:
|
||||
@ -43,14 +51,16 @@ def ziggify_type(name: str, t: str) -> str:
|
||||
"camera", "collisionPoint", "frames", "image", "colorCount", "dst",
|
||||
"texture", "srcPtr", "dstPtr", "count", "codepointSize", "utf8Size",
|
||||
"position", "mesh", "materialCount", "material", "model", "animCount",
|
||||
"wave", "v1", "v2", "outAxis", "outAngle", "fileSize"
|
||||
"wave", "v1", "v2", "outAxis", "outAngle", "fileSize",
|
||||
"AutomationEventList", "list"
|
||||
]
|
||||
multi = [
|
||||
"data", "compData", "points", "fileData", "colors", "pixels",
|
||||
"fontChars", "chars", "recs", "codepoints", "textList", "transforms",
|
||||
"animations", "samples", "LoadImageColors", "LoadImagePalette",
|
||||
"LoadFontData", "LoadCodepoints", "TextSplit", "LoadMaterials",
|
||||
"LoadModelAnimations", "LoadWaveSamples", "images"
|
||||
"LoadModelAnimations", "LoadWaveSamples", "images",
|
||||
"LoadRandomSequence", "sequence", "kernel", "GlyphInfo", "glyphs", "glyphRecs",
|
||||
]
|
||||
string = False
|
||||
|
||||
@ -106,15 +116,7 @@ def make_return_cast(source_type: str, dest_type: str, inner: str) -> str:
|
||||
|
||||
# These all have to be done manually because their sizes depend on the
|
||||
# function arguments.
|
||||
if source_type in [
|
||||
"[*c]Color",
|
||||
"[*c]GlyphInfo",
|
||||
"[*c]c_int",
|
||||
"[*c][*c]const u8",
|
||||
"[*c]Material",
|
||||
"[*c]ModelAnimation",
|
||||
"[*c]f32",
|
||||
]:
|
||||
if source_type in IGNORE_TYPES:
|
||||
return None
|
||||
else:
|
||||
raise ValueError(f"Don't know what to do {source_type} {dest_type} {inner}")
|
||||
@ -281,9 +283,6 @@ def parse_header(header_name: str, output_file: str, ext_file: str, prefix: str,
|
||||
"EncodeDataBase64",
|
||||
"DecodeDataBase64",
|
||||
"SetWindowIcons",
|
||||
"DrawLineStrip",
|
||||
"DrawTriangleFan",
|
||||
"DrawTriangleStrip",
|
||||
"CheckCollisionPointPoly",
|
||||
"LoadFontEx",
|
||||
"GenImageFontAtlas",
|
||||
|
@ -3,8 +3,8 @@
|
||||
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 WindowShouldClose() bool;
|
||||
pub extern "c" fn IsWindowReady() bool;
|
||||
pub extern "c" fn IsWindowFullscreen() bool;
|
||||
pub extern "c" fn IsWindowHidden() bool;
|
||||
@ -26,6 +26,7 @@ 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 SetWindowMaxSize(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 SetWindowFocused() void;
|
||||
@ -49,9 +50,6 @@ 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;
|
||||
@ -95,27 +93,32 @@ pub extern "c" fn GetScreenToWorld2D(position: rl.Vector2, camera: rl.Camera2D)
|
||||
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 GetFPS() c_int;
|
||||
pub extern "c" fn SwapScreenBuffer() void;
|
||||
pub extern "c" fn PollInputEvents() void;
|
||||
pub extern "c" fn WaitTime(seconds: f64) void;
|
||||
pub extern "c" fn SetRandomSeed(seed: c_uint) void;
|
||||
pub extern "c" fn GetRandomValue(min: c_int, max: c_int) c_int;
|
||||
pub extern "c" fn LoadRandomSequence(count: c_uint, min: c_int, max: c_int) [*c]c_int;
|
||||
pub extern "c" fn UnloadRandomSequence(sequence: [*c]c_int) void;
|
||||
pub extern "c" fn TakeScreenshot(fileName: [*c]const u8) void;
|
||||
pub extern "c" fn SetConfigFlags(flags: rl.ConfigFlags) void;
|
||||
pub extern "c" fn OpenURL(url: [*c]const u8) void;
|
||||
pub extern "c" fn TraceLog(logLevel: rl.TraceLogLevel, text: [*c]const u8, ...) void;
|
||||
pub extern "c" fn SetTraceLogLevel(logLevel: rl.TraceLogLevel) 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 LoadFileData(fileName: [*c]const u8, dataSize: [*c]c_int) [*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 SaveFileData(fileName: [*c]const u8, data: *anyopaque, dataSize: c_int) bool;
|
||||
pub extern "c" fn ExportDataAsCode(data: [*c]const u8, dataSize: c_int, 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;
|
||||
@ -143,13 +146,22 @@ pub extern "c" fn CompressData(data: [*c]const u8, dataSize: c_int, compDataSize
|
||||
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 LoadAutomationEventList(fileName: [*c]const u8) rl.AutomationEventList;
|
||||
pub extern "c" fn UnloadAutomationEventList(list: rl.AutomationEventList) void;
|
||||
pub extern "c" fn ExportAutomationEventList(list: rl.AutomationEventList, fileName: [*c]const u8) bool;
|
||||
pub extern "c" fn SetAutomationEventList(list: [*c]rl.AutomationEventList) void;
|
||||
pub extern "c" fn SetAutomationEventBaseFrame(frame: c_int) void;
|
||||
pub extern "c" fn StartAutomationEventRecording() void;
|
||||
pub extern "c" fn StopAutomationEventRecording() void;
|
||||
pub extern "c" fn PlayAutomationEvent(event: rl.AutomationEvent) void;
|
||||
pub extern "c" fn IsKeyPressed(key: rl.KeyboardKey) bool;
|
||||
pub extern "c" fn IsKeyPressedRepeat(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() rl.KeyboardKey;
|
||||
pub extern "c" fn GetCharPressed() c_int;
|
||||
pub extern "c" fn SetExitKey(key: rl.KeyboardKey) void;
|
||||
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;
|
||||
@ -195,10 +207,8 @@ 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 DrawLineStrip(points: [*c]const rl.Vector2, pointCount: c_int, 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;
|
||||
@ -223,23 +233,39 @@ pub extern "c" fn DrawRectangleRounded(rec: rl.Rectangle, roundness: f32, segmen
|
||||
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 DrawTriangleFan(points: [*c]const rl.Vector2, pointCount: c_int, color: rl.Color) void;
|
||||
pub extern "c" fn DrawTriangleStrip(points: [*c]const 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 DrawSplineLinear(points: [*c]const rl.Vector2, pointCount: c_int, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineBasis(points: [*c]const rl.Vector2, pointCount: c_int, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineCatmullRom(points: [*c]const rl.Vector2, pointCount: c_int, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineBezierQuadratic(points: [*c]const rl.Vector2, pointCount: c_int, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineBezierCubic(points: [*c]const rl.Vector2, pointCount: c_int, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineSegmentLinear(p1: rl.Vector2, p2: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineSegmentBasis(p1: rl.Vector2, p2: rl.Vector2, p3: rl.Vector2, p4: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineSegmentCatmullRom(p1: rl.Vector2, p2: rl.Vector2, p3: rl.Vector2, p4: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineSegmentBezierQuadratic(p1: rl.Vector2, c2: rl.Vector2, p3: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn DrawSplineSegmentBezierCubic(p1: rl.Vector2, c2: rl.Vector2, c3: rl.Vector2, p4: rl.Vector2, thick: f32, color: rl.Color) void;
|
||||
pub extern "c" fn GetSplinePointLinear(startPos: rl.Vector2, endPos: rl.Vector2, t: f32) rl.Vector2;
|
||||
pub extern "c" fn GetSplinePointBasis(p1: rl.Vector2, p2: rl.Vector2, p3: rl.Vector2, p4: rl.Vector2, t: f32) rl.Vector2;
|
||||
pub extern "c" fn GetSplinePointCatmullRom(p1: rl.Vector2, p2: rl.Vector2, p3: rl.Vector2, p4: rl.Vector2, t: f32) rl.Vector2;
|
||||
pub extern "c" fn GetSplinePointBezierQuad(p1: rl.Vector2, c2: rl.Vector2, p3: rl.Vector2, t: f32) rl.Vector2;
|
||||
pub extern "c" fn GetSplinePointBezierCubic(p1: rl.Vector2, c2: rl.Vector2, c3: rl.Vector2, p4: rl.Vector2, t: f32) rl.Vector2;
|
||||
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 CheckCollisionPointPoly(point: rl.Vector2, points: [*c]const 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 LoadImageSvg(fileNameOrString: [*c]const u8, width: c_int, height: 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;
|
||||
@ -270,6 +296,7 @@ pub extern "c" fn ImageAlphaClear(image: [*c]rl.Image, color: rl.Color, threshol
|
||||
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 ImageKernelConvolution(image: [*c]rl.Image, kernel: [*c]f32, kernelSize: 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;
|
||||
@ -344,13 +371,13 @@ pub extern "c" fn SetPixelColor(dstPtr: *anyopaque, color: rl.Color, format: c_i
|
||||
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 LoadFontEx(fileName: [*c]const u8, fontSize: c_int, codepoints: [*c]c_int, codepointCount: 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 LoadFontFromMemory(fileType: [*c]const u8, fileData: [*c]const u8, dataSize: c_int, fontSize: c_int, codepoints: [*c]c_int, codepointCount: c_int) rl.Font;
|
||||
pub extern "c" fn IsFontReady(font: rl.Font) bool;
|
||||
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 LoadFontData(fileData: [*c]const u8, dataSize: c_int, fontSize: c_int, codepoints: [*c]c_int, codepointCount: c_int, ty: c_int) [*c]rl.GlyphInfo;
|
||||
pub extern "c" fn GenImageFontAtlas(glyphs: [*c]const rl.GlyphInfo, glyphRecs: [*c][*c]rl.Rectangle, glyphCount: c_int, fontSize: c_int, padding: c_int, packMethod: c_int) rl.Image;
|
||||
pub extern "c" fn UnloadFontData(glyphs: [*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;
|
||||
@ -358,7 +385,7 @@ pub extern "c" fn DrawText(text: [*c]const u8, posX: c_int, posY: c_int, fontSiz
|
||||
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 DrawTextCodepoints(font: rl.Font, codepoints: [*c]const c_int, codepointCount: c_int, position: rl.Vector2, fontSize: f32, spacing: f32, tint: rl.Color) void;
|
||||
pub extern "c" fn SetTextLineSpacing(spacing: c_int) 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;
|
||||
@ -389,11 +416,12 @@ 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 TextToFloat(text: [*c]const u8) f32;
|
||||
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 DrawTriangleStrip3D(points: [*c]const 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;
|
||||
@ -428,9 +456,10 @@ pub extern "c" fn UpdateMeshBuffer(mesh: rl.Mesh, index: c_int, data: *const any
|
||||
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 ExportMesh(mesh: rl.Mesh, fileName: [*c]const u8) bool;
|
||||
pub extern "c" fn ExportMeshAsCode(mesh: rl.Mesh, fileName: [*c]const u8) bool;
|
||||
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;
|
||||
@ -448,10 +477,10 @@ pub extern "c" fn IsMaterialReady(material: rl.Material) bool;
|
||||
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 LoadModelAnimations(fileName: [*c]const u8, animCount: [*c]c_int) [*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 UnloadModelAnimations(animations: [*c]rl.ModelAnimation, animCount: c_int) 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;
|
||||
@ -465,6 +494,7 @@ 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 GetMasterVolume() f32;
|
||||
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 IsWaveReady(wave: rl.Wave) bool;
|
||||
|
@ -55,6 +55,8 @@ 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 Vector3Project(v1: rl.Vector3, v2: rl.Vector3) rl.Vector3;
|
||||
pub extern "c" fn Vector3Reject(v1: rl.Vector3, v2: 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;
|
||||
|
@ -226,6 +226,14 @@ pub fn vector3Normalize(v: Vector3) Vector3 {
|
||||
return cdef.Vector3Normalize(v);
|
||||
}
|
||||
|
||||
pub fn vector3Project(v1: Vector3, v2: Vector3) Vector3 {
|
||||
return cdef.Vector3Project(v1, v2);
|
||||
}
|
||||
|
||||
pub fn vector3Reject(v1: Vector3, v2: Vector3) Vector3 {
|
||||
return cdef.Vector3Reject(v1, v2);
|
||||
}
|
||||
|
||||
pub fn vector3OrthoNormalize(v1: *Vector3, v2: *Vector3) void {
|
||||
cdef.Vector3OrthoNormalize(@as([*c]Vector3, @ptrCast(v1)), @as([*c]Vector3, @ptrCast(v2)));
|
||||
}
|
||||
|
@ -1376,20 +1376,20 @@ pub fn loadMusicStreamFromMemory(fileType: [:0]const u8, data: []const u8) Music
|
||||
return cdef.LoadMusicStreamFromMemory(@as([*c]const u8, @ptrCast(fileType)), @as([*c]const u8, @ptrCast(data)), @as(c_int, @intCast(data.len)));
|
||||
}
|
||||
|
||||
pub fn drawLineStrip(points: []const Vector2, color: Color) void {
|
||||
cdef.DrawLineStrip(@as([*c]Vector2, @constCast(@ptrCast(points))), @as(c_int, @intCast(points.len)), color);
|
||||
pub fn drawLineStrip(points: []Vector2, color: Color) void {
|
||||
cdef.DrawLineStrip(@as([*c]Vector2, @ptrCast(points)), @as(c_int, @intCast(points.len)), color);
|
||||
}
|
||||
|
||||
pub fn drawTriangleFan(points: []const Vector2, color: Color) void {
|
||||
cdef.DrawTriangleFan(@as([*c]Vector2, @constCast(@ptrCast(points))), @as(c_int, @intCast(points.len)), color);
|
||||
pub fn drawTriangleFan(points: []Vector2, color: Color) void {
|
||||
cdef.DrawTriangleFan(@as([*c]Vector2, @ptrCast(points)), @as(c_int, @intCast(points.len)), color);
|
||||
}
|
||||
|
||||
pub fn drawTriangleStrip(points: []const Vector2, color: Color) void {
|
||||
cdef.DrawTriangleStrip(@as([*c]Vector2, @constCast(@ptrCast(points))), @as(c_int, @intCast(points.len)), color);
|
||||
pub fn drawTriangleStrip(points: []Vector2, color: Color) void {
|
||||
cdef.DrawTriangleStrip(@as([*c]Vector2, @ptrCast(points)), @as(c_int, @intCast(points.len)), color);
|
||||
}
|
||||
|
||||
pub fn checkCollisionPointPoly(point: Vector2, points: []const Vector2) bool {
|
||||
return cdef.CheckCollisionPointPoly(point, @as([*c]Vector2, @constCast(@ptrCast(points))), @as(c_int, @intCast(points.len)));
|
||||
pub fn checkCollisionPointPoly(point: Vector2, points: []Vector2) bool {
|
||||
return cdef.CheckCollisionPointPoly(point, @as([*c]Vector2, @ptrCast(points)), @as(c_int, @intCast(points.len)));
|
||||
}
|
||||
|
||||
pub fn loadFontEx(fileName: [:0]const u8, fontSize: i32, fontChars: []i32) Font {
|
||||
@ -1420,14 +1420,14 @@ pub fn initWindow(width: i32, height: i32, title: [:0]const u8) void {
|
||||
cdef.InitWindow(@as(c_int, width), @as(c_int, height), @as([*c]const u8, @ptrCast(title)));
|
||||
}
|
||||
|
||||
pub fn windowShouldClose() bool {
|
||||
return cdef.WindowShouldClose();
|
||||
}
|
||||
|
||||
pub fn closeWindow() void {
|
||||
cdef.CloseWindow();
|
||||
}
|
||||
|
||||
pub fn windowShouldClose() bool {
|
||||
return cdef.WindowShouldClose();
|
||||
}
|
||||
|
||||
pub fn isWindowReady() bool {
|
||||
return cdef.IsWindowReady();
|
||||
}
|
||||
@ -1508,6 +1508,10 @@ pub fn setWindowMinSize(width: i32, height: i32) void {
|
||||
cdef.SetWindowMinSize(@as(c_int, width), @as(c_int, height));
|
||||
}
|
||||
|
||||
pub fn setWindowMaxSize(width: i32, height: i32) void {
|
||||
cdef.SetWindowMaxSize(@as(c_int, width), @as(c_int, height));
|
||||
}
|
||||
|
||||
pub fn setWindowSize(width: i32, height: i32) void {
|
||||
cdef.SetWindowSize(@as(c_int, width), @as(c_int, height));
|
||||
}
|
||||
@ -1600,18 +1604,6 @@ pub fn disableEventWaiting() void {
|
||||
cdef.DisableEventWaiting();
|
||||
}
|
||||
|
||||
pub fn swapScreenBuffer() void {
|
||||
cdef.SwapScreenBuffer();
|
||||
}
|
||||
|
||||
pub fn pollInputEvents() void {
|
||||
cdef.PollInputEvents();
|
||||
}
|
||||
|
||||
pub fn waitTime(seconds: f64) void {
|
||||
cdef.WaitTime(seconds);
|
||||
}
|
||||
|
||||
pub fn showCursor() void {
|
||||
cdef.ShowCursor();
|
||||
}
|
||||
@ -1776,10 +1768,6 @@ pub fn setTargetFPS(fps: i32) void {
|
||||
cdef.SetTargetFPS(@as(c_int, fps));
|
||||
}
|
||||
|
||||
pub fn getFPS() i32 {
|
||||
return @as(i32, cdef.GetFPS());
|
||||
}
|
||||
|
||||
pub fn getFrameTime() f32 {
|
||||
return cdef.GetFrameTime();
|
||||
}
|
||||
@ -1788,14 +1776,34 @@ pub fn getTime() f64 {
|
||||
return cdef.GetTime();
|
||||
}
|
||||
|
||||
pub fn getRandomValue(min: i32, max: i32) i32 {
|
||||
return @as(i32, cdef.GetRandomValue(@as(c_int, min), @as(c_int, max)));
|
||||
pub fn getFPS() i32 {
|
||||
return @as(i32, cdef.GetFPS());
|
||||
}
|
||||
|
||||
pub fn swapScreenBuffer() void {
|
||||
cdef.SwapScreenBuffer();
|
||||
}
|
||||
|
||||
pub fn pollInputEvents() void {
|
||||
cdef.PollInputEvents();
|
||||
}
|
||||
|
||||
pub fn waitTime(seconds: f64) void {
|
||||
cdef.WaitTime(seconds);
|
||||
}
|
||||
|
||||
pub fn setRandomSeed(seed: u32) void {
|
||||
cdef.SetRandomSeed(@as(c_uint, seed));
|
||||
}
|
||||
|
||||
pub fn getRandomValue(min: i32, max: i32) i32 {
|
||||
return @as(i32, cdef.GetRandomValue(@as(c_int, min), @as(c_int, max)));
|
||||
}
|
||||
|
||||
pub fn unloadRandomSequence(sequence: []i32) void {
|
||||
cdef.UnloadRandomSequence(@as([*c]c_int, @ptrCast(sequence)));
|
||||
}
|
||||
|
||||
pub fn takeScreenshot(fileName: [:0]const u8) void {
|
||||
cdef.TakeScreenshot(@as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
@ -1804,6 +1812,10 @@ pub fn setConfigFlags(flags: ConfigFlags) void {
|
||||
cdef.SetConfigFlags(flags);
|
||||
}
|
||||
|
||||
pub fn openURL(url: [:0]const u8) void {
|
||||
cdef.OpenURL(@as([*c]const u8, @ptrCast(url)));
|
||||
}
|
||||
|
||||
pub fn traceLog(logLevel: TraceLogLevel, text: [:0]const u8) void {
|
||||
cdef.TraceLog(logLevel, @as([*c]const u8, @ptrCast(text)));
|
||||
}
|
||||
@ -1824,10 +1836,6 @@ pub fn memFree(ptr: *anyopaque) void {
|
||||
cdef.MemFree(ptr);
|
||||
}
|
||||
|
||||
pub fn openURL(url: [:0]const u8) void {
|
||||
cdef.OpenURL(@as([*c]const u8, @ptrCast(url)));
|
||||
}
|
||||
|
||||
pub fn setLoadFileDataCallback(callback: LoadFileDataCallback) void {
|
||||
cdef.SetLoadFileDataCallback(callback);
|
||||
}
|
||||
@ -1940,10 +1948,46 @@ pub fn getFileModTime(fileName: [:0]const u8) i64 {
|
||||
return @as(i64, cdef.GetFileModTime(@as([*c]const u8, @ptrCast(fileName))));
|
||||
}
|
||||
|
||||
pub fn loadAutomationEventList(fileName: [:0]const u8) AutomationEventList {
|
||||
return cdef.LoadAutomationEventList(@as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
|
||||
pub fn unloadAutomationEventList(list: AutomationEventList) void {
|
||||
cdef.UnloadAutomationEventList(list);
|
||||
}
|
||||
|
||||
pub fn exportAutomationEventList(list: AutomationEventList, fileName: [:0]const u8) bool {
|
||||
return cdef.ExportAutomationEventList(list, @as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
|
||||
pub fn setAutomationEventList(list: *AutomationEventList) void {
|
||||
cdef.SetAutomationEventList(@as([*c]AutomationEventList, @ptrCast(list)));
|
||||
}
|
||||
|
||||
pub fn setAutomationEventBaseFrame(frame: i32) void {
|
||||
cdef.SetAutomationEventBaseFrame(@as(c_int, frame));
|
||||
}
|
||||
|
||||
pub fn startAutomationEventRecording() void {
|
||||
cdef.StartAutomationEventRecording();
|
||||
}
|
||||
|
||||
pub fn stopAutomationEventRecording() void {
|
||||
cdef.StopAutomationEventRecording();
|
||||
}
|
||||
|
||||
pub fn playAutomationEvent(event: AutomationEvent) void {
|
||||
cdef.PlayAutomationEvent(event);
|
||||
}
|
||||
|
||||
pub fn isKeyPressed(key: KeyboardKey) bool {
|
||||
return cdef.IsKeyPressed(key);
|
||||
}
|
||||
|
||||
pub fn isKeyPressedRepeat(key: KeyboardKey) bool {
|
||||
return cdef.IsKeyPressedRepeat(key);
|
||||
}
|
||||
|
||||
pub fn isKeyDown(key: KeyboardKey) bool {
|
||||
return cdef.IsKeyDown(key);
|
||||
}
|
||||
@ -1956,10 +2000,6 @@ pub fn isKeyUp(key: KeyboardKey) bool {
|
||||
return cdef.IsKeyUp(key);
|
||||
}
|
||||
|
||||
pub fn setExitKey(key: KeyboardKey) void {
|
||||
cdef.SetExitKey(key);
|
||||
}
|
||||
|
||||
pub fn getKeyPressed() KeyboardKey {
|
||||
return cdef.GetKeyPressed();
|
||||
}
|
||||
@ -1968,6 +2008,10 @@ pub fn getCharPressed() i32 {
|
||||
return @as(i32, cdef.GetCharPressed());
|
||||
}
|
||||
|
||||
pub fn setExitKey(key: KeyboardKey) void {
|
||||
cdef.SetExitKey(key);
|
||||
}
|
||||
|
||||
pub fn isGamepadAvailable(gamepad: i32) bool {
|
||||
return cdef.IsGamepadAvailable(@as(c_int, gamepad));
|
||||
}
|
||||
@ -2148,18 +2192,14 @@ pub fn drawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color)
|
||||
cdef.DrawLineEx(startPos, endPos, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawLineStrip(points: []const Vector2, pointCount: i32, color: Color) void {
|
||||
cdef.DrawLineStrip(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), color);
|
||||
}
|
||||
|
||||
pub fn drawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawLineBezier(startPos, endPos, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawLineBezierQuad(startPos: Vector2, endPos: Vector2, controlPos: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawLineBezierQuad(startPos, endPos, controlPos, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawLineBezierCubic(startPos: Vector2, endPos: Vector2, startControlPos: Vector2, endControlPos: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawLineBezierCubic(startPos, endPos, startControlPos, endControlPos, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawCircle(centerX: i32, centerY: i32, radius: f32, color: Color) void {
|
||||
cdef.DrawCircle(@as(c_int, centerX), @as(c_int, centerY), radius, color);
|
||||
}
|
||||
@ -2256,6 +2296,14 @@ pub fn drawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) vo
|
||||
cdef.DrawTriangleLines(v1, v2, v3, color);
|
||||
}
|
||||
|
||||
pub fn drawTriangleFan(points: []const Vector2, pointCount: i32, color: Color) void {
|
||||
cdef.DrawTriangleFan(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), color);
|
||||
}
|
||||
|
||||
pub fn drawTriangleStrip(points: []const Vector2, pointCount: i32, color: Color) void {
|
||||
cdef.DrawTriangleStrip(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), color);
|
||||
}
|
||||
|
||||
pub fn drawPoly(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) void {
|
||||
cdef.DrawPoly(center, @as(c_int, sides), radius, rotation, color);
|
||||
}
|
||||
@ -2268,6 +2316,66 @@ pub fn drawPolyLinesEx(center: Vector2, sides: i32, radius: f32, rotation: f32,
|
||||
cdef.DrawPolyLinesEx(center, @as(c_int, sides), radius, rotation, lineThick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineLinear(points: []const Vector2, pointCount: i32, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineLinear(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineBasis(points: []const Vector2, pointCount: i32, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineBasis(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineCatmullRom(points: []const Vector2, pointCount: i32, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineCatmullRom(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineBezierQuadratic(points: []const Vector2, pointCount: i32, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineBezierQuadratic(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineBezierCubic(points: []const Vector2, pointCount: i32, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineBezierCubic(@as([*c]const Vector2, @ptrCast(points)), @as(c_int, pointCount), thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineSegmentLinear(p1: Vector2, p2: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineSegmentLinear(p1, p2, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineSegmentBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineSegmentBasis(p1, p2, p3, p4, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineSegmentCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineSegmentCatmullRom(p1, p2, p3, p4, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineSegmentBezierQuadratic(p1: Vector2, c2: Vector2, p3: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineSegmentBezierQuadratic(p1, c2, p3, thick, color);
|
||||
}
|
||||
|
||||
pub fn drawSplineSegmentBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: f32, color: Color) void {
|
||||
cdef.DrawSplineSegmentBezierCubic(p1, c2, c3, p4, thick, color);
|
||||
}
|
||||
|
||||
pub fn getSplinePointLinear(startPos: Vector2, endPos: Vector2, t: f32) Vector2 {
|
||||
return cdef.GetSplinePointLinear(startPos, endPos, t);
|
||||
}
|
||||
|
||||
pub fn getSplinePointBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2 {
|
||||
return cdef.GetSplinePointBasis(p1, p2, p3, p4, t);
|
||||
}
|
||||
|
||||
pub fn getSplinePointCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2 {
|
||||
return cdef.GetSplinePointCatmullRom(p1, p2, p3, p4, t);
|
||||
}
|
||||
|
||||
pub fn getSplinePointBezierQuad(p1: Vector2, c2: Vector2, p3: Vector2, t: f32) Vector2 {
|
||||
return cdef.GetSplinePointBezierQuad(p1, c2, p3, t);
|
||||
}
|
||||
|
||||
pub fn getSplinePointBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: f32) Vector2 {
|
||||
return cdef.GetSplinePointBezierCubic(p1, c2, c3, p4, t);
|
||||
}
|
||||
|
||||
pub fn checkCollisionRecs(rec1: Rectangle, rec2: Rectangle) bool {
|
||||
return cdef.CheckCollisionRecs(rec1, rec2);
|
||||
}
|
||||
@ -2312,6 +2420,10 @@ pub fn loadImageRaw(fileName: [:0]const u8, width: i32, height: i32, format: i32
|
||||
return cdef.LoadImageRaw(@as([*c]const u8, @ptrCast(fileName)), @as(c_int, width), @as(c_int, height), @as(c_int, format), @as(c_int, headerSize));
|
||||
}
|
||||
|
||||
pub fn loadImageSvg(fileNameOrString: [:0]const u8, width: i32, height: i32) Image {
|
||||
return cdef.LoadImageSvg(@as([*c]const u8, @ptrCast(fileNameOrString)), @as(c_int, width), @as(c_int, height));
|
||||
}
|
||||
|
||||
pub fn loadImageAnim(fileName: [:0]const u8, frames: *i32) Image {
|
||||
return cdef.LoadImageAnim(@as([*c]const u8, @ptrCast(fileName)), @as([*c]c_int, @ptrCast(frames)));
|
||||
}
|
||||
@ -2428,6 +2540,10 @@ pub fn imageBlurGaussian(image: *Image, blurSize: i32) void {
|
||||
cdef.ImageBlurGaussian(@as([*c]Image, @ptrCast(image)), @as(c_int, blurSize));
|
||||
}
|
||||
|
||||
pub fn imageKernelConvolution(image: *Image, kernel: []f32, kernelSize: i32) void {
|
||||
cdef.ImageKernelConvolution(@as([*c]Image, @ptrCast(image)), @as([*c]f32, @ptrCast(kernel)), @as(c_int, kernelSize));
|
||||
}
|
||||
|
||||
pub fn imageResize(image: *Image, newWidth: i32, newHeight: i32) void {
|
||||
cdef.ImageResize(@as([*c]Image, @ptrCast(image)), @as(c_int, newWidth), @as(c_int, newHeight));
|
||||
}
|
||||
@ -2852,6 +2968,10 @@ pub fn textToInteger(text: [:0]const u8) i32 {
|
||||
return @as(i32, cdef.TextToInteger(@as([*c]const u8, @ptrCast(text))));
|
||||
}
|
||||
|
||||
pub fn textToFloat(text: [:0]const u8) f32 {
|
||||
return cdef.TextToFloat(@as([*c]const u8, @ptrCast(text)));
|
||||
}
|
||||
|
||||
pub fn drawLine3D(startPos: Vector3, endPos: Vector3, color: Color) void {
|
||||
cdef.DrawLine3D(startPos, endPos, color);
|
||||
}
|
||||
@ -3000,10 +3120,6 @@ pub fn drawMesh(mesh: Mesh, material: Material, transform: Matrix) void {
|
||||
cdef.DrawMesh(mesh, material, transform);
|
||||
}
|
||||
|
||||
pub fn exportMesh(mesh: Mesh, fileName: [:0]const u8) bool {
|
||||
return cdef.ExportMesh(mesh, @as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
|
||||
pub fn getMeshBoundingBox(mesh: Mesh) BoundingBox {
|
||||
return cdef.GetMeshBoundingBox(mesh);
|
||||
}
|
||||
@ -3012,6 +3128,14 @@ pub fn genMeshTangents(mesh: *Mesh) void {
|
||||
cdef.GenMeshTangents(@as([*c]Mesh, @ptrCast(mesh)));
|
||||
}
|
||||
|
||||
pub fn exportMesh(mesh: Mesh, fileName: [:0]const u8) bool {
|
||||
return cdef.ExportMesh(mesh, @as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
|
||||
pub fn exportMeshAsCode(mesh: Mesh, fileName: [:0]const u8) bool {
|
||||
return cdef.ExportMeshAsCode(mesh, @as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
|
||||
pub fn genMeshPoly(sides: i32, radius: f32) Mesh {
|
||||
return cdef.GenMeshPoly(@as(c_int, sides), radius);
|
||||
}
|
||||
@ -3136,6 +3260,10 @@ pub fn setMasterVolume(volume: f32) void {
|
||||
cdef.SetMasterVolume(volume);
|
||||
}
|
||||
|
||||
pub fn getMasterVolume() f32 {
|
||||
return cdef.GetMasterVolume();
|
||||
}
|
||||
|
||||
pub fn loadWave(fileName: [:0]const u8) Wave {
|
||||
return cdef.LoadWave(@as([*c]const u8, @ptrCast(fileName)));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user