~evantj/hare-raylib

630e3cb9090ce1b9caf7018882fef00d1b467ee2 — Evan Johnston a month ago cce6221 master
exclude duplicate definitions from raymath
5 files changed, 509 insertions(+), 106 deletions(-)

M Makefile
M hare-raylib.py
A raylib/opaque.ha
M raylib/raylib.ha
A raylib/raymath.ha
M Makefile => Makefile +2 -2
@@ 5,12 5,12 @@ LIBS=-lraylib
RAYLIB_HEADER := /usr/include/raylib.h
RAYMATH_HEADER := /usr/include/raymath.h

all: raylib/raylib.ha
all: raylib/raylib.ha raylib/raymath.ha

raylib/raylib.ha: raylib.json hare-raylib.py
	./hare-raylib.py raylib.json > raylib/raylib.ha
raylib/raymath.ha: raymath.json hare-raylib.py
	./hare-raylib.py raymath.json > raylib/raymath.ha
	./hare-raylib.py raymath.json PI DEG2RAD RAD2DEG Vector2 Vector3 Vector4 Matrix Quaternion> raylib/raymath.ha

raylib.json: $(RAYLIB_HEADER)
	raylib_parser -i $(RAYLIB_HEADER) -f JSON -o raylib.json

M hare-raylib.py => hare-raylib.py +14 -7
@@ 78,6 78,8 @@ def document(value, indent = False):

def defines(defines):
    for define in defines:
        if define["name"] in excluded:
            continue
        if define["type"] in define_types:
            define_type = define_types[define["type"]]
            value = define["value"]


@@ 96,6 98,8 @@ def defines(defines):

def structs(structs):
    for struct in structs:
        if struct["name"] in excluded:
            continue
        print(document(struct), end = '')
        print("export type %s = struct {" % (name(struct)))
        for field in struct["fields"]:


@@ 107,11 111,15 @@ def structs(structs):

def aliases(aliases):
    for alias in aliases:
        if alias["name"] in excluded:
            continue
        print(document(alias), end = '')
        print("export type %s = %s;\n" % (name(alias), alias["type"]))

def enums(enums):
    for enum in enums:
        if enum["name"] in excluded:
            continue
        print(document(enum), end = '')
        print("export type %s = enum {" % (name(enum)))
        for value in enum["values"]:


@@ 137,6 145,8 @@ def function_type(function, name = "", wrapping = False):

def callbacks(callbacks):
    for callback in callbacks:
        if callback["name"] in excluded:
            continue
        print(document(callback), end = '')
        print("export type %s = *%s;\n" % (name(callback), function_type(callback)))



@@ 171,6 181,8 @@ def should_wrap(function):

def functions(functions):
    for function in functions:
        if function["name"] in excluded:
            continue
        if should_wrap(function):
            print('@symbol("%s") %s;\n' %
                    (name(function), function_type(function, name = "_" + name(function))))


@@ 181,17 193,12 @@ def functions(functions):
                    (name(function), function_type(function, name = name(function))))

f = open(sys.argv[1], "r")
excluded = sys.argv[2:]
print(excluded, file=sys.stderr)
api = json.load(f)
print(
"""
use types::c;

// internal to raudio
export type rAudioProcessor = opaque;

// internal to raudio
export type rAudioBuffer = opaque;

"""
)
defines(api["defines"])

A raylib/opaque.ha => raylib/opaque.ha +2 -0
@@ 0,0 1,2 @@
export type rAudioProcessor = opaque;   
export type rAudioBuffer = opaque;      

M raylib/raylib.ha => raylib/raylib.ha +249 -97
@@ 1,14 1,7 @@

use types::c;

// internal to raudio
export type rAudioProcessor = opaque;

// internal to raudio
export type rAudioBuffer = opaque;


export def RAYLIB_VERSION: str = "4.5";
export def RAYLIB_VERSION: str = "5.0";

export def PI: f64 = 3.141592653589793;



@@ 406,6 399,8 @@ export type ModelAnimation = struct {
	bones: *[*]BoneInfo,
	// Poses array by frame
	framePoses: *[*]*[*]Transform,
	// Animation name
	name: [32]c::char,
};

// Ray, ray for raycasting


@@ 540,6 535,26 @@ export type FilePathList = struct {
	paths: *[*]*[*]c::char,
};

// Automation event
export type AutomationEvent = struct {
	// Event frame
	frame: uint,
	// Event type (AutomationEventType)
	_type: uint,
	// Event parameters (if required)
	params: [4]int,
};

// Automation event list
export type AutomationEventList = struct {
	// Events max entries (MAX_AUTOMATION_EVENTS)
	capacity: uint,
	// Events entries count
	count: uint,
	// Events entries
	events: *[*]AutomationEvent,
};

// Quaternion, 4 components (Vector4 alias)
export type Quaternion = Vector4;



