diff --git a/example/src/raylib.nub b/example/src/raylib.nub index 06c4f35..75ecdbc 100644 --- a/example/src/raylib.nub +++ b/example/src/raylib.nub @@ -267,7 +267,7 @@ export struct Transform // materials: ^Material // meshMaterial: ^int -// boneCount: int +// boneCount: i32 // bones: ^BoneInfo // bindPose: ^Transform // } @@ -894,363 +894,313 @@ export extern "TakeScreenshot" func TakeScreenshot(fileName: cstring) export extern "SetConfigFlags" func SetConfigFlags(flags: u32) export extern "OpenURL" func OpenURL(url: cstring) -// todo(nub31): not implemented -// // NOTE: Following functions implemented in module [utils] -// //------------------------------------------------------------------ -// RLAPI void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) -// RLAPI void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level -// RLAPI void *MemAlloc(unsigned int size); // Internal memory allocator -// RLAPI void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator -// RLAPI void MemFree(void *ptr); // Internal memory free +// export extern "TraceLog" func TraceLog(logLevel: i32, text: cstring, ...) +export extern "SetTraceLogLevel" func SetTraceLogLevel(logLevel: i32) +export extern "MemAlloc" func MemAlloc(size: u32): ^void +export extern "MemRealloc" func MemRealloc(ptr: ^void, size: u32): ^void +export extern "MemFree" func MemFree(ptr: ^void) -// // Set custom callbacks -// // WARNING: Callbacks setup is intended for advanced users -// RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log -// RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader -// RLAPI void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver -// RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader -// RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver +// export extern "SetTraceLogCallback" func SetTraceLogCallback(callback: TraceLogCallback) +// export extern "SetLoadFileDataCallback" func SetLoadFileDataCallback(callback: LoadFileDataCallback) +// export extern "SetSaveFileDataCallback" func SetSaveFileDataCallback(callback: SaveFileDataCallback) +// export extern "SetLoadFileTextCallback" func SetLoadFileTextCallback(callback: LoadFileTextCallback) +// export extern "SetSaveFileTextCallback" func SetSaveFileTextCallback(callback: SaveFileTextCallback) -// // Files management functions -// RLAPI unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read) -// RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() -// RLAPI bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write), returns true on success -// RLAPI bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName); // Export data to code (.h), returns true on success -// RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string -// RLAPI void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText() -// RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success -// //------------------------------------------------------------------ +export extern "LoadFileData" func LoadFileData(fileName: cstring, dataSize: ^i32): ^u8 +export extern "UnloadFileData" func UnloadFileData(data: ^u8) +export extern "SaveFileData" func SaveFileData(fileName: cstring, data: ^void, dataSize: i32): bool +export extern "ExportDataAsCode" func ExportDataAsCode(data: ^u8, dataSize: i32, fileName: cstring): bool +export extern "LoadFileText" func LoadFileText(fileName: cstring): cstring +export extern "UnloadFileText" func UnloadFileText(text: cstring) +export extern "SaveFileText" func SaveFileText(fileName: cstring, text: cstring): bool -// // File system functions -// RLAPI bool FileExists(const char *fileName); // Check if file exists -// RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists -// RLAPI bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav) -// RLAPI int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) -// RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png') -// RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string -// RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) -// RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) -// RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) -// RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) -// RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string) -// RLAPI int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success -// RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success -// RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory -// RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS -// RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths -// RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result -// RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths -// RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -// RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths -// RLAPI void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths -// RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) +export extern "FileExists" func FileExists(fileName: cstring): bool +export extern "DirectoryExists" func DirectoryExists(dirPath: cstring): bool +export extern "IsFileExtension" func IsFileExtension(fileName: cstring, ext: cstring): bool +export extern "GetFileLength" func GetFileLength(fileName: cstring): i32 +export extern "GetFileExtension" func GetFileExtension(fileName: cstring): cstring +export extern "GetFileName" func GetFileName(filePath: cstring): cstring +export extern "GetFileNameWithoutExt" func GetFileNameWithoutExt(filePath: cstring): cstring +export extern "GetDirectoryPath" func GetDirectoryPath(filePath: cstring): cstring +export extern "GetPrevDirectoryPath" func GetPrevDirectoryPath(dirPath: cstring): cstring +export extern "GetWorkingDirectory" func GetWorkingDirectory(): cstring +export extern "GetApplicationDirectory" func GetApplicationDirectory(): cstring +export extern "MakeDirectory" func MakeDirectory(dirPath: cstring): i32 +export extern "ChangeDirectory" func ChangeDirectory(dir: cstring): bool +export extern "IsPathFile" func IsPathFile(path: cstring): bool +export extern "IsFileNameValid" func IsFileNameValid(fileName: cstring): bool +// export extern "LoadDirectoryFiles" func LoadDirectoryFiles(dirPath: cstring): FilePathList +// export extern "LoadDirectoryFilesEx" func LoadDirectoryFilesEx(basePath: cstring, filter: cstring, scanSubdirs: bool): FilePathList +// export extern "UnloadDirectoryFiles" func UnloadDirectoryFiles(files: FilePathList) +export extern "IsFileDropped" func IsFileDropped(): bool +// export extern "LoadDroppedFiles" func LoadDroppedFiles(): FilePathList +// export extern "UnloadDroppedFiles" func UnloadDroppedFiles(files: FilePathList) +export extern "GetFileModTime" func GetFileModTime(fileName: cstring): i64 -// // Compression/Encoding functionality -// RLAPI unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree() -// RLAPI unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree() -// RLAPI char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree() -// RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree() -// RLAPI unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code -// RLAPI unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes) -// RLAPI unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes) +export extern "CompressData" func CompressData(data: ^u8, dataSize: i32, compDataSize: ^i32): ^u8 +export extern "DecompressData" func DecompressData(compData: ^u8, compDataSize: i32, dataSize: ^i32): ^u8 +export extern "EncodeDataBase64" func EncodeDataBase64(data: ^u8, dataSize: i32, outputSize: ^i32): ^u8 +export extern "DecodeDataBase64" func DecodeDataBase64(data: ^u8, outputSize: ^i32): ^u8 +export extern "ComputeCRC32" func ComputeCRC32(data: ^u8, dataSize: i32): u32 +export extern "ComputeMD5" func ComputeMD5(data: ^u8, dataSize: i32): ^u32 +export extern "ComputeSHA1" func ComputeSHA1(data: ^u8, dataSize: i32): ^u32 +// export extern "LoadAutomationEventList" func LoadAutomationEventList(fileName: cstring): AutomationEventList +// export extern "UnloadAutomationEventList" func UnloadAutomationEventList(list: AutomationEventList) +// export extern "ExportAutomationEventList" func ExportAutomationEventList(list: AutomationEventList, fileName: cstring): bool +// export extern "SetAutomationEventList" func SetAutomationEventList(list: ^AutomationEventList) +export extern "SetAutomationEventBaseFrame" func SetAutomationEventBaseFrame(frame: i32) +export extern "StartAutomationEventRecording" func StartAutomationEventRecording() +export extern "StopAutomationEventRecording" func StopAutomationEventRecording() +// export extern "PlayAutomationEvent" func PlayAutomationEvent(event: AutomationEvent) -// // Automation events functionality -// RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS -// RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file -// RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file -// RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to -// RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording -// RLAPI void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set) -// RLAPI void StopAutomationEventRecording(void); // Stop recording automation events -// RLAPI void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event +export extern "IsKeyPressed" func IsKeyPressed(key: i32): bool +export extern "IsKeyPressedRepeat" func IsKeyPressedRepeat(key: i32): bool +export extern "IsKeyDown" func IsKeyDown(key: i32): bool +export extern "IsKeyReleased" func IsKeyReleased(key: i32): bool +export extern "IsKeyUp" func IsKeyUp(key: i32): bool +export extern "GetKeyPressed" func GetKeyPressed(): i32 +export extern "GetCharPressed" func GetCharPressed(): i32 +export extern "SetExitKey" func SetExitKey(key: i32) -// //------------------------------------------------------------------------------------ -// // Input Handling Functions (Module: core) -// //------------------------------------------------------------------------------------ +export extern "IsGamepadAvailable" func IsGamepadAvailable(gamepad: i32): bool +export extern "GetGamepadName" func GetGamepadName(gamepad: i32): cstring +export extern "IsGamepadButtonPressed" func IsGamepadButtonPressed(gamepad: i32, button: i32): bool +export extern "IsGamepadButtonDown" func IsGamepadButtonDown(gamepad: i32, button: i32): bool +export extern "IsGamepadButtonReleased" func IsGamepadButtonReleased(gamepad: i32, button: i32): bool +export extern "IsGamepadButtonUp" func IsGamepadButtonUp(gamepad: i32, button: i32): bool +export extern "GetGamepadButtonPressed" func GetGamepadButtonPressed(): i32 +export extern "GetGamepadAxisCount" func GetGamepadAxisCount(gamepad: i32): i32 +export extern "GetGamepadAxisMovement" func GetGamepadAxisMovement(gamepad: i32, axis: i32): f32 +export extern "SetGamepadMappings" func SetGamepadMappings(mappings: ^u8): i32 +export extern "SetGamepadVibration" func SetGamepadVibration(gamepad: i32, leftMotor: f32, rightMotor: f32, duration: f32) -// // Input-related functions: keyboard -// RLAPI bool IsKeyPressed(int key); // Check if a key has been pressed once -// RLAPI bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again -// RLAPI bool IsKeyDown(int key); // Check if a key is being pressed -// RLAPI bool IsKeyReleased(int key); // Check if a key has been released once -// RLAPI bool IsKeyUp(int key); // Check if a key is NOT being pressed -// RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty -// RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty -// RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +export extern "IsMouseButtonPressed" func IsMouseButtonPressed(button: i32): bool +export extern "IsMouseButtonDown" func IsMouseButtonDown(button: i32): bool +export extern "IsMouseButtonReleased" func IsMouseButtonReleased(button: i32): bool +export extern "IsMouseButtonUp" func IsMouseButtonUp(button: i32): bool +export extern "GetMouseX" func GetMouseX(): i32 +export extern "GetMouseY" func GetMouseY(): i32 +export extern "GetMousePosition" func GetMousePosition(): Vector2 +export extern "GetMouseDelta" func GetMouseDelta(): Vector2 +export extern "SetMousePosition" func SetMousePosition(x: i32, y: i32) +export extern "SetMouseOffset" func SetMouseOffset(offsetX: i32, offsetY: i32) +export extern "SetMouseScale" func SetMouseScale(scaleX: f32, scaleY: f32) +export extern "GetMouseWheelMove" func GetMouseWheelMove(): f32 +export extern "GetMouseWheelMoveV" func GetMouseWheelMoveV(): Vector2 +export extern "SetMouseCursor" func SetMouseCursor(cursor: i32) -// // Input-related functions: gamepads -// RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available -// RLAPI const char *GetGamepadName(int gamepad); // Get gamepad internal name id -// RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once -// RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed -// RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once -// RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed -// RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -// RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad -// RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis -// RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) -// RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) +export extern "GetTouchX" func GetTouchX(): i32 +export extern "GetTouchY" func GetTouchY(): i32 +export extern "GetTouchPosition" func GetTouchPosition(index: i32): Vector2 +export extern "GetTouchPointId" func GetTouchPointId(index: i32): i32 +export extern "GetTouchPointCount" func GetTouchPointCount(): i32 -// // Input-related functions: mouse -// RLAPI bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once -// RLAPI bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed -// RLAPI bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once -// RLAPI bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed -// RLAPI int GetMouseX(void); // Get mouse position X -// RLAPI int GetMouseY(void); // Get mouse position Y -// RLAPI Vector2 GetMousePosition(void); // Get mouse position XY -// RLAPI Vector2 GetMouseDelta(void); // Get mouse delta between frames -// RLAPI void SetMousePosition(int x, int y); // Set mouse position XY -// RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset -// RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling -// RLAPI float GetMouseWheelMove(void); // Get mouse wheel movement for X or Y, whichever is larger -// RLAPI Vector2 GetMouseWheelMoveV(void); // Get mouse wheel movement for both X and Y -// RLAPI void SetMouseCursor(int cursor); // Set mouse cursor +export extern "SetGesturesEnabled" func SetGesturesEnabled(flags: u32) +export extern "IsGestureDetected" func IsGestureDetected(gesture: u32): bool +export extern "GetGestureDetected" func GetGestureDetected(): i32 +export extern "GetGestureHoldDuration" func GetGestureHoldDuration(): f32 +export extern "GetGestureDragVector" func GetGestureDragVector(): Vector2 +export extern "GetGestureDragAngle" func GetGestureDragAngle(): f32 +export extern "GetGesturePinchVector" func GetGesturePinchVector(): Vector2 +export extern "GetGesturePinchAngle" func GetGesturePinchAngle(): f32 -// // Input-related functions: touch -// RLAPI int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size) -// RLAPI int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size) -// RLAPI Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size) -// RLAPI int GetTouchPointId(int index); // Get touch point identifier for given index -// RLAPI int GetTouchPointCount(void); // Get number of touch points +export extern "UpdateCamera" func UpdateCamera(camera: ^Camera, mode: i32) +export extern "UpdateCameraPro" func UpdateCameraPro(camera: ^Camera, movement: Vector3, rotation: Vector3, zoom: f32) -// //------------------------------------------------------------------------------------ -// // Gestures and Touch Handling Functions (Module: rgestures) -// //------------------------------------------------------------------------------------ -// RLAPI void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags -// RLAPI bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected -// RLAPI int GetGestureDetected(void); // Get latest detected gesture -// RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in seconds -// RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector -// RLAPI float GetGestureDragAngle(void); // Get gesture drag angle -// RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -// RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle +export extern "SetShapesTexture" func SetShapesTexture(texture: Texture2D, source: Rectangle) +export extern "GetShapesTexture" func GetShapesTexture(): Texture2D +export extern "GetShapesTextureRectangle" func GetShapesTextureRectangle(): Rectangle -// //------------------------------------------------------------------------------------ -// // Camera System Functions (Module: rcamera) -// //------------------------------------------------------------------------------------ -// RLAPI void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode -// RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, float zoom); // Update camera movement/rotation +export extern "DrawPixel" func DrawPixel(posX: i32, posY: i32, color: Color) +export extern "DrawPixelV" func DrawPixelV(position: Vector2, color: Color) +export extern "DrawLine" func DrawLine(startPosX: i32, startPosY: i32, endPosX: i32, endPosY: i32, color: Color) +export extern "DrawLineV" func DrawLineV(startPos: Vector2, endPos: Vector2, color: Color) +export extern "DrawLineEx" func DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) +export extern "DrawLineStrip" func DrawLineStrip(points: ^Vector2, pointCount: i32, color: Color) +export extern "DrawLineBezier" func DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) +export extern "DrawCircle" func DrawCircle(centerX: i32, centerY: i32, radius: f32, color: Color) +export extern "DrawCircleSector" func DrawCircleSector(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) +export extern "DrawCircleSectorLines" func DrawCircleSectorLines(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) +export extern "DrawCircleGradient" func DrawCircleGradient(centerX: i32, centerY: i32, radius: f32, inner: Color, outer: Color) +export extern "DrawCircleV" func DrawCircleV(center: Vector2, radius: f32, color: Color) +export extern "DrawCircleLines" func DrawCircleLines(centerX: i32, centerY: i32, radius: f32, color: Color) +export extern "DrawCircleLinesV" func DrawCircleLinesV(center: Vector2, radius: f32, color: Color) +export extern "DrawEllipse" func DrawEllipse(centerX: i32, centerY: i32, radiusH: f32, radiusV: f32, color: Color) +export extern "DrawEllipseLines" func DrawEllipseLines(centerX: i32, centerY: i32, radiusH: f32, radiusV: f32, color: Color) +export extern "DrawRing" func DrawRing(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) +export extern "DrawRingLines" func DrawRingLines(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) +export extern "DrawRectangle" func DrawRectangle(posX: i32, posY: i32, width: i32, height: i32, color: Color) +export extern "DrawRectangleV" func DrawRectangleV(position: Vector2, size: Vector2, color: Color) +export extern "DrawRectangleRec" func DrawRectangleRec(rec: Rectangle, color: Color) +export extern "DrawRectanglePro" func DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color) +export extern "DrawRectangleGradientV" func DrawRectangleGradientV(posX: i32, posY: i32, width: i32, height: i32, top: Color, bottom: Color) +export extern "DrawRectangleGradientH" func DrawRectangleGradientH(posX: i32, posY: i32, width: i32, height: i32, left: Color, right: Color) +export extern "DrawRectangleGradientEx" func DrawRectangleGradientEx(rec: Rectangle, topLeft: Color, bottomLeft: Color, topRight: Color, bottomRight: Color) +export extern "DrawRectangleLines" func DrawRectangleLines(posX: i32, posY: i32, width: i32, height: i32, color: Color) +export extern "DrawRectangleLinesEx" func DrawRectangleLinesEx(rec: Rectangle, lineThick: f32, color: Color) +export extern "DrawRectangleRounded" func DrawRectangleRounded(rec: Rectangle, roundness: f32, segments: i32, color: Color) +export extern "DrawRectangleRoundedLines" func DrawRectangleRoundedLines(rec: Rectangle, roundness: f32, segments: i32, color: Color) +export extern "DrawRectangleRoundedLinesEx" func DrawRectangleRoundedLinesEx(rec: Rectangle, roundness: f32, segments: i32, lineThick: f32, color: Color) +export extern "DrawTriangle" func DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) +export extern "DrawTriangleLines" func DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) +export extern "DrawTriangleFan" func DrawTriangleFan(points: ^Vector2, pointCount: i32, color: Color) +export extern "DrawTriangleStrip" func DrawTriangleStrip(points: ^Vector2, pointCount: i32, color: Color) +export extern "DrawPoly" func DrawPoly(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) +export extern "DrawPolyLines" func DrawPolyLines(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) +export extern "DrawPolyLinesEx" func DrawPolyLinesEx(center: Vector2, sides: i32, radius: f32, rotation: f32, lineThick: f32, color: Color) -// //------------------------------------------------------------------------------------ -// // Basic Shapes Drawing Functions (Module: shapes) -// //------------------------------------------------------------------------------------ -// // Set texture and rectangle to be used on shapes drawing -// // NOTE: It can be useful when using basic shapes and one single font, -// // defining a font char white rectangle would allow drawing everything in a single draw call -// RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing -// RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing -// RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing +export extern "DrawSplineLinear" func DrawSplineLinear(points: ^Vector2, pointCount: i32, thick: f32, color: Color) +export extern "DrawSplineBasis" func DrawSplineBasis(points: ^Vector2, pointCount: i32, thick: f32, color: Color) +export extern "DrawSplineCatmullRom" func DrawSplineCatmullRom(points: ^Vector2, pointCount: i32, thick: f32, color: Color) +export extern "DrawSplineBezierQuadratic" func DrawSplineBezierQuadratic(points: ^Vector2, pointCount: i32, thick: f32, color: Color) +export extern "DrawSplineBezierCubic" func DrawSplineBezierCubic(points: ^Vector2, pointCount: i32, thick: f32, color: Color) +export extern "DrawSplineSegmentLinear" func DrawSplineSegmentLinear(p1: Vector2, p2: Vector2, thick: f32, color: Color) +export extern "DrawSplineSegmentBasis" func DrawSplineSegmentBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) +export extern "DrawSplineSegmentCatmullRom" func DrawSplineSegmentCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) +export extern "DrawSplineSegmentBezierQuadratic" func DrawSplineSegmentBezierQuadratic(p1: Vector2, c2: Vector2, p3: Vector2, thick: f32, color: Color) +export extern "DrawSplineSegmentBezierCubic" func DrawSplineSegmentBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: f32, color: Color) -// // Basic shapes drawing functions -// RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care] -// RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel using geometry (Vector version) [Can be slow, use with care] -// RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line -// RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (using gl lines) -// RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads) -// RLAPI void DrawLineStrip(const Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines) -// RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation -// RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -// RLAPI void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle -// RLAPI void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline -// RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // Draw a gradient-filled circle -// RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) -// RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline -// RLAPI void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version) -// RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse -// RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline -// RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring -// RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline -// RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle -// RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -// RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle -// RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -// RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle -// RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle -// RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors -// RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -// RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters -// RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -// RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges -// RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline -// RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) -// RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) -// RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -// RLAPI void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points -// RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -// RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides -// RLAPI void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters +export extern "GetSplinePointLinear" func GetSplinePointLinear(startPos: Vector2, endPos: Vector2, t: f32): Vector2 +export extern "GetSplinePointBasis" func GetSplinePointBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32): Vector2 +export extern "GetSplinePointCatmullRom" func GetSplinePointCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32): Vector2 +export extern "GetSplinePointBezierQuad" func GetSplinePointBezierQuad(p1: Vector2, c2: Vector2, p3: Vector2, t: f32): Vector2 +export extern "GetSplinePointBezierCubic" func GetSplinePointBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: f32): Vector2 -// // Splines drawing functions -// RLAPI void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points -// RLAPI void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points -// RLAPI void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points -// RLAPI void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] -// RLAPI void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] -// RLAPI void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points -// RLAPI void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points -// RLAPI void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points -// RLAPI void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color); // Draw spline segment: Quadratic Bezier, 2 points, 1 control point -// RLAPI void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color); // Draw spline segment: Cubic Bezier, 2 points, 2 control points +export extern "CheckCollisionRecs" func CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle): bool +export extern "CheckCollisionCircles" func CheckCollisionCircles(center1: Vector2, radius1: f32, center2: Vector2, radius2: f32): bool +export extern "CheckCollisionCircleRec" func CheckCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle): bool +export extern "CheckCollisionCircleLine" func CheckCollisionCircleLine(center: Vector2, radius: f32, p1: Vector2, p2: Vector2): bool +export extern "CheckCollisionPointRec" func CheckCollisionPointRec(point: Vector2, rec: Rectangle): bool +export extern "CheckCollisionPointCircle" func CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f32): bool +export extern "CheckCollisionPointTriangle" func CheckCollisionPointTriangle(point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2): bool +export extern "CheckCollisionPointLine" func CheckCollisionPointLine(point: Vector2, p1: Vector2, p2: Vector2, threshold: i32): bool +export extern "CheckCollisionPointPoly" func CheckCollisionPointPoly(point: Vector2, points: ^Vector2, pointCount: i32): bool +export extern "CheckCollisionLines" func CheckCollisionLines(startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint: ^Vector2): bool +export extern "GetCollisionRec" func GetCollisionRec(rec1: Rectangle, rec2: Rectangle): Rectangle -// // Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] -// RLAPI Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t); // Get (evaluate) spline point: Linear -// RLAPI Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: B-Spline -// RLAPI Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: Catmull-Rom -// RLAPI Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float t); // Get (evaluate) spline point: Quadratic Bezier -// RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier +export extern "LoadImage" func LoadImage(fileName: cstring): Image +export extern "LoadImageRaw" func LoadImageRaw(fileName: cstring, width: i32, height: i32, format: i32, headerSize: i32): Image +export extern "LoadImageAnim" func LoadImageAnim(fileName: cstring, frames: ^i32): Image +export extern "LoadImageAnimFromMemory" func LoadImageAnimFromMemory(fileType: cstring, fileData: ^u8, dataSize: i32, frames: ^i32): Image +export extern "LoadImageFromMemory" func LoadImageFromMemory(fileType: cstring, fileData: ^u8, dataSize: i32): Image +export extern "LoadImageFromTexture" func LoadImageFromTexture(texture: Texture2D): Image +export extern "LoadImageFromScreen" func LoadImageFromScreen(): Image +export extern "IsImageValid" func IsImageValid(image: Image): bool +export extern "UnloadImage" func UnloadImage(image: Image) +export extern "ExportImage" func ExportImage(image: Image, fileName: cstring): bool +export extern "ExportImageToMemory" func ExportImageToMemory(image: Image, fileType: cstring, fileSize: ^i32): ^u8 +export extern "ExportImageAsCode" func ExportImageAsCode(image: Image, fileName: cstring): bool -// // Basic shapes collision detection functions -// RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles -// RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles -// RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle -// RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] -// RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -// RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle -// RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle -// RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] -// RLAPI bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices -// RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference -// RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision +export extern "GenImageColor" func GenImageColor(width: i32, height: i32, color: Color): Image +export extern "GenImageGradientLinear" func GenImageGradientLinear(width: i32, height: i32, direction: i32, start: Color, end: Color): Image +export extern "GenImageGradientRadial" func GenImageGradientRadial(width: i32, height: i32, density: f32, inner: Color, outer: Color): Image +export extern "GenImageGradientSquare" func GenImageGradientSquare(width: i32, height: i32, density: f32, inner: Color, outer: Color): Image +export extern "GenImageChecked" func GenImageChecked(width: i32, height: i32, checksX: i32, checksY: i32, col1: Color, col2: Color): Image +export extern "GenImageWhiteNoise" func GenImageWhiteNoise(width: i32, height: i32, factor: f32): Image +export extern "GenImagePerlinNoise" func GenImagePerlinNoise(width: i32, height: i32, offsetX: i32, offsetY: i32, scale: f32): Image +export extern "GenImageCellular" func GenImageCellular(width: i32, height: i32, tileSize: i32): Image +export extern "GenImageText" func GenImageText(width: i32, height: i32, text: cstring): Image -// //------------------------------------------------------------------------------------ -// // Texture Loading and Drawing Functions (Module: textures) -// //------------------------------------------------------------------------------------ +export extern "ImageCopy" func ImageCopy(image: Image): Image +export extern "ImageFromImage" func ImageFromImage(image: Image, rec: Rectangle): Image +export extern "ImageFromChannel" func ImageFromChannel(image: Image, selectedChannel: i32): Image +export extern "ImageText" func ImageText(text: cstring, fontSize: i32, color: Color): Image +export extern "ImageTextEx" func ImageTextEx(font: Font, text: cstring, fontSize: f32, spacing: f32, tint: Color): Image +export extern "ImageFormat" func ImageFormat(image: ^Image, newFormat: i32) +export extern "ImageToPOT" func ImageToPOT(image: ^Image, fill: Color) +export extern "ImageCrop" func ImageCrop(image: ^Image, crop: Rectangle) +export extern "ImageAlphaCrop" func ImageAlphaCrop(image: ^Image, threshold: f32) +export extern "ImageAlphaClear" func ImageAlphaClear(image: ^Image, color: Color, threshold: f32) +export extern "ImageAlphaMask" func ImageAlphaMask(image: ^Image, alphaMask: Image) +export extern "ImageAlphaPremultiply" func ImageAlphaPremultiply(image: ^Image) +export extern "ImageBlurGaussian" func ImageBlurGaussian(image: ^Image, blurSize: i32) +export extern "ImageKernelConvolution" func ImageKernelConvolution(image: ^Image, kernel: ^f32, kernelSize: i32) +export extern "ImageResize" func ImageResize(image: ^Image, newWidth: i32, newHeight: i32) +export extern "ImageResizeNN" func ImageResizeNN(image: ^Image, newWidth: i32, newHeight: i32) +export extern "ImageResizeCanvas" func ImageResizeCanvas(image: ^Image, newWidth: i32, newHeight: i32, offsetX: i32, offsetY: i32, fill: Color) +export extern "ImageMipmaps" func ImageMipmaps(image: ^Image) +export extern "ImageDither" func ImageDither(image: ^Image, rBpp: i32, gBpp: i32, bBpp: i32, aBpp: i32) +export extern "ImageFlipVertical" func ImageFlipVertical(image: ^Image) +export extern "ImageFlipHorizontal" func ImageFlipHorizontal(image: ^Image) +export extern "ImageRotate" func ImageRotate(image: ^Image, degrees: i32) +export extern "ImageRotateCW" func ImageRotateCW(image: ^Image) +export extern "ImageRotateCCW" func ImageRotateCCW(image: ^Image) +export extern "ImageColorTint" func ImageColorTint(image: ^Image, color: Color) +export extern "ImageColorInvert" func ImageColorInvert(image: ^Image) +export extern "ImageColorGrayscale" func ImageColorGrayscale(image: ^Image) +export extern "ImageColorContrast" func ImageColorContrast(image: ^Image, contrast: f32) +export extern "ImageColorBrightness" func ImageColorBrightness(image: ^Image, brightness: i32) +export extern "ImageColorReplace" func ImageColorReplace(image: ^Image, color: Color, replace: Color) +export extern "LoadImageColors" func LoadImageColors(image: Image): ^Color +export extern "LoadImagePalette" func LoadImagePalette(image: Image, maxPaletteSize: i32, colorCount: ^i32): ^Color +export extern "UnloadImageColors" func UnloadImageColors(colors: ^Color) +export extern "UnloadImagePalette" func UnloadImagePalette(colors: ^Color) +export extern "GetImageAlphaBorder" func GetImageAlphaBorder(image: Image, threshold: f32): Rectangle +export extern "GetImageColor" func GetImageColor(image: Image, x: i32, y: i32): Color -// // Image loading functions -// // NOTE: These functions do not require GPU access -// RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) -// RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data -// RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) -// RLAPI Image LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer -// RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' -// RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data -// RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) -// RLAPI bool IsImageValid(Image image); // Check if an image is valid (data and parameters) -// RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) -// RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success -// RLAPI unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer -// RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success +export extern "ImageClearBackground" func ImageClearBackground(dst: ^Image, color: Color) +export extern "ImageDrawPixel" func ImageDrawPixel(dst: ^Image, posX: i32, posY: i32, color: Color) +export extern "ImageDrawPixelV" func ImageDrawPixelV(dst: ^Image, position: Vector2, color: Color) +export extern "ImageDrawLine" func ImageDrawLine(dst: ^Image, startPosX: i32, startPosY: i32, endPosX: i32, endPosY: i32, color: Color) +export extern "ImageDrawLineV" func ImageDrawLineV(dst: ^Image, start: Vector2, end: Vector2, color: Color) +export extern "ImageDrawLineEx" func ImageDrawLineEx(dst: ^Image, start: Vector2, end: Vector2, thick: i32, color: Color) +export extern "ImageDrawCircle" func ImageDrawCircle(dst: ^Image, centerX: i32, centerY: i32, radius: i32, color: Color) +export extern "ImageDrawCircleV" func ImageDrawCircleV(dst: ^Image, center: Vector2, radius: i32, color: Color) +export extern "ImageDrawCircleLines" func ImageDrawCircleLines(dst: ^Image, centerX: i32, centerY: i32, radius: i32, color: Color) +export extern "ImageDrawCircleLinesV" func ImageDrawCircleLinesV(dst: ^Image, center: Vector2, radius: i32, color: Color) +export extern "ImageDrawRectangle" func ImageDrawRectangle(dst: ^Image, posX: i32, posY: i32, width: i32, height: i32, color: Color) +export extern "ImageDrawRectangleV" func ImageDrawRectangleV(dst: ^Image, position: Vector2, size: Vector2, color: Color) +export extern "ImageDrawRectangleRec" func ImageDrawRectangleRec(dst: ^Image, rec: Rectangle, color: Color) +export extern "ImageDrawRectangleLines" func ImageDrawRectangleLines(dst: ^Image, rec: Rectangle, thick: i32, color: Color) +export extern "ImageDrawTriangle" func ImageDrawTriangle(dst: ^Image, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) +export extern "ImageDrawTriangleEx" func ImageDrawTriangleEx(dst: ^Image, v1: Vector2, v2: Vector2, v3: Vector2, c1: Color, c2: Color, c3: Color) +export extern "ImageDrawTriangleLines" func ImageDrawTriangleLines(dst: ^Image, v1: Vector2, v2: Vector2, v3: Vector2, color: Color) +export extern "ImageDrawTriangleFan" func ImageDrawTriangleFan(dst: ^Image, points: ^Vector2, pointCount: i32, color: Color) +export extern "ImageDrawTriangleStrip" func ImageDrawTriangleStrip(dst: ^Image, points: ^Vector2, pointCount: i32, color: Color) +export extern "ImageDraw" func ImageDraw(dst: ^Image, src: Image, srcRec: Rectangle, dstRec: Rectangle, tint: Color) +export extern "ImageDrawText" func ImageDrawText(dst: ^Image, text: cstring, posX: i32, posY: i32, fontSize: i32, color: Color) +export extern "ImageDrawTextEx" func ImageDrawTextEx(dst: ^Image, font: Font, text: cstring, position: Vector2, fontSize: f32, spacing: f32, tint: Color) -// // Image generation functions -// RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color -// RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient -// RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient -// RLAPI Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer); // Generate image: square gradient -// RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked -// RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise -// RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise -// RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells -// RLAPI Image GenImageText(int width, int height, const char *text); // Generate image: grayscale image from text data +export extern "LoadTexture" func LoadTexture(fileName: cstring): Texture2D +export extern "LoadTextureFromImage" func LoadTextureFromImage(image: Image): Texture2D +export extern "LoadTextureCubemap" func LoadTextureCubemap(image: Image, layout: i32): TextureCubemap +export extern "LoadRenderTexture" func LoadRenderTexture(width: i32, height: i32): RenderTexture2D +export extern "IsTextureValid" func IsTextureValid(texture: Texture2D): bool +export extern "UnloadTexture" func UnloadTexture(texture: Texture2D) +export extern "IsRenderTextureValid" func IsRenderTextureValid(target: RenderTexture2D): bool +export extern "UnloadRenderTexture" func UnloadRenderTexture(target: RenderTexture2D) +export extern "UpdateTexture" func UpdateTexture(texture: Texture2D, pixels: ^void) +export extern "UpdateTextureRec" func UpdateTextureRec(texture: Texture2D, rec: Rectangle, pixels: ^void) -// // Image manipulation functions -// RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -// RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece -// RLAPI Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE) -// RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -// RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) -// RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format -// RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) -// RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -// RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value -// RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color -// RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image -// RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel -// RLAPI void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation -// RLAPI void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image -// RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) -// RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) -// RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color -// RLAPI void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image -// RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -// RLAPI void ImageFlipVertical(Image *image); // Flip image vertically -// RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally -// RLAPI void ImageRotate(Image *image, int degrees); // Rotate image by input angle in degrees (-359 to 359) -// RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg -// RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg -// RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint -// RLAPI void ImageColorInvert(Image *image); // Modify image color: invert -// RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale -// RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) -// RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -// RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color -// RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) -// RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) -// RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() -// RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() -// RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle -// RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position +export extern "GenTextureMipmaps" func GenTextureMipmaps(texture: ^Texture2D) +export extern "SetTextureFilter" func SetTextureFilter(texture: Texture2D, filter: i32) +export extern "SetTextureWrap" func SetTextureWrap(texture: Texture2D, wrap: i32) -// // Image drawing functions -// // NOTE: Image software-rendering functions (CPU) -// RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color -// RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image -// RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) -// RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image -// RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) -// RLAPI void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image -// RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image -// RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version) -// RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image -// RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) -// RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image -// RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) -// RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image -// RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image -// RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image -// RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image -// RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image -// RLAPI void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center) -// RLAPI void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image -// RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) -// RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) -// RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) +export extern "DrawTexture" func DrawTexture(texture: Texture2D, posX: i32, posY: i32, tint: Color) +export extern "DrawTextureV" func DrawTextureV(texture: Texture2D, position: Vector2, tint: Color) +export extern "DrawTextureEx" func DrawTextureEx(texture: Texture2D, position: Vector2, rotation: f32, scale: f32, tint: Color) +export extern "DrawTextureRec" func DrawTextureRec(texture: Texture2D, source: Rectangle, position: Vector2, tint: Color) +export extern "DrawTexturePro" func DrawTexturePro(texture: Texture2D, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color) +export extern "DrawTextureNPatch" func DrawTextureNPatch(texture: Texture2D, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color) -// // Texture loading functions -// // NOTE: These functions require GPU access -// RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) -// RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data -// RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported -// RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) -// RLAPI bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU) -// RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) -// RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) -// RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) -// RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data -// RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data - -// // Texture configuration functions -// RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -// RLAPI void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode -// RLAPI void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode - -// // Texture drawing functions -// RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D -// RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -// RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -// RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -// RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -// RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely - -// // Color/pixel related functions -// RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal -// RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -// RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA) -// RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] -// RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] -// RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] -// RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1] -// RLAPI Color ColorTint(Color color, Color tint); // Get color multiplied with another color -// RLAPI Color ColorBrightness(Color color, float factor); // Get color with brightness correction, brightness factor goes from -1.0f to 1.0f -// RLAPI Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f -// RLAPI Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f -// RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint -// RLAPI Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f] -// RLAPI Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value -// RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format -// RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer -// RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format +export extern "ColorIsEqual" func ColorIsEqual(col1: Color, col2: Color): bool +export extern "Fade" func Fade(color: Color, alpha: f32): Color +export extern "ColorToInt" func ColorToInt(color: Color): i32 +export extern "ColorNormalize" func ColorNormalize(color: Color): Vector4 +export extern "ColorFromNormalized" func ColorFromNormalized(normalized: Vector4): Color +export extern "ColorToHSV" func ColorToHSV(color: Color): Vector3 +export extern "ColorFromHSV" func ColorFromHSV(hue: f32, saturation: f32, value: f32): Color +export extern "ColorTint" func ColorTint(color: Color, tint: Color): Color +export extern "ColorBrightness" func ColorBrightness(color: Color, factor: f32): Color +export extern "ColorContrast" func ColorContrast(color: Color, contrast: f32): Color +export extern "ColorAlpha" func ColorAlpha(color: Color, alpha: f32): Color +export extern "ColorAlphaBlend" func ColorAlphaBlend(dst: Color, src: Color, tint: Color): Color +export extern "ColorLerp" func ColorLerp(color1: Color, color2: Color, factor: f32): Color +export extern "GetColor" func GetColor(hexValue: u32): Color +export extern "GetPixelColor" func GetPixelColor(srcPtr: ^void, format: i32): Color +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)