From 4bba6fdce30bf20cb4fda680bb46917105f19d2d Mon Sep 17 00:00:00 2001 From: nub31 Date: Sun, 28 Sep 2025 21:46:37 +0200 Subject: [PATCH] mooooore bindings --- example/src/raylib.nub | 422 +++++++++++++++++++---------------------- 1 file changed, 193 insertions(+), 229 deletions(-) diff --git a/example/src/raylib.nub b/example/src/raylib.nub index 75ecdbc..cd49d6f 100644 --- a/example/src/raylib.nub +++ b/example/src/raylib.nub @@ -265,7 +265,7 @@ export struct Transform // materialCount: i32 // meshes: ^Mesh // materials: ^Material -// meshMaterial: ^int +// meshMaterial: ^i32 // boneCount: i32 // bones: ^BoneInfo @@ -1202,251 +1202,215 @@ export extern "GetPixelColor" func GetPixelColor(srcPtr: ^void, format: i32): Co export extern "SetPixelColor" func SetPixelColor(dstPtr: ^void, color: Color, format: i32) export extern "GetPixelDataSize" func GetPixelDataSize(width: i32, height: i32, format: i32): i32 -// //------------------------------------------------------------------------------------ -// // Font Loading and Text Drawing Functions (Module: text) -// //------------------------------------------------------------------------------------ +export extern "GetFontDefault" func GetFontDefault(): Font +export extern "LoadFont" func LoadFont(fileName: cstring): Font +export extern "LoadFontEx" func LoadFontEx(fileName: cstring, fontSize: i32, codepoints: ^i32, codepointCount: i32): Font +export extern "LoadFontFromImage" func LoadFontFromImage(image: Image, key: Color, firstChar: i32): Font +export extern "LoadFontFromMemory" func LoadFontFromMemory(fileType: cstring, fileData: ^u8, dataSize: i32, fontSize: i32, codepoints: ^i32, codepointCount: i32): Font +export extern "IsFontValid" func IsFontValid(font: Font): bool +export extern "LoadFontData" func LoadFontData(fileData: ^u8, dataSize: i32, fontSize: i32, codepoints: ^i32, codepointCount: i32, type: i32): ^GlyphInfo +export extern "GenImageFontAtlas" func GenImageFontAtlas(glyphs: ^GlyphInfo, glyphRecs: ^^Rectangle, glyphCount: i32, fontSize: i32, padding: i32, packMethod: i32): Image +export extern "UnloadFontData" func UnloadFontData(glyphs: ^GlyphInfo, glyphCount: i32) +export extern "UnloadFont" func UnloadFont(font: Font) +export extern "ExportFontAsCode" func ExportFontAsCode(font: Font, fileName: cstring): bool -// // Font loading/unloading functions -// RLAPI Font GetFontDefault(void); // Get the default Font -// RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) -// RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height -// RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) -// RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -// RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) -// RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use -// RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info -// RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) -// RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) -// RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success +export extern "DrawFPS" func DrawFPS(posX: i32, posY: i32) +export extern "DrawText" func DrawText(text: cstring, posX: i32, posY: i32, fontSize: i32, color: Color) +export extern "DrawTextEx" func DrawTextEx(font: Font, text: cstring, position: Vector2, fontSize: f32, spacing: f32, tint: Color) +export extern "DrawTextPro" func DrawTextPro(font: Font, text: cstring, position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) +export extern "DrawTextCodepoint" func DrawTextCodepoint(font: Font, codepoint: i32, position: Vector2, fontSize: f32, tint: Color) +export extern "DrawTextCodepoints" func DrawTextCodepoints(font: Font, codepoints: ^i32, codepointCount: i32, position: Vector2, fontSize: f32, spacing: f32, tint: Color) -// // Text drawing functions -// RLAPI void DrawFPS(int posX, int posY); // Draw current FPS -// RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -// RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters -// RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) -// RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) -// RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) +export extern "SetTextLineSpacing" func SetTextLineSpacing(spacing: i32) +export extern "MeasureText" func MeasureText(text: cstring, fontSize: i32): i32 +export extern "MeasureTextEx" func MeasureTextEx(font: Font, text: cstring, fontSize: f32, spacing: f32): Vector2 +export extern "GetGlyphIndex" func GetGlyphIndex(font: Font, codepoint: i32): i32 +export extern "GetGlyphInfo" func GetGlyphInfo(font: Font, codepoint: i32): GlyphInfo +export extern "GetGlyphAtlasRec" func GetGlyphAtlasRec(font: Font, codepoint: i32): Rectangle -// // Text font info functions -// RLAPI void SetTextLineSpacing(int spacing); // Set vertical line spacing when drawing with line-breaks -// RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font -// RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font -// RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found -// RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found -// RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found +export extern "LoadUTF8" func LoadUTF8(codepoints: ^i32, length: i32): ^u8 +export extern "UnloadUTF8" func UnloadUTF8(text: ^u8) +export extern "LoadCodepoints" func LoadCodepoints(text: ^u8, count: ^i32): ^i32 +export extern "UnloadCodepoints" func UnloadCodepoints(codepoints: ^i32) +export extern "GetCodepointCount" func GetCodepointCount(text: ^u8): i32 +export extern "GetCodepoint" func GetCodepoint(text: ^u8, codepointSize: ^i32): i32 +export extern "GetCodepointNext" func GetCodepointNext(text: ^u8, codepointSize: ^i32): i32 +export extern "GetCodepointPrevious" func GetCodepointPrevious(text: ^u8, codepointSize: ^i32): i32 +export extern "CodepointToUTF8" func CodepointToUTF8(codepoint: i32, utf8Size: ^i32): ^u8 -// // Text codepoints management functions (unicode characters) -// RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array -// RLAPI void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array -// RLAPI int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter -// RLAPI void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory -// RLAPI int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string -// RLAPI int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -// RLAPI int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -// RLAPI int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure -// RLAPI const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter) +export extern "TextCopy" func TextCopy(dst: cstring, src: cstring): i32 +export extern "TextIsEqual" func TextIsEqual(text1: cstring, text2: cstring): bool +export extern "TextLength" func TextLength(text: cstring): u32 +// export extern "TextFormat" func TextFormat(text: cstring, ...): cstring +export extern "TextSubtext" func TextSubtext(text: cstring, position: i32, length: i32): cstring +export extern "TextReplace" func TextReplace(text: cstring, replace: cstring, by: cstring): cstring +export extern "TextInsert" func TextInsert(text: cstring, insert: cstring, position: i32): cstring +export extern "TextJoin" func TextJoin(textList: ^cstring, count: i32, delimiter: cstring): cstring +export extern "TextSplit" func TextSplit(text: cstring, delimiter: u8, count: ^i32): ^cstring +export extern "TextAppend" func TextAppend(text: cstring, append: cstring, position: ^i32) +export extern "TextFindIndex" func TextFindIndex(text: cstring, find: cstring): i32 +export extern "TextToUpper" func TextToUpper(text: cstring): cstring +export extern "TextToLower" func TextToLower(text: cstring): cstring +export extern "TextToPascal" func TextToPascal(text: cstring): cstring +export extern "TextToSnake" func TextToSnake(text: cstring): cstring +export extern "TextToCamel" func TextToCamel(text: cstring): cstring -// // Text strings management functions (no UTF-8 strings, only byte chars) -// // NOTE: Some strings allocate memory internally for returned strings, just be careful! -// RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied -// RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal -// RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending -// RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style) -// RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string -// RLAPI char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!) -// RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!) -// RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter -// RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings -// RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! -// RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string -// RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string -// RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string -// RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string -// RLAPI const char *TextToSnake(const char *text); // Get Snake case notation version of provided string -// RLAPI const char *TextToCamel(const char *text); // Get Camel case notation version of provided string +export extern "TextToInteger" func TextToInteger(text: cstring): i32 +export extern "TextToFloat" func TextToFloat(text: cstring): f32 -// RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) -// RLAPI float TextToFloat(const char *text); // Get float value from text (negative values not supported) +export extern "DrawLine3D" func DrawLine3D(startPos: Vector3, endPos: Vector3, color: Color) +export extern "DrawPoint3D" func DrawPoint3D(position: Vector3, color: Color) +export extern "DrawCircle3D" func DrawCircle3D(center: Vector3, radius: f32, rotationAxis: Vector3, rotationAngle: f32, color: Color) +export extern "DrawTriangle3D" func DrawTriangle3D(v1: Vector3, v2: Vector3, v3: Vector3, color: Color) +export extern "DrawTriangleStrip3D" func DrawTriangleStrip3D(points: ^Vector3, pointCount: i32, color: Color) +export extern "DrawCube" func DrawCube(position: Vector3, width: f32, height: f32, length: f32, color: Color) +export extern "DrawCubeV" func DrawCubeV(position: Vector3, size: Vector3, color: Color) +export extern "DrawCubeWires" func DrawCubeWires(position: Vector3, width: f32, height: f32, length: f32, color: Color) +export extern "DrawCubeWiresV" func DrawCubeWiresV(position: Vector3, size: Vector3, color: Color) +export extern "DrawSphere" func DrawSphere(centerPos: Vector3, radius: f32, color: Color) +export extern "DrawSphereEx" func DrawSphereEx(centerPos: Vector3, radius: f32, rings: i32, slices: i32, color: Color) +export extern "DrawSphereWires" func DrawSphereWires(centerPos: Vector3, radius: f32, rings: i32, slices: i32, color: Color) +export extern "DrawCylinder" func DrawCylinder(position: Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: i32, color: Color) +export extern "DrawCylinderEx" func DrawCylinderEx(startPos: Vector3, endPos: Vector3, startRadius: f32, endRadius: f32, sides: i32, color: Color) +export extern "DrawCylinderWires" func DrawCylinderWires(position: Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: i32, color: Color) +export extern "DrawCylinderWiresEx" func DrawCylinderWiresEx(startPos: Vector3, endPos: Vector3, startRadius: f32, endRadius: f32, sides: i32, color: Color) +export extern "DrawCapsule" func DrawCapsule(startPos: Vector3, endPos: Vector3, radius: f32, slices: i32, rings: i32, color: Color) +export extern "DrawCapsuleWires" func DrawCapsuleWires(startPos: Vector3, endPos: Vector3, radius: f32, slices: i32, rings: i32, color: Color) +export extern "DrawPlane" func DrawPlane(centerPos: Vector3, size: Vector2, color: Color) +export extern "DrawRay" func DrawRay(ray: Ray, color: Color) +export extern "DrawGrid" func DrawGrid(slices: i32, spacing: f32) -// //------------------------------------------------------------------------------------ -// // Basic 3d Shapes Drawing Functions (Module: models) -// //------------------------------------------------------------------------------------ +// export extern "LoadModel" func LoadModel(fileName: cstring): Model +// export extern "LoadModelFromMesh" func LoadModelFromMesh(mesh: Mesh): Model +// export extern "IsModelValid" func IsModelValid(model: Model): bool +// export extern "UnloadModel" func UnloadModel(model: Model) +// export extern "GetModelBoundingBox" func GetModelBoundingBox(model: Model): BoundingBox -// // Basic geometric 3D shapes drawing functions -// RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -// RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line -// RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space -// RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -// RLAPI void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points -// RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube -// RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) -// RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires -// RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) -// RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -// RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters -// RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -// RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone -// RLAPI void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder with base at startPos and top at endPos -// RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -// RLAPI void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); // Draw a cylinder wires with base at startPos and top at endPos -// RLAPI void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos -// RLAPI void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos -// RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ -// RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line -// RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) +// export extern "DrawModel" func DrawModel(model: Model, position: Vector3, scale: f32, tint: Color) +// export extern "DrawModelEx" func DrawModelEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) +// export extern "DrawModelWires" func DrawModelWires(model: Model, position: Vector3, scale: f32, tint: Color) +// export extern "DrawModelWiresEx" func DrawModelWiresEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) +// export extern "DrawModelPoints" func DrawModelPoints(model: Model, position: Vector3, scale: f32, tint: Color) +// export extern "DrawModelPointsEx" func DrawModelPointsEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color) +export extern "DrawBoundingBox" func DrawBoundingBox(box: BoundingBox, color: Color) +export extern "DrawBillboard" func DrawBillboard(camera: Camera, texture: Texture2D, position: Vector3, scale: f32, tint: Color) +export extern "DrawBillboardRec" func DrawBillboardRec(camera: Camera, texture: Texture2D, source: Rectangle, position: Vector3, size: Vector2, tint: Color) +export extern "DrawBillboardPro" func DrawBillboardPro(camera: Camera, texture: Texture2D, source: Rectangle, position: Vector3, up: Vector3, size: Vector2, origin: Vector2, rotation: f32, tint: Color) -// //------------------------------------------------------------------------------------ -// // Model 3d Loading and Drawing Functions (Module: models) -// //------------------------------------------------------------------------------------ +export extern "UploadMesh" func UploadMesh(mesh: ^Mesh, dynamic: bool) +export extern "UpdateMeshBuffer" func UpdateMeshBuffer(mesh: Mesh, index: i32, data: ^void, dataSize: i32, offset: i32) +export extern "UnloadMesh" func UnloadMesh(mesh: Mesh) +// export extern "DrawMesh" func DrawMesh(mesh: Mesh, material: Material, transform: Matrix) +// export extern "DrawMeshInstanced" func DrawMeshInstanced(mesh: Mesh, material: Material, transforms: ^Matrix, instances: i32) +export extern "GetMeshBoundingBox" func GetMeshBoundingBox(mesh: Mesh): BoundingBox +export extern "GenMeshTangents" func GenMeshTangents(mesh: ^Mesh) +export extern "ExportMesh" func ExportMesh(mesh: Mesh, fileName: cstring): bool +export extern "ExportMeshAsCode" func ExportMeshAsCode(mesh: Mesh, fileName: cstring): bool -// // Model management functions -// RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) -// RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) -// RLAPI bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs) -// RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) -// RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) +export extern "GenMeshPoly" func GenMeshPoly(sides: i32, radius: f32): Mesh +export extern "GenMeshPlane" func GenMeshPlane(width: f32, length: f32, resX: i32, resZ: i32): Mesh +export extern "GenMeshCube" func GenMeshCube(width: f32, height: f32, length: f32): Mesh +export extern "GenMeshSphere" func GenMeshSphere(radius: f32, rings: i32, slices: i32): Mesh +export extern "GenMeshHemiSphere" func GenMeshHemiSphere(radius: f32, rings: i32, slices: i32): Mesh +export extern "GenMeshCylinder" func GenMeshCylinder(radius: f32, height: f32, slices: i32): Mesh +export extern "GenMeshCone" func GenMeshCone(radius: f32, height: f32, slices: i32): Mesh +export extern "GenMeshTorus" func GenMeshTorus(radius: f32, size: f32, radSeg: i32, sides: i32): Mesh +export extern "GenMeshKnot" func GenMeshKnot(radius: f32, size: f32, radSeg: i32, sides: i32): Mesh +export extern "GenMeshHeightmap" func GenMeshHeightmap(heightmap: Image, size: Vector3): Mesh +export extern "GenMeshCubicmap" func GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3): Mesh -// // Model drawing functions -// RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -// RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters -// RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -// RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -// RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points -// RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters -// RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) -// RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture -// RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -// RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation +// export extern "LoadMaterials" func LoadMaterials(fileName: cstring, materialCount: ^i32): ^Material +// export extern "LoadMaterialDefault" func LoadMaterialDefault(): Material +// export extern "IsMaterialValid" func IsMaterialValid(material: Material): bool +// export extern "UnloadMaterial" func UnloadMaterial(material: Material) +// export extern "SetMaterialTexture" func SetMaterialTexture(material: ^Material, mapType: i32, texture: Texture2D) +// export extern "SetModelMeshMaterial" func SetModelMeshMaterial(model: ^Model, meshId: i32, materialId: i32) -// // Mesh management functions -// RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids -// RLAPI void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index -// RLAPI void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU -// RLAPI void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform -// RLAPI void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms -// RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits -// RLAPI void GenMeshTangents(Mesh *mesh); // Compute mesh tangents -// RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success -// RLAPI bool ExportMeshAsCode(Mesh mesh, const char *fileName); // Export mesh as code file (.h) defining multiple arrays of vertex attributes +// export extern "LoadModelAnimations" func LoadModelAnimations(fileName: cstring, animCount: ^i32): ^ModelAnimation +// export extern "UpdateModelAnimation" func UpdateModelAnimation(model: Model, anim: ModelAnimation, frame: i32) +// export extern "UpdateModelAnimationBones" func UpdateModelAnimationBones(model: Model, anim: ModelAnimation, frame: i32) +// export extern "UnloadModelAnimation" func UnloadModelAnimation(anim: ModelAnimation) +// export extern "UnloadModelAnimations" func UnloadModelAnimations(animations: ^ModelAnimation, animCount: i32) +// export extern "IsModelAnimationValid" func IsModelAnimationValid(model: Model, anim: ModelAnimation): bool -// // Mesh generation functions -// RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh -// RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) -// RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh -// RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) -// RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) -// RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh -// RLAPI Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh -// RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh -// RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh -// RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data -// RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data +export extern "CheckCollisionSpheres" func CheckCollisionSpheres(center1: Vector3, radius1: f32, center2: Vector3, radius2: f32): bool +export extern "CheckCollisionBoxes" func CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox): bool +export extern "CheckCollisionBoxSphere" func CheckCollisionBoxSphere(box: BoundingBox, center: Vector3, radius: f32): bool +export extern "GetRayCollisionSphere" func GetRayCollisionSphere(ray: Ray, center: Vector3, radius: f32): RayCollision +export extern "GetRayCollisionBox" func GetRayCollisionBox(ray: Ray, box: BoundingBox): RayCollision +export extern "GetRayCollisionMesh" func GetRayCollisionMesh(ray: Ray, mesh: Mesh, transform: Matrix): RayCollision +export extern "GetRayCollisionTriangle" func GetRayCollisionTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3): RayCollision +export extern "GetRayCollisionQuad" func GetRayCollisionQuad(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3): RayCollision -// // Material loading/unloading functions -// RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file -// RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -// RLAPI bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU) -// RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) -// RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) -// RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh +export extern "InitAudioDevice" func InitAudioDevice() +export extern "CloseAudioDevice" func CloseAudioDevice() +export extern "IsAudioDeviceReady" func IsAudioDeviceReady(): bool +export extern "SetMasterVolume" func SetMasterVolume(volume: f32) +export extern "GetMasterVolume" func GetMasterVolume(): f32 -// // Model animations loading/unloading functions -// RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file -// RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU) -// RLAPI void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning) -// RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data -// RLAPI void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data -// RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match +// export extern "LoadWave" func LoadWave(fileName: cstring): Wave +// export extern "LoadWaveFromMemory" func LoadWaveFromMemory(fileType: cstring, fileData: ^u8, dataSize: i32): Wave +// export extern "IsWaveValid" func IsWaveValid(wave: Wave): bool +// export extern "LoadSound" func LoadSound(fileName: cstring): Sound +// export extern "LoadSoundFromWave" func LoadSoundFromWave(wave: Wave): Sound +// export extern "LoadSoundAlias" func LoadSoundAlias(source: Sound): Sound +// export extern "IsSoundValid" func IsSoundValid(sound: Sound): bool +// export extern "UpdateSound" func UpdateSound(sound: Sound, data: ^void, sampleCount: i32) +// export extern "UnloadWave" func UnloadWave(wave: Wave) +// export extern "UnloadSound" func UnloadSound(sound: Sound) +// export extern "UnloadSoundAlias" func UnloadSoundAlias(alias: Sound) +// export extern "ExportWave" func ExportWave(wave: Wave, fileName: cstring): bool +// export extern "ExportWaveAsCode" func ExportWaveAsCode(wave: Wave, fileName: cstring): bool -// // Collision detection functions -// RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres -// RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes -// RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere -// RLAPI RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere -// RLAPI RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box -// RLAPI RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh -// RLAPI RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle -// RLAPI RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad +// export extern "PlaySound" func PlaySound(sound: Sound) +// export extern "StopSound" func StopSound(sound: Sound) +// export extern "PauseSound" func PauseSound(sound: Sound) +// export extern "ResumeSound" func ResumeSound(sound: Sound) +// export extern "IsSoundPlaying" func IsSoundPlaying(sound: Sound): bool +// export extern "SetSoundVolume" func SetSoundVolume(sound: Sound, volume: f32) +// export extern "SetSoundPitch" func SetSoundPitch(sound: Sound, pitch: f32) +// export extern "SetSoundPan" func SetSoundPan(sound: Sound, pan: f32) +// export extern "WaveCopy" func WaveCopy(wave: Wave): Wave +// export extern "WaveCrop" func WaveCrop(wave: ^Wave, initFrame: i32, finalFrame: i32) +// export extern "WaveFormat" func WaveFormat(wave: ^Wave, sampleRate: i32, sampleSize: i32, channels: i32) +// export extern "LoadWaveSamples" func LoadWaveSamples(wave: Wave): ^f32 +export extern "UnloadWaveSamples" func UnloadWaveSamples(samples: ^f32) -// //------------------------------------------------------------------------------------ -// // Audio Loading and Playing Functions (Module: audio) -// //------------------------------------------------------------------------------------ -// typedef void (*AudioCallback)(void *bufferData, unsigned int frames); +// export extern "LoadMusicStream" func LoadMusicStream(fileName: cstring): Music +// export extern "LoadMusicStreamFromMemory" func LoadMusicStreamFromMemory(fileType: cstring, data: ^u8, dataSize: i32): Music +// export extern "IsMusicValid" func IsMusicValid(music: Music): bool +// export extern "UnloadMusicStream" func UnloadMusicStream(music: Music) +// export extern "PlayMusicStream" func PlayMusicStream(music: Music) +// export extern "IsMusicStreamPlaying" func IsMusicStreamPlaying(music: Music): bool +// export extern "UpdateMusicStream" func UpdateMusicStream(music: Music) +// export extern "StopMusicStream" func StopMusicStream(music: Music) +// export extern "PauseMusicStream" func PauseMusicStream(music: Music) +// export extern "ResumeMusicStream" func ResumeMusicStream(music: Music) +// export extern "SeekMusicStream" func SeekMusicStream(music: Music, position: f32) +// export extern "SetMusicVolume" func SetMusicVolume(music: Music, volume: f32) +// export extern "SetMusicPitch" func SetMusicPitch(music: Music, pitch: f32) +// export extern "SetMusicPan" func SetMusicPan(music: Music, pan: f32) +// export extern "GetMusicTimeLength" func GetMusicTimeLength(music: Music): f32 +// export extern "GetMusicTimePlayed" func GetMusicTimePlayed(music: Music): f32 -// // Audio device management functions -// RLAPI void InitAudioDevice(void); // Initialize audio device and context -// RLAPI void CloseAudioDevice(void); // Close the audio device and context -// RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -// RLAPI void SetMasterVolume(float volume); // Set master volume (listener) -// RLAPI float GetMasterVolume(void); // Get master volume (listener) +// export extern "LoadAudioStream" func LoadAudioStream(sampleRate: u32, sampleSize: u32, channels: u32): AudioStream +// export extern "IsAudioStreamValid" func IsAudioStreamValid(stream: AudioStream): bool +// export extern "UnloadAudioStream" func UnloadAudioStream(stream: AudioStream) +// export extern "UpdateAudioStream" func UpdateAudioStream(stream: AudioStream, data: ^void, frameCount: i32) +// export extern "IsAudioStreamProcessed" func IsAudioStreamProcessed(stream: AudioStream): bool +// export extern "PlayAudioStream" func PlayAudioStream(stream: AudioStream) +// export extern "PauseAudioStream" func PauseAudioStream(stream: AudioStream) +// export extern "ResumeAudioStream" func ResumeAudioStream(stream: AudioStream) +// export extern "IsAudioStreamPlaying" func IsAudioStreamPlaying(stream: AudioStream): bool +// export extern "StopAudioStream" func StopAudioStream(stream: AudioStream) +// export extern "SetAudioStreamVolume" func SetAudioStreamVolume(stream: AudioStream, volume: f32) +// export extern "SetAudioStreamPitch" func SetAudioStreamPitch(stream: AudioStream, pitch: f32) +// export extern "SetAudioStreamPan" func SetAudioStreamPan(stream: AudioStream, pan: f32) +export extern "SetAudioStreamBufferSizeDefault" func SetAudioStreamBufferSizeDefault(size: i32) +// export extern "SetAudioStreamCallback" func SetAudioStreamCallback(stream: AudioStream, callback: func(^void, u32)) -// // Wave/Sound loading/unloading functions -// RLAPI Wave LoadWave(const char *fileName); // Load wave data from file -// RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' -// RLAPI bool IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters) -// RLAPI Sound LoadSound(const char *fileName); // Load sound from file -// RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -// RLAPI Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data -// RLAPI bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized) -// RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data -// RLAPI void UnloadWave(Wave wave); // Unload wave data -// RLAPI void UnloadSound(Sound sound); // Unload sound -// RLAPI void UnloadSoundAlias(Sound alias); // Unload a sound alias (does not deallocate sample data) -// RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success -// RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success +// export extern "AttachAudioStreamProcessor" func AttachAudioStreamProcessor(stream: AudioStream, processor: func(^void, u32)) +// export extern "DetachAudioStreamProcessor" func DetachAudioStreamProcessor(stream: AudioStream, processor: func(^void, u32)) -// // Wave/Sound management functions -// RLAPI void PlaySound(Sound sound); // Play a sound -// RLAPI void StopSound(Sound sound); // Stop playing a sound -// RLAPI void PauseSound(Sound sound); // Pause a sound -// RLAPI void ResumeSound(Sound sound); // Resume a paused sound -// RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing -// RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) -// RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -// RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) -// RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave -// RLAPI void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range -// RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format -// RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array -// RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() - -// // Music management functions -// RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file -// RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data -// RLAPI bool IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized) -// RLAPI void UnloadMusicStream(Music music); // Unload music stream -// RLAPI void PlayMusicStream(Music music); // Start music playing -// RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing -// RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming -// RLAPI void StopMusicStream(Music music); // Stop music playing -// RLAPI void PauseMusicStream(Music music); // Pause music playing -// RLAPI void ResumeMusicStream(Music music); // Resume playing paused music -// RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) -// RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) -// RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) -// RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center) -// RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) -// RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) - -// // AudioStream management functions -// RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) -// RLAPI bool IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized) -// RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory -// RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data -// RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill -// RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream -// RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream -// RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream -// RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing -// RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream -// RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) -// RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) -// RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered) -// RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams -// RLAPI void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data - -// RLAPI void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as 'float' -// RLAPI void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream - -// RLAPI void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' -// RLAPI void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline +export extern "AttachAudioMixedProcessor" func AttachAudioMixedProcessor(processor: func(^void, u32)) +export extern "DetachAudioMixedProcessor" func DetachAudioMixedProcessor(processor: func(^void, u32)) \ No newline at end of file