@@ 583,6 598,8 @@ export type ConfigFlags = enum {
	FLAG_WINDOW_HIGHDPI = 8192,
	// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
	FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384,
	// Set to run program in borderless windowed mode
	FLAG_BORDERLESS_WINDOWED_MODE = 32768,
	// Set to try enabling MSAA 4X
	FLAG_MSAA_4X_HINT = 32,
	// Set to try enabling interlaced video format (for V3D)


@@ 1071,28 1088,34 @@ export type PixelFormat = enum {
	PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
	// 32*4 bpp (4 channels - float)
	PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
	// 16 bpp (1 channel - half float)
	PIXELFORMAT_UNCOMPRESSED_R16 = 11,
	// 16*3 bpp (3 channels - half float)
	PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12,
	// 16*4 bpp (4 channels - half float)
	PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13,
	// 4 bpp (no alpha)
	PIXELFORMAT_COMPRESSED_DXT1_RGB = 11,
	PIXELFORMAT_COMPRESSED_DXT1_RGB = 14,
	// 4 bpp (1 bit alpha)
	PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12,
	PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15,
	// 8 bpp
	PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13,
	PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16,
	// 8 bpp
	PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14,
	PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17,
	// 4 bpp
	PIXELFORMAT_COMPRESSED_ETC1_RGB = 15,
	PIXELFORMAT_COMPRESSED_ETC1_RGB = 18,
	// 4 bpp
	PIXELFORMAT_COMPRESSED_ETC2_RGB = 16,
	PIXELFORMAT_COMPRESSED_ETC2_RGB = 19,
	// 8 bpp
	PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17,
	PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20,
	// 4 bpp
	PIXELFORMAT_COMPRESSED_PVRT_RGB = 18,
	PIXELFORMAT_COMPRESSED_PVRT_RGB = 21,
	// 4 bpp
	PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19,
	PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22,
	// 8 bpp
	PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20,
	PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23,
	// 2 bpp
	PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21,
	PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24,
};

// Texture parameters: filter mode


@@ 1231,10 1254,10 @@ export type NPatchLayout = enum {
export type TraceLogCallback = *fn(logLevel: int, text: const *c::char, args: valist) void;

// FileIO: Load binary data
export type LoadFileDataCallback = *fn(fileName: const *c::char, bytesRead: *uint) *c::uchar;
export type LoadFileDataCallback = *fn(fileName: const *c::char, dataSize: *int) *c::uchar;

// FileIO: Save binary data
export type SaveFileDataCallback = *fn(fileName: const *c::char, data: *opaque, bytesToWrite: uint) bool;
export type SaveFileDataCallback = *fn(fileName: const *c::char, data: *opaque, dataSize: int) bool;

// FileIO: Load text data
export type LoadFileTextCallback = *fn(fileName: const *c::char) *c::char;


@@ 1253,12 1276,12 @@ export fn InitWindow(width: int, height: int, title: const str) void = {
	return _InitWindow(width, height, title_cstring);
};

// Check if KEY_ESCAPE pressed or Close icon pressed
export @symbol("WindowShouldClose") fn WindowShouldClose() bool;

// Close window and unload OpenGL context
export @symbol("CloseWindow") fn CloseWindow() void;

// Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
export @symbol("WindowShouldClose") fn WindowShouldClose() bool;

// Check if window has been initialized successfully
export @symbol("IsWindowReady") fn IsWindowReady() bool;



@@ 1292,6 1315,9 @@ export @symbol("ClearWindowState") fn ClearWindowState(flags: uint) void;
// Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
export @symbol("ToggleFullscreen") fn ToggleFullscreen() void;

// Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
export @symbol("ToggleBorderlessWindowed") fn ToggleBorderlessWindowed() void;

// Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
export @symbol("MaximizeWindow") fn MaximizeWindow() void;



@@ 1309,7 1335,7 @@ export @symbol("SetWindowIcons") fn SetWindowIcons(images: *Image, count: int) v

@symbol("SetWindowTitle") fn _SetWindowTitle(title: const *c::char) void;

// Set title for window (only PLATFORM_DESKTOP)
// Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)
export fn SetWindowTitle(title: const str) void = {
	let title_cstring: *c::char = c::fromstr(title);
	defer free(title_cstring);


@@ 1319,18 1345,24 @@ export fn SetWindowTitle(title: const str) void = {
// Set window position on screen (only PLATFORM_DESKTOP)
export @symbol("SetWindowPosition") fn SetWindowPosition(x: int, y: int) void;

// Set monitor for the current window (fullscreen mode)
// Set monitor for the current window
export @symbol("SetWindowMonitor") fn SetWindowMonitor(monitor: int) void;

// Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
export @symbol("SetWindowMinSize") fn SetWindowMinSize(width: int, height: int) void;

// Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
export @symbol("SetWindowMaxSize") fn SetWindowMaxSize(width: int, height: int) void;

// Set window dimensions
export @symbol("SetWindowSize") fn SetWindowSize(width: int, height: int) void;

// Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
export @symbol("SetWindowOpacity") fn SetWindowOpacity(opacity: f32) void;

// Set window focused (only PLATFORM_DESKTOP)
export @symbol("SetWindowFocused") fn SetWindowFocused() void;

// Get native window handle
export @symbol("GetWindowHandle") fn GetWindowHandle() *opaque;



@@ 1378,7 1410,7 @@ export @symbol("GetWindowScaleDPI") fn GetWindowScaleDPI() Vector2;

@symbol("GetMonitorName") fn _GetMonitorName(monitor: int) const *c::char;

// Get the human-readable, UTF-8 encoded name of the primary monitor
// Get the human-readable, UTF-8 encoded name of the specified monitor
export fn GetMonitorName(monitor: int) const str = {
	return c::tostr(_GetMonitorName(monitor))!;
};


@@ 1405,15 1437,6 @@ export @symbol("EnableEventWaiting") fn EnableEventWaiting() void;
// Disable waiting for events on EndDrawing(), automatic events polling
export @symbol("DisableEventWaiting") fn DisableEventWaiting() void;

// Swap back buffer with front buffer (screen drawing)
export @symbol("SwapScreenBuffer") fn SwapScreenBuffer() void;

// Register all input events
export @symbol("PollInputEvents") fn PollInputEvents() void;

// Wait for some time (halt program execution)
export @symbol("WaitTime") fn WaitTime(seconds: f64) void;

// Shows cursor
export @symbol("ShowCursor") fn ShowCursor() void;



@@ 1571,21 1594,36 @@ export @symbol("GetWorldToScreen2D") fn GetWorldToScreen2D(position: Vector2, ca
// Set target FPS (maximum)
export @symbol("SetTargetFPS") fn SetTargetFPS(fps: int) void;

// Get current FPS
export @symbol("GetFPS") fn GetFPS() int;

// Get time in seconds for last frame drawn (delta time)
export @symbol("GetFrameTime") fn GetFrameTime() f32;

// Get elapsed time in seconds since InitWindow()
export @symbol("GetTime") fn GetTime() f64;

// Get a random value between min and max (both included)
export @symbol("GetRandomValue") fn GetRandomValue(min: int, max: int) int;
// Get current FPS
export @symbol("GetFPS") fn GetFPS() int;

// Swap back buffer with front buffer (screen drawing)
export @symbol("SwapScreenBuffer") fn SwapScreenBuffer() void;

// Register all input events
export @symbol("PollInputEvents") fn PollInputEvents() void;

// Wait for some time (halt program execution)
export @symbol("WaitTime") fn WaitTime(seconds: f64) void;

// Set the seed for the random number generator
export @symbol("SetRandomSeed") fn SetRandomSeed(seed: uint) void;

// Get a random value between min and max (both included)
export @symbol("GetRandomValue") fn GetRandomValue(min: int, max: int) int;

// Load random values sequence, no values repeated
export @symbol("LoadRandomSequence") fn LoadRandomSequence(count: uint, min: int, max: int) *int;

// Unload random values sequence
export @symbol("UnloadRandomSequence") fn UnloadRandomSequence(sequence: *int) void;

@symbol("TakeScreenshot") fn _TakeScreenshot(fileName: const *c::char) void;

// Takes a screenshot of current screen (filename extension defines format)


@@ 1598,6 1636,15 @@ export fn TakeScreenshot(fileName: const str) void = {
// Setup init configuration flags (view FLAGS)
export @symbol("SetConfigFlags") fn SetConfigFlags(flags: uint) void;

@symbol("OpenURL") fn _OpenURL(url: const *c::char) void;

// Open URL with default system browser (if available)
export fn OpenURL(url: const str) void = {
	let url_cstring: *c::char = c::fromstr(url);
	defer free(url_cstring);
	return _OpenURL(url_cstring);
};

// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
export @symbol("TraceLog") fn TraceLog(logLevel: int, text: const *c::char, ...) void;



@@ 1613,15 1660,6 @@ export @symbol("MemRealloc") fn MemRealloc(ptr: *opaque, _size: uint) *opaque;
// Internal memory free
export @symbol("MemFree") fn MemFree(ptr: *opaque) void;

@symbol("OpenURL") fn _OpenURL(url: const *c::char) void;

// Open URL with default system browser (if available)
export fn OpenURL(url: const str) void = {
	let url_cstring: *c::char = c::fromstr(url);
	defer free(url_cstring);
	return _OpenURL(url_cstring);
};

// Set custom trace log
export @symbol("SetTraceLogCallback") fn SetTraceLogCallback(callback: TraceLogCallback) void;



@@ 1637,34 1675,34 @@ export @symbol("SetLoadFileTextCallback") fn SetLoadFileTextCallback(callback: L
// Set custom file text data saver
export @symbol("SetSaveFileTextCallback") fn SetSaveFileTextCallback(callback: SaveFileTextCallback) void;

@symbol("LoadFileData") fn _LoadFileData(fileName: const *c::char, bytesRead: *uint) *c::uchar;
@symbol("LoadFileData") fn _LoadFileData(fileName: const *c::char, dataSize: *int) *c::uchar;

// Load file data as byte array (read)
export fn LoadFileData(fileName: const str, bytesRead: *uint) *c::uchar = {
export fn LoadFileData(fileName: const str, dataSize: *int) *c::uchar = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _LoadFileData(fileName_cstring, bytesRead);
	return _LoadFileData(fileName_cstring, dataSize);
};

// Unload file data allocated by LoadFileData()
export @symbol("UnloadFileData") fn UnloadFileData(data: *c::uchar) void;

@symbol("SaveFileData") fn _SaveFileData(fileName: const *c::char, data: *opaque, bytesToWrite: uint) bool;
@symbol("SaveFileData") fn _SaveFileData(fileName: const *c::char, data: *opaque, dataSize: int) bool;

// Save data to file from byte array (write), returns true on success
export fn SaveFileData(fileName: const str, data: *opaque, bytesToWrite: uint) bool = {
export fn SaveFileData(fileName: const str, data: *opaque, dataSize: int) bool = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _SaveFileData(fileName_cstring, data, bytesToWrite);
	return _SaveFileData(fileName_cstring, data, dataSize);
};

@symbol("ExportDataAsCode") fn _ExportDataAsCode(data: const *c::uchar, _size: uint, fileName: const *c::char) bool;
@symbol("ExportDataAsCode") fn _ExportDataAsCode(data: const *c::uchar, dataSize: int, fileName: const *c::char) bool;

// Export data to code (.h), returns true on success
export fn ExportDataAsCode(data: const *c::uchar, _size: uint, fileName: const str) bool = {
export fn ExportDataAsCode(data: const *c::uchar, dataSize: int, fileName: const str) bool = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _ExportDataAsCode(data, _size, fileName_cstring);
	return _ExportDataAsCode(data, dataSize, fileName_cstring);
};

@symbol("LoadFileText") fn _LoadFileText(fileName: const *c::char) *c::char;


@@ 1788,7 1826,7 @@ export fn GetWorkingDirectory() const str = {

@symbol("GetApplicationDirectory") fn _GetApplicationDirectory() const *c::char;

// Get the directory if the running application (uses static string)
// Get the directory of the running application (uses static string)
export fn GetApplicationDirectory() const str = {
	return c::tostr(_GetApplicationDirectory())!;
};


@@ 1868,9 1906,48 @@ export fn EncodeDataBase64(data: const *c::uchar, dataSize: int, outputSize: *in
// Decode Base64 string data, memory must be MemFree()
export @symbol("DecodeDataBase64") fn DecodeDataBase64(data: const *c::uchar, outputSize: *int) *c::uchar;

@symbol("LoadAutomationEventList") fn _LoadAutomationEventList(fileName: const *c::char) AutomationEventList;

// Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
export fn LoadAutomationEventList(fileName: const str) AutomationEventList = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _LoadAutomationEventList(fileName_cstring);
};

// Unload automation events list from file
export @symbol("UnloadAutomationEventList") fn UnloadAutomationEventList(list: *AutomationEventList) void;

@symbol("ExportAutomationEventList") fn _ExportAutomationEventList(list: AutomationEventList, fileName: const *c::char) bool;

// Export automation events list as text file
export fn ExportAutomationEventList(list: AutomationEventList, fileName: const str) bool = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _ExportAutomationEventList(list, fileName_cstring);
};

// Set automation event list to record to
export @symbol("SetAutomationEventList") fn SetAutomationEventList(list: *AutomationEventList) void;

// Set automation event internal base frame to start recording
export @symbol("SetAutomationEventBaseFrame") fn SetAutomationEventBaseFrame(frame: int) void;

// Start recording automation events (AutomationEventList must be set)
export @symbol("StartAutomationEventRecording") fn StartAutomationEventRecording() void;

// Stop recording automation events
export @symbol("StopAutomationEventRecording") fn StopAutomationEventRecording() void;

// Play a recorded automation event
export @symbol("PlayAutomationEvent") fn PlayAutomationEvent(event: AutomationEvent) void;

// Check if a key has been pressed once
export @symbol("IsKeyPressed") fn IsKeyPressed(key: int) bool;

// Check if a key has been pressed again (Only PLATFORM_DESKTOP)
export @symbol("IsKeyPressedRepeat") fn IsKeyPressedRepeat(key: int) bool;

// Check if a key is being pressed
export @symbol("IsKeyDown") fn IsKeyDown(key: int) bool;



@@ 1880,15 1957,15 @@ export @symbol("IsKeyReleased") fn IsKeyReleased(key: int) bool;
// Check if a key is NOT being pressed
export @symbol("IsKeyUp") fn IsKeyUp(key: int) bool;

// Set a custom key to exit program (default is ESC)
export @symbol("SetExitKey") fn SetExitKey(key: int) void;

// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
export @symbol("GetKeyPressed") fn GetKeyPressed() int;

// Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
export @symbol("GetCharPressed") fn GetCharPressed() int;

// Set a custom key to exit program (default is ESC)
export @symbol("SetExitKey") fn SetExitKey(key: int) void;

// Check if a gamepad is available
export @symbol("IsGamepadAvailable") fn IsGamepadAvailable(gamepad: int) bool;



@@ 1990,7 2067,7 @@ export @symbol("GetTouchPointCount") fn GetTouchPointCount() int;
export @symbol("SetGesturesEnabled") fn SetGesturesEnabled(flags: uint) void;

// Check if a gesture have been detected
export @symbol("IsGestureDetected") fn IsGestureDetected(gesture: int) bool;
export @symbol("IsGestureDetected") fn IsGestureDetected(gesture: uint) bool;

// Get latest detected gesture
export @symbol("GetGestureDetected") fn GetGestureDetected() int;


@@ 2028,24 2105,18 @@ export @symbol("DrawPixelV") fn DrawPixelV(position: Vector2, color: Color) void
// Draw a line
export @symbol("DrawLine") fn DrawLine(startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: Color) void;

// Draw a line (Vector version)
// Draw a line (using gl lines)
export @symbol("DrawLineV") fn DrawLineV(startPos: Vector2, endPos: Vector2, color: Color) void;

// Draw a line defining thickness
// Draw a line (using triangles/quads)
export @symbol("DrawLineEx") fn DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) void;

// Draw a line using cubic-bezier curves in-out
export @symbol("DrawLineBezier") fn DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) void;

// Draw line using quadratic bezier curves with a control point
export @symbol("DrawLineBezierQuad") fn DrawLineBezierQuad(startPos: Vector2, endPos: Vector2, controlPos: Vector2, thick: f32, color: Color) void;

// Draw line using cubic bezier curves with 2 control points
export @symbol("DrawLineBezierCubic") fn DrawLineBezierCubic(startPos: Vector2, endPos: Vector2, startControlPos: Vector2, endControlPos: Vector2, thick: f32, color: Color) void;

// Draw lines sequence
// Draw lines sequence (using gl lines)
export @symbol("DrawLineStrip") fn DrawLineStrip(points: *Vector2, pointCount: int, color: Color) void;

// Draw line segment cubic-bezier in-out interpolation
export @symbol("DrawLineBezier") fn DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) void;

// Draw a color-filled circle
export @symbol("DrawCircle") fn DrawCircle(centerX: int, centerY: int, radius: f32, color: Color) void;



@@ 2064,6 2135,9 @@ export @symbol("DrawCircleV") fn DrawCircleV(center: Vector2, radius: f32, color
// Draw circle outline
export @symbol("DrawCircleLines") fn DrawCircleLines(centerX: int, centerY: int, radius: f32, color: Color) void;

// Draw circle outline (Vector version)
export @symbol("DrawCircleLinesV") fn DrawCircleLinesV(center: Vector2, radius: f32, color: Color) void;

// Draw ellipse
export @symbol("DrawEllipse") fn DrawEllipse(centerX: int, centerY: int, radiusH: f32, radiusV: f32, color: Color) void;



@@ 2130,6 2204,51 @@ export @symbol("DrawPolyLines") fn DrawPolyLines(center: Vector2, sides: int, ra
// Draw a polygon outline of n sides with extended parameters
export @symbol("DrawPolyLinesEx") fn DrawPolyLinesEx(center: Vector2, sides: int, radius: f32, rotation: f32, lineThick: f32, color: Color) void;

// Draw spline: Linear, minimum 2 points
export @symbol("DrawSplineLinear") fn DrawSplineLinear(points: *Vector2, pointCount: int, thick: f32, color: Color) void;

// Draw spline: B-Spline, minimum 4 points
export @symbol("DrawSplineBasis") fn DrawSplineBasis(points: *Vector2, pointCount: int, thick: f32, color: Color) void;

// Draw spline: Catmull-Rom, minimum 4 points
export @symbol("DrawSplineCatmullRom") fn DrawSplineCatmullRom(points: *Vector2, pointCount: int, thick: f32, color: Color) void;

// Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
export @symbol("DrawSplineBezierQuadratic") fn DrawSplineBezierQuadratic(points: *Vector2, pointCount: int, thick: f32, color: Color) void;

// Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
export @symbol("DrawSplineBezierCubic") fn DrawSplineBezierCubic(points: *Vector2, pointCount: int, thick: f32, color: Color) void;

// Draw spline segment: Linear, 2 points
export @symbol("DrawSplineSegmentLinear") fn DrawSplineSegmentLinear(p1: Vector2, p2: Vector2, thick: f32, color: Color) void;

// Draw spline segment: B-Spline, 4 points
export @symbol("DrawSplineSegmentBasis") fn DrawSplineSegmentBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) void;

// Draw spline segment: Catmull-Rom, 4 points
export @symbol("DrawSplineSegmentCatmullRom") fn DrawSplineSegmentCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) void;

// Draw spline segment: Quadratic Bezier, 2 points, 1 control point
export @symbol("DrawSplineSegmentBezierQuadratic") fn DrawSplineSegmentBezierQuadratic(p1: Vector2, c2: Vector2, p3: Vector2, thick: f32, color: Color) void;

// Draw spline segment: Cubic Bezier, 2 points, 2 control points
export @symbol("DrawSplineSegmentBezierCubic") fn DrawSplineSegmentBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: f32, color: Color) void;

// Get (evaluate) spline point: Linear
export @symbol("GetSplinePointLinear") fn GetSplinePointLinear(startPos: Vector2, endPos: Vector2, t: f32) Vector2;

// Get (evaluate) spline point: B-Spline
export @symbol("GetSplinePointBasis") fn GetSplinePointBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2;

// Get (evaluate) spline point: Catmull-Rom
export @symbol("GetSplinePointCatmullRom") fn GetSplinePointCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2;

// Get (evaluate) spline point: Quadratic Bezier
export @symbol("GetSplinePointBezierQuad") fn GetSplinePointBezierQuad(p1: Vector2, c2: Vector2, p3: Vector2, t: f32) Vector2;

// Get (evaluate) spline point: Cubic Bezier
export @symbol("GetSplinePointBezierCubic") fn GetSplinePointBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: f32) Vector2;

// Check collision between two rectangles
export @symbol("CheckCollisionRecs") fn CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle) bool;



@@ 2178,6 2297,15 @@ export fn LoadImageRaw(fileName: const str, width: int, height: int, format: int
	return _LoadImageRaw(fileName_cstring, width, height, format, headerSize);
};

@symbol("LoadImageSvg") fn _LoadImageSvg(fileNameOrString: const *c::char, width: int, height: int) Image;

// Load image from SVG file data or string with specified size
export fn LoadImageSvg(fileNameOrString: const str, width: int, height: int) Image = {
	let fileNameOrString_cstring: *c::char = c::fromstr(fileNameOrString);
	defer free(fileNameOrString_cstring);
	return _LoadImageSvg(fileNameOrString_cstring, width, height);
};

@symbol("LoadImageAnim") fn _LoadImageAnim(fileName: const *c::char, frames: *int) Image;

// Load image sequence from file (frames appended to image.data)


@@ 2217,6 2345,15 @@ export fn ExportImage(image: Image, fileName: const str) bool = {
	return _ExportImage(image, fileName_cstring);
};

@symbol("ExportImageToMemory") fn _ExportImageToMemory(image: Image, fileType: const *c::char, fileSize: *int) *c::uchar;

// Export image to memory buffer
export fn ExportImageToMemory(image: Image, fileType: const str, fileSize: *int) *c::uchar = {
	let fileType_cstring: *c::char = c::fromstr(fileType);
	defer free(fileType_cstring);
	return _ExportImageToMemory(image, fileType_cstring, fileSize);
};

@symbol("ExportImageAsCode") fn _ExportImageAsCode(image: Image, fileName: const *c::char) bool;

// Export image as code file defining an array of bytes, returns true on success


@@ 2229,15 2366,15 @@ export fn ExportImageAsCode(image: Image, fileName: const str) bool = {
// Generate image: plain color
export @symbol("GenImageColor") fn GenImageColor(width: int, height: int, color: Color) Image;

// Generate image: vertical gradient
export @symbol("GenImageGradientV") fn GenImageGradientV(width: int, height: int, top: Color, bottom: Color) Image;

// Generate image: horizontal gradient
export @symbol("GenImageGradientH") fn GenImageGradientH(width: int, height: int, left: Color, right: Color) Image;
// Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
export @symbol("GenImageGradientLinear") fn GenImageGradientLinear(width: int, height: int, direction: int, start: Color, end: Color) Image;

// Generate image: radial gradient
export @symbol("GenImageGradientRadial") fn GenImageGradientRadial(width: int, height: int, density: f32, inner: Color, outer: Color) Image;

// Generate image: square gradient
export @symbol("GenImageGradientSquare") fn GenImageGradientSquare(width: int, height: int, density: f32, inner: Color, outer: Color) Image;

// Generate image: checked
export @symbol("GenImageChecked") fn GenImageChecked(width: int, height: int, checksX: int, checksY: int, col1: Color, col2: Color) Image;



@@ 2328,6 2465,9 @@ export @symbol("ImageFlipVertical") fn ImageFlipVertical(image: *Image) void;
// Flip image horizontally
export @symbol("ImageFlipHorizontal") fn ImageFlipHorizontal(image: *Image) void;

// Rotate image by input angle in degrees (-359 to 359)
export @symbol("ImageRotate") fn ImageRotate(image: *Image, degrees: int) void;

// Rotate image clockwise 90deg
export @symbol("ImageRotateCW") fn ImageRotateCW(image: *Image) void;



@@ 2550,38 2690,38 @@ export fn LoadFont(fileName: const str) Font = {
	return _LoadFont(fileName_cstring);
};

@symbol("LoadFontEx") fn _LoadFontEx(fileName: const *c::char, fontSize: int, fontChars: *int, glyphCount: int) Font;
@symbol("LoadFontEx") fn _LoadFontEx(fileName: const *c::char, fontSize: int, codepoints: *int, codepointCount: int) Font;

// Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
export fn LoadFontEx(fileName: const str, fontSize: int, fontChars: *int, glyphCount: int) Font = {
// Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont
export fn LoadFontEx(fileName: const str, fontSize: int, codepoints: *int, codepointCount: int) Font = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _LoadFontEx(fileName_cstring, fontSize, fontChars, glyphCount);
	return _LoadFontEx(fileName_cstring, fontSize, codepoints, codepointCount);
};

// Load font from Image (XNA style)
export @symbol("LoadFontFromImage") fn LoadFontFromImage(image: Image, key: Color, firstChar: int) Font;

@symbol("LoadFontFromMemory") fn _LoadFontFromMemory(fileType: const *c::char, fileData: const *c::uchar, dataSize: int, fontSize: int, fontChars: *int, glyphCount: int) Font;
@symbol("LoadFontFromMemory") fn _LoadFontFromMemory(fileType: const *c::char, fileData: const *c::uchar, dataSize: int, fontSize: int, codepoints: *int, codepointCount: int) Font;

// Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
export fn LoadFontFromMemory(fileType: const str, fileData: const *c::uchar, dataSize: int, fontSize: int, fontChars: *int, glyphCount: int) Font = {
export fn LoadFontFromMemory(fileType: const str, fileData: const *c::uchar, dataSize: int, fontSize: int, codepoints: *int, codepointCount: int) Font = {
	let fileType_cstring: *c::char = c::fromstr(fileType);
	defer free(fileType_cstring);
	return _LoadFontFromMemory(fileType_cstring, fileData, dataSize, fontSize, fontChars, glyphCount);
	return _LoadFontFromMemory(fileType_cstring, fileData, dataSize, fontSize, codepoints, codepointCount);
};

// Check if a font is ready
export @symbol("IsFontReady") fn IsFontReady(font: Font) bool;

// Load font data for further use
export @symbol("LoadFontData") fn LoadFontData(fileData: const *c::uchar, dataSize: int, fontSize: int, fontChars: *int, glyphCount: int, _type: int) *GlyphInfo;
export @symbol("LoadFontData") fn LoadFontData(fileData: const *c::uchar, dataSize: int, fontSize: int, codepoints: *int, codepointCount: int, _type: int) *GlyphInfo;

// Generate image font atlas using chars info
export @symbol("GenImageFontAtlas") fn GenImageFontAtlas(chars: const *GlyphInfo, recs: **Rectangle, glyphCount: int, fontSize: int, padding: int, packMethod: int) Image;
export @symbol("GenImageFontAtlas") fn GenImageFontAtlas(glyphs: const *GlyphInfo, glyphRecs: **Rectangle, glyphCount: int, fontSize: int, padding: int, packMethod: int) Image;

// Unload font chars info data (RAM)
export @symbol("UnloadFontData") fn UnloadFontData(chars: *GlyphInfo, glyphCount: int) void;
export @symbol("UnloadFontData") fn UnloadFontData(glyphs: *GlyphInfo, glyphCount: int) void;

// Unload font from GPU memory (VRAM)
export @symbol("UnloadFont") fn UnloadFont(font: Font) void;


@@ 2629,7 2769,10 @@ export fn DrawTextPro(font: Font, text: const str, position: Vector2, origin: Ve
export @symbol("DrawTextCodepoint") fn DrawTextCodepoint(font: Font, codepoint: int, position: Vector2, fontSize: f32, tint: Color) void;

// Draw multiple character (codepoint)
export @symbol("DrawTextCodepoints") fn DrawTextCodepoints(font: Font, codepoints: const *int, count: int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;
export @symbol("DrawTextCodepoints") fn DrawTextCodepoints(font: Font, codepoints: const *int, codepointCount: int, position: Vector2, fontSize: f32, spacing: f32, tint: Color) void;

// Set vertical line spacing when drawing with line-breaks
export @symbol("SetTextLineSpacing") fn SetTextLineSpacing(spacing: int) void;

@symbol("MeasureText") fn _MeasureText(text: const *c::char, fontSize: int) int;



@@ 3067,10 3210,10 @@ export @symbol("SetMaterialTexture") fn SetMaterialTexture(material: *Material, 
// Set material for a mesh
export @symbol("SetModelMeshMaterial") fn SetModelMeshMaterial(model: *Model, meshId: int, materialId: int) void;

@symbol("LoadModelAnimations") fn _LoadModelAnimations(fileName: const *c::char, animCount: *uint) *ModelAnimation;
@symbol("LoadModelAnimations") fn _LoadModelAnimations(fileName: const *c::char, animCount: *int) *ModelAnimation;

// Load model animations from file
export fn LoadModelAnimations(fileName: const str, animCount: *uint) *ModelAnimation = {
export fn LoadModelAnimations(fileName: const str, animCount: *int) *ModelAnimation = {
	let fileName_cstring: *c::char = c::fromstr(fileName);
	defer free(fileName_cstring);
	return _LoadModelAnimations(fileName_cstring, animCount);


@@ 3083,7 3226,7 @@ export @symbol("UpdateModelAnimation") fn UpdateModelAnimation(model: Model, ani
export @symbol("UnloadModelAnimation") fn UnloadModelAnimation(anim: ModelAnimation) void;

// Unload animation array data
export @symbol("UnloadModelAnimations") fn UnloadModelAnimations(animations: *ModelAnimation, count: uint) void;
export @symbol("UnloadModelAnimations") fn UnloadModelAnimations(animations: *ModelAnimation, animCount: int) void;

// Check model animation skeleton match
export @symbol("IsModelAnimationValid") fn IsModelAnimationValid(model: Model, anim: ModelAnimation) bool;


@@ 3124,6 3267,9 @@ export @symbol("IsAudioDeviceReady") fn IsAudioDeviceReady() bool;
// Set master volume (listener)
export @symbol("SetMasterVolume") fn SetMasterVolume(volume: f32) void;

// Get master volume (listener)
export @symbol("GetMasterVolume") fn GetMasterVolume() f32;

@symbol("LoadWave") fn _LoadWave(fileName: const *c::char) Wave;

// Load wave data from file


@@ 3157,6 3303,9 @@ export fn LoadSound(fileName: const str) Sound = {
// Load sound from wave data
export @symbol("LoadSoundFromWave") fn LoadSoundFromWave(wave: Wave) Sound;

// Create a new sound that shares the same sample data as the source sound, does not own the sound data
export @symbol("LoadSoundAlias") fn LoadSoundAlias(source: Sound) Sound;

// Checks if a sound is ready
export @symbol("IsSoundReady") fn IsSoundReady(sound: Sound) bool;



@@ 3169,6 3318,9 @@ export @symbol("UnloadWave") fn UnloadWave(wave: Wave) void;
// Unload sound
export @symbol("UnloadSound") fn UnloadSound(sound: Sound) void;

// Unload a sound alias (does not deallocate sample data)
export @symbol("UnloadSoundAlias") fn UnloadSoundAlias(alias: Sound) void;

@symbol("ExportWave") fn _ExportWave(wave: Wave, fileName: const *c::char) bool;

// Export wave data to file, returns true on success


@@ 3331,13 3483,13 @@ export @symbol("SetAudioStreamBufferSizeDefault") fn SetAudioStreamBufferSizeDef
// Audio thread callback to request new data
export @symbol("SetAudioStreamCallback") fn SetAudioStreamCallback(stream: AudioStream, callback: AudioCallback) void;

// Attach audio stream processor to stream
// Attach audio stream processor to stream, receives the samples as <float>s
export @symbol("AttachAudioStreamProcessor") fn AttachAudioStreamProcessor(stream: AudioStream, processor: AudioCallback) void;

// Detach audio stream processor from stream
export @symbol("DetachAudioStreamProcessor") fn DetachAudioStreamProcessor(stream: AudioStream, processor: AudioCallback) void;

// Attach audio stream processor to the entire audio pipeline
// Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s
export @symbol("AttachAudioMixedProcessor") fn AttachAudioMixedProcessor(processor: AudioCallback) void;

// Detach audio stream processor from the entire audio pipeline

A raylib/raymath.ha => raylib/raymath.ha +242 -0
@@ 0,0 1,242 @@

use types::c;

export def EPSILON: f64 = 1e-06;

// NOTE: Helper types to be used instead of array return types for *ToFloat functions
export type float3 = struct {
	v: [3]f32,
};

export type float16 = struct {
	v: [16]f32,
};

export @symbol("Clamp") fn Clamp(value: f32, min: f32, max: f32) f32;

export @symbol("Lerp") fn Lerp(start: f32, end: f32, amount: f32) f32;

export @symbol("Normalize") fn Normalize(value: f32, start: f32, end: f32) f32;

export @symbol("Remap") fn Remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32;

export @symbol("Wrap") fn Wrap(value: f32, min: f32, max: f32) f32;

export @symbol("FloatEquals") fn FloatEquals(x: f32, y: f32) int;

export @symbol("Vector2Zero") fn Vector2Zero() Vector2;

export @symbol("Vector2One") fn Vector2One() Vector2;

export @symbol("Vector2Add") fn Vector2Add(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2AddValue") fn Vector2AddValue(v: Vector2, add: f32) Vector2;

export @symbol("Vector2Subtract") fn Vector2Subtract(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2SubtractValue") fn Vector2SubtractValue(v: Vector2, sub: f32) Vector2;

export @symbol("Vector2Length") fn Vector2Length(v: Vector2) f32;

export @symbol("Vector2LengthSqr") fn Vector2LengthSqr(v: Vector2) f32;

export @symbol("Vector2DotProduct") fn Vector2DotProduct(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2Distance") fn Vector2Distance(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2DistanceSqr") fn Vector2DistanceSqr(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2Angle") fn Vector2Angle(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2LineAngle") fn Vector2LineAngle(start: Vector2, end: Vector2) f32;

export @symbol("Vector2Scale") fn Vector2Scale(v: Vector2, scale: f32) Vector2;

export @symbol("Vector2Multiply") fn Vector2Multiply(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2Negate") fn Vector2Negate(v: Vector2) Vector2;

export @symbol("Vector2Divide") fn Vector2Divide(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2Normalize") fn Vector2Normalize(v: Vector2) Vector2;

export @symbol("Vector2Transform") fn Vector2Transform(v: Vector2, mat: Matrix) Vector2;

export @symbol("Vector2Lerp") fn Vector2Lerp(v1: Vector2, v2: Vector2, amount: f32) Vector2;

export @symbol("Vector2Reflect") fn Vector2Reflect(v: Vector2, normal: Vector2) Vector2;

export @symbol("Vector2Rotate") fn Vector2Rotate(v: Vector2, angle: f32) Vector2;

export @symbol("Vector2MoveTowards") fn Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2;

export @symbol("Vector2Invert") fn Vector2Invert(v: Vector2) Vector2;

export @symbol("Vector2Clamp") fn Vector2Clamp(v: Vector2, min: Vector2, max: Vector2) Vector2;

export @symbol("Vector2ClampValue") fn Vector2ClampValue(v: Vector2, min: f32, max: f32) Vector2;

export @symbol("Vector2Equals") fn Vector2Equals(p: Vector2, q: Vector2) int;

export @symbol("Vector3Zero") fn Vector3Zero() Vector3;

export @symbol("Vector3One") fn Vector3One() Vector3;

export @symbol("Vector3Add") fn Vector3Add(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3AddValue") fn Vector3AddValue(v: Vector3, add: f32) Vector3;

export @symbol("Vector3Subtract") fn Vector3Subtract(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3SubtractValue") fn Vector3SubtractValue(v: Vector3, sub: f32) Vector3;

export @symbol("Vector3Scale") fn Vector3Scale(v: Vector3, scalar: f32) Vector3;

export @symbol("Vector3Multiply") fn Vector3Multiply(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3CrossProduct") fn Vector3CrossProduct(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Perpendicular") fn Vector3Perpendicular(v: Vector3) Vector3;

export @symbol("Vector3Length") fn Vector3Length(v: const Vector3) f32;

export @symbol("Vector3LengthSqr") fn Vector3LengthSqr(v: const Vector3) f32;

export @symbol("Vector3DotProduct") fn Vector3DotProduct(v1: Vector3, v2: Vector3) f32;

export @symbol("Vector3Distance") fn Vector3Distance(v1: Vector3, v2: Vector3) f32;

export @symbol("Vector3DistanceSqr") fn Vector3DistanceSqr(v1: Vector3, v2: Vector3) f32;

export @symbol("Vector3Angle") fn Vector3Angle(v1: Vector3, v2: Vector3) f32;

export @symbol("Vector3Negate") fn Vector3Negate(v: Vector3) Vector3;

export @symbol("Vector3Divide") fn Vector3Divide(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Normalize") fn Vector3Normalize(v: Vector3) Vector3;

export @symbol("Vector3Project") fn Vector3Project(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Reject") fn Vector3Reject(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3OrthoNormalize") fn Vector3OrthoNormalize(v1: *Vector3, v2: *Vector3) void;

export @symbol("Vector3Transform") fn Vector3Transform(v: Vector3, mat: Matrix) Vector3;

export @symbol("Vector3RotateByQuaternion") fn Vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3;

export @symbol("Vector3RotateByAxisAngle") fn Vector3RotateByAxisAngle(v: Vector3, axis: Vector3, angle: f32) Vector3;

export @symbol("Vector3Lerp") fn Vector3Lerp(v1: Vector3, v2: Vector3, amount: f32) Vector3;

export @symbol("Vector3Reflect") fn Vector3Reflect(v: Vector3, normal: Vector3) Vector3;

export @symbol("Vector3Min") fn Vector3Min(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Max") fn Vector3Max(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Barycenter") fn Vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) Vector3;

export @symbol("Vector3Unproject") fn Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3;

export @symbol("Vector3ToFloatV") fn Vector3ToFloatV(v: Vector3) float3;

export @symbol("Vector3Invert") fn Vector3Invert(v: Vector3) Vector3;

export @symbol("Vector3Clamp") fn Vector3Clamp(v: Vector3, min: Vector3, max: Vector3) Vector3;

export @symbol("Vector3ClampValue") fn Vector3ClampValue(v: Vector3, min: f32, max: f32) Vector3;

export @symbol("Vector3Equals") fn Vector3Equals(p: Vector3, q: Vector3) int;

export @symbol("Vector3Refract") fn Vector3Refract(v: Vector3, n: Vector3, r: f32) Vector3;

export @symbol("MatrixDeterminant") fn MatrixDeterminant(mat: Matrix) f32;

export @symbol("MatrixTrace") fn MatrixTrace(mat: Matrix) f32;

export @symbol("MatrixTranspose") fn MatrixTranspose(mat: Matrix) Matrix;

export @symbol("MatrixInvert") fn MatrixInvert(mat: Matrix) Matrix;

export @symbol("MatrixIdentity") fn MatrixIdentity() Matrix;

export @symbol("MatrixAdd") fn MatrixAdd(left: Matrix, right: Matrix) Matrix;

export @symbol("MatrixSubtract") fn MatrixSubtract(left: Matrix, right: Matrix) Matrix;

export @symbol("MatrixMultiply") fn MatrixMultiply(left: Matrix, right: Matrix) Matrix;

export @symbol("MatrixTranslate") fn MatrixTranslate(x: f32, y: f32, z: f32) Matrix;

export @symbol("MatrixRotate") fn MatrixRotate(axis: Vector3, angle: f32) Matrix;

export @symbol("MatrixRotateX") fn MatrixRotateX(angle: f32) Matrix;

export @symbol("MatrixRotateY") fn MatrixRotateY(angle: f32) Matrix;

export @symbol("MatrixRotateZ") fn MatrixRotateZ(angle: f32) Matrix;

export @symbol("MatrixRotateXYZ") fn MatrixRotateXYZ(angle: Vector3) Matrix;

export @symbol("MatrixRotateZYX") fn MatrixRotateZYX(angle: Vector3) Matrix;

export @symbol("MatrixScale") fn MatrixScale(x: f32, y: f32, z: f32) Matrix;

export @symbol("MatrixFrustum") fn MatrixFrustum(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix;

export @symbol("MatrixPerspective") fn MatrixPerspective(fovY: f64, aspect: f64, nearPlane: f64, farPlane: f64) Matrix;

export @symbol("MatrixOrtho") fn MatrixOrtho(left: f64, right: f64, bottom: f64, top: f64, nearPlane: f64, farPlane: f64) Matrix;

export @symbol("MatrixLookAt") fn MatrixLookAt(eye: Vector3, target: Vector3, up: Vector3) Matrix;

export @symbol("MatrixToFloatV") fn MatrixToFloatV(mat: Matrix) float16;

export @symbol("QuaternionAdd") fn QuaternionAdd(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionAddValue") fn QuaternionAddValue(q: Quaternion, add: f32) Quaternion;

export @symbol("QuaternionSubtract") fn QuaternionSubtract(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionSubtractValue") fn QuaternionSubtractValue(q: Quaternion, sub: f32) Quaternion;

export @symbol("QuaternionIdentity") fn QuaternionIdentity() Quaternion;

export @symbol("QuaternionLength") fn QuaternionLength(q: Quaternion) f32;

export @symbol("QuaternionNormalize") fn QuaternionNormalize(q: Quaternion) Quaternion;

export @symbol("QuaternionInvert") fn QuaternionInvert(q: Quaternion) Quaternion;

export @symbol("QuaternionMultiply") fn QuaternionMultiply(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionScale") fn QuaternionScale(q: Quaternion, mul: f32) Quaternion;

export @symbol("QuaternionDivide") fn QuaternionDivide(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionLerp") fn QuaternionLerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;

export @symbol("QuaternionNlerp") fn QuaternionNlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;

export @symbol("QuaternionSlerp") fn QuaternionSlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;

export @symbol("QuaternionFromVector3ToVector3") fn QuaternionFromVector3ToVector3(from: Vector3, to: Vector3) Quaternion;

export @symbol("QuaternionFromMatrix") fn QuaternionFromMatrix(mat: Matrix) Quaternion;

export @symbol("QuaternionToMatrix") fn QuaternionToMatrix(q: Quaternion) Matrix;

export @symbol("QuaternionFromAxisAngle") fn QuaternionFromAxisAngle(axis: Vector3, angle: f32) Quaternion;

export @symbol("QuaternionToAxisAngle") fn QuaternionToAxisAngle(q: Quaternion, outAxis: *Vector3, outAngle: *f32) void;

export @symbol("QuaternionFromEuler") fn QuaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion;

export @symbol("QuaternionToEuler") fn QuaternionToEuler(q: Quaternion) Vector3;

export @symbol("QuaternionTransform") fn QuaternionTransform(q: Quaternion, mat: Matrix) Quaternion;

export @symbol("QuaternionEquals") fn QuaternionEquals(p: Quaternion, q: Quaternion) int;