hate-no-d/hate-no-d.lua
pedro-bento 3b9bbd529a
All checks were successful
release / linux/aarch64 (push) Successful in 1m55s
release / linux/armv7 (push) Successful in 2m18s
release / linux/i686 (push) Successful in 2m11s
release / linux/x86_64 (push) Successful in 1m54s
release / android (push) Successful in 2m50s
release / freebsd/x86_64 (push) Successful in 4m55s
release / windows/i686 (push) Successful in 2m7s
release / windows/x86_64 (push) Successful in 2m11s
Add raylib
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-22 22:47:20 +01:00

11140 lines
333 KiB
Lua

--[[
hate-no-d.lua - generated by gen-hate-no-d.lua, do not edit.
raylib 6.5-dev / rlgl / raymath
Functions: 928
raymath symbols come from rcore.o (RAYMATH_IMPLEMENTATION) in libraylib.a.
]]
local ffi = require("ffi")
ffi.cdef[[
struct rAudioBuffer;
struct rAudioProcessor;
typedef struct Vector2 {
float x;
float y;
} Vector2;
typedef struct Vector3 {
float x;
float y;
float z;
} Vector3;
typedef struct Vector4 {
float x;
float y;
float z;
float w;
} Vector4;
typedef struct Matrix {
float m0;
float m4;
float m8;
float m12;
float m1;
float m5;
float m9;
float m13;
float m2;
float m6;
float m10;
float m14;
float m3;
float m7;
float m11;
float m15;
} Matrix;
typedef struct Color {
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
} Color;
typedef struct Rectangle {
float x;
float y;
float width;
float height;
} Rectangle;
typedef struct Image {
void *data;
int width;
int height;
int mipmaps;
int format;
} Image;
typedef struct Texture {
unsigned int id;
int width;
int height;
int mipmaps;
int format;
} Texture;
typedef struct RenderTexture {
unsigned int id;
Texture texture;
Texture depth;
} RenderTexture;
typedef struct NPatchInfo {
Rectangle source;
int left;
int top;
int right;
int bottom;
int layout;
} NPatchInfo;
typedef struct GlyphInfo {
int value;
int offsetX;
int offsetY;
int advanceX;
Image image;
} GlyphInfo;
typedef Texture Texture2D;
typedef struct Font {
int baseSize;
int glyphCount;
int glyphPadding;
Texture2D texture;
Rectangle *recs;
GlyphInfo *glyphs;
} Font;
typedef struct Camera3D {
Vector3 position;
Vector3 target;
Vector3 up;
float fovy;
int projection;
} Camera3D;
typedef struct Camera2D {
Vector2 offset;
Vector2 target;
float rotation;
float zoom;
} Camera2D;
typedef struct Mesh {
int vertexCount;
int triangleCount;
float *vertices;
float *texcoords;
float *texcoords2;
float *normals;
float *tangents;
unsigned char *colors;
unsigned short *indices;
int boneCount;
unsigned char *boneIndices;
float *boneWeights;
float *animVertices;
float *animNormals;
unsigned int vaoId;
unsigned int *vboId;
} Mesh;
typedef struct Shader {
unsigned int id;
int *locs;
} Shader;
typedef struct MaterialMap {
Texture2D texture;
Color color;
float value;
} MaterialMap;
typedef struct Material {
Shader shader;
MaterialMap *maps;
float params[4];
} Material;
typedef Vector4 Quaternion;
typedef struct Transform {
Vector3 translation;
Quaternion rotation;
Vector3 scale;
} Transform;
typedef struct BoneInfo {
char name[32];
int parent;
} BoneInfo;
typedef Transform * ModelAnimPose;
typedef struct ModelSkeleton {
unsigned int boneCount;
BoneInfo *bones;
ModelAnimPose bindPose;
} ModelSkeleton;
typedef struct Model {
Matrix transform;
int meshCount;
int materialCount;
Mesh *meshes;
Material *materials;
int *meshMaterial;
ModelSkeleton skeleton;
ModelAnimPose currentPose;
Matrix *boneMatrices;
} Model;
typedef struct ModelAnimation {
char name[32];
unsigned int boneCount;
int keyframeCount;
ModelAnimPose *keyframePoses;
} ModelAnimation;
typedef struct Ray {
Vector3 position;
Vector3 direction;
} Ray;
typedef struct RayCollision {
bool hit;
float distance;
Vector3 point;
Vector3 normal;
} RayCollision;
typedef struct BoundingBox {
Vector3 min;
Vector3 max;
} BoundingBox;
typedef struct Wave {
unsigned int frameCount;
unsigned int sampleRate;
unsigned int sampleSize;
unsigned int channels;
void *data;
} Wave;
typedef struct AudioStream {
struct rAudioBuffer *buffer;
struct rAudioProcessor *processor;
unsigned int sampleRate;
unsigned int sampleSize;
unsigned int channels;
} AudioStream;
typedef struct Sound {
AudioStream stream;
unsigned int frameCount;
} Sound;
typedef struct Music {
AudioStream stream;
unsigned int frameCount;
bool looping;
int ctxType;
void *ctxData;
} Music;
typedef struct VrDeviceInfo {
int hResolution;
int vResolution;
float hScreenSize;
float vScreenSize;
float eyeToScreenDistance;
float lensSeparationDistance;
float interpupillaryDistance;
float lensDistortionValues[4];
float chromaAbCorrection[4];
} VrDeviceInfo;
typedef struct VrStereoConfig {
Matrix projection[2];
Matrix viewOffset[2];
float leftLensCenter[2];
float rightLensCenter[2];
float leftScreenCenter[2];
float rightScreenCenter[2];
float scale[2];
float scaleIn[2];
} VrStereoConfig;
typedef struct FilePathList {
unsigned int count;
char **paths;
} FilePathList;
typedef struct AutomationEvent {
unsigned int frame;
unsigned int type;
int params[4];
} AutomationEvent;
typedef struct AutomationEventList {
unsigned int capacity;
unsigned int count;
AutomationEvent *events;
} AutomationEventList;
typedef Texture TextureCubemap;
typedef RenderTexture RenderTexture2D;
typedef Camera3D Camera;
typedef struct rlVertexBuffer {
int elementCount;
float *vertices;
float *texcoords;
float *normals;
unsigned char *colors;
unsigned int *indices;
unsigned int vaoId;
unsigned int vboId[5];
} rlVertexBuffer;
typedef struct rlDrawCall {
int mode;
int vertexCount;
int vertexAlignment;
unsigned int textureId;
} rlDrawCall;
typedef struct rlRenderBatch {
int bufferCount;
int currentBuffer;
rlVertexBuffer *vertexBuffer;
rlDrawCall *draws;
int drawCounter;
float currentDepth;
} rlRenderBatch;
typedef struct float3 {
float v[3];
} float3;
typedef struct float16 {
float v[16];
} float16;
typedef void (*AudioCallback)(void * bufferData, unsigned int frames);
typedef unsigned char * (*LoadFileDataCallback)(const char * fileName, int * dataSize);
typedef bool (*SaveFileDataCallback)(const char * fileName, const void * data, int dataSize);
typedef char * (*LoadFileTextCallback)(const char * fileName);
typedef bool (*SaveFileTextCallback)(const char * fileName, const char * text);
void InitWindow(int width, int height, const char * title);
void CloseWindow(void);
bool WindowShouldClose(void);
bool IsWindowReady(void);
bool IsWindowFullscreen(void);
bool IsWindowHidden(void);
bool IsWindowMinimized(void);
bool IsWindowMaximized(void);
bool IsWindowFocused(void);
bool IsWindowResized(void);
bool IsWindowState(unsigned int flag);
void SetWindowState(unsigned int flags);
void ClearWindowState(unsigned int flags);
void ToggleFullscreen(void);
void ToggleBorderlessWindowed(void);
void MaximizeWindow(void);
void MinimizeWindow(void);
void RestoreWindow(void);
void SetWindowIcon(Image image);
void SetWindowIcons(Image * images, int count);
void SetWindowTitle(const char * title);
void SetWindowPosition(int x, int y);
void SetWindowMonitor(int monitor);
void SetWindowMinSize(int width, int height);
void SetWindowMaxSize(int width, int height);
void SetWindowSize(int width, int height);
void SetWindowOpacity(float opacity);
void SetWindowFocused(void);
void * GetWindowHandle(void);
int GetScreenWidth(void);
int GetScreenHeight(void);
int GetRenderWidth(void);
int GetRenderHeight(void);
int GetMonitorCount(void);
int GetCurrentMonitor(void);
Vector2 GetMonitorPosition(int monitor);
int GetMonitorWidth(int monitor);
int GetMonitorHeight(int monitor);
int GetMonitorPhysicalWidth(int monitor);
int GetMonitorPhysicalHeight(int monitor);
int GetMonitorRefreshRate(int monitor);
Vector2 GetWindowPosition(void);
Vector2 GetWindowScaleDPI(void);
const char * GetMonitorName(int monitor);
void SetClipboardText(const char * text);
const char * GetClipboardText(void);
Image GetClipboardImage(void);
void EnableEventWaiting(void);
void DisableEventWaiting(void);
void ShowCursor(void);
void HideCursor(void);
bool IsCursorHidden(void);
void EnableCursor(void);
void DisableCursor(void);
bool IsCursorOnScreen(void);
void ClearBackground(Color color);
void BeginDrawing(void);
void EndDrawing(void);
void BeginMode2D(Camera2D camera);
void EndMode2D(void);
void BeginMode3D(Camera3D camera);
void EndMode3D(void);
void BeginTextureMode(RenderTexture2D target);
void EndTextureMode(void);
void BeginShaderMode(Shader shader);
void EndShaderMode(void);
void BeginBlendMode(int mode);
void EndBlendMode(void);
void BeginScissorMode(int x, int y, int width, int height);
void EndScissorMode(void);
void BeginVrStereoMode(VrStereoConfig config);
void EndVrStereoMode(void);
VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device);
void UnloadVrStereoConfig(VrStereoConfig config);
Shader LoadShader(const char * vsFileName, const char * fsFileName);
Shader LoadShaderFromMemory(const char * vsCode, const char * fsCode);
bool IsShaderValid(Shader shader);
int GetShaderLocation(Shader shader, const char * uniformName);
int GetShaderLocationAttrib(Shader shader, const char * attribName);
void SetShaderValue(Shader shader, int locIndex, const void * value, int uniformType);
void SetShaderValueV(Shader shader, int locIndex, const void * value, int uniformType, int count);
void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat);
void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture);
void UnloadShader(Shader shader);
Ray GetScreenToWorldRay(Vector2 position, Camera camera);
Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height);
Vector2 GetWorldToScreen(Vector3 position, Camera camera);
Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height);
Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera);
Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera);
Matrix GetCameraMatrix(Camera camera);
Matrix GetCameraMatrix2D(Camera2D camera);
void SetTargetFPS(int fps);
float GetFrameTime(void);
double GetTime(void);
int GetFPS(void);
void SwapScreenBuffer(void);
void PollInputEvents(void);
void WaitTime(double seconds);
void SetRandomSeed(unsigned int seed);
int GetRandomValue(int min, int max);
int * LoadRandomSequence(unsigned int count, int min, int max);
void UnloadRandomSequence(int * sequence);
void TakeScreenshot(const char * fileName);
void SetConfigFlags(unsigned int flags);
void OpenURL(const char * url);
void SetTraceLogLevel(int logLevel);
void TraceLog(int logLevel, const char * text, ...);
void * MemAlloc(unsigned int size);
void * MemRealloc(void * ptr, unsigned int size);
void MemFree(void * ptr);
unsigned char * LoadFileData(const char * fileName, int * dataSize);
void UnloadFileData(unsigned char * data);
bool SaveFileData(const char * fileName, const void * data, int dataSize);
bool ExportDataAsCode(const unsigned char * data, int dataSize, const char * fileName);
char * LoadFileText(const char * fileName);
void UnloadFileText(char * text);
bool SaveFileText(const char * fileName, const char * text);
void SetLoadFileDataCallback(LoadFileDataCallback callback);
void SetSaveFileDataCallback(SaveFileDataCallback callback);
void SetLoadFileTextCallback(LoadFileTextCallback callback);
void SetSaveFileTextCallback(SaveFileTextCallback callback);
int FileRename(const char * fileName, const char * fileRename);
int FileRemove(const char * fileName);
int FileCopy(const char * srcPath, const char * dstPath);
int FileMove(const char * srcPath, const char * dstPath);
int FileTextReplace(const char * fileName, const char * search, const char * replacement);
int FileTextFindIndex(const char * fileName, const char * search);
bool FileExists(const char * fileName);
bool DirectoryExists(const char * dirPath);
bool IsFileExtension(const char * fileName, const char * ext);
bool IsFileHidden(const char * filePath);
int GetFileLength(const char * fileName);
long GetFileModTime(const char * fileName);
const char * GetFileExtension(const char * fileName);
const char * GetFileName(const char * filePath);
const char * GetFileNameWithoutExt(const char * filePath);
const char * GetDirectoryPath(const char * filePath);
const char * GetPrevDirectoryPath(const char * dirPath);
const char * GetWorkingDirectory(void);
const char * GetApplicationDirectory(void);
int MakeDirectory(const char * dirPath);
int ChangeDirectory(const char * dirPath);
bool IsPathFile(const char * path);
bool IsPathDirectory(const char * path);
bool IsPathAbsolute(const char * path);
bool IsFileNameValid(const char * fileName);
FilePathList LoadDirectoryFiles(const char * dirPath);
FilePathList LoadDirectoryFilesEx(const char * basePath, const char * filter, bool scanSubdirs);
void UnloadDirectoryFiles(FilePathList files);
bool IsFileDropped(void);
FilePathList LoadDroppedFiles(void);
void UnloadDroppedFiles(FilePathList files);
unsigned int GetDirectoryFileCount(const char * dirPath);
unsigned int GetDirectoryFileCountEx(const char * basePath, const char * filter, bool scanSubdirs);
unsigned char * CompressData(const unsigned char * data, int dataSize, int * compDataSize);
unsigned char * DecompressData(const unsigned char * compData, int compDataSize, int * dataSize);
char * EncodeDataBase64(const unsigned char * data, int dataSize, int * outputSize);
unsigned char * DecodeDataBase64(const char * text, int * outputSize);
unsigned int ComputeCRC32(const unsigned char * data, int dataSize);
unsigned int * ComputeMD5(const unsigned char * data, int dataSize);
unsigned int * ComputeSHA1(const unsigned char * data, int dataSize);
unsigned int * ComputeSHA256(const unsigned char * data, int dataSize);
AutomationEventList LoadAutomationEventList(const char * fileName);
void UnloadAutomationEventList(AutomationEventList list);
bool ExportAutomationEventList(AutomationEventList list, const char * fileName);
void SetAutomationEventList(AutomationEventList * list);
void SetAutomationEventBaseFrame(int frame);
void StartAutomationEventRecording(void);
void StopAutomationEventRecording(void);
void PlayAutomationEvent(AutomationEvent event);
bool IsKeyPressed(int key);
bool IsKeyPressedRepeat(int key);
bool IsKeyDown(int key);
bool IsKeyReleased(int key);
bool IsKeyUp(int key);
int GetKeyPressed(void);
int GetCharPressed(void);
const char * GetKeyName(int key);
void SetExitKey(int key);
bool IsGamepadAvailable(int gamepad);
const char * GetGamepadName(int gamepad);
bool IsGamepadButtonPressed(int gamepad, int button);
bool IsGamepadButtonDown(int gamepad, int button);
bool IsGamepadButtonReleased(int gamepad, int button);
bool IsGamepadButtonUp(int gamepad, int button);
int GetGamepadButtonPressed(void);
int GetGamepadAxisCount(int gamepad);
float GetGamepadAxisMovement(int gamepad, int axis);
int SetGamepadMappings(const char * mappings);
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration);
bool IsMouseButtonPressed(int button);
bool IsMouseButtonDown(int button);
bool IsMouseButtonReleased(int button);
bool IsMouseButtonUp(int button);
int GetMouseX(void);
int GetMouseY(void);
Vector2 GetMousePosition(void);
Vector2 GetMouseDelta(void);
void SetMousePosition(int x, int y);
void SetMouseOffset(int offsetX, int offsetY);
void SetMouseScale(float scaleX, float scaleY);
float GetMouseWheelMove(void);
Vector2 GetMouseWheelMoveV(void);
void SetMouseCursor(int cursor);
int GetTouchX(void);
int GetTouchY(void);
Vector2 GetTouchPosition(int index);
int GetTouchPointId(int index);
int GetTouchPointCount(void);
void SetGesturesEnabled(unsigned int flags);
bool IsGestureDetected(unsigned int gesture);
int GetGestureDetected(void);
float GetGestureHoldDuration(void);
Vector2 GetGestureDragVector(void);
float GetGestureDragAngle(void);
Vector2 GetGesturePinchVector(void);
float GetGesturePinchAngle(void);
void UpdateCamera(Camera * camera, int mode);
void UpdateCameraPro(Camera * camera, Vector3 movement, Vector3 rotation, float zoom);
void SetShapesTexture(Texture2D texture, Rectangle rec);
Texture2D GetShapesTexture(void);
Rectangle GetShapesTextureRectangle(void);
void DrawPixel(int posX, int posY, Color color);
void DrawPixelV(Vector2 position, Color color);
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);
void DrawLineStrip(const Vector2 * points, int pointCount, Color color);
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
void DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color);
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
void DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3);
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
void DrawTriangleLinesEx(Vector2 v1, Vector2 v2, Vector2 v3, float thick, Color color);
void DrawTriangleFan(const Vector2 * points, int pointCount, Color color);
void DrawTriangleStrip(const Vector2 * points, int pointCount, Color color);
void DrawRectangle(int posX, int posY, int width, int height, Color color);
void DrawRectangleV(Vector2 position, Vector2 size, Color color);
void DrawRectangleRec(Rectangle rec, Color color);
void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom);
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right);
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4);
void DrawRectangleLines(int posX, int posY, int width, int height, Color color);
void DrawRectangleLinesEx(Rectangle rec, float thick, Color color);
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color);
void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color);
void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float thick, Color color);
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color);
void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color);
void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float thick, Color color);
void DrawCircle(int centerX, int centerY, float radius, Color color);
void DrawCircleV(Vector2 center, float radius, Color color);
void DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer);
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color);
void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color);
void DrawCircleSectorLinesEx(Vector2 center, float radius, float startAngle, float endAngle, int segments, float thick, Color color);
void DrawCircleLines(int centerX, int centerY, float radius, Color color);
void DrawCircleLinesV(Vector2 center, float radius, Color color);
void DrawCircleLinesEx(Vector2 center, float radius, float thick, Color color);
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color);
void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color);
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color);
void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color);
void DrawEllipseLinesEx(Vector2 center, float radiusH, float radiusV, float thick, Color color);
void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color);
void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color);
void DrawRingLinesEx(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, float thick, Color color);
void DrawSplineLinear(const Vector2 * points, int pointCount, float thick, Color color);
void DrawSplineBasis(const Vector2 * points, int pointCount, float thick, Color color);
void DrawSplineCatmullRom(const Vector2 * points, int pointCount, float thick, Color color);
void DrawSplineBezierQuadratic(const Vector2 * points, int pointCount, float thick, Color color);
void DrawSplineBezierCubic(const Vector2 * points, int pointCount, float thick, Color color);
void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color);
void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);
void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);
void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color);
void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color);
Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t);
Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t);
Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t);
Vector2 GetSplinePointBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float t);
Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t);
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);
bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2);
bool CheckCollisionPointRec(Vector2 point, Rectangle rec);
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold);
bool CheckCollisionPointPoly(Vector2 point, const Vector2 * points, int pointCount);
bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 * collisionPoint);
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2);
Image LoadImage(const char * fileName);
Image LoadImageRaw(const char * fileName, int width, int height, int format, int headerSize);
Image LoadImageAnim(const char * fileName, int * frames);
Image LoadImageAnimFromMemory(const char * fileType, const unsigned char * fileData, int dataSize, int * frames);
Image LoadImageFromMemory(const char * fileType, const unsigned char * fileData, int dataSize);
Image LoadImageFromTexture(Texture2D texture);
Image LoadImageFromScreen(void);
bool IsImageValid(Image image);
void UnloadImage(Image image);
bool ExportImage(Image image, const char * fileName);
unsigned char * ExportImageToMemory(Image image, const char * fileType, int * fileSize);
bool ExportImageAsCode(Image image, const char * fileName);
Image GenImageColor(int width, int height, Color color);
Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end);
Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer);
Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer);
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2);
Image GenImageWhiteNoise(int width, int height, float factor);
Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale);
Image GenImageCellular(int width, int height, int tileSize);
Image GenImageText(int width, int height, const char * text);
Image ImageCopy(Image image);
Image ImageFromImage(Image image, Rectangle rec);
Image ImageFromChannel(Image image, int selectedChannel);
Image ImageText(const char * text, int fontSize, Color color);
Image ImageTextEx(Font font, const char * text, float fontSize, float spacing, Color tint);
void ImageFormat(Image * image, int newFormat);
void ImageToPOT(Image * image, Color fill);
void ImageCrop(Image * image, Rectangle crop);
void ImageAlphaCrop(Image * image, float threshold);
void ImageAlphaClear(Image * image, Color color, float threshold);
void ImageAlphaMask(Image * image, Image alphaMask);
void ImageAlphaPremultiply(Image * image);
void ImageBlurGaussian(Image * image, int blurSize);
void ImageKernelConvolution(Image * image, const float * kernel, int kernelSize);
void ImageResize(Image * image, int newWidth, int newHeight);
void ImageResizeNN(Image * image, int newWidth, int newHeight);
void ImageResizeCanvas(Image * image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill);
void ImageMipmaps(Image * image);
void ImageDither(Image * image, int rBpp, int gBpp, int bBpp, int aBpp);
void ImageFlipVertical(Image * image);
void ImageFlipHorizontal(Image * image);
void ImageRotate(Image * image, int degrees);
void ImageRotateCW(Image * image);
void ImageRotateCCW(Image * image);
void ImageColorTint(Image * image, Color color);
void ImageColorInvert(Image * image);
void ImageColorGrayscale(Image * image);
void ImageColorContrast(Image * image, int contrast);
void ImageColorBrightness(Image * image, int brightness);
void ImageColorReplace(Image * image, Color color, Color replace);
Color * LoadImageColors(Image image);
Color * LoadImagePalette(Image image, int maxPaletteSize, int * colorCount);
void UnloadImageColors(Color * colors);
void UnloadImagePalette(Color * colors);
Rectangle GetImageAlphaBorder(Image image, float threshold);
Color GetImageColor(Image image, int x, int y);
void ImageClearBackground(Image * dst, Color color);
void ImageDrawPixel(Image * dst, int posX, int posY, Color color);
void ImageDrawPixelV(Image * dst, Vector2 position, Color color);
void ImageDrawLine(Image * dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color);
void ImageDrawLineV(Image * dst, Vector2 start, Vector2 end, Color color);
void ImageDrawLineEx(Image * dst, Vector2 start, Vector2 end, int thick, Color color);
void ImageDrawLineStrip(Image * dst, const Vector2 * points, int pointCount, Color color);
void ImageDrawTriangle(Image * dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color);
void ImageDrawTriangleGradient(Image * dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3);
void ImageDrawTriangleLines(Image * dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color);
void ImageDrawTriangleFan(Image * dst, const Vector2 * points, int pointCount, Color color);
void ImageDrawTriangleStrip(Image * dst, const Vector2 * points, int pointCount, Color color);
void ImageDrawRectangle(Image * dst, int posX, int posY, int width, int height, Color color);
void ImageDrawRectangleV(Image * dst, Vector2 position, Vector2 size, Color color);
void ImageDrawRectangleRec(Image * dst, Rectangle rec, Color color);
void ImageDrawRectanglePro(Image * dst, Rectangle rec, Vector2 origin, float rotation, Color color);
void ImageDrawRectangleLines(Image * dst, int posX, int posY, int width, int height, Color color);
void ImageDrawRectangleLinesEx(Image * dst, Rectangle rec, int thick, Color color);
void ImageDrawRectangleGradientEx(Image * dst, Rectangle rec, Color col1, Color col2, Color col3, Color col4);
void ImageDrawCircle(Image * dst, int centerX, int centerY, int radius, Color color);
void ImageDrawCircleV(Image * dst, Vector2 center, int radius, Color color);
void ImageDrawCircleLines(Image * dst, int centerX, int centerY, int radius, Color color);
void ImageDrawCircleLinesV(Image * dst, Vector2 center, int radius, Color color);
void ImageDrawCircleGradient(Image * dst, Vector2 center, float radius, Color inner, Color outer);
void ImageDrawImage(Image * dst, Image src, int posX, int posY, Color tint);
void ImageDrawImageEx(Image * dst, Image src, Vector2 position, float rotation, float scale, Color tint);
void ImageDrawImageRec(Image * dst, Image src, Rectangle srcRec, Vector2 position, Color tint);
void ImageDrawImagePro(Image * dst, Image src, Rectangle srcRec, Rectangle dstRec, Vector2 origin, float rotation, Color tint);
void ImageDrawText(Image * dst, const char * text, int posX, int posY, int fontSize, Color color);
void ImageDrawTextEx(Image * dst, Font font, const char * text, Vector2 position, float fontSize, float spacing, Color tint);
void ImageDrawTextPro(Image * dst, Font font, const char * text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint);
Texture2D LoadTexture(const char * fileName);
Texture2D LoadTextureFromImage(Image image);
TextureCubemap LoadTextureCubemap(Image image, int layout);
RenderTexture2D LoadRenderTexture(int width, int height);
RenderTexture2D LoadRenderTextureEx(int width, int height, int format);
bool IsTextureValid(Texture2D texture);
void UnloadTexture(Texture2D texture);
bool IsRenderTextureValid(RenderTexture2D target);
void UnloadRenderTexture(RenderTexture2D target);
void UpdateTexture(Texture2D texture, const void * pixels);
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void * pixels);
void GenTextureMipmaps(Texture2D * texture);
void SetTextureFilter(Texture2D texture, int filter);
void SetTextureWrap(Texture2D texture, int wrap);
void DrawTexture(Texture2D texture, int posX, int posY, Color tint);
void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);
void DrawTextureRec(Texture2D texture, Rectangle rec, Vector2 position, Color tint);
void DrawTexturePro(Texture2D texture, Rectangle srcrec, Rectangle dstrec, Vector2 origin, float rotation, Color tint);
void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dstrec, Vector2 origin, float rotation, Color tint);
bool ColorIsEqual(Color col1, Color col2);
Color Fade(Color color, float alpha);
int ColorToInt(Color color);
Vector4 ColorNormalize(Color color);
Color ColorFromNormalized(Vector4 normalized);
Vector3 ColorToHSV(Color color);
Color ColorFromHSV(float hue, float saturation, float value);
Color ColorTint(Color color, Color tint);
Color ColorBrightness(Color color, float factor);
Color ColorContrast(Color color, float contrast);
Color ColorAlpha(Color color, float alpha);
Color ColorAlphaBlend(Color dst, Color src, Color tint);
Color ColorLerp(Color color1, Color color2, float factor);
Color GetColor(unsigned int hexValue);
Color GetPixelColor(const void * srcPtr, int format);
void SetPixelColor(void * dstPtr, Color color, int format);
int GetPixelDataSize(int width, int height, int format);
Font GetFontDefault(void);
Font LoadFont(const char * fileName);
Font LoadFontEx(const char * fileName, int fontSize, const int * codepoints, int codepointCount);
Font LoadFontFromImage(Image image, Color key, int firstChar);
Font LoadFontFromMemory(const char * fileType, const unsigned char * fileData, int dataSize, int fontSize, const int * codepoints, int codepointCount);
bool IsFontValid(Font font);
GlyphInfo * LoadFontData(const unsigned char * fileData, int dataSize, int fontSize, const int * codepoints, int codepointCount, int type, int * glyphCount);
Image GenImageFontAtlas(const GlyphInfo * glyphs, Rectangle ** glyphRecs, int glyphCount, int fontSize, int padding, int packMethod);
void UnloadFontData(GlyphInfo * glyphs, int glyphCount);
void UnloadFont(Font font);
bool ExportFontAsCode(Font font, const char * fileName);
void DrawFPS(int posX, int posY);
void DrawText(const char * text, int posX, int posY, int fontSize, Color color);
void DrawTextEx(Font font, const char * text, Vector2 position, float fontSize, float spacing, Color tint);
void DrawTextPro(Font font, const char * text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint);
void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint);
void DrawTextCodepoints(Font font, const int * codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint);
void SetTextLineSpacing(int spacing);
int MeasureText(const char * text, int fontSize);
Vector2 MeasureTextEx(Font font, const char * text, float fontSize, float spacing);
Vector2 MeasureTextCodepoints(Font font, const int * codepoints, int length, float fontSize, float spacing);
int GetGlyphIndex(Font font, int codepoint);
GlyphInfo GetGlyphInfo(Font font, int codepoint);
Rectangle GetGlyphAtlasRec(Font font, int codepoint);
char * LoadUTF8(const int * codepoints, int length);
void UnloadUTF8(char * text);
int * LoadCodepoints(const char * text, int * count);
void UnloadCodepoints(int * codepoints);
int GetCodepointCount(const char * text);
int GetCodepoint(const char * text, int * codepointSize);
int GetCodepointNext(const char * text, int * codepointSize);
int GetCodepointPrevious(const char * text, int * codepointSize);
const char * CodepointToUTF8(int codepoint, int * utf8Size);
char ** LoadTextLines(const char * text, int * count);
void UnloadTextLines(char ** text, int lineCount);
int TextCopy(char * dst, const char * src);
bool TextIsEqual(const char * text1, const char * text2);
unsigned int TextLength(const char * text);
const char * TextFormat(const char * text, ...);
const char * TextSubtext(const char * text, int position, int length);
const char * TextRemoveSpaces(const char * text);
char * GetTextBetween(const char * text, const char * begin, const char * end);
char * TextReplace(const char * text, const char * search, const char * replacement);
char * TextReplaceAlloc(const char * text, const char * search, const char * replacement);
char * TextReplaceBetween(const char * text, const char * begin, const char * end, const char * replacement);
char * TextReplaceBetweenAlloc(const char * text, const char * begin, const char * end, const char * replacement);
char * TextInsert(const char * text, const char * insert, int position);
char * TextInsertAlloc(const char * text, const char * insert, int position);
char * TextJoin(char ** textList, int count, const char * delimiter);
char ** TextSplit(const char * text, char delimiter, int * count);
void TextAppend(char * text, const char * append, int * position);
int TextFindIndex(const char * text, const char * search);
char * TextToUpper(const char * text);
char * TextToLower(const char * text);
char * TextToPascal(const char * text);
char * TextToSnake(const char * text);
char * TextToCamel(const char * text);
int TextToInteger(const char * text);
float TextToFloat(const char * text);
void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color);
void DrawPoint3D(Vector3 position, Color color);
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);
void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color);
void DrawTriangleStrip3D(const Vector3 * points, int pointCount, Color color);
void DrawCube(Vector3 position, float width, float height, float length, Color color);
void DrawCubeV(Vector3 position, Vector3 size, Color color);
void DrawCubeWires(Vector3 position, float width, float height, float length, Color color);
void DrawCubeWiresV(Vector3 position, Vector3 size, Color color);
void DrawSphere(Vector3 centerPos, float radius, Color color);
void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color);
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color);
void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color);
void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color);
void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color);
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color);
void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color);
void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int rings, int slices, Color color);
void DrawPlane(Vector3 centerPos, Vector2 size, Color color);
void DrawRay(Ray ray, Color color);
void DrawGrid(int slices, float spacing);
Model LoadModel(const char * fileName);
Model LoadModelFromMesh(Mesh mesh);
bool IsModelValid(Model model);
void UnloadModel(Model model);
BoundingBox GetModelBoundingBox(Model model);
void DrawModel(Model model, Vector3 position, float scale, Color tint);
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);
void DrawModelWires(Model model, Vector3 position, float scale, Color tint);
void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);
void DrawBoundingBox(BoundingBox box, Color color);
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint);
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector2 size, Color tint);
void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle rec, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint);
void UploadMesh(Mesh * mesh, bool dynamic);
void UpdateMeshBuffer(Mesh mesh, int index, const void * data, int dataSize, int offset);
void UnloadMesh(Mesh mesh);
void DrawMesh(Mesh mesh, Material material, Matrix transform);
void DrawMeshInstanced(Mesh mesh, Material material, const Matrix * transforms, int instances);
BoundingBox GetMeshBoundingBox(Mesh mesh);
void GenMeshTangents(Mesh * mesh);
bool ExportMesh(Mesh mesh, const char * fileName);
bool ExportMeshAsCode(Mesh mesh, const char * fileName);
Mesh GenMeshPoly(int sides, float radius);
Mesh GenMeshPlane(float width, float length, int resX, int resZ);
Mesh GenMeshCube(float width, float height, float length);
Mesh GenMeshSphere(float radius, int rings, int slices);
Mesh GenMeshHemiSphere(float radius, int rings, int slices);
Mesh GenMeshCylinder(float radius, float height, int slices);
Mesh GenMeshCone(float radius, float height, int slices);
Mesh GenMeshTorus(float radius, float size, int radSeg, int sides);
Mesh GenMeshKnot(float radius, float size, int radSeg, int sides);
Mesh GenMeshHeightmap(Image heightmap, Vector3 size);
Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize);
Material * LoadMaterials(const char * fileName, int * materialCount);
Material LoadMaterialDefault(void);
bool IsMaterialValid(Material material);
void UnloadMaterial(Material material);
void SetMaterialTexture(Material * material, int mapType, Texture2D texture);
void SetModelMeshMaterial(Model * model, int meshId, int materialId);
ModelAnimation * LoadModelAnimations(const char * fileName, int * animCount);
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame);
void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend);
void UnloadModelAnimations(ModelAnimation * animations, int animCount);
bool IsModelAnimationValid(Model model, ModelAnimation anim);
bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2);
bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);
bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius);
RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius);
RayCollision GetRayCollisionBox(Ray ray, BoundingBox box);
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform);
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4);
void InitAudioDevice(void);
void CloseAudioDevice(void);
bool IsAudioDeviceReady(void);
void SetMasterVolume(float volume);
float GetMasterVolume(void);
Wave LoadWave(const char * fileName);
Wave LoadWaveFromMemory(const char * fileType, const unsigned char * fileData, int dataSize);
bool IsWaveValid(Wave wave);
Sound LoadSound(const char * fileName);
Sound LoadSoundFromWave(Wave wave);
Sound LoadSoundAlias(Sound source);
bool IsSoundValid(Sound sound);
void UpdateSound(Sound sound, const void * data, int frameCount);
void UnloadWave(Wave wave);
void UnloadSound(Sound sound);
void UnloadSoundAlias(Sound alias);
bool ExportWave(Wave wave, const char * fileName);
bool ExportWaveAsCode(Wave wave, const char * fileName);
void PlaySound(Sound sound);
void StopSound(Sound sound);
void PauseSound(Sound sound);
void ResumeSound(Sound sound);
bool IsSoundPlaying(Sound sound);
void SetSoundVolume(Sound sound, float volume);
void SetSoundPitch(Sound sound, float pitch);
void SetSoundPan(Sound sound, float pan);
Wave WaveCopy(Wave wave);
void WaveCrop(Wave * wave, int initFrame, int finalFrame);
void WaveFormat(Wave * wave, int sampleRate, int sampleSize, int channels);
float * LoadWaveSamples(Wave wave);
void UnloadWaveSamples(float * samples);
Music LoadMusicStream(const char * fileName);
Music LoadMusicStreamFromMemory(const char * fileType, const unsigned char * data, int dataSize);
bool IsMusicValid(Music music);
void UnloadMusicStream(Music music);
void PlayMusicStream(Music music);
bool IsMusicStreamPlaying(Music music);
void UpdateMusicStream(Music music);
void StopMusicStream(Music music);
void PauseMusicStream(Music music);
void ResumeMusicStream(Music music);
void SeekMusicStream(Music music, float position);
void SetMusicVolume(Music music, float volume);
void SetMusicPitch(Music music, float pitch);
void SetMusicPan(Music music, float pan);
float GetMusicTimeLength(Music music);
float GetMusicTimePlayed(Music music);
AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels);
bool IsAudioStreamValid(AudioStream stream);
void UnloadAudioStream(AudioStream stream);
void UpdateAudioStream(AudioStream stream, const void * data, int frameCount);
bool IsAudioStreamProcessed(AudioStream stream);
void PlayAudioStream(AudioStream stream);
void PauseAudioStream(AudioStream stream);
void ResumeAudioStream(AudioStream stream);
bool IsAudioStreamPlaying(AudioStream stream);
void StopAudioStream(AudioStream stream);
void SetAudioStreamVolume(AudioStream stream, float volume);
void SetAudioStreamPitch(AudioStream stream, float pitch);
void SetAudioStreamPan(AudioStream stream, float pan);
void SetAudioStreamBufferSizeDefault(int size);
void SetAudioStreamCallback(AudioStream stream, AudioCallback callback);
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
void AttachAudioMixedProcessor(AudioCallback processor);
void DetachAudioMixedProcessor(AudioCallback processor);
void rlMatrixMode(int mode);
void rlPushMatrix(void);
void rlPopMatrix(void);
void rlLoadIdentity(void);
void rlTranslatef(float x, float y, float z);
void rlRotatef(float angle, float x, float y, float z);
void rlScalef(float x, float y, float z);
void rlMultMatrixf(const float * matf);
void rlFrustum(float left, float right, float bottom, float top, float znear, float zfar);
void rlOrtho(float left, float right, float bottom, float top, float znear, float zfar);
void rlViewport(int x, int y, int width, int height);
void rlSetClipPlanes(float nearPlane, float farPlane);
float rlGetCullDistanceNear(void);
float rlGetCullDistanceFar(void);
void rlBegin(int mode);
void rlEnd(void);
void rlVertex2i(int x, int y);
void rlVertex2f(float x, float y);
void rlVertex3f(float x, float y, float z);
void rlTexCoord2f(float x, float y);
void rlNormal3f(float x, float y, float z);
void rlColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
void rlColor3f(float x, float y, float z);
void rlColor4f(float x, float y, float z, float w);
bool rlEnableVertexArray(unsigned int vaoId);
void rlDisableVertexArray(void);
void rlEnableVertexBuffer(unsigned int id);
void rlDisableVertexBuffer(void);
void rlEnableVertexBufferElement(unsigned int id);
void rlDisableVertexBufferElement(void);
void rlEnableVertexAttribute(unsigned int index);
void rlDisableVertexAttribute(unsigned int index);
void rlEnableStatePointer(int vertexAttribType, void * buffer);
void rlDisableStatePointer(int vertexAttribType);
void rlActiveTextureSlot(int slot);
void rlEnableTexture(unsigned int id);
void rlDisableTexture(void);
void rlEnableTextureCubemap(unsigned int id);
void rlDisableTextureCubemap(void);
void rlTextureParameters(unsigned int id, int param, int value);
void rlCubemapParameters(unsigned int id, int param, int value);
void rlEnableShader(unsigned int id);
void rlDisableShader(void);
void rlEnableFramebuffer(unsigned int id);
void rlDisableFramebuffer(void);
unsigned int rlGetActiveFramebuffer(void);
void rlActiveDrawBuffers(int count);
void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask);
void rlBindFramebuffer(unsigned int target, unsigned int framebuffer);
void rlEnableColorBlend(void);
void rlDisableColorBlend(void);
void rlEnableDepthTest(void);
void rlDisableDepthTest(void);
void rlEnableDepthMask(void);
void rlDisableDepthMask(void);
void rlEnableBackfaceCulling(void);
void rlDisableBackfaceCulling(void);
void rlColorMask(bool r, bool g, bool b, bool a);
void rlSetCullFace(int mode);
void rlEnableScissorTest(void);
void rlDisableScissorTest(void);
void rlScissor(int x, int y, int width, int height);
void rlEnablePointMode(void);
void rlDisablePointMode(void);
void rlSetPointSize(float size);
float rlGetPointSize(void);
void rlEnableWireMode(void);
void rlDisableWireMode(void);
void rlSetLineWidth(float width);
float rlGetLineWidth(void);
void rlEnableSmoothLines(void);
void rlDisableSmoothLines(void);
void rlEnableStereoRender(void);
void rlDisableStereoRender(void);
bool rlIsStereoRenderEnabled(void);
void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
void rlClearScreenBuffers(void);
void rlCheckErrors(void);
void rlSetBlendMode(int mode);
void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation);
void rlSetBlendFactorsSeparate(int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha);
void rlglInit(int width, int height);
void rlglClose(void);
void rlLoadExtensions(void * loader);
void * rlGetProcAddress(const char * procName);
int rlGetVersion(void);
void rlSetFramebufferWidth(int width);
int rlGetFramebufferWidth(void);
void rlSetFramebufferHeight(int height);
int rlGetFramebufferHeight(void);
unsigned int rlGetTextureIdDefault(void);
unsigned int rlGetShaderIdDefault(void);
int * rlGetShaderLocsDefault(void);
rlRenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements);
void rlUnloadRenderBatch(rlRenderBatch batch);
void rlDrawRenderBatch(rlRenderBatch * batch);
void rlSetRenderBatchActive(rlRenderBatch * batch);
void rlDrawRenderBatchActive(void);
bool rlCheckRenderBatchLimit(int vCount);
void rlSetTexture(unsigned int id);
unsigned int rlLoadVertexArray(void);
unsigned int rlLoadVertexBuffer(const void * buffer, int size, bool dynamic);
unsigned int rlLoadVertexBufferElement(const void * buffer, int size, bool dynamic);
void rlUpdateVertexBuffer(unsigned int bufferId, const void * data, int dataSize, int offset);
void rlUpdateVertexBufferElements(unsigned int id, const void * data, int dataSize, int offset);
void rlUnloadVertexArray(unsigned int vaoId);
void rlUnloadVertexBuffer(unsigned int vboId);
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, int offset);
void rlSetVertexAttributeDivisor(unsigned int index, int divisor);
void rlSetVertexAttributeDefault(int locIndex, const void * value, int attribType, int count);
void rlDrawVertexArray(int offset, int count);
void rlDrawVertexArrayElements(int offset, int count, const void * buffer);
void rlDrawVertexArrayInstanced(int offset, int count, int instances);
void rlDrawVertexArrayElementsInstanced(int offset, int count, const void * buffer, int instances);
unsigned int rlLoadTexture(const void * data, int width, int height, int format, int mipmapCount);
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer);
unsigned int rlLoadTextureCubemap(const void * data, int size, int format, int mipmapCount);
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void * data);
void rlGetGlTextureFormats(int format, unsigned int * glInternalFormat, unsigned int * glFormat, unsigned int * glType);
const char * rlGetPixelFormatName(unsigned int format);
void rlUnloadTexture(unsigned int id);
void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int * mipmaps);
void * rlReadTexturePixels(unsigned int id, int width, int height, int format);
unsigned char * rlReadScreenPixels(int width, int height);
unsigned int rlLoadFramebuffer(void);
void rlFramebufferAttach(unsigned int id, unsigned int texId, int attachType, int texType, int mipLevel);
bool rlFramebufferComplete(unsigned int id);
void rlUnloadFramebuffer(unsigned int id);
void rlCopyFramebuffer(int x, int y, int width, int height, int format, void * pixels);
void rlResizeFramebuffer(int width, int height);
unsigned int rlLoadShader(const char * code, int type);
unsigned int rlLoadShaderProgram(const char * vsCode, const char * fsCode);
unsigned int rlLoadShaderProgramEx(unsigned int vsId, unsigned int fsId);
unsigned int rlLoadShaderProgramCompute(unsigned int csId);
void rlUnloadShader(unsigned int id);
void rlUnloadShaderProgram(unsigned int id);
int rlGetLocationUniform(unsigned int id, const char * uniformName);
int rlGetLocationAttrib(unsigned int id, const char * attribName);
void rlSetUniform(int locIndex, const void * value, int uniformType, int count);
void rlSetUniformMatrix(int locIndex, Matrix mat);
void rlSetUniformMatrices(int locIndex, const Matrix * mat, int count);
void rlSetUniformSampler(int locIndex, unsigned int textureId);
void rlSetShader(unsigned int id, int * locs);
void rlComputeShaderDispatch(unsigned int groupX, unsigned int groupY, unsigned int groupZ);
unsigned int rlLoadShaderBuffer(unsigned int size, const void * data, int usageHint);
void rlUnloadShaderBuffer(unsigned int ssboId);
void rlUpdateShaderBuffer(unsigned int id, const void * data, unsigned int dataSize, unsigned int offset);
void rlBindShaderBuffer(unsigned int id, unsigned int index);
void rlReadShaderBuffer(unsigned int id, void * dest, unsigned int count, unsigned int offset);
void rlCopyShaderBuffer(unsigned int destId, unsigned int srcId, unsigned int destOffset, unsigned int srcOffset, unsigned int count);
unsigned int rlGetShaderBufferSize(unsigned int id);
void rlBindImageTexture(unsigned int id, unsigned int index, int format, bool readonly);
Matrix rlGetMatrixModelview(void);
Matrix rlGetMatrixProjection(void);
Matrix rlGetMatrixTransform(void);
Matrix rlGetMatrixProjectionStereo(int eye);
Matrix rlGetMatrixViewOffsetStereo(int eye);
void rlSetMatrixProjection(Matrix proj);
void rlSetMatrixModelview(Matrix view);
void rlSetMatrixProjectionStereo(Matrix right, Matrix left);
void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left);
void rlLoadDrawCube(void);
void rlLoadDrawQuad(void);
float Clamp(float value, float min, float max);
float Lerp(float start, float end, float amount);
float Normalize(float value, float start, float end);
float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd);
float Wrap(float value, float min, float max);
int FloatEquals(float x, float y);
Vector2 Vector2Zero(void);
Vector2 Vector2One(void);
Vector2 Vector2Add(Vector2 v1, Vector2 v2);
Vector2 Vector2AddValue(Vector2 v, float add);
Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
Vector2 Vector2SubtractValue(Vector2 v, float sub);
float Vector2Length(Vector2 v);
float Vector2LengthSqr(Vector2 v);
float Vector2DotProduct(Vector2 v1, Vector2 v2);
float Vector2CrossProduct(Vector2 v1, Vector2 v2);
float Vector2Distance(Vector2 v1, Vector2 v2);
float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
float Vector2Angle(Vector2 v1, Vector2 v2);
float Vector2LineAngle(Vector2 start, Vector2 end);
Vector2 Vector2Scale(Vector2 v, float scale);
Vector2 Vector2Multiply(Vector2 v1, Vector2 v2);
Vector2 Vector2Negate(Vector2 v);
Vector2 Vector2Divide(Vector2 v1, Vector2 v2);
Vector2 Vector2Normalize(Vector2 v);
Vector2 Vector2Transform(Vector2 v, Matrix mat);
Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount);
Vector2 Vector2Reflect(Vector2 v, Vector2 normal);
Vector2 Vector2Min(Vector2 v1, Vector2 v2);
Vector2 Vector2Max(Vector2 v1, Vector2 v2);
Vector2 Vector2Rotate(Vector2 v, float angle);
Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance);
Vector2 Vector2Invert(Vector2 v);
Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max);
Vector2 Vector2ClampValue(Vector2 v, float min, float max);
int Vector2Equals(Vector2 p, Vector2 q);
Vector2 Vector2Refract(Vector2 v, Vector2 n, float r);
Vector3 Vector3Zero(void);
Vector3 Vector3One(void);
Vector3 Vector3Add(Vector3 v1, Vector3 v2);
Vector3 Vector3AddValue(Vector3 v, float add);
Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
Vector3 Vector3SubtractValue(Vector3 v, float sub);
Vector3 Vector3Scale(Vector3 v, float scalar);
Vector3 Vector3Multiply(Vector3 v1, Vector3 v2);
Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
Vector3 Vector3Perpendicular(Vector3 v);
float Vector3Length(const Vector3 v);
float Vector3LengthSqr(const Vector3 v);
float Vector3DotProduct(Vector3 v1, Vector3 v2);
float Vector3Distance(Vector3 v1, Vector3 v2);
float Vector3DistanceSqr(Vector3 v1, Vector3 v2);
float Vector3Angle(Vector3 v1, Vector3 v2);
Vector3 Vector3Negate(Vector3 v);
Vector3 Vector3Divide(Vector3 v1, Vector3 v2);
Vector3 Vector3Normalize(Vector3 v);
Vector3 Vector3Project(Vector3 v1, Vector3 v2);
Vector3 Vector3Reject(Vector3 v1, Vector3 v2);
void Vector3OrthoNormalize(Vector3 * v1, Vector3 * v2);
Vector3 Vector3Transform(Vector3 v, Matrix mat);
Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);
Vector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance);
Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
Vector3 Vector3CubicHermite(Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount);
Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
Vector3 Vector3Min(Vector3 v1, Vector3 v2);
Vector3 Vector3Max(Vector3 v1, Vector3 v2);
Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view);
float3 Vector3ToFloatV(Vector3 v);
Vector3 Vector3Invert(Vector3 v);
Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max);
Vector3 Vector3ClampValue(Vector3 v, float min, float max);
int Vector3Equals(Vector3 p, Vector3 q);
Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);
Vector4 Vector4Zero(void);
Vector4 Vector4One(void);
Vector4 Vector4Add(Vector4 v1, Vector4 v2);
Vector4 Vector4AddValue(Vector4 v, float add);
Vector4 Vector4Subtract(Vector4 v1, Vector4 v2);
Vector4 Vector4SubtractValue(Vector4 v, float add);
float Vector4Length(Vector4 v);
float Vector4LengthSqr(Vector4 v);
float Vector4DotProduct(Vector4 v1, Vector4 v2);
float Vector4Distance(Vector4 v1, Vector4 v2);
float Vector4DistanceSqr(Vector4 v1, Vector4 v2);
Vector4 Vector4Scale(Vector4 v, float scale);
Vector4 Vector4Multiply(Vector4 v1, Vector4 v2);
Vector4 Vector4Negate(Vector4 v);
Vector4 Vector4Divide(Vector4 v1, Vector4 v2);
Vector4 Vector4Normalize(Vector4 v);
Vector4 Vector4Min(Vector4 v1, Vector4 v2);
Vector4 Vector4Max(Vector4 v1, Vector4 v2);
Vector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount);
Vector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance);
Vector4 Vector4Invert(Vector4 v);
int Vector4Equals(Vector4 p, Vector4 q);
float MatrixDeterminant(Matrix mat);
float MatrixTrace(Matrix mat);
Matrix MatrixTranspose(Matrix mat);
Matrix MatrixInvert(Matrix mat);
Matrix MatrixIdentity(void);
Matrix MatrixAdd(Matrix left, Matrix right);
Matrix MatrixSubtract(Matrix left, Matrix right);
Matrix MatrixMultiply(Matrix left, Matrix right);
Matrix MatrixMultiplyValue(Matrix left, float value);
Matrix MatrixTranslate(float x, float y, float z);
Matrix MatrixRotate(Vector3 axis, float angle);
Matrix MatrixRotateX(float angle);
Matrix MatrixRotateY(float angle);
Matrix MatrixRotateZ(float angle);
Matrix MatrixRotateXYZ(Vector3 angle);
Matrix MatrixRotateZYX(Vector3 angle);
Matrix MatrixScale(float x, float y, float z);
Matrix MatrixFrustum(float left, float right, float bottom, float top, float nearPlane, float farPlane);
Matrix MatrixPerspective(float fovY, float aspect, float nearPlane, float farPlane);
Matrix MatrixOrtho(float left, float right, float bottom, float top, float nearPlane, float farPlane);
Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
float16 MatrixToFloatV(Matrix mat);
Quaternion QuaternionAdd(Quaternion q1, Quaternion q2);
Quaternion QuaternionAddValue(Quaternion q, float add);
Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2);
Quaternion QuaternionSubtractValue(Quaternion q, float sub);
Quaternion QuaternionIdentity(void);
float QuaternionLength(Quaternion q);
Quaternion QuaternionNormalize(Quaternion q);
Quaternion QuaternionInvert(Quaternion q);
Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
Quaternion QuaternionScale(Quaternion q, float mul);
Quaternion QuaternionDivide(Quaternion q1, Quaternion q2);
Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
Quaternion QuaternionCubicHermiteSpline(Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t);
Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
Quaternion QuaternionFromMatrix(Matrix mat);
Matrix QuaternionToMatrix(Quaternion q);
Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
void QuaternionToAxisAngle(Quaternion q, Vector3 * outAxis, float * outAngle);
Quaternion QuaternionFromEuler(float pitch, float yaw, float roll);
Vector3 QuaternionToEuler(Quaternion q);
Quaternion QuaternionTransform(Quaternion q, Matrix mat);
int QuaternionEquals(Quaternion p, Quaternion q);
Matrix MatrixCompose(Vector3 translation, Quaternion rotation, Vector3 scale);
void MatrixDecompose(Matrix mat, Vector3 * translation, Quaternion * rotation, Vector3 * scale);
]]
local C = ffi.C
local string_format = string.format
local ffi_string = ffi.string
local type, select = type, select
local M = {}
-- Raw namespace for hot paths that want to skip the Lua wrapper.
---@type ffi.namespace*
M.C = C
---@class raylib.char_buffer
---@field [integer] integer
---@class raylib.cstring_array
---@field [integer] ffi.cdata*
local pinned = {}
local callback_cache = {}
local function pin(ctype, fn)
if fn == nil then
return nil
end
local by_type = callback_cache[fn]
if by_type == nil then
by_type = {}
callback_cache[fn] = by_type
end
local cb = by_type[ctype]
if cb == nil then
cb = ffi.cast(ctype, fn)
by_type[ctype] = cb
pinned[#pinned + 1] = cb
end
return cb
end
local function to_array(ct, t, n)
n = n or #t
local a = ffi.new(ct .. "[?]", n)
for i = 1, n do
a[i - 1] = t[i]
end
return a
end
---@enum raylib.ConfigFlags
M.ConfigFlags = {
FLAG_VSYNC_HINT = 64,
FLAG_FULLSCREEN_MODE = 2,
FLAG_WINDOW_RESIZABLE = 4,
FLAG_WINDOW_UNDECORATED = 8,
FLAG_WINDOW_HIDDEN = 128,
FLAG_WINDOW_MINIMIZED = 512,
FLAG_WINDOW_MAXIMIZED = 1024,
FLAG_WINDOW_UNFOCUSED = 2048,
FLAG_WINDOW_TOPMOST = 4096,
FLAG_WINDOW_ALWAYS_RUN = 256,
FLAG_WINDOW_TRANSPARENT = 16,
FLAG_WINDOW_HIGHDPI = 8192,
FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384,
FLAG_BORDERLESS_WINDOWED_MODE = 32768,
FLAG_MSAA_4X_HINT = 32,
FLAG_INTERLACED_HINT = 65536,
}
---@enum raylib.TraceLogLevel
M.TraceLogLevel = {
LOG_ALL = 0,
LOG_TRACE = 1,
LOG_DEBUG = 2,
LOG_INFO = 3,
LOG_WARNING = 4,
LOG_ERROR = 5,
LOG_FATAL = 6,
LOG_NONE = 7,
}
---@enum raylib.KeyboardKey
M.KeyboardKey = {
KEY_NULL = 0,
KEY_APOSTROPHE = 39,
KEY_COMMA = 44,
KEY_MINUS = 45,
KEY_PERIOD = 46,
KEY_SLASH = 47,
KEY_ZERO = 48,
KEY_ONE = 49,
KEY_TWO = 50,
KEY_THREE = 51,
KEY_FOUR = 52,
KEY_FIVE = 53,
KEY_SIX = 54,
KEY_SEVEN = 55,
KEY_EIGHT = 56,
KEY_NINE = 57,
KEY_SEMICOLON = 59,
KEY_EQUAL = 61,
KEY_A = 65,
KEY_B = 66,
KEY_C = 67,
KEY_D = 68,
KEY_E = 69,
KEY_F = 70,
KEY_G = 71,
KEY_H = 72,
KEY_I = 73,
KEY_J = 74,
KEY_K = 75,
KEY_L = 76,
KEY_M = 77,
KEY_N = 78,
KEY_O = 79,
KEY_P = 80,
KEY_Q = 81,
KEY_R = 82,
KEY_S = 83,
KEY_T = 84,
KEY_U = 85,
KEY_V = 86,
KEY_W = 87,
KEY_X = 88,
KEY_Y = 89,
KEY_Z = 90,
KEY_LEFT_BRACKET = 91,
KEY_BACKSLASH = 92,
KEY_RIGHT_BRACKET = 93,
KEY_GRAVE = 96,
KEY_SPACE = 32,
KEY_ESCAPE = 256,
KEY_ENTER = 257,
KEY_TAB = 258,
KEY_BACKSPACE = 259,
KEY_INSERT = 260,
KEY_DELETE = 261,
KEY_RIGHT = 262,
KEY_LEFT = 263,
KEY_DOWN = 264,
KEY_UP = 265,
KEY_PAGE_UP = 266,
KEY_PAGE_DOWN = 267,
KEY_HOME = 268,
KEY_END = 269,
KEY_CAPS_LOCK = 280,
KEY_SCROLL_LOCK = 281,
KEY_NUM_LOCK = 282,
KEY_PRINT_SCREEN = 283,
KEY_PAUSE = 284,
KEY_F1 = 290,
KEY_F2 = 291,
KEY_F3 = 292,
KEY_F4 = 293,
KEY_F5 = 294,
KEY_F6 = 295,
KEY_F7 = 296,
KEY_F8 = 297,
KEY_F9 = 298,
KEY_F10 = 299,
KEY_F11 = 300,
KEY_F12 = 301,
KEY_LEFT_SHIFT = 340,
KEY_LEFT_CONTROL = 341,
KEY_LEFT_ALT = 342,
KEY_LEFT_SUPER = 343,
KEY_RIGHT_SHIFT = 344,
KEY_RIGHT_CONTROL = 345,
KEY_RIGHT_ALT = 346,
KEY_RIGHT_SUPER = 347,
KEY_KB_MENU = 348,
KEY_KP_0 = 320,
KEY_KP_1 = 321,
KEY_KP_2 = 322,
KEY_KP_3 = 323,
KEY_KP_4 = 324,
KEY_KP_5 = 325,
KEY_KP_6 = 326,
KEY_KP_7 = 327,
KEY_KP_8 = 328,
KEY_KP_9 = 329,
KEY_KP_DECIMAL = 330,
KEY_KP_DIVIDE = 331,
KEY_KP_MULTIPLY = 332,
KEY_KP_SUBTRACT = 333,
KEY_KP_ADD = 334,
KEY_KP_ENTER = 335,
KEY_KP_EQUAL = 336,
KEY_BACK = 4,
KEY_MENU = 5,
KEY_VOLUME_UP = 24,
KEY_VOLUME_DOWN = 25,
}
---@enum raylib.MouseButton
M.MouseButton = {
MOUSE_BUTTON_LEFT = 0,
MOUSE_BUTTON_RIGHT = 1,
MOUSE_BUTTON_MIDDLE = 2,
MOUSE_BUTTON_SIDE = 3,
MOUSE_BUTTON_EXTRA = 4,
MOUSE_BUTTON_FORWARD = 5,
MOUSE_BUTTON_BACK = 6,
}
---@enum raylib.MouseCursor
M.MouseCursor = {
MOUSE_CURSOR_DEFAULT = 0,
MOUSE_CURSOR_ARROW = 1,
MOUSE_CURSOR_IBEAM = 2,
MOUSE_CURSOR_CROSSHAIR = 3,
MOUSE_CURSOR_POINTING_HAND = 4,
MOUSE_CURSOR_RESIZE_EW = 5,
MOUSE_CURSOR_RESIZE_NS = 6,
MOUSE_CURSOR_RESIZE_NWSE = 7,
MOUSE_CURSOR_RESIZE_NESW = 8,
MOUSE_CURSOR_RESIZE_ALL = 9,
MOUSE_CURSOR_NOT_ALLOWED = 10,
}
---@enum raylib.GamepadButton
M.GamepadButton = {
GAMEPAD_BUTTON_UNKNOWN = 0,
GAMEPAD_BUTTON_LEFT_FACE_UP = 1,
GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2,
GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3,
GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4,
GAMEPAD_BUTTON_RIGHT_FACE_UP = 5,
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6,
GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7,
GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8,
GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9,
GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10,
GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11,
GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12,
GAMEPAD_BUTTON_MIDDLE_LEFT = 13,
GAMEPAD_BUTTON_MIDDLE = 14,
GAMEPAD_BUTTON_MIDDLE_RIGHT = 15,
GAMEPAD_BUTTON_LEFT_THUMB = 16,
GAMEPAD_BUTTON_RIGHT_THUMB = 17,
}
---@enum raylib.GamepadAxis
M.GamepadAxis = {
GAMEPAD_AXIS_LEFT_X = 0,
GAMEPAD_AXIS_LEFT_Y = 1,
GAMEPAD_AXIS_RIGHT_X = 2,
GAMEPAD_AXIS_RIGHT_Y = 3,
GAMEPAD_AXIS_LEFT_TRIGGER = 4,
GAMEPAD_AXIS_RIGHT_TRIGGER = 5,
}
---@enum raylib.MaterialMapIndex
M.MaterialMapIndex = {
MATERIAL_MAP_ALBEDO = 0,
MATERIAL_MAP_METALNESS = 1,
MATERIAL_MAP_NORMAL = 2,
MATERIAL_MAP_ROUGHNESS = 3,
MATERIAL_MAP_OCCLUSION = 4,
MATERIAL_MAP_EMISSION = 5,
MATERIAL_MAP_HEIGHT = 6,
MATERIAL_MAP_CUBEMAP = 7,
MATERIAL_MAP_IRRADIANCE = 8,
MATERIAL_MAP_PREFILTER = 9,
MATERIAL_MAP_BRDF = 10,
}
---@enum raylib.ShaderLocationIndex
M.ShaderLocationIndex = {
SHADER_LOC_VERTEX_POSITION = 0,
SHADER_LOC_VERTEX_TEXCOORD01 = 1,
SHADER_LOC_VERTEX_TEXCOORD02 = 2,
SHADER_LOC_VERTEX_NORMAL = 3,
SHADER_LOC_VERTEX_TANGENT = 4,
SHADER_LOC_VERTEX_COLOR = 5,
SHADER_LOC_MATRIX_MVP = 6,
SHADER_LOC_MATRIX_VIEW = 7,
SHADER_LOC_MATRIX_PROJECTION = 8,
SHADER_LOC_MATRIX_MODEL = 9,
SHADER_LOC_MATRIX_NORMAL = 10,
SHADER_LOC_VECTOR_VIEW = 11,
SHADER_LOC_COLOR_DIFFUSE = 12,
SHADER_LOC_COLOR_SPECULAR = 13,
SHADER_LOC_COLOR_AMBIENT = 14,
SHADER_LOC_MAP_ALBEDO = 15,
SHADER_LOC_MAP_METALNESS = 16,
SHADER_LOC_MAP_NORMAL = 17,
SHADER_LOC_MAP_ROUGHNESS = 18,
SHADER_LOC_MAP_OCCLUSION = 19,
SHADER_LOC_MAP_EMISSION = 20,
SHADER_LOC_MAP_HEIGHT = 21,
SHADER_LOC_MAP_CUBEMAP = 22,
SHADER_LOC_MAP_IRRADIANCE = 23,
SHADER_LOC_MAP_PREFILTER = 24,
SHADER_LOC_MAP_BRDF = 25,
SHADER_LOC_VERTEX_BONEIDS = 26,
SHADER_LOC_VERTEX_BONEWEIGHTS = 27,
SHADER_LOC_MATRIX_BONETRANSFORMS = 28,
SHADER_LOC_VERTEX_INSTANCETRANSFORM = 29,
}
---@enum raylib.ShaderUniformDataType
M.ShaderUniformDataType = {
SHADER_UNIFORM_FLOAT = 0,
SHADER_UNIFORM_VEC2 = 1,
SHADER_UNIFORM_VEC3 = 2,
SHADER_UNIFORM_VEC4 = 3,
SHADER_UNIFORM_INT = 4,
SHADER_UNIFORM_IVEC2 = 5,
SHADER_UNIFORM_IVEC3 = 6,
SHADER_UNIFORM_IVEC4 = 7,
SHADER_UNIFORM_UINT = 8,
SHADER_UNIFORM_UIVEC2 = 9,
SHADER_UNIFORM_UIVEC3 = 10,
SHADER_UNIFORM_UIVEC4 = 11,
SHADER_UNIFORM_SAMPLER2D = 12,
}
---@enum raylib.ShaderAttributeDataType
M.ShaderAttributeDataType = {
SHADER_ATTRIB_FLOAT = 0,
SHADER_ATTRIB_VEC2 = 1,
SHADER_ATTRIB_VEC3 = 2,
SHADER_ATTRIB_VEC4 = 3,
}
---@enum raylib.PixelFormat
M.PixelFormat = {
PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2,
PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3,
PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4,
PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5,
PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6,
PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7,
PIXELFORMAT_UNCOMPRESSED_R32 = 8,
PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
PIXELFORMAT_UNCOMPRESSED_R16 = 11,
PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12,
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13,
PIXELFORMAT_COMPRESSED_DXT1_RGB = 14,
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15,
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16,
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17,
PIXELFORMAT_COMPRESSED_ETC1_RGB = 18,
PIXELFORMAT_COMPRESSED_ETC2_RGB = 19,
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20,
PIXELFORMAT_COMPRESSED_PVRT_RGB = 21,
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22,
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23,
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24,
}
---@enum raylib.TextureFilter
M.TextureFilter = {
TEXTURE_FILTER_POINT = 0,
TEXTURE_FILTER_BILINEAR = 1,
TEXTURE_FILTER_TRILINEAR = 2,
TEXTURE_FILTER_ANISOTROPIC_4X = 3,
TEXTURE_FILTER_ANISOTROPIC_8X = 4,
TEXTURE_FILTER_ANISOTROPIC_16X = 5,
}
---@enum raylib.TextureWrap
M.TextureWrap = {
TEXTURE_WRAP_REPEAT = 0,
TEXTURE_WRAP_CLAMP = 1,
TEXTURE_WRAP_MIRROR_REPEAT = 2,
TEXTURE_WRAP_MIRROR_CLAMP = 3,
}
---@enum raylib.CubemapLayout
M.CubemapLayout = {
CUBEMAP_LAYOUT_AUTO_DETECT = 0,
CUBEMAP_LAYOUT_LINE_VERTICAL = 1,
CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2,
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3,
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4,
}
---@enum raylib.FontType
M.FontType = {
FONT_DEFAULT = 0,
FONT_BITMAP = 1,
FONT_SDF = 2,
}
---@enum raylib.BlendMode
M.BlendMode = {
BLEND_ALPHA = 0,
BLEND_ADDITIVE = 1,
BLEND_MULTIPLIED = 2,
BLEND_ADD_COLORS = 3,
BLEND_SUBTRACT_COLORS = 4,
BLEND_ALPHA_PREMULTIPLY = 5,
BLEND_CUSTOM = 6,
BLEND_CUSTOM_SEPARATE = 7,
}
---@enum raylib.Gesture
M.Gesture = {
GESTURE_NONE = 0,
GESTURE_TAP = 1,
GESTURE_DOUBLETAP = 2,
GESTURE_HOLD = 4,
GESTURE_DRAG = 8,
GESTURE_SWIPE_RIGHT = 16,
GESTURE_SWIPE_LEFT = 32,
GESTURE_SWIPE_UP = 64,
GESTURE_SWIPE_DOWN = 128,
GESTURE_PINCH_IN = 256,
GESTURE_PINCH_OUT = 512,
}
---@enum raylib.CameraMode
M.CameraMode = {
CAMERA_CUSTOM = 0,
CAMERA_FREE = 1,
CAMERA_ORBITAL = 2,
CAMERA_FIRST_PERSON = 3,
CAMERA_THIRD_PERSON = 4,
}
---@enum raylib.CameraProjection
M.CameraProjection = {
CAMERA_PERSPECTIVE = 0,
CAMERA_ORTHOGRAPHIC = 1,
}
---@enum raylib.NPatchLayout
M.NPatchLayout = {
NPATCH_NINE_PATCH = 0,
NPATCH_THREE_PATCH_VERTICAL = 1,
NPATCH_THREE_PATCH_HORIZONTAL = 2,
}
---@enum raylib.rlGlVersion
M.rlGlVersion = {
RL_OPENGL_SOFTWARE = 0,
RL_OPENGL_11 = 1,
RL_OPENGL_21 = 2,
RL_OPENGL_33 = 3,
RL_OPENGL_43 = 4,
RL_OPENGL_ES_20 = 5,
RL_OPENGL_ES_30 = 6,
}
---@enum raylib.rlTraceLogLevel
M.rlTraceLogLevel = {
RL_LOG_ALL = 0,
RL_LOG_TRACE = 1,
RL_LOG_DEBUG = 2,
RL_LOG_INFO = 3,
RL_LOG_WARNING = 4,
RL_LOG_ERROR = 5,
RL_LOG_FATAL = 6,
RL_LOG_NONE = 7,
}
---@enum raylib.rlPixelFormat
M.rlPixelFormat = {
RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2,
RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3,
RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4,
RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5,
RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6,
RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7,
RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8,
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
RL_PIXELFORMAT_UNCOMPRESSED_R16 = 11,
RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12,
RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13,
RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 14,
RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15,
RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16,
RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17,
RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 18,
RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 19,
RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20,
RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 21,
RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22,
RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23,
RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24,
}
---@enum raylib.rlTextureFilter
M.rlTextureFilter = {
RL_TEXTURE_FILTER_POINT = 0,
RL_TEXTURE_FILTER_BILINEAR = 1,
RL_TEXTURE_FILTER_TRILINEAR = 2,
RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3,
RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4,
RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5,
}
---@enum raylib.rlBlendMode
M.rlBlendMode = {
RL_BLEND_ALPHA = 0,
RL_BLEND_ADDITIVE = 1,
RL_BLEND_MULTIPLIED = 2,
RL_BLEND_ADD_COLORS = 3,
RL_BLEND_SUBTRACT_COLORS = 4,
RL_BLEND_ALPHA_PREMULTIPLY = 5,
RL_BLEND_CUSTOM = 6,
RL_BLEND_CUSTOM_SEPARATE = 7,
}
---@enum raylib.rlShaderLocationIndex
M.rlShaderLocationIndex = {
RL_SHADER_LOC_VERTEX_POSITION = 0,
RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1,
RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2,
RL_SHADER_LOC_VERTEX_NORMAL = 3,
RL_SHADER_LOC_VERTEX_TANGENT = 4,
RL_SHADER_LOC_VERTEX_COLOR = 5,
RL_SHADER_LOC_MATRIX_MVP = 6,
RL_SHADER_LOC_MATRIX_VIEW = 7,
RL_SHADER_LOC_MATRIX_PROJECTION = 8,
RL_SHADER_LOC_MATRIX_MODEL = 9,
RL_SHADER_LOC_MATRIX_NORMAL = 10,
RL_SHADER_LOC_VECTOR_VIEW = 11,
RL_SHADER_LOC_COLOR_DIFFUSE = 12,
RL_SHADER_LOC_COLOR_SPECULAR = 13,
RL_SHADER_LOC_COLOR_AMBIENT = 14,
RL_SHADER_LOC_MAP_ALBEDO = 15,
RL_SHADER_LOC_MAP_METALNESS = 16,
RL_SHADER_LOC_MAP_NORMAL = 17,
RL_SHADER_LOC_MAP_ROUGHNESS = 18,
RL_SHADER_LOC_MAP_OCCLUSION = 19,
RL_SHADER_LOC_MAP_EMISSION = 20,
RL_SHADER_LOC_MAP_HEIGHT = 21,
RL_SHADER_LOC_MAP_CUBEMAP = 22,
RL_SHADER_LOC_MAP_IRRADIANCE = 23,
RL_SHADER_LOC_MAP_PREFILTER = 24,
RL_SHADER_LOC_MAP_BRDF = 25,
}
---@enum raylib.rlShaderUniformDataType
M.rlShaderUniformDataType = {
RL_SHADER_UNIFORM_FLOAT = 0,
RL_SHADER_UNIFORM_VEC2 = 1,
RL_SHADER_UNIFORM_VEC3 = 2,
RL_SHADER_UNIFORM_VEC4 = 3,
RL_SHADER_UNIFORM_INT = 4,
RL_SHADER_UNIFORM_IVEC2 = 5,
RL_SHADER_UNIFORM_IVEC3 = 6,
RL_SHADER_UNIFORM_IVEC4 = 7,
RL_SHADER_UNIFORM_UINT = 8,
RL_SHADER_UNIFORM_UIVEC2 = 9,
RL_SHADER_UNIFORM_UIVEC3 = 10,
RL_SHADER_UNIFORM_UIVEC4 = 11,
RL_SHADER_UNIFORM_SAMPLER2D = 12,
}
---@enum raylib.rlShaderAttributeDataType
M.rlShaderAttributeDataType = {
RL_SHADER_ATTRIB_FLOAT = 0,
RL_SHADER_ATTRIB_VEC2 = 1,
RL_SHADER_ATTRIB_VEC3 = 2,
RL_SHADER_ATTRIB_VEC4 = 3,
}
---@enum raylib.rlFramebufferAttachType
M.rlFramebufferAttachType = {
RL_ATTACHMENT_COLOR_CHANNEL0 = 0,
RL_ATTACHMENT_COLOR_CHANNEL1 = 1,
RL_ATTACHMENT_COLOR_CHANNEL2 = 2,
RL_ATTACHMENT_COLOR_CHANNEL3 = 3,
RL_ATTACHMENT_COLOR_CHANNEL4 = 4,
RL_ATTACHMENT_COLOR_CHANNEL5 = 5,
RL_ATTACHMENT_COLOR_CHANNEL6 = 6,
RL_ATTACHMENT_COLOR_CHANNEL7 = 7,
RL_ATTACHMENT_DEPTH = 100,
RL_ATTACHMENT_STENCIL = 200,
}
---@enum raylib.rlFramebufferAttachTextureType
M.rlFramebufferAttachTextureType = {
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1,
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3,
RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5,
RL_ATTACHMENT_TEXTURE2D = 100,
RL_ATTACHMENT_RENDERBUFFER = 200,
}
---@enum raylib.rlCullMode
M.rlCullMode = {
RL_CULL_FACE_FRONT = 0,
RL_CULL_FACE_BACK = 1,
}
---@type raylib.ConfigFlags
M.FLAG_VSYNC_HINT = M.ConfigFlags.FLAG_VSYNC_HINT
---@type raylib.ConfigFlags
M.FLAG_FULLSCREEN_MODE = M.ConfigFlags.FLAG_FULLSCREEN_MODE
---@type raylib.ConfigFlags
M.FLAG_WINDOW_RESIZABLE = M.ConfigFlags.FLAG_WINDOW_RESIZABLE
---@type raylib.ConfigFlags
M.FLAG_WINDOW_UNDECORATED = M.ConfigFlags.FLAG_WINDOW_UNDECORATED
---@type raylib.ConfigFlags
M.FLAG_WINDOW_HIDDEN = M.ConfigFlags.FLAG_WINDOW_HIDDEN
---@type raylib.ConfigFlags
M.FLAG_WINDOW_MINIMIZED = M.ConfigFlags.FLAG_WINDOW_MINIMIZED
---@type raylib.ConfigFlags
M.FLAG_WINDOW_MAXIMIZED = M.ConfigFlags.FLAG_WINDOW_MAXIMIZED
---@type raylib.ConfigFlags
M.FLAG_WINDOW_UNFOCUSED = M.ConfigFlags.FLAG_WINDOW_UNFOCUSED
---@type raylib.ConfigFlags
M.FLAG_WINDOW_TOPMOST = M.ConfigFlags.FLAG_WINDOW_TOPMOST
---@type raylib.ConfigFlags
M.FLAG_WINDOW_ALWAYS_RUN = M.ConfigFlags.FLAG_WINDOW_ALWAYS_RUN
---@type raylib.ConfigFlags
M.FLAG_WINDOW_TRANSPARENT = M.ConfigFlags.FLAG_WINDOW_TRANSPARENT
---@type raylib.ConfigFlags
M.FLAG_WINDOW_HIGHDPI = M.ConfigFlags.FLAG_WINDOW_HIGHDPI
---@type raylib.ConfigFlags
M.FLAG_WINDOW_MOUSE_PASSTHROUGH = M.ConfigFlags.FLAG_WINDOW_MOUSE_PASSTHROUGH
---@type raylib.ConfigFlags
M.FLAG_BORDERLESS_WINDOWED_MODE = M.ConfigFlags.FLAG_BORDERLESS_WINDOWED_MODE
---@type raylib.ConfigFlags
M.FLAG_MSAA_4X_HINT = M.ConfigFlags.FLAG_MSAA_4X_HINT
---@type raylib.ConfigFlags
M.FLAG_INTERLACED_HINT = M.ConfigFlags.FLAG_INTERLACED_HINT
---@type raylib.TraceLogLevel
M.LOG_ALL = M.TraceLogLevel.LOG_ALL
---@type raylib.TraceLogLevel
M.LOG_TRACE = M.TraceLogLevel.LOG_TRACE
---@type raylib.TraceLogLevel
M.LOG_DEBUG = M.TraceLogLevel.LOG_DEBUG
---@type raylib.TraceLogLevel
M.LOG_INFO = M.TraceLogLevel.LOG_INFO
---@type raylib.TraceLogLevel
M.LOG_WARNING = M.TraceLogLevel.LOG_WARNING
---@type raylib.TraceLogLevel
M.LOG_ERROR = M.TraceLogLevel.LOG_ERROR
---@type raylib.TraceLogLevel
M.LOG_FATAL = M.TraceLogLevel.LOG_FATAL
---@type raylib.TraceLogLevel
M.LOG_NONE = M.TraceLogLevel.LOG_NONE
---@type raylib.KeyboardKey
M.KEY_NULL = M.KeyboardKey.KEY_NULL
---@type raylib.KeyboardKey
M.KEY_APOSTROPHE = M.KeyboardKey.KEY_APOSTROPHE
---@type raylib.KeyboardKey
M.KEY_COMMA = M.KeyboardKey.KEY_COMMA
---@type raylib.KeyboardKey
M.KEY_MINUS = M.KeyboardKey.KEY_MINUS
---@type raylib.KeyboardKey
M.KEY_PERIOD = M.KeyboardKey.KEY_PERIOD
---@type raylib.KeyboardKey
M.KEY_SLASH = M.KeyboardKey.KEY_SLASH
---@type raylib.KeyboardKey
M.KEY_ZERO = M.KeyboardKey.KEY_ZERO
---@type raylib.KeyboardKey
M.KEY_ONE = M.KeyboardKey.KEY_ONE
---@type raylib.KeyboardKey
M.KEY_TWO = M.KeyboardKey.KEY_TWO
---@type raylib.KeyboardKey
M.KEY_THREE = M.KeyboardKey.KEY_THREE
---@type raylib.KeyboardKey
M.KEY_FOUR = M.KeyboardKey.KEY_FOUR
---@type raylib.KeyboardKey
M.KEY_FIVE = M.KeyboardKey.KEY_FIVE
---@type raylib.KeyboardKey
M.KEY_SIX = M.KeyboardKey.KEY_SIX
---@type raylib.KeyboardKey
M.KEY_SEVEN = M.KeyboardKey.KEY_SEVEN
---@type raylib.KeyboardKey
M.KEY_EIGHT = M.KeyboardKey.KEY_EIGHT
---@type raylib.KeyboardKey
M.KEY_NINE = M.KeyboardKey.KEY_NINE
---@type raylib.KeyboardKey
M.KEY_SEMICOLON = M.KeyboardKey.KEY_SEMICOLON
---@type raylib.KeyboardKey
M.KEY_EQUAL = M.KeyboardKey.KEY_EQUAL
---@type raylib.KeyboardKey
M.KEY_A = M.KeyboardKey.KEY_A
---@type raylib.KeyboardKey
M.KEY_B = M.KeyboardKey.KEY_B
---@type raylib.KeyboardKey
M.KEY_C = M.KeyboardKey.KEY_C
---@type raylib.KeyboardKey
M.KEY_D = M.KeyboardKey.KEY_D
---@type raylib.KeyboardKey
M.KEY_E = M.KeyboardKey.KEY_E
---@type raylib.KeyboardKey
M.KEY_F = M.KeyboardKey.KEY_F
---@type raylib.KeyboardKey
M.KEY_G = M.KeyboardKey.KEY_G
---@type raylib.KeyboardKey
M.KEY_H = M.KeyboardKey.KEY_H
---@type raylib.KeyboardKey
M.KEY_I = M.KeyboardKey.KEY_I
---@type raylib.KeyboardKey
M.KEY_J = M.KeyboardKey.KEY_J
---@type raylib.KeyboardKey
M.KEY_K = M.KeyboardKey.KEY_K
---@type raylib.KeyboardKey
M.KEY_L = M.KeyboardKey.KEY_L
---@type raylib.KeyboardKey
M.KEY_M = M.KeyboardKey.KEY_M
---@type raylib.KeyboardKey
M.KEY_N = M.KeyboardKey.KEY_N
---@type raylib.KeyboardKey
M.KEY_O = M.KeyboardKey.KEY_O
---@type raylib.KeyboardKey
M.KEY_P = M.KeyboardKey.KEY_P
---@type raylib.KeyboardKey
M.KEY_Q = M.KeyboardKey.KEY_Q
---@type raylib.KeyboardKey
M.KEY_R = M.KeyboardKey.KEY_R
---@type raylib.KeyboardKey
M.KEY_S = M.KeyboardKey.KEY_S
---@type raylib.KeyboardKey
M.KEY_T = M.KeyboardKey.KEY_T
---@type raylib.KeyboardKey
M.KEY_U = M.KeyboardKey.KEY_U
---@type raylib.KeyboardKey
M.KEY_V = M.KeyboardKey.KEY_V
---@type raylib.KeyboardKey
M.KEY_W = M.KeyboardKey.KEY_W
---@type raylib.KeyboardKey
M.KEY_X = M.KeyboardKey.KEY_X
---@type raylib.KeyboardKey
M.KEY_Y = M.KeyboardKey.KEY_Y
---@type raylib.KeyboardKey
M.KEY_Z = M.KeyboardKey.KEY_Z
---@type raylib.KeyboardKey
M.KEY_LEFT_BRACKET = M.KeyboardKey.KEY_LEFT_BRACKET
---@type raylib.KeyboardKey
M.KEY_BACKSLASH = M.KeyboardKey.KEY_BACKSLASH
---@type raylib.KeyboardKey
M.KEY_RIGHT_BRACKET = M.KeyboardKey.KEY_RIGHT_BRACKET
---@type raylib.KeyboardKey
M.KEY_GRAVE = M.KeyboardKey.KEY_GRAVE
---@type raylib.KeyboardKey
M.KEY_SPACE = M.KeyboardKey.KEY_SPACE
---@type raylib.KeyboardKey
M.KEY_ESCAPE = M.KeyboardKey.KEY_ESCAPE
---@type raylib.KeyboardKey
M.KEY_ENTER = M.KeyboardKey.KEY_ENTER
---@type raylib.KeyboardKey
M.KEY_TAB = M.KeyboardKey.KEY_TAB
---@type raylib.KeyboardKey
M.KEY_BACKSPACE = M.KeyboardKey.KEY_BACKSPACE
---@type raylib.KeyboardKey
M.KEY_INSERT = M.KeyboardKey.KEY_INSERT
---@type raylib.KeyboardKey
M.KEY_DELETE = M.KeyboardKey.KEY_DELETE
---@type raylib.KeyboardKey
M.KEY_RIGHT = M.KeyboardKey.KEY_RIGHT
---@type raylib.KeyboardKey
M.KEY_LEFT = M.KeyboardKey.KEY_LEFT
---@type raylib.KeyboardKey
M.KEY_DOWN = M.KeyboardKey.KEY_DOWN
---@type raylib.KeyboardKey
M.KEY_UP = M.KeyboardKey.KEY_UP
---@type raylib.KeyboardKey
M.KEY_PAGE_UP = M.KeyboardKey.KEY_PAGE_UP
---@type raylib.KeyboardKey
M.KEY_PAGE_DOWN = M.KeyboardKey.KEY_PAGE_DOWN
---@type raylib.KeyboardKey
M.KEY_HOME = M.KeyboardKey.KEY_HOME
---@type raylib.KeyboardKey
M.KEY_END = M.KeyboardKey.KEY_END
---@type raylib.KeyboardKey
M.KEY_CAPS_LOCK = M.KeyboardKey.KEY_CAPS_LOCK
---@type raylib.KeyboardKey
M.KEY_SCROLL_LOCK = M.KeyboardKey.KEY_SCROLL_LOCK
---@type raylib.KeyboardKey
M.KEY_NUM_LOCK = M.KeyboardKey.KEY_NUM_LOCK
---@type raylib.KeyboardKey
M.KEY_PRINT_SCREEN = M.KeyboardKey.KEY_PRINT_SCREEN
---@type raylib.KeyboardKey
M.KEY_PAUSE = M.KeyboardKey.KEY_PAUSE
---@type raylib.KeyboardKey
M.KEY_F1 = M.KeyboardKey.KEY_F1
---@type raylib.KeyboardKey
M.KEY_F2 = M.KeyboardKey.KEY_F2
---@type raylib.KeyboardKey
M.KEY_F3 = M.KeyboardKey.KEY_F3
---@type raylib.KeyboardKey
M.KEY_F4 = M.KeyboardKey.KEY_F4
---@type raylib.KeyboardKey
M.KEY_F5 = M.KeyboardKey.KEY_F5
---@type raylib.KeyboardKey
M.KEY_F6 = M.KeyboardKey.KEY_F6
---@type raylib.KeyboardKey
M.KEY_F7 = M.KeyboardKey.KEY_F7
---@type raylib.KeyboardKey
M.KEY_F8 = M.KeyboardKey.KEY_F8
---@type raylib.KeyboardKey
M.KEY_F9 = M.KeyboardKey.KEY_F9
---@type raylib.KeyboardKey
M.KEY_F10 = M.KeyboardKey.KEY_F10
---@type raylib.KeyboardKey
M.KEY_F11 = M.KeyboardKey.KEY_F11
---@type raylib.KeyboardKey
M.KEY_F12 = M.KeyboardKey.KEY_F12
---@type raylib.KeyboardKey
M.KEY_LEFT_SHIFT = M.KeyboardKey.KEY_LEFT_SHIFT
---@type raylib.KeyboardKey
M.KEY_LEFT_CONTROL = M.KeyboardKey.KEY_LEFT_CONTROL
---@type raylib.KeyboardKey
M.KEY_LEFT_ALT = M.KeyboardKey.KEY_LEFT_ALT
---@type raylib.KeyboardKey
M.KEY_LEFT_SUPER = M.KeyboardKey.KEY_LEFT_SUPER
---@type raylib.KeyboardKey
M.KEY_RIGHT_SHIFT = M.KeyboardKey.KEY_RIGHT_SHIFT
---@type raylib.KeyboardKey
M.KEY_RIGHT_CONTROL = M.KeyboardKey.KEY_RIGHT_CONTROL
---@type raylib.KeyboardKey
M.KEY_RIGHT_ALT = M.KeyboardKey.KEY_RIGHT_ALT
---@type raylib.KeyboardKey
M.KEY_RIGHT_SUPER = M.KeyboardKey.KEY_RIGHT_SUPER
---@type raylib.KeyboardKey
M.KEY_KB_MENU = M.KeyboardKey.KEY_KB_MENU
---@type raylib.KeyboardKey
M.KEY_KP_0 = M.KeyboardKey.KEY_KP_0
---@type raylib.KeyboardKey
M.KEY_KP_1 = M.KeyboardKey.KEY_KP_1
---@type raylib.KeyboardKey
M.KEY_KP_2 = M.KeyboardKey.KEY_KP_2
---@type raylib.KeyboardKey
M.KEY_KP_3 = M.KeyboardKey.KEY_KP_3
---@type raylib.KeyboardKey
M.KEY_KP_4 = M.KeyboardKey.KEY_KP_4
---@type raylib.KeyboardKey
M.KEY_KP_5 = M.KeyboardKey.KEY_KP_5
---@type raylib.KeyboardKey
M.KEY_KP_6 = M.KeyboardKey.KEY_KP_6
---@type raylib.KeyboardKey
M.KEY_KP_7 = M.KeyboardKey.KEY_KP_7
---@type raylib.KeyboardKey
M.KEY_KP_8 = M.KeyboardKey.KEY_KP_8
---@type raylib.KeyboardKey
M.KEY_KP_9 = M.KeyboardKey.KEY_KP_9
---@type raylib.KeyboardKey
M.KEY_KP_DECIMAL = M.KeyboardKey.KEY_KP_DECIMAL
---@type raylib.KeyboardKey
M.KEY_KP_DIVIDE = M.KeyboardKey.KEY_KP_DIVIDE
---@type raylib.KeyboardKey
M.KEY_KP_MULTIPLY = M.KeyboardKey.KEY_KP_MULTIPLY
---@type raylib.KeyboardKey
M.KEY_KP_SUBTRACT = M.KeyboardKey.KEY_KP_SUBTRACT
---@type raylib.KeyboardKey
M.KEY_KP_ADD = M.KeyboardKey.KEY_KP_ADD
---@type raylib.KeyboardKey
M.KEY_KP_ENTER = M.KeyboardKey.KEY_KP_ENTER
---@type raylib.KeyboardKey
M.KEY_KP_EQUAL = M.KeyboardKey.KEY_KP_EQUAL
---@type raylib.KeyboardKey
M.KEY_BACK = M.KeyboardKey.KEY_BACK
---@type raylib.KeyboardKey
M.KEY_MENU = M.KeyboardKey.KEY_MENU
---@type raylib.KeyboardKey
M.KEY_VOLUME_UP = M.KeyboardKey.KEY_VOLUME_UP
---@type raylib.KeyboardKey
M.KEY_VOLUME_DOWN = M.KeyboardKey.KEY_VOLUME_DOWN
---@type raylib.MouseButton
M.MOUSE_BUTTON_LEFT = M.MouseButton.MOUSE_BUTTON_LEFT
---@type raylib.MouseButton
M.MOUSE_BUTTON_RIGHT = M.MouseButton.MOUSE_BUTTON_RIGHT
---@type raylib.MouseButton
M.MOUSE_BUTTON_MIDDLE = M.MouseButton.MOUSE_BUTTON_MIDDLE
---@type raylib.MouseButton
M.MOUSE_BUTTON_SIDE = M.MouseButton.MOUSE_BUTTON_SIDE
---@type raylib.MouseButton
M.MOUSE_BUTTON_EXTRA = M.MouseButton.MOUSE_BUTTON_EXTRA
---@type raylib.MouseButton
M.MOUSE_BUTTON_FORWARD = M.MouseButton.MOUSE_BUTTON_FORWARD
---@type raylib.MouseButton
M.MOUSE_BUTTON_BACK = M.MouseButton.MOUSE_BUTTON_BACK
---@type raylib.MouseCursor
M.MOUSE_CURSOR_DEFAULT = M.MouseCursor.MOUSE_CURSOR_DEFAULT
---@type raylib.MouseCursor
M.MOUSE_CURSOR_ARROW = M.MouseCursor.MOUSE_CURSOR_ARROW
---@type raylib.MouseCursor
M.MOUSE_CURSOR_IBEAM = M.MouseCursor.MOUSE_CURSOR_IBEAM
---@type raylib.MouseCursor
M.MOUSE_CURSOR_CROSSHAIR = M.MouseCursor.MOUSE_CURSOR_CROSSHAIR
---@type raylib.MouseCursor
M.MOUSE_CURSOR_POINTING_HAND = M.MouseCursor.MOUSE_CURSOR_POINTING_HAND
---@type raylib.MouseCursor
M.MOUSE_CURSOR_RESIZE_EW = M.MouseCursor.MOUSE_CURSOR_RESIZE_EW
---@type raylib.MouseCursor
M.MOUSE_CURSOR_RESIZE_NS = M.MouseCursor.MOUSE_CURSOR_RESIZE_NS
---@type raylib.MouseCursor
M.MOUSE_CURSOR_RESIZE_NWSE = M.MouseCursor.MOUSE_CURSOR_RESIZE_NWSE
---@type raylib.MouseCursor
M.MOUSE_CURSOR_RESIZE_NESW = M.MouseCursor.MOUSE_CURSOR_RESIZE_NESW
---@type raylib.MouseCursor
M.MOUSE_CURSOR_RESIZE_ALL = M.MouseCursor.MOUSE_CURSOR_RESIZE_ALL
---@type raylib.MouseCursor
M.MOUSE_CURSOR_NOT_ALLOWED = M.MouseCursor.MOUSE_CURSOR_NOT_ALLOWED
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_UNKNOWN = M.GamepadButton.GAMEPAD_BUTTON_UNKNOWN
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_FACE_UP = M.GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_UP
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_FACE_RIGHT = M.GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_RIGHT
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_FACE_DOWN = M.GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_DOWN
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_FACE_LEFT = M.GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_LEFT
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_FACE_UP = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_UP
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_FACE_DOWN = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_DOWN
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_FACE_LEFT = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_LEFT
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_TRIGGER_1 = M.GamepadButton.GAMEPAD_BUTTON_LEFT_TRIGGER_1
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_TRIGGER_2 = M.GamepadButton.GAMEPAD_BUTTON_LEFT_TRIGGER_2
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_TRIGGER_1
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_TRIGGER_2
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_MIDDLE_LEFT = M.GamepadButton.GAMEPAD_BUTTON_MIDDLE_LEFT
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_MIDDLE = M.GamepadButton.GAMEPAD_BUTTON_MIDDLE
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_MIDDLE_RIGHT = M.GamepadButton.GAMEPAD_BUTTON_MIDDLE_RIGHT
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_LEFT_THUMB = M.GamepadButton.GAMEPAD_BUTTON_LEFT_THUMB
---@type raylib.GamepadButton
M.GAMEPAD_BUTTON_RIGHT_THUMB = M.GamepadButton.GAMEPAD_BUTTON_RIGHT_THUMB
---@type raylib.GamepadAxis
M.GAMEPAD_AXIS_LEFT_X = M.GamepadAxis.GAMEPAD_AXIS_LEFT_X
---@type raylib.GamepadAxis
M.GAMEPAD_AXIS_LEFT_Y = M.GamepadAxis.GAMEPAD_AXIS_LEFT_Y
---@type raylib.GamepadAxis
M.GAMEPAD_AXIS_RIGHT_X = M.GamepadAxis.GAMEPAD_AXIS_RIGHT_X
---@type raylib.GamepadAxis
M.GAMEPAD_AXIS_RIGHT_Y = M.GamepadAxis.GAMEPAD_AXIS_RIGHT_Y
---@type raylib.GamepadAxis
M.GAMEPAD_AXIS_LEFT_TRIGGER = M.GamepadAxis.GAMEPAD_AXIS_LEFT_TRIGGER
---@type raylib.GamepadAxis
M.GAMEPAD_AXIS_RIGHT_TRIGGER = M.GamepadAxis.GAMEPAD_AXIS_RIGHT_TRIGGER
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_ALBEDO = M.MaterialMapIndex.MATERIAL_MAP_ALBEDO
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_METALNESS = M.MaterialMapIndex.MATERIAL_MAP_METALNESS
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_NORMAL = M.MaterialMapIndex.MATERIAL_MAP_NORMAL
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_ROUGHNESS = M.MaterialMapIndex.MATERIAL_MAP_ROUGHNESS
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_OCCLUSION = M.MaterialMapIndex.MATERIAL_MAP_OCCLUSION
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_EMISSION = M.MaterialMapIndex.MATERIAL_MAP_EMISSION
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_HEIGHT = M.MaterialMapIndex.MATERIAL_MAP_HEIGHT
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_CUBEMAP = M.MaterialMapIndex.MATERIAL_MAP_CUBEMAP
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_IRRADIANCE = M.MaterialMapIndex.MATERIAL_MAP_IRRADIANCE
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_PREFILTER = M.MaterialMapIndex.MATERIAL_MAP_PREFILTER
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_BRDF = M.MaterialMapIndex.MATERIAL_MAP_BRDF
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_POSITION = M.ShaderLocationIndex.SHADER_LOC_VERTEX_POSITION
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_TEXCOORD01 = M.ShaderLocationIndex.SHADER_LOC_VERTEX_TEXCOORD01
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_TEXCOORD02 = M.ShaderLocationIndex.SHADER_LOC_VERTEX_TEXCOORD02
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_NORMAL = M.ShaderLocationIndex.SHADER_LOC_VERTEX_NORMAL
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_TANGENT = M.ShaderLocationIndex.SHADER_LOC_VERTEX_TANGENT
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_COLOR = M.ShaderLocationIndex.SHADER_LOC_VERTEX_COLOR
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MATRIX_MVP = M.ShaderLocationIndex.SHADER_LOC_MATRIX_MVP
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MATRIX_VIEW = M.ShaderLocationIndex.SHADER_LOC_MATRIX_VIEW
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MATRIX_PROJECTION = M.ShaderLocationIndex.SHADER_LOC_MATRIX_PROJECTION
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MATRIX_MODEL = M.ShaderLocationIndex.SHADER_LOC_MATRIX_MODEL
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MATRIX_NORMAL = M.ShaderLocationIndex.SHADER_LOC_MATRIX_NORMAL
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VECTOR_VIEW = M.ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_COLOR_DIFFUSE = M.ShaderLocationIndex.SHADER_LOC_COLOR_DIFFUSE
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_COLOR_SPECULAR = M.ShaderLocationIndex.SHADER_LOC_COLOR_SPECULAR
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_COLOR_AMBIENT = M.ShaderLocationIndex.SHADER_LOC_COLOR_AMBIENT
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_ALBEDO = M.ShaderLocationIndex.SHADER_LOC_MAP_ALBEDO
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_METALNESS = M.ShaderLocationIndex.SHADER_LOC_MAP_METALNESS
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_NORMAL = M.ShaderLocationIndex.SHADER_LOC_MAP_NORMAL
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_ROUGHNESS = M.ShaderLocationIndex.SHADER_LOC_MAP_ROUGHNESS
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_OCCLUSION = M.ShaderLocationIndex.SHADER_LOC_MAP_OCCLUSION
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_EMISSION = M.ShaderLocationIndex.SHADER_LOC_MAP_EMISSION
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_HEIGHT = M.ShaderLocationIndex.SHADER_LOC_MAP_HEIGHT
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_CUBEMAP = M.ShaderLocationIndex.SHADER_LOC_MAP_CUBEMAP
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_IRRADIANCE = M.ShaderLocationIndex.SHADER_LOC_MAP_IRRADIANCE
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_PREFILTER = M.ShaderLocationIndex.SHADER_LOC_MAP_PREFILTER
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_BRDF = M.ShaderLocationIndex.SHADER_LOC_MAP_BRDF
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_BONEIDS = M.ShaderLocationIndex.SHADER_LOC_VERTEX_BONEIDS
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_BONEWEIGHTS = M.ShaderLocationIndex.SHADER_LOC_VERTEX_BONEWEIGHTS
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MATRIX_BONETRANSFORMS = M.ShaderLocationIndex.SHADER_LOC_MATRIX_BONETRANSFORMS
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_VERTEX_INSTANCETRANSFORM = M.ShaderLocationIndex.SHADER_LOC_VERTEX_INSTANCETRANSFORM
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_FLOAT = M.ShaderUniformDataType.SHADER_UNIFORM_FLOAT
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_VEC2 = M.ShaderUniformDataType.SHADER_UNIFORM_VEC2
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_VEC3 = M.ShaderUniformDataType.SHADER_UNIFORM_VEC3
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_VEC4 = M.ShaderUniformDataType.SHADER_UNIFORM_VEC4
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_INT = M.ShaderUniformDataType.SHADER_UNIFORM_INT
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_IVEC2 = M.ShaderUniformDataType.SHADER_UNIFORM_IVEC2
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_IVEC3 = M.ShaderUniformDataType.SHADER_UNIFORM_IVEC3
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_IVEC4 = M.ShaderUniformDataType.SHADER_UNIFORM_IVEC4
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_UINT = M.ShaderUniformDataType.SHADER_UNIFORM_UINT
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_UIVEC2 = M.ShaderUniformDataType.SHADER_UNIFORM_UIVEC2
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_UIVEC3 = M.ShaderUniformDataType.SHADER_UNIFORM_UIVEC3
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_UIVEC4 = M.ShaderUniformDataType.SHADER_UNIFORM_UIVEC4
---@type raylib.ShaderUniformDataType
M.SHADER_UNIFORM_SAMPLER2D = M.ShaderUniformDataType.SHADER_UNIFORM_SAMPLER2D
---@type raylib.ShaderAttributeDataType
M.SHADER_ATTRIB_FLOAT = M.ShaderAttributeDataType.SHADER_ATTRIB_FLOAT
---@type raylib.ShaderAttributeDataType
M.SHADER_ATTRIB_VEC2 = M.ShaderAttributeDataType.SHADER_ATTRIB_VEC2
---@type raylib.ShaderAttributeDataType
M.SHADER_ATTRIB_VEC3 = M.ShaderAttributeDataType.SHADER_ATTRIB_VEC3
---@type raylib.ShaderAttributeDataType
M.SHADER_ATTRIB_VEC4 = M.ShaderAttributeDataType.SHADER_ATTRIB_VEC4
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R5G6B5 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R5G6B5
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R8G8B8 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R32 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R32
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R32G32B32 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R32G32B32
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R16 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R16
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R16G16B16 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R16G16B16
---@type raylib.PixelFormat
M.PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = M.PixelFormat.PIXELFORMAT_UNCOMPRESSED_R16G16B16A16
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_DXT1_RGB = M.PixelFormat.PIXELFORMAT_COMPRESSED_DXT1_RGB
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_DXT1_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_DXT1_RGBA
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_DXT3_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_DXT3_RGBA
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_DXT5_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_DXT5_RGBA
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_ETC1_RGB = M.PixelFormat.PIXELFORMAT_COMPRESSED_ETC1_RGB
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_ETC2_RGB = M.PixelFormat.PIXELFORMAT_COMPRESSED_ETC2_RGB
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_PVRT_RGB = M.PixelFormat.PIXELFORMAT_COMPRESSED_PVRT_RGB
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_PVRT_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_PVRT_RGBA
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA
---@type raylib.PixelFormat
M.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = M.PixelFormat.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA
---@type raylib.TextureFilter
M.TEXTURE_FILTER_POINT = M.TextureFilter.TEXTURE_FILTER_POINT
---@type raylib.TextureFilter
M.TEXTURE_FILTER_BILINEAR = M.TextureFilter.TEXTURE_FILTER_BILINEAR
---@type raylib.TextureFilter
M.TEXTURE_FILTER_TRILINEAR = M.TextureFilter.TEXTURE_FILTER_TRILINEAR
---@type raylib.TextureFilter
M.TEXTURE_FILTER_ANISOTROPIC_4X = M.TextureFilter.TEXTURE_FILTER_ANISOTROPIC_4X
---@type raylib.TextureFilter
M.TEXTURE_FILTER_ANISOTROPIC_8X = M.TextureFilter.TEXTURE_FILTER_ANISOTROPIC_8X
---@type raylib.TextureFilter
M.TEXTURE_FILTER_ANISOTROPIC_16X = M.TextureFilter.TEXTURE_FILTER_ANISOTROPIC_16X
---@type raylib.TextureWrap
M.TEXTURE_WRAP_REPEAT = M.TextureWrap.TEXTURE_WRAP_REPEAT
---@type raylib.TextureWrap
M.TEXTURE_WRAP_CLAMP = M.TextureWrap.TEXTURE_WRAP_CLAMP
---@type raylib.TextureWrap
M.TEXTURE_WRAP_MIRROR_REPEAT = M.TextureWrap.TEXTURE_WRAP_MIRROR_REPEAT
---@type raylib.TextureWrap
M.TEXTURE_WRAP_MIRROR_CLAMP = M.TextureWrap.TEXTURE_WRAP_MIRROR_CLAMP
---@type raylib.CubemapLayout
M.CUBEMAP_LAYOUT_AUTO_DETECT = M.CubemapLayout.CUBEMAP_LAYOUT_AUTO_DETECT
---@type raylib.CubemapLayout
M.CUBEMAP_LAYOUT_LINE_VERTICAL = M.CubemapLayout.CUBEMAP_LAYOUT_LINE_VERTICAL
---@type raylib.CubemapLayout
M.CUBEMAP_LAYOUT_LINE_HORIZONTAL = M.CubemapLayout.CUBEMAP_LAYOUT_LINE_HORIZONTAL
---@type raylib.CubemapLayout
M.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = M.CubemapLayout.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR
---@type raylib.CubemapLayout
M.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = M.CubemapLayout.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE
---@type raylib.FontType
M.FONT_DEFAULT = M.FontType.FONT_DEFAULT
---@type raylib.FontType
M.FONT_BITMAP = M.FontType.FONT_BITMAP
---@type raylib.FontType
M.FONT_SDF = M.FontType.FONT_SDF
---@type raylib.BlendMode
M.BLEND_ALPHA = M.BlendMode.BLEND_ALPHA
---@type raylib.BlendMode
M.BLEND_ADDITIVE = M.BlendMode.BLEND_ADDITIVE
---@type raylib.BlendMode
M.BLEND_MULTIPLIED = M.BlendMode.BLEND_MULTIPLIED
---@type raylib.BlendMode
M.BLEND_ADD_COLORS = M.BlendMode.BLEND_ADD_COLORS
---@type raylib.BlendMode
M.BLEND_SUBTRACT_COLORS = M.BlendMode.BLEND_SUBTRACT_COLORS
---@type raylib.BlendMode
M.BLEND_ALPHA_PREMULTIPLY = M.BlendMode.BLEND_ALPHA_PREMULTIPLY
---@type raylib.BlendMode
M.BLEND_CUSTOM = M.BlendMode.BLEND_CUSTOM
---@type raylib.BlendMode
M.BLEND_CUSTOM_SEPARATE = M.BlendMode.BLEND_CUSTOM_SEPARATE
---@type raylib.Gesture
M.GESTURE_NONE = M.Gesture.GESTURE_NONE
---@type raylib.Gesture
M.GESTURE_TAP = M.Gesture.GESTURE_TAP
---@type raylib.Gesture
M.GESTURE_DOUBLETAP = M.Gesture.GESTURE_DOUBLETAP
---@type raylib.Gesture
M.GESTURE_HOLD = M.Gesture.GESTURE_HOLD
---@type raylib.Gesture
M.GESTURE_DRAG = M.Gesture.GESTURE_DRAG
---@type raylib.Gesture
M.GESTURE_SWIPE_RIGHT = M.Gesture.GESTURE_SWIPE_RIGHT
---@type raylib.Gesture
M.GESTURE_SWIPE_LEFT = M.Gesture.GESTURE_SWIPE_LEFT
---@type raylib.Gesture
M.GESTURE_SWIPE_UP = M.Gesture.GESTURE_SWIPE_UP
---@type raylib.Gesture
M.GESTURE_SWIPE_DOWN = M.Gesture.GESTURE_SWIPE_DOWN
---@type raylib.Gesture
M.GESTURE_PINCH_IN = M.Gesture.GESTURE_PINCH_IN
---@type raylib.Gesture
M.GESTURE_PINCH_OUT = M.Gesture.GESTURE_PINCH_OUT
---@type raylib.CameraMode
M.CAMERA_CUSTOM = M.CameraMode.CAMERA_CUSTOM
---@type raylib.CameraMode
M.CAMERA_FREE = M.CameraMode.CAMERA_FREE
---@type raylib.CameraMode
M.CAMERA_ORBITAL = M.CameraMode.CAMERA_ORBITAL
---@type raylib.CameraMode
M.CAMERA_FIRST_PERSON = M.CameraMode.CAMERA_FIRST_PERSON
---@type raylib.CameraMode
M.CAMERA_THIRD_PERSON = M.CameraMode.CAMERA_THIRD_PERSON
---@type raylib.CameraProjection
M.CAMERA_PERSPECTIVE = M.CameraProjection.CAMERA_PERSPECTIVE
---@type raylib.CameraProjection
M.CAMERA_ORTHOGRAPHIC = M.CameraProjection.CAMERA_ORTHOGRAPHIC
---@type raylib.NPatchLayout
M.NPATCH_NINE_PATCH = M.NPatchLayout.NPATCH_NINE_PATCH
---@type raylib.NPatchLayout
M.NPATCH_THREE_PATCH_VERTICAL = M.NPatchLayout.NPATCH_THREE_PATCH_VERTICAL
---@type raylib.NPatchLayout
M.NPATCH_THREE_PATCH_HORIZONTAL = M.NPatchLayout.NPATCH_THREE_PATCH_HORIZONTAL
---@type raylib.rlGlVersion
M.RL_OPENGL_SOFTWARE = M.rlGlVersion.RL_OPENGL_SOFTWARE
---@type raylib.rlGlVersion
M.RL_OPENGL_11 = M.rlGlVersion.RL_OPENGL_11
---@type raylib.rlGlVersion
M.RL_OPENGL_21 = M.rlGlVersion.RL_OPENGL_21
---@type raylib.rlGlVersion
M.RL_OPENGL_33 = M.rlGlVersion.RL_OPENGL_33
---@type raylib.rlGlVersion
M.RL_OPENGL_43 = M.rlGlVersion.RL_OPENGL_43
---@type raylib.rlGlVersion
M.RL_OPENGL_ES_20 = M.rlGlVersion.RL_OPENGL_ES_20
---@type raylib.rlGlVersion
M.RL_OPENGL_ES_30 = M.rlGlVersion.RL_OPENGL_ES_30
---@type raylib.rlTraceLogLevel
M.RL_LOG_ALL = M.rlTraceLogLevel.RL_LOG_ALL
---@type raylib.rlTraceLogLevel
M.RL_LOG_TRACE = M.rlTraceLogLevel.RL_LOG_TRACE
---@type raylib.rlTraceLogLevel
M.RL_LOG_DEBUG = M.rlTraceLogLevel.RL_LOG_DEBUG
---@type raylib.rlTraceLogLevel
M.RL_LOG_INFO = M.rlTraceLogLevel.RL_LOG_INFO
---@type raylib.rlTraceLogLevel
M.RL_LOG_WARNING = M.rlTraceLogLevel.RL_LOG_WARNING
---@type raylib.rlTraceLogLevel
M.RL_LOG_ERROR = M.rlTraceLogLevel.RL_LOG_ERROR
---@type raylib.rlTraceLogLevel
M.RL_LOG_FATAL = M.rlTraceLogLevel.RL_LOG_FATAL
---@type raylib.rlTraceLogLevel
M.RL_LOG_NONE = M.rlTraceLogLevel.RL_LOG_NONE
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R32 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R32
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R16 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R16
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = M.rlPixelFormat.RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_DXT1_RGB
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_ETC1_RGB
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_ETC2_RGB
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_PVRT_RGB
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA
---@type raylib.rlPixelFormat
M.RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = M.rlPixelFormat.RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA
---@type raylib.rlTextureFilter
M.RL_TEXTURE_FILTER_POINT = M.rlTextureFilter.RL_TEXTURE_FILTER_POINT
---@type raylib.rlTextureFilter
M.RL_TEXTURE_FILTER_BILINEAR = M.rlTextureFilter.RL_TEXTURE_FILTER_BILINEAR
---@type raylib.rlTextureFilter
M.RL_TEXTURE_FILTER_TRILINEAR = M.rlTextureFilter.RL_TEXTURE_FILTER_TRILINEAR
---@type raylib.rlTextureFilter
M.RL_TEXTURE_FILTER_ANISOTROPIC_4X = M.rlTextureFilter.RL_TEXTURE_FILTER_ANISOTROPIC_4X
---@type raylib.rlTextureFilter
M.RL_TEXTURE_FILTER_ANISOTROPIC_8X = M.rlTextureFilter.RL_TEXTURE_FILTER_ANISOTROPIC_8X
---@type raylib.rlTextureFilter
M.RL_TEXTURE_FILTER_ANISOTROPIC_16X = M.rlTextureFilter.RL_TEXTURE_FILTER_ANISOTROPIC_16X
---@type raylib.rlBlendMode
M.RL_BLEND_ALPHA = M.rlBlendMode.RL_BLEND_ALPHA
---@type raylib.rlBlendMode
M.RL_BLEND_ADDITIVE = M.rlBlendMode.RL_BLEND_ADDITIVE
---@type raylib.rlBlendMode
M.RL_BLEND_MULTIPLIED = M.rlBlendMode.RL_BLEND_MULTIPLIED
---@type raylib.rlBlendMode
M.RL_BLEND_ADD_COLORS = M.rlBlendMode.RL_BLEND_ADD_COLORS
---@type raylib.rlBlendMode
M.RL_BLEND_SUBTRACT_COLORS = M.rlBlendMode.RL_BLEND_SUBTRACT_COLORS
---@type raylib.rlBlendMode
M.RL_BLEND_ALPHA_PREMULTIPLY = M.rlBlendMode.RL_BLEND_ALPHA_PREMULTIPLY
---@type raylib.rlBlendMode
M.RL_BLEND_CUSTOM = M.rlBlendMode.RL_BLEND_CUSTOM
---@type raylib.rlBlendMode
M.RL_BLEND_CUSTOM_SEPARATE = M.rlBlendMode.RL_BLEND_CUSTOM_SEPARATE
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VERTEX_POSITION = M.rlShaderLocationIndex.RL_SHADER_LOC_VERTEX_POSITION
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VERTEX_TEXCOORD01 = M.rlShaderLocationIndex.RL_SHADER_LOC_VERTEX_TEXCOORD01
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VERTEX_TEXCOORD02 = M.rlShaderLocationIndex.RL_SHADER_LOC_VERTEX_TEXCOORD02
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VERTEX_NORMAL = M.rlShaderLocationIndex.RL_SHADER_LOC_VERTEX_NORMAL
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VERTEX_TANGENT = M.rlShaderLocationIndex.RL_SHADER_LOC_VERTEX_TANGENT
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VERTEX_COLOR = M.rlShaderLocationIndex.RL_SHADER_LOC_VERTEX_COLOR
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MATRIX_MVP = M.rlShaderLocationIndex.RL_SHADER_LOC_MATRIX_MVP
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MATRIX_VIEW = M.rlShaderLocationIndex.RL_SHADER_LOC_MATRIX_VIEW
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MATRIX_PROJECTION = M.rlShaderLocationIndex.RL_SHADER_LOC_MATRIX_PROJECTION
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MATRIX_MODEL = M.rlShaderLocationIndex.RL_SHADER_LOC_MATRIX_MODEL
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MATRIX_NORMAL = M.rlShaderLocationIndex.RL_SHADER_LOC_MATRIX_NORMAL
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_VECTOR_VIEW = M.rlShaderLocationIndex.RL_SHADER_LOC_VECTOR_VIEW
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_COLOR_DIFFUSE = M.rlShaderLocationIndex.RL_SHADER_LOC_COLOR_DIFFUSE
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_COLOR_SPECULAR = M.rlShaderLocationIndex.RL_SHADER_LOC_COLOR_SPECULAR
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_COLOR_AMBIENT = M.rlShaderLocationIndex.RL_SHADER_LOC_COLOR_AMBIENT
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_ALBEDO = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_ALBEDO
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_METALNESS = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_METALNESS
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_NORMAL = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_NORMAL
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_ROUGHNESS = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_ROUGHNESS
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_OCCLUSION = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_OCCLUSION
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_EMISSION = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_EMISSION
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_HEIGHT = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_HEIGHT
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_CUBEMAP = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_CUBEMAP
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_IRRADIANCE = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_IRRADIANCE
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_PREFILTER = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_PREFILTER
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_BRDF = M.rlShaderLocationIndex.RL_SHADER_LOC_MAP_BRDF
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_FLOAT = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_FLOAT
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_VEC2 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_VEC2
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_VEC3 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_VEC3
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_VEC4 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_VEC4
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_INT = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_INT
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_IVEC2 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_IVEC2
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_IVEC3 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_IVEC3
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_IVEC4 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_IVEC4
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_UINT = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_UINT
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_UIVEC2 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_UIVEC2
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_UIVEC3 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_UIVEC3
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_UIVEC4 = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_UIVEC4
---@type raylib.rlShaderUniformDataType
M.RL_SHADER_UNIFORM_SAMPLER2D = M.rlShaderUniformDataType.RL_SHADER_UNIFORM_SAMPLER2D
---@type raylib.rlShaderAttributeDataType
M.RL_SHADER_ATTRIB_FLOAT = M.rlShaderAttributeDataType.RL_SHADER_ATTRIB_FLOAT
---@type raylib.rlShaderAttributeDataType
M.RL_SHADER_ATTRIB_VEC2 = M.rlShaderAttributeDataType.RL_SHADER_ATTRIB_VEC2
---@type raylib.rlShaderAttributeDataType
M.RL_SHADER_ATTRIB_VEC3 = M.rlShaderAttributeDataType.RL_SHADER_ATTRIB_VEC3
---@type raylib.rlShaderAttributeDataType
M.RL_SHADER_ATTRIB_VEC4 = M.rlShaderAttributeDataType.RL_SHADER_ATTRIB_VEC4
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL0 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL1 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL1
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL2 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL2
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL3 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL3
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL4 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL4
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL5 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL5
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL6 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL6
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_COLOR_CHANNEL7 = M.rlFramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL7
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_DEPTH = M.rlFramebufferAttachType.RL_ATTACHMENT_DEPTH
---@type raylib.rlFramebufferAttachType
M.RL_ATTACHMENT_STENCIL = M.rlFramebufferAttachType.RL_ATTACHMENT_STENCIL
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_CUBEMAP_POSITIVE_X = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_X
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_NEGATIVE_X
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_Y
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_Z
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_TEXTURE2D = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_TEXTURE2D
---@type raylib.rlFramebufferAttachTextureType
M.RL_ATTACHMENT_RENDERBUFFER = M.rlFramebufferAttachTextureType.RL_ATTACHMENT_RENDERBUFFER
---@type raylib.rlCullMode
M.RL_CULL_FACE_FRONT = M.rlCullMode.RL_CULL_FACE_FRONT
---@type raylib.rlCullMode
M.RL_CULL_FACE_BACK = M.rlCullMode.RL_CULL_FACE_BACK
M.RAYLIB_VERSION_MAJOR = 6
M.RAYLIB_VERSION_MINOR = 5
M.RAYLIB_VERSION_PATCH = 0
M.RAYLIB_VERSION = "6.5-dev"
M.PI = 3.1415926535898
M.DEG2RAD = 0.017453292519943
M.RAD2DEG = 57.295779513082
---@type raylib.Color
M.LIGHTGRAY = ffi.new("Color", { r = 200, g = 200, b = 200, a = 255 })
---@type raylib.Color
M.GRAY = ffi.new("Color", { r = 130, g = 130, b = 130, a = 255 })
---@type raylib.Color
M.DARKGRAY = ffi.new("Color", { r = 80, g = 80, b = 80, a = 255 })
---@type raylib.Color
M.YELLOW = ffi.new("Color", { r = 253, g = 249, b = 0, a = 255 })
---@type raylib.Color
M.GOLD = ffi.new("Color", { r = 255, g = 203, b = 0, a = 255 })
---@type raylib.Color
M.ORANGE = ffi.new("Color", { r = 255, g = 161, b = 0, a = 255 })
---@type raylib.Color
M.PINK = ffi.new("Color", { r = 255, g = 109, b = 194, a = 255 })
---@type raylib.Color
M.RED = ffi.new("Color", { r = 230, g = 41, b = 55, a = 255 })
---@type raylib.Color
M.MAROON = ffi.new("Color", { r = 190, g = 33, b = 55, a = 255 })
---@type raylib.Color
M.GREEN = ffi.new("Color", { r = 0, g = 228, b = 48, a = 255 })
---@type raylib.Color
M.LIME = ffi.new("Color", { r = 0, g = 158, b = 47, a = 255 })
---@type raylib.Color
M.DARKGREEN = ffi.new("Color", { r = 0, g = 117, b = 44, a = 255 })
---@type raylib.Color
M.SKYBLUE = ffi.new("Color", { r = 102, g = 191, b = 255, a = 255 })
---@type raylib.Color
M.BLUE = ffi.new("Color", { r = 0, g = 121, b = 241, a = 255 })
---@type raylib.Color
M.DARKBLUE = ffi.new("Color", { r = 0, g = 82, b = 172, a = 255 })
---@type raylib.Color
M.PURPLE = ffi.new("Color", { r = 200, g = 122, b = 255, a = 255 })
---@type raylib.Color
M.VIOLET = ffi.new("Color", { r = 135, g = 60, b = 190, a = 255 })
---@type raylib.Color
M.DARKPURPLE = ffi.new("Color", { r = 112, g = 31, b = 126, a = 255 })
---@type raylib.Color
M.BEIGE = ffi.new("Color", { r = 211, g = 176, b = 131, a = 255 })
---@type raylib.Color
M.BROWN = ffi.new("Color", { r = 127, g = 106, b = 79, a = 255 })
---@type raylib.Color
M.DARKBROWN = ffi.new("Color", { r = 76, g = 63, b = 47, a = 255 })
---@type raylib.Color
M.WHITE = ffi.new("Color", { r = 255, g = 255, b = 255, a = 255 })
---@type raylib.Color
M.BLACK = ffi.new("Color", { r = 0, g = 0, b = 0, a = 255 })
---@type raylib.Color
M.BLANK = ffi.new("Color", { r = 0, g = 0, b = 0, a = 0 })
---@type raylib.Color
M.MAGENTA = ffi.new("Color", { r = 255, g = 0, b = 255, a = 255 })
---@type raylib.Color
M.RAYWHITE = ffi.new("Color", { r = 245, g = 245, b = 245, a = 255 })
M.RLGL_VERSION = "6.0"
M.RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192
M.RL_DEFAULT_BATCH_BUFFERS = 1
M.RL_DEFAULT_BATCH_DRAWCALLS = 256
M.RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4
M.RL_MAX_MATRIX_STACK_SIZE = 32
M.RL_MAX_SHADER_LOCATIONS = 32
M.RL_CULL_DISTANCE_NEAR = 0.05
M.RL_CULL_DISTANCE_FAR = 4000
M.RL_TEXTURE_WRAP_S = 10242
M.RL_TEXTURE_WRAP_T = 10243
M.RL_TEXTURE_MAG_FILTER = 10240
M.RL_TEXTURE_MIN_FILTER = 10241
M.RL_TEXTURE_FILTER_NEAREST = 9728
M.RL_TEXTURE_FILTER_LINEAR = 9729
M.RL_TEXTURE_FILTER_MIP_NEAREST = 9984
M.RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 9986
M.RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 9985
M.RL_TEXTURE_FILTER_MIP_LINEAR = 9987
M.RL_TEXTURE_FILTER_ANISOTROPIC = 12288
M.RL_TEXTURE_MIPMAP_BIAS_RATIO = 16384
M.RL_TEXTURE_WRAP_REPEAT = 10497
M.RL_TEXTURE_WRAP_CLAMP = 33071
M.RL_TEXTURE_WRAP_MIRROR_REPEAT = 33648
M.RL_TEXTURE_WRAP_MIRROR_CLAMP = 34626
M.RL_MODELVIEW = 5888
M.RL_PROJECTION = 5889
M.RL_TEXTURE = 5890
M.RL_LINES = 1
M.RL_TRIANGLES = 4
M.RL_QUADS = 7
M.RL_UNSIGNED_BYTE = 5121
M.RL_FLOAT = 5126
M.RL_STREAM_DRAW = 35040
M.RL_STREAM_READ = 35041
M.RL_STREAM_COPY = 35042
M.RL_STATIC_DRAW = 35044
M.RL_STATIC_READ = 35045
M.RL_STATIC_COPY = 35046
M.RL_DYNAMIC_DRAW = 35048
M.RL_DYNAMIC_READ = 35049
M.RL_DYNAMIC_COPY = 35050
M.RL_FRAGMENT_SHADER = 35632
M.RL_VERTEX_SHADER = 35633
M.RL_COMPUTE_SHADER = 37305
M.RL_ZERO = 0
M.RL_ONE = 1
M.RL_SRC_COLOR = 768
M.RL_ONE_MINUS_SRC_COLOR = 769
M.RL_SRC_ALPHA = 770
M.RL_ONE_MINUS_SRC_ALPHA = 771
M.RL_DST_ALPHA = 772
M.RL_ONE_MINUS_DST_ALPHA = 773
M.RL_DST_COLOR = 774
M.RL_ONE_MINUS_DST_COLOR = 775
M.RL_SRC_ALPHA_SATURATE = 776
M.RL_CONSTANT_COLOR = 32769
M.RL_ONE_MINUS_CONSTANT_COLOR = 32770
M.RL_CONSTANT_ALPHA = 32771
M.RL_ONE_MINUS_CONSTANT_ALPHA = 32772
M.RL_FUNC_ADD = 32774
M.RL_MIN = 32775
M.RL_MAX = 32776
M.RL_FUNC_SUBTRACT = 32778
M.RL_FUNC_REVERSE_SUBTRACT = 32779
M.RL_BLEND_EQUATION = 32777
M.RL_BLEND_EQUATION_RGB = 32777
M.RL_BLEND_EQUATION_ALPHA = 34877
M.RL_BLEND_DST_RGB = 32968
M.RL_BLEND_SRC_RGB = 32969
M.RL_BLEND_DST_ALPHA = 32970
M.RL_BLEND_SRC_ALPHA = 32971
M.RL_BLEND_COLOR = 32773
M.RL_READ_FRAMEBUFFER = 36008
M.RL_DRAW_FRAMEBUFFER = 36009
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION = 0
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD = 1
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL = 2
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR = 3
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT = 4
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 = 5
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES = 6
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES = 7
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS = 8
M.RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM = 9
M.EPSILON = 1e-06
---@type raylib.MouseButton
M.MOUSE_LEFT_BUTTON = M.MOUSE_BUTTON_LEFT
---@type raylib.MouseButton
M.MOUSE_RIGHT_BUTTON = M.MOUSE_BUTTON_RIGHT
---@type raylib.MouseButton
M.MOUSE_MIDDLE_BUTTON = M.MOUSE_BUTTON_MIDDLE
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_DIFFUSE = M.MATERIAL_MAP_ALBEDO
---@type raylib.MaterialMapIndex
M.MATERIAL_MAP_SPECULAR = M.MATERIAL_MAP_METALNESS
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_DIFFUSE = M.SHADER_LOC_MAP_ALBEDO
---@type raylib.ShaderLocationIndex
M.SHADER_LOC_MAP_SPECULAR = M.SHADER_LOC_MAP_METALNESS
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_DIFFUSE = M.RL_SHADER_LOC_MAP_ALBEDO
---@type raylib.rlShaderLocationIndex
M.RL_SHADER_LOC_MAP_SPECULAR = M.RL_SHADER_LOC_MAP_METALNESS
---Vector2, 2 components
---@class raylib.Vector2
---@field x number Vector x component
---@field y number Vector y component
---Vector3, 3 components
---@class raylib.Vector3
---@field x number Vector x component
---@field y number Vector y component
---@field z number Vector z component
---Vector4, 4 components
---@class raylib.Vector4
---@field x number Vector x component
---@field y number Vector y component
---@field z number Vector z component
---@field w number Vector w component
---Matrix, 4x4 components, column major, OpenGL style, right-handed
---@class raylib.Matrix
---@field m0 number Matrix first row (4 components)
---@field m4 number Matrix first row (4 components)
---@field m8 number Matrix first row (4 components)
---@field m12 number Matrix first row (4 components)
---@field m1 number Matrix second row (4 components)
---@field m5 number Matrix second row (4 components)
---@field m9 number Matrix second row (4 components)
---@field m13 number Matrix second row (4 components)
---@field m2 number Matrix third row (4 components)
---@field m6 number Matrix third row (4 components)
---@field m10 number Matrix third row (4 components)
---@field m14 number Matrix third row (4 components)
---@field m3 number Matrix fourth row (4 components)
---@field m7 number Matrix fourth row (4 components)
---@field m11 number Matrix fourth row (4 components)
---@field m15 number Matrix fourth row (4 components)
---Color, 4 components, R8G8B8A8 (32bit)
---@class raylib.Color
---@field r integer Color red value
---@field g integer Color green value
---@field b integer Color blue value
---@field a integer Color alpha value
---Rectangle, 4 components
---@class raylib.Rectangle
---@field x number Rectangle top-left corner position x
---@field y number Rectangle top-left corner position y
---@field width number Rectangle width
---@field height number Rectangle height
---Image, pixel data stored in CPU memory (RAM)
---@class raylib.Image
---@field data ffi.cdata* Image raw data
---@field width integer Image base width
---@field height integer Image base height
---@field mipmaps integer Mipmap levels, 1 by default
---@field format integer Data format (PixelFormat type)
---Texture, tex data stored in GPU memory (VRAM)
---@class raylib.Texture
---@field id integer OpenGL texture id
---@field width integer Texture base width
---@field height integer Texture base height
---@field mipmaps integer Mipmap levels, 1 by default
---@field format integer Data format (PixelFormat type)
---RenderTexture, fbo for texture rendering
---@class raylib.RenderTexture
---@field id integer OpenGL framebuffer object id
---@field texture raylib.Texture Color buffer attachment texture
---@field depth raylib.Texture Depth buffer attachment texture
---NPatchInfo, n-patch layout info
---@class raylib.NPatchInfo
---@field source raylib.Rectangle Texture source rectangle
---@field left integer Left border offset
---@field top integer Top border offset
---@field right integer Right border offset
---@field bottom integer Bottom border offset
---@field layout integer Layout of the n-patch: 3x3, 1x3 or 3x1
---GlyphInfo, font characters glyphs info
---@class raylib.GlyphInfo
---@field value integer Character value (Unicode)
---@field offsetX integer Character offset X when drawing
---@field offsetY integer Character offset Y when drawing
---@field advanceX integer Character advance position X
---@field image raylib.Image Character image data
---@alias raylib.Texture2D raylib.Texture
---Font, font texture and GlyphInfo array data
---@class raylib.Font
---@field baseSize integer Base size (default chars height)
---@field glyphCount integer Number of glyph characters
---@field glyphPadding integer Padding around the glyph characters
---@field texture raylib.Texture2D Texture atlas containing the glyphs
---@field recs raylib.Rectangle[] Rectangles in texture for the glyphs
---@field glyphs raylib.GlyphInfo[] Glyphs info data
---Camera, defines position/orientation in 3d space
---@class raylib.Camera3D
---@field position raylib.Vector3 Camera position
---@field target raylib.Vector3 Camera target it looks-at
---@field up raylib.Vector3 Camera up vector (rotation over its axis)
---@field fovy number Camera field-of-view aperture in Y (degrees) in perspective, used as near plane height in world units in orthographic
---@field projection integer Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
---Camera2D, defines position/orientation in 2d space
---@class raylib.Camera2D
---@field offset raylib.Vector2 Camera offset (screen space offset from window origin, unscaled by DPI, real pixel size)
---@field target raylib.Vector2 Camera target (world space target point that is mapped to screen space offset)
---@field rotation number Camera rotation in degrees (pivots around target)
---@field zoom number Camera zoom (scaling around target), must not be set to 0, set to 1.0f for no scale
---Mesh, vertex data and vao/vbo
---@class raylib.Mesh
---@field vertexCount integer Number of vertices stored in arrays
---@field triangleCount integer Number of triangles stored (indexed or not)
---@field vertices number[] Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
---@field texcoords number[] Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
---@field texcoords2 number[] Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
---@field normals number[] Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
---@field tangents number[] Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
---@field colors integer[] Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
---@field indices integer[] Vertex indices (in case vertex data comes indexed)
---@field boneCount integer Number of bones (MAX: 256 bones)
---@field boneIndices integer[] Vertex bone indices, up to 4 bones influence by vertex (skinning) (shader-location = 6)
---@field boneWeights number[] Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
---@field animVertices number[] Animated vertex positions (after bones transformations)
---@field animNormals number[] Animated normals (after bones transformations)
---@field vaoId integer OpenGL Vertex Array Object id
---@field vboId integer[] OpenGL Vertex Buffer Objects id (default vertex data)
---Shader
---@class raylib.Shader
---@field id integer Shader program id
---@field locs integer[] Shader locations array (RL_MAX_SHADER_LOCATIONS)
---MaterialMap
---@class raylib.MaterialMap
---@field texture raylib.Texture2D Material map texture
---@field color raylib.Color Material map color
---@field value number Material map value
---Material, includes shader and maps
---@class raylib.Material
---@field shader raylib.Shader Material shader
---@field maps raylib.MaterialMap[] Material maps array (MAX_MATERIAL_MAPS)
---@field params number[] Material generic parameters (if required)
---@alias raylib.Quaternion raylib.Vector4
---Transform, vertex transformation data
---@class raylib.Transform
---@field translation raylib.Vector3 Translation
---@field rotation raylib.Quaternion Rotation
---@field scale raylib.Vector3 Scale
---Bone, skeletal animation bone
---@class raylib.BoneInfo
---@field name raylib.char_buffer Bone name
---@field parent integer Bone parent
---@alias raylib.ModelAnimPose ffi.cdata*
---Skeleton, animation bones hierarchy
---@class raylib.ModelSkeleton
---@field boneCount integer Number of bones
---@field bones raylib.BoneInfo[] Bones information (skeleton)
---@field bindPose raylib.ModelAnimPose Bones base transformation (Transform[])
---Model, meshes, materials and animation data
---@class raylib.Model
---@field transform raylib.Matrix Local transform matrix
---@field meshCount integer Number of meshes
---@field materialCount integer Number of materials
---@field meshes raylib.Mesh[] Meshes array
---@field materials raylib.Material[] Materials array
---@field meshMaterial integer[] Mesh material number
---@field skeleton raylib.ModelSkeleton Skeleton for animation
---@field currentPose raylib.ModelAnimPose Current animation pose (Transform[])
---@field boneMatrices raylib.Matrix[] Bones animated transformation matrices
---ModelAnimation, contains a full animation sequence
---@class raylib.ModelAnimation
---@field name raylib.char_buffer Animation name
---@field boneCount integer Number of bones (per pose)
---@field keyframeCount integer Number of animation key frames
---@field keyframePoses raylib.ModelAnimPose[] Animation sequence keyframe poses [keyframe][pose]
---Ray, ray for raycasting
---@class raylib.Ray
---@field position raylib.Vector3 Ray position (origin)
---@field direction raylib.Vector3 Ray direction (normalized)
---RayCollision, ray hit information
---@class raylib.RayCollision
---@field hit boolean Did the ray hit something?
---@field distance number Distance to the nearest hit
---@field point raylib.Vector3 Point of the nearest hit
---@field normal raylib.Vector3 Surface normal of hit
---BoundingBox
---@class raylib.BoundingBox
---@field min raylib.Vector3 Minimum vertex box-corner
---@field max raylib.Vector3 Maximum vertex box-corner
---Wave, audio wave data
---@class raylib.Wave
---@field frameCount integer Total number of frames (considering channels)
---@field sampleRate integer Frequency (samples per second)
---@field sampleSize integer Bit depth (bits per sample): 8, 16, 32 (24 not supported)
---@field channels integer Number of channels (1-mono, 2-stereo, ...)
---@field data ffi.cdata* Buffer data pointer
---AudioStream, custom audio stream
---@class raylib.AudioStream
---@field buffer ffi.cdata* Pointer to internal data used by the audio system
---@field processor ffi.cdata* Pointer to internal data processor, useful for audio effects
---@field sampleRate integer Frequency (samples per second)
---@field sampleSize integer Bit depth (bits per sample): 8, 16, 32 (24 not supported)
---@field channels integer Number of channels (1-mono, 2-stereo, ...)
---Sound
---@class raylib.Sound
---@field stream raylib.AudioStream Audio stream
---@field frameCount integer Total number of frames (considering channels)
---Music, audio stream, anything longer than ~10 seconds should be streamed
---@class raylib.Music
---@field stream raylib.AudioStream Audio stream
---@field frameCount integer Total number of frames (considering channels)
---@field looping boolean Music looping enable
---@field ctxType integer Type of music context (audio filetype)
---@field ctxData ffi.cdata* Audio context data, depends on type
---VrDeviceInfo, Head-Mounted-Display device parameters
---@class raylib.VrDeviceInfo
---@field hResolution integer Horizontal resolution in pixels
---@field vResolution integer Vertical resolution in pixels
---@field hScreenSize number Horizontal size in meters
---@field vScreenSize number Vertical size in meters
---@field eyeToScreenDistance number Distance between eye and display in meters
---@field lensSeparationDistance number Lens separation distance in meters
---@field interpupillaryDistance number IPD (distance between pupils) in meters
---@field lensDistortionValues number[] Lens distortion constant parameters
---@field chromaAbCorrection number[] Chromatic aberration correction parameters
---VrStereoConfig, VR stereo rendering configuration for simulator
---@class raylib.VrStereoConfig
---@field projection raylib.Matrix[] VR projection matrices (per eye)
---@field viewOffset raylib.Matrix[] VR view offset matrices (per eye)
---@field leftLensCenter number[] VR left lens center
---@field rightLensCenter number[] VR right lens center
---@field leftScreenCenter number[] VR left screen center
---@field rightScreenCenter number[] VR right screen center
---@field scale number[] VR distortion scale
---@field scaleIn number[] VR distortion scale in
---File path list
---@class raylib.FilePathList
---@field count integer Filepaths entries count
---@field paths raylib.cstring_array Filepaths entries
---Automation event
---@class raylib.AutomationEvent
---@field frame integer Event frame
---@field type integer Event type (AutomationEventType)
---@field params integer[] Event parameters (if required)
---Automation event list
---@class raylib.AutomationEventList
---@field capacity integer Events max entries (MAX_AUTOMATION_EVENTS)
---@field count integer Events entries count
---@field events raylib.AutomationEvent[] Events entries
---@alias raylib.TextureCubemap raylib.Texture
---@alias raylib.RenderTexture2D raylib.RenderTexture
---@alias raylib.Camera raylib.Camera3D
---Dynamic vertex buffers (position + texcoords + colors + indices arrays)
---@class raylib.rlVertexBuffer
---@field elementCount integer Number of elements in the buffer (QUADS)
---@field vertices number[] Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
---@field texcoords number[] Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
---@field normals number[] Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
---@field colors integer[] Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
---@field indices integer[] Vertex indices (in case vertex data comes indexed) (6 indices per quad)
---@field vaoId integer OpenGL Vertex Array Object id
---@field vboId integer[] OpenGL Vertex Buffer Objects id (5 types of vertex data)
---of those state-change happens (this is done in core module)
---@class raylib.rlDrawCall
---@field mode integer Drawing mode: LINES, TRIANGLES, QUADS
---@field vertexCount integer Number of vertex of the draw
---@field vertexAlignment integer Number of vertex required for index alignment (LINES, TRIANGLES)
---@field textureId integer Texture id to be used on the draw -> Use to create new draw call if changes
---rlRenderBatch type
---@class raylib.rlRenderBatch
---@field bufferCount integer Number of vertex buffers (multi-buffering support)
---@field currentBuffer integer Current buffer tracking in case of multi-buffering
---@field vertexBuffer raylib.rlVertexBuffer[] Dynamic buffer(s) for vertex data
---@field draws raylib.rlDrawCall[] Draw calls array, depends on textureId
---@field drawCounter integer Draw calls counter
---@field currentDepth number Current depth value for next draw
---@class raylib.float3
---@field v number[]
---@class raylib.float16
---@field v number[]
---@alias raylib.AudioCallback fun(bufferData: ffi.cdata*, frames: integer)
---@alias raylib.LoadFileDataCallback fun(fileName: string, dataSize: integer): ffi.cdata*
---@alias raylib.SaveFileDataCallback fun(fileName: string, data: ffi.cdata*, dataSize: integer): boolean
---@alias raylib.LoadFileTextCallback fun(fileName: string): string
---@alias raylib.SaveFileTextCallback fun(fileName: string, text: string): boolean
---Initialize window and OpenGL context
---@param width integer
---@param height integer
---@param title string
---@return nil
function M.InitWindow(width, height, title)
C.InitWindow(width, height, title)
end
---Close window and unload OpenGL context
---@return nil
function M.CloseWindow()
C.CloseWindow()
end
---Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
---@return boolean
function M.WindowShouldClose()
return C.WindowShouldClose()
end
---Check if window has been initialized successfully
---@return boolean
function M.IsWindowReady()
return C.IsWindowReady()
end
---Check if window is currently fullscreen
---@return boolean
function M.IsWindowFullscreen()
return C.IsWindowFullscreen()
end
---Check if window is currently hidden
---@return boolean
function M.IsWindowHidden()
return C.IsWindowHidden()
end
---Check if window is currently minimized
---@return boolean
function M.IsWindowMinimized()
return C.IsWindowMinimized()
end
---Check if window is currently maximized
---@return boolean
function M.IsWindowMaximized()
return C.IsWindowMaximized()
end
---Check if window is currently focused
---@return boolean
function M.IsWindowFocused()
return C.IsWindowFocused()
end
---Check if window has been resized last frame
---@return boolean
function M.IsWindowResized()
return C.IsWindowResized()
end
---Check if one specific window flag is enabled
---@param flag integer
---@return boolean
function M.IsWindowState(flag)
return C.IsWindowState(flag)
end
---Set window configuration state using flags
---@param flags integer
---@return nil
function M.SetWindowState(flags)
C.SetWindowState(flags)
end
---Clear window configuration state flags
---@param flags integer
---@return nil
function M.ClearWindowState(flags)
C.ClearWindowState(flags)
end
---Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
---@return nil
function M.ToggleFullscreen()
C.ToggleFullscreen()
end
---Toggle window state: borderless windowed, resizes window to match monitor resolution
---@return nil
function M.ToggleBorderlessWindowed()
C.ToggleBorderlessWindowed()
end
---Set window state: maximized, if resizable
---@return nil
function M.MaximizeWindow()
C.MaximizeWindow()
end
---Set window state: minimized, if resizable
---@return nil
function M.MinimizeWindow()
C.MinimizeWindow()
end
---Restore window from being minimized/maximized
---@return nil
function M.RestoreWindow()
C.RestoreWindow()
end
---Set icon for window (single image, RGBA 32bit)
---@param image raylib.Image
---@return nil
function M.SetWindowIcon(image)
C.SetWindowIcon(image)
end
---Set icon for window (multiple images, RGBA 32bit)
---@param images raylib.Image
---@param count integer
---@return raylib.Image
function M.SetWindowIcons(images, count)
local _o1 = ffi.new("Image[1]", images)
C.SetWindowIcons(_o1, count)
return _o1[0]
end
---Set title for window
---@param title string
---@return nil
function M.SetWindowTitle(title)
C.SetWindowTitle(title)
end
---Set window position on screen
---@param x integer
---@param y integer
---@return nil
function M.SetWindowPosition(x, y)
C.SetWindowPosition(x, y)
end
---Set monitor for the current window
---@param monitor integer
---@return nil
function M.SetWindowMonitor(monitor)
C.SetWindowMonitor(monitor)
end
---Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
---@param width integer
---@param height integer
---@return nil
function M.SetWindowMinSize(width, height)
C.SetWindowMinSize(width, height)
end
---Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
---@param width integer
---@param height integer
---@return nil
function M.SetWindowMaxSize(width, height)
C.SetWindowMaxSize(width, height)
end
---Set window dimensions
---@param width integer
---@param height integer
---@return nil
function M.SetWindowSize(width, height)
C.SetWindowSize(width, height)
end
---Set window opacity [0.0f..1.0f]
---@param opacity number
---@return nil
function M.SetWindowOpacity(opacity)
C.SetWindowOpacity(opacity)
end
---Set window focused
---@return nil
function M.SetWindowFocused()
C.SetWindowFocused()
end
---Get native window handle
---@return ffi.cdata*
function M.GetWindowHandle()
return C.GetWindowHandle()
end
---Get current screen width
---@return integer
function M.GetScreenWidth()
return C.GetScreenWidth()
end
---Get current screen height
---@return integer
function M.GetScreenHeight()
return C.GetScreenHeight()
end
---Get current render width (it considers HiDPI)
---@return integer
function M.GetRenderWidth()
return C.GetRenderWidth()
end
---Get current render height (it considers HiDPI)
---@return integer
function M.GetRenderHeight()
return C.GetRenderHeight()
end
---Get number of connected monitors
---@return integer
function M.GetMonitorCount()
return C.GetMonitorCount()
end
---Get current monitor where window is placed
---@return integer
function M.GetCurrentMonitor()
return C.GetCurrentMonitor()
end
---Get specified monitor position
---@param monitor integer
---@return raylib.Vector2
function M.GetMonitorPosition(monitor)
return C.GetMonitorPosition(monitor)
end
---Get specified monitor width (current video mode used by monitor)
---@param monitor integer
---@return integer
function M.GetMonitorWidth(monitor)
return C.GetMonitorWidth(monitor)
end
---Get specified monitor height (current video mode used by monitor)
---@param monitor integer
---@return integer
function M.GetMonitorHeight(monitor)
return C.GetMonitorHeight(monitor)
end
---Get specified monitor physical width in millimetres
---@param monitor integer
---@return integer
function M.GetMonitorPhysicalWidth(monitor)
return C.GetMonitorPhysicalWidth(monitor)
end
---Get specified monitor physical height in millimetres
---@param monitor integer
---@return integer
function M.GetMonitorPhysicalHeight(monitor)
return C.GetMonitorPhysicalHeight(monitor)
end
---Get specified monitor refresh rate
---@param monitor integer
---@return integer
function M.GetMonitorRefreshRate(monitor)
return C.GetMonitorRefreshRate(monitor)
end
---Get window position XY on monitor
---@return raylib.Vector2
function M.GetWindowPosition()
return C.GetWindowPosition()
end
---Get window scale DPI factor
---@return raylib.Vector2
function M.GetWindowScaleDPI()
return C.GetWindowScaleDPI()
end
---Get the human-readable, UTF-8 encoded name of the specified monitor
---@param monitor integer
---@return string|nil
function M.GetMonitorName(monitor)
local _p = C.GetMonitorName(monitor)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Set clipboard text content
---@param text string
---@return nil
function M.SetClipboardText(text)
C.SetClipboardText(text)
end
---Get clipboard text content
---@return string|nil
function M.GetClipboardText()
local _p = C.GetClipboardText()
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get clipboard image content
---@return raylib.Image
function M.GetClipboardImage()
return C.GetClipboardImage()
end
---Enable waiting for events on EndDrawing(), no automatic event polling
---@return nil
function M.EnableEventWaiting()
C.EnableEventWaiting()
end
---Disable waiting for events on EndDrawing(), automatic events polling
---@return nil
function M.DisableEventWaiting()
C.DisableEventWaiting()
end
---Show cursor
---@return nil
function M.ShowCursor()
C.ShowCursor()
end
---Hide cursor
---@return nil
function M.HideCursor()
C.HideCursor()
end
---Check if cursor is not visible
---@return boolean
function M.IsCursorHidden()
return C.IsCursorHidden()
end
---Enable cursor (unlock cursor)
---@return nil
function M.EnableCursor()
C.EnableCursor()
end
---Disable cursor (lock cursor)
---@return nil
function M.DisableCursor()
C.DisableCursor()
end
---Check if cursor is on the screen
---@return boolean
function M.IsCursorOnScreen()
return C.IsCursorOnScreen()
end
---Clear background (framebuffer) to color
---@param color raylib.Color
---@return nil
function M.ClearBackground(color)
C.ClearBackground(color)
end
---Begin canvas (framebuffer) drawing
---@return nil
function M.BeginDrawing()
C.BeginDrawing()
end
---End canvas (framebuffer) drawing and swap buffers (double buffering)
---@return nil
function M.EndDrawing()
C.EndDrawing()
end
---Begin 2D mode with custom camera (2D)
---@param camera raylib.Camera2D
---@return nil
function M.BeginMode2D(camera)
C.BeginMode2D(camera)
end
---End 2D mode with custom camera
---@return nil
function M.EndMode2D()
C.EndMode2D()
end
---Begin 3D mode with custom camera (3D)
---@param camera raylib.Camera3D
---@return nil
function M.BeginMode3D(camera)
C.BeginMode3D(camera)
end
---End 3D mode and returns to default 2D orthographic mode
---@return nil
function M.EndMode3D()
C.EndMode3D()
end
---Begin drawing to render texture
---@param target raylib.RenderTexture2D
---@return nil
function M.BeginTextureMode(target)
C.BeginTextureMode(target)
end
---End drawing to render texture
---@return nil
function M.EndTextureMode()
C.EndTextureMode()
end
---Begin custom shader drawing
---@param shader raylib.Shader
---@return nil
function M.BeginShaderMode(shader)
C.BeginShaderMode(shader)
end
---End custom shader drawing (use default shader)
---@return nil
function M.EndShaderMode()
C.EndShaderMode()
end
---Begin blending mode (alpha, additive, multiplied, subtract, custom)
---@param mode integer
---@return nil
function M.BeginBlendMode(mode)
C.BeginBlendMode(mode)
end
---End blending mode (reset to default: alpha blending)
---@return nil
function M.EndBlendMode()
C.EndBlendMode()
end
---Begin scissor mode (define screen area for following drawing)
---@param x integer
---@param y integer
---@param width integer
---@param height integer
---@return nil
function M.BeginScissorMode(x, y, width, height)
C.BeginScissorMode(x, y, width, height)
end
---End scissor mode
---@return nil
function M.EndScissorMode()
C.EndScissorMode()
end
---Begin stereo rendering (requires VR simulator)
---@param config raylib.VrStereoConfig
---@return nil
function M.BeginVrStereoMode(config)
C.BeginVrStereoMode(config)
end
---End stereo rendering (requires VR simulator)
---@return nil
function M.EndVrStereoMode()
C.EndVrStereoMode()
end
---Load VR stereo config for VR simulator device parameters
---@param device raylib.VrDeviceInfo
---@return raylib.VrStereoConfig
function M.LoadVrStereoConfig(device)
return C.LoadVrStereoConfig(device)
end
---Unload VR stereo config
---@param config raylib.VrStereoConfig
---@return nil
function M.UnloadVrStereoConfig(config)
C.UnloadVrStereoConfig(config)
end
---Load shader from files and bind default locations
---@param vsFileName string
---@param fsFileName string
---@return raylib.Shader
function M.LoadShader(vsFileName, fsFileName)
return C.LoadShader(vsFileName, fsFileName)
end
---Load shader from code strings and bind default locations
---@param vsCode string
---@param fsCode string
---@return raylib.Shader
function M.LoadShaderFromMemory(vsCode, fsCode)
return C.LoadShaderFromMemory(vsCode, fsCode)
end
---Check if shader is valid (loaded on GPU)
---@param shader raylib.Shader
---@return boolean
function M.IsShaderValid(shader)
return C.IsShaderValid(shader)
end
---Get shader uniform location
---@param shader raylib.Shader
---@param uniformName string
---@return integer
function M.GetShaderLocation(shader, uniformName)
return C.GetShaderLocation(shader, uniformName)
end
---Get shader attribute location
---@param shader raylib.Shader
---@param attribName string
---@return integer
function M.GetShaderLocationAttrib(shader, attribName)
return C.GetShaderLocationAttrib(shader, attribName)
end
---Set shader uniform value
---@param shader raylib.Shader
---@param locIndex integer
---@param value ffi.cdata*|string
---@param uniformType integer
---@return nil
function M.SetShaderValue(shader, locIndex, value, uniformType)
local _a3
if type(value) == "string" then _a3 = ffi.cast("const void *", value)
else _a3 = value end
C.SetShaderValue(shader, locIndex, _a3, uniformType)
end
---Set shader uniform value vector
---@param shader raylib.Shader
---@param locIndex integer
---@param value ffi.cdata*|string
---@param uniformType integer
---@param count integer
---@return nil
function M.SetShaderValueV(shader, locIndex, value, uniformType, count)
local _a3
if type(value) == "string" then _a3 = ffi.cast("const void *", value)
else _a3 = value end
C.SetShaderValueV(shader, locIndex, _a3, uniformType, count)
end
---Set shader uniform value (matrix 4x4)
---@param shader raylib.Shader
---@param locIndex integer
---@param mat raylib.Matrix
---@return nil
function M.SetShaderValueMatrix(shader, locIndex, mat)
C.SetShaderValueMatrix(shader, locIndex, mat)
end
---Set shader uniform value and bind the texture (sampler2d)
---@param shader raylib.Shader
---@param locIndex integer
---@param texture raylib.Texture2D
---@return nil
function M.SetShaderValueTexture(shader, locIndex, texture)
C.SetShaderValueTexture(shader, locIndex, texture)
end
---Unload shader from GPU memory (VRAM)
---@param shader raylib.Shader
---@return nil
function M.UnloadShader(shader)
C.UnloadShader(shader)
end
---Get a ray trace from screen position (i.e mouse)
---@param position raylib.Vector2
---@param camera raylib.Camera
---@return raylib.Ray
function M.GetScreenToWorldRay(position, camera)
return C.GetScreenToWorldRay(position, camera)
end
---Get a ray trace from screen position (i.e mouse) in a viewport
---@param position raylib.Vector2
---@param camera raylib.Camera
---@param width integer
---@param height integer
---@return raylib.Ray
function M.GetScreenToWorldRayEx(position, camera, width, height)
return C.GetScreenToWorldRayEx(position, camera, width, height)
end
---Get screen space position for a 3d world space position
---@param position raylib.Vector3
---@param camera raylib.Camera
---@return raylib.Vector2
function M.GetWorldToScreen(position, camera)
return C.GetWorldToScreen(position, camera)
end
---Get sized screen space position for a 3d world space position
---@param position raylib.Vector3
---@param camera raylib.Camera
---@param width integer
---@param height integer
---@return raylib.Vector2
function M.GetWorldToScreenEx(position, camera, width, height)
return C.GetWorldToScreenEx(position, camera, width, height)
end
---Get screen space position for a 2d camera world space position
---@param position raylib.Vector2
---@param camera raylib.Camera2D
---@return raylib.Vector2
function M.GetWorldToScreen2D(position, camera)
return C.GetWorldToScreen2D(position, camera)
end
---Get world space position for a 2d camera screen space position
---@param position raylib.Vector2
---@param camera raylib.Camera2D
---@return raylib.Vector2
function M.GetScreenToWorld2D(position, camera)
return C.GetScreenToWorld2D(position, camera)
end
---Get camera transform matrix (view matrix)
---@param camera raylib.Camera
---@return raylib.Matrix
function M.GetCameraMatrix(camera)
return C.GetCameraMatrix(camera)
end
---Get camera 2d transform matrix
---@param camera raylib.Camera2D
---@return raylib.Matrix
function M.GetCameraMatrix2D(camera)
return C.GetCameraMatrix2D(camera)
end
---Set target FPS (maximum)
---@param fps integer
---@return nil
function M.SetTargetFPS(fps)
C.SetTargetFPS(fps)
end
---Get time in seconds for last frame drawn (delta time)
---@return number
function M.GetFrameTime()
return C.GetFrameTime()
end
---Get elapsed time in seconds since InitWindow()
---@return number
function M.GetTime()
return C.GetTime()
end
---Get current FPS
---@return integer
function M.GetFPS()
return C.GetFPS()
end
---Swap back buffer with front buffer (screen drawing)
---@return nil
function M.SwapScreenBuffer()
C.SwapScreenBuffer()
end
---Register all input events
---@return nil
function M.PollInputEvents()
C.PollInputEvents()
end
---Wait for some time (halt program execution)
---@param seconds number
---@return nil
function M.WaitTime(seconds)
C.WaitTime(seconds)
end
---Set the seed for the random number generator
---@param seed integer
---@return nil
function M.SetRandomSeed(seed)
C.SetRandomSeed(seed)
end
---Get a random value between min and max (both included)
---@param min integer
---@param max integer
---@return integer
function M.GetRandomValue(min, max)
return C.GetRandomValue(min, max)
end
---Load random values sequence, no values repeated
---@param count integer
---@param min integer
---@param max integer
---@return ffi.cdata*
function M.LoadRandomSequence(count, min, max)
return C.LoadRandomSequence(count, min, max)
end
---Unload random values sequence
---@param sequence ffi.cdata*
---@return nil
function M.UnloadRandomSequence(sequence)
C.UnloadRandomSequence(sequence)
end
---Takes a screenshot of current screen (filename extension defines format)
---@param fileName string
---@return nil
function M.TakeScreenshot(fileName)
C.TakeScreenshot(fileName)
end
---Set init configuration flags (view FLAGS)
---@param flags integer
---@return nil
function M.SetConfigFlags(flags)
C.SetConfigFlags(flags)
end
---Open URL with default system browser (if available)
---@param url string
---@return nil
function M.OpenURL(url)
C.OpenURL(url)
end
---Set the current threshold (minimum) log level
---@param logLevel integer
---@return nil
function M.SetTraceLogLevel(logLevel)
C.SetTraceLogLevel(logLevel)
end
---Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
---@param level integer
---@param fmt string
---@param ... any
---@return nil
function M.TraceLog(level, fmt, ...)
if select("#", ...) == 0 then
C.TraceLog(level, "%s", fmt)
else
C.TraceLog(level, "%s", string_format(fmt, ...))
end
end
---Internal memory allocator
---@param size integer
---@return ffi.cdata*
function M.MemAlloc(size)
return C.MemAlloc(size)
end
---Internal memory reallocator
---@param ptr ffi.cdata*|string
---@param size integer
---@return ffi.cdata*
function M.MemRealloc(ptr, size)
local _a1
if type(ptr) == "string" then _a1 = ffi.cast("const void *", ptr)
else _a1 = ptr end
return C.MemRealloc(_a1, size)
end
---Internal memory free
---@param ptr ffi.cdata*|string
---@return nil
function M.MemFree(ptr)
local _a1
if type(ptr) == "string" then _a1 = ffi.cast("const void *", ptr)
else _a1 = ptr end
C.MemFree(_a1)
end
---Load file data as byte array (read)
---@param fileName string
---@param dataSize ffi.cdata*
---@return ffi.cdata*
function M.LoadFileData(fileName, dataSize)
return C.LoadFileData(fileName, dataSize)
end
---Unload file data allocated by LoadFileData()
---@param data ffi.cdata*
---@return nil
function M.UnloadFileData(data)
C.UnloadFileData(data)
end
---Save data to file from byte array (write), returns true on success
---@param fileName string
---@param data ffi.cdata*|string
---@param dataSize integer
---@return boolean
function M.SaveFileData(fileName, data, dataSize)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
return C.SaveFileData(fileName, _a2, dataSize)
end
---Export data to code (.h), returns true on success
---@param data string|integer[]
---@param dataSize integer
---@param fileName string
---@return boolean
function M.ExportDataAsCode(data, dataSize, fileName)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
return C.ExportDataAsCode(_a1, dataSize, fileName)
end
---Load text data from file (read), returns a '\0' terminated string
---@param fileName string
---@return string|nil
function M.LoadFileText(fileName)
local _p = C.LoadFileText(fileName)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
C.UnloadFileText(_p)
return _s
end
---Unload file text data allocated by LoadFileText()
---@param text raylib.char_buffer|string
---@return nil
function M.UnloadFileText(text)
C.UnloadFileText(text)
end
---Save text data to file (write), string must be '\0' terminated, returns true on success
---@param fileName string
---@param text string
---@return boolean
function M.SaveFileText(fileName, text)
return C.SaveFileText(fileName, text)
end
---Set custom file binary data loader
---@param callback raylib.LoadFileDataCallback
---@return nil
function M.SetLoadFileDataCallback(callback)
local _cb1 = pin("LoadFileDataCallback", callback)
C.SetLoadFileDataCallback(_cb1)
end
---Set custom file binary data saver
---@param callback raylib.SaveFileDataCallback
---@return nil
function M.SetSaveFileDataCallback(callback)
local _cb1 = pin("SaveFileDataCallback", callback)
C.SetSaveFileDataCallback(_cb1)
end
---Set custom file text data loader
---@param callback raylib.LoadFileTextCallback
---@return nil
function M.SetLoadFileTextCallback(callback)
local _cb1 = pin("LoadFileTextCallback", callback)
C.SetLoadFileTextCallback(_cb1)
end
---Set custom file text data saver
---@param callback raylib.SaveFileTextCallback
---@return nil
function M.SetSaveFileTextCallback(callback)
local _cb1 = pin("SaveFileTextCallback", callback)
C.SetSaveFileTextCallback(_cb1)
end
---Rename file (if exists), returns 0 on success
---@param fileName string
---@param fileRename string
---@return integer
function M.FileRename(fileName, fileRename)
return C.FileRename(fileName, fileRename)
end
---Remove file (if exists), returns 0 on success
---@param fileName string
---@return integer
function M.FileRemove(fileName)
return C.FileRemove(fileName)
end
---Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success
---@param srcPath string
---@param dstPath string
---@return integer
function M.FileCopy(srcPath, dstPath)
return C.FileCopy(srcPath, dstPath)
end
---Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success
---@param srcPath string
---@param dstPath string
---@return integer
function M.FileMove(srcPath, dstPath)
return C.FileMove(srcPath, dstPath)
end
---Replace text in an existing file, returns 0 on success
---@param fileName string
---@param search string
---@param replacement string
---@return integer
function M.FileTextReplace(fileName, search, replacement)
return C.FileTextReplace(fileName, search, replacement)
end
---Find text in existing file, returns -1 if index not found or index otherwise
---@param fileName string
---@param search string
---@return integer
function M.FileTextFindIndex(fileName, search)
return C.FileTextFindIndex(fileName, search)
end
---Check if file exists
---@param fileName string
---@return boolean
function M.FileExists(fileName)
return C.FileExists(fileName)
end
---Check if directory path exists
---@param dirPath string
---@return boolean
function M.DirectoryExists(dirPath)
return C.DirectoryExists(dirPath)
end
---Check file extension (recommended include point: .png, .wav)
---@param fileName string
---@param ext string
---@return boolean
function M.IsFileExtension(fileName, ext)
return C.IsFileExtension(fileName, ext)
end
---Check if file path (file or directory) is hidden by OS
---@param filePath string
---@return boolean
function M.IsFileHidden(filePath)
return C.IsFileHidden(filePath)
end
---Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
---@param fileName string
---@return integer
function M.GetFileLength(fileName)
return C.GetFileLength(fileName)
end
---Get file modification time (last write time)
---@param fileName string
---@return integer
function M.GetFileModTime(fileName)
return C.GetFileModTime(fileName)
end
---Get pointer to extension for a filename string (includes dot: '.png')
---@param fileName string
---@return string|nil
function M.GetFileExtension(fileName)
local _p = C.GetFileExtension(fileName)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get pointer to filename for a path string
---@param filePath string
---@return string|nil
function M.GetFileName(filePath)
local _p = C.GetFileName(filePath)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get filename string without extension (uses static string)
---@param filePath string
---@return string|nil
function M.GetFileNameWithoutExt(filePath)
local _p = C.GetFileNameWithoutExt(filePath)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get full path for a provided fileName with path (uses static string)
---@param filePath string
---@return string|nil
function M.GetDirectoryPath(filePath)
local _p = C.GetDirectoryPath(filePath)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get previous directory path for a provided path (uses static string)
---@param dirPath string
---@return string|nil
function M.GetPrevDirectoryPath(dirPath)
local _p = C.GetPrevDirectoryPath(dirPath)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get current working directory (uses static string)
---@return string|nil
function M.GetWorkingDirectory()
local _p = C.GetWorkingDirectory()
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get the directory of the running application (uses static string)
---@return string|nil
function M.GetApplicationDirectory()
local _p = C.GetApplicationDirectory()
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Create directories (including full path requested), returns 0 on success
---@param dirPath string
---@return integer
function M.MakeDirectory(dirPath)
return C.MakeDirectory(dirPath)
end
---Change working directory, returns 0 on success
---@param dirPath string
---@return integer
function M.ChangeDirectory(dirPath)
return C.ChangeDirectory(dirPath)
end
---Check if provided path points to a file
---@param path string
---@return boolean
function M.IsPathFile(path)
return C.IsPathFile(path)
end
---Check if provided path points to a directory
---@param path string
---@return boolean
function M.IsPathDirectory(path)
return C.IsPathDirectory(path)
end
---Check if provided path is an absolute path
---@param path string
---@return boolean
function M.IsPathAbsolute(path)
return C.IsPathAbsolute(path)
end
---Check if fileName is valid for the platform/OS
---@param fileName string
---@return boolean
function M.IsFileNameValid(fileName)
return C.IsFileNameValid(fileName)
end
---Load directory filepaths, files and directories, no subdirs scan
---@param dirPath string
---@return raylib.FilePathList
function M.LoadDirectoryFiles(dirPath)
return C.LoadDirectoryFiles(dirPath)
end
---Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'
---@param basePath string
---@param filter string
---@param scanSubdirs boolean
---@return raylib.FilePathList
function M.LoadDirectoryFilesEx(basePath, filter, scanSubdirs)
return C.LoadDirectoryFilesEx(basePath, filter, scanSubdirs)
end
---Unload filepaths
---@param files raylib.FilePathList
---@return nil
function M.UnloadDirectoryFiles(files)
C.UnloadDirectoryFiles(files)
end
---Check if file has been dropped into window
---@return boolean
function M.IsFileDropped()
return C.IsFileDropped()
end
---Load dropped filepaths
---@return raylib.FilePathList
function M.LoadDroppedFiles()
return C.LoadDroppedFiles()
end
---Unload dropped filepaths
---@param files raylib.FilePathList
---@return nil
function M.UnloadDroppedFiles(files)
C.UnloadDroppedFiles(files)
end
---Get the file count in a directory
---@param dirPath string
---@return integer
function M.GetDirectoryFileCount(dirPath)
return C.GetDirectoryFileCount(dirPath)
end
---Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
---@param basePath string
---@param filter string
---@param scanSubdirs boolean
---@return integer
function M.GetDirectoryFileCountEx(basePath, filter, scanSubdirs)
return C.GetDirectoryFileCountEx(basePath, filter, scanSubdirs)
end
---Compress data (DEFLATE algorithm), memory must be MemFree()
---@param data string|integer[]
---@param dataSize integer
---@param compDataSize ffi.cdata*
---@return ffi.cdata*
function M.CompressData(data, dataSize, compDataSize)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
return C.CompressData(_a1, dataSize, compDataSize)
end
---Decompress data (DEFLATE algorithm), memory must be MemFree()
---@param compData string|integer[]
---@param compDataSize integer
---@param dataSize ffi.cdata*
---@return ffi.cdata*
function M.DecompressData(compData, compDataSize, dataSize)
local _a1
if type(compData) == "string" then _a1 = ffi.cast("const unsigned char *", compData)
elseif type(compData) == "table" then _a1 = to_array("unsigned char", compData)
else _a1 = compData end
return C.DecompressData(_a1, compDataSize, dataSize)
end
---Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
---@param data string|integer[]
---@param dataSize integer
---@param outputSize ffi.cdata*
---@return string|nil
function M.EncodeDataBase64(data, dataSize, outputSize)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
local _p = C.EncodeDataBase64(_a1, dataSize, outputSize)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
C.MemFree(_p)
return _s
end
---Decode Base64 string (expected NULL terminated), memory must be MemFree()
---@param text string
---@param outputSize ffi.cdata*
---@return ffi.cdata*
function M.DecodeDataBase64(text, outputSize)
return C.DecodeDataBase64(text, outputSize)
end
---Compute CRC32 hash code
---@param data string|integer[]
---@param dataSize integer
---@return integer
function M.ComputeCRC32(data, dataSize)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
return C.ComputeCRC32(_a1, dataSize)
end
---Compute MD5 hash code, returns static int[4] (16 bytes)
---@param data string|integer[]
---@param dataSize integer
---@return ffi.cdata*
function M.ComputeMD5(data, dataSize)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
return C.ComputeMD5(_a1, dataSize)
end
---Compute SHA1 hash code, returns static int[5] (20 bytes)
---@param data string|integer[]
---@param dataSize integer
---@return ffi.cdata*
function M.ComputeSHA1(data, dataSize)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
return C.ComputeSHA1(_a1, dataSize)
end
---Compute SHA256 hash code, returns static int[8] (32 bytes)
---@param data string|integer[]
---@param dataSize integer
---@return ffi.cdata*
function M.ComputeSHA256(data, dataSize)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a1 = to_array("unsigned char", data)
else _a1 = data end
return C.ComputeSHA256(_a1, dataSize)
end
---Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
---@param fileName string
---@return raylib.AutomationEventList
function M.LoadAutomationEventList(fileName)
return C.LoadAutomationEventList(fileName)
end
---Unload automation events list from file
---@param list raylib.AutomationEventList
---@return nil
function M.UnloadAutomationEventList(list)
C.UnloadAutomationEventList(list)
end
---Export automation events list as text file
---@param list raylib.AutomationEventList
---@param fileName string
---@return boolean
function M.ExportAutomationEventList(list, fileName)
return C.ExportAutomationEventList(list, fileName)
end
---Set automation event list to record to
---@param list raylib.AutomationEventList
---@return raylib.AutomationEventList
function M.SetAutomationEventList(list)
local _o1 = ffi.new("AutomationEventList[1]", list)
C.SetAutomationEventList(_o1)
return _o1[0]
end
---Set automation event internal base frame to start recording
---@param frame integer
---@return nil
function M.SetAutomationEventBaseFrame(frame)
C.SetAutomationEventBaseFrame(frame)
end
---Start recording automation events (AutomationEventList must be set)
---@return nil
function M.StartAutomationEventRecording()
C.StartAutomationEventRecording()
end
---Stop recording automation events
---@return nil
function M.StopAutomationEventRecording()
C.StopAutomationEventRecording()
end
---Play a recorded automation event
---@param event raylib.AutomationEvent
---@return nil
function M.PlayAutomationEvent(event)
C.PlayAutomationEvent(event)
end
---Check if key has been pressed once
---@param key integer
---@return boolean
function M.IsKeyPressed(key)
return C.IsKeyPressed(key)
end
---Check if key has been pressed again
---@param key integer
---@return boolean
function M.IsKeyPressedRepeat(key)
return C.IsKeyPressedRepeat(key)
end
---Check if key is being pressed
---@param key integer
---@return boolean
function M.IsKeyDown(key)
return C.IsKeyDown(key)
end
---Check if key has been released once
---@param key integer
---@return boolean
function M.IsKeyReleased(key)
return C.IsKeyReleased(key)
end
---Check if key is NOT being pressed
---@param key integer
---@return boolean
function M.IsKeyUp(key)
return C.IsKeyUp(key)
end
---Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
---@return integer
function M.GetKeyPressed()
return C.GetKeyPressed()
end
---Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
---@return integer
function M.GetCharPressed()
return C.GetCharPressed()
end
---Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)
---@param key integer
---@return string|nil
function M.GetKeyName(key)
local _p = C.GetKeyName(key)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Set a custom key to exit program (default is ESC)
---@param key integer
---@return nil
function M.SetExitKey(key)
C.SetExitKey(key)
end
---Check if gamepad is available
---@param gamepad integer
---@return boolean
function M.IsGamepadAvailable(gamepad)
return C.IsGamepadAvailable(gamepad)
end
---Get gamepad internal name id
---@param gamepad integer
---@return string|nil
function M.GetGamepadName(gamepad)
local _p = C.GetGamepadName(gamepad)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Check if gamepad button has been pressed once
---@param gamepad integer
---@param button integer
---@return boolean
function M.IsGamepadButtonPressed(gamepad, button)
return C.IsGamepadButtonPressed(gamepad, button)
end
---Check if gamepad button is being pressed
---@param gamepad integer
---@param button integer
---@return boolean
function M.IsGamepadButtonDown(gamepad, button)
return C.IsGamepadButtonDown(gamepad, button)
end
---Check if gamepad button has been released once
---@param gamepad integer
---@param button integer
---@return boolean
function M.IsGamepadButtonReleased(gamepad, button)
return C.IsGamepadButtonReleased(gamepad, button)
end
---Check if gamepad button is NOT being pressed
---@param gamepad integer
---@param button integer
---@return boolean
function M.IsGamepadButtonUp(gamepad, button)
return C.IsGamepadButtonUp(gamepad, button)
end
---Get the last gamepad button pressed
---@return integer
function M.GetGamepadButtonPressed()
return C.GetGamepadButtonPressed()
end
---Get axis count for a gamepad
---@param gamepad integer
---@return integer
function M.GetGamepadAxisCount(gamepad)
return C.GetGamepadAxisCount(gamepad)
end
---Get movement value for a gamepad axis
---@param gamepad integer
---@param axis integer
---@return number
function M.GetGamepadAxisMovement(gamepad, axis)
return C.GetGamepadAxisMovement(gamepad, axis)
end
---Set internal gamepad mappings (SDL_GameControllerDB)
---@param mappings string
---@return integer
function M.SetGamepadMappings(mappings)
return C.SetGamepadMappings(mappings)
end
---Set gamepad vibration for both motors (duration in seconds)
---@param gamepad integer
---@param leftMotor number
---@param rightMotor number
---@param duration number
---@return nil
function M.SetGamepadVibration(gamepad, leftMotor, rightMotor, duration)
C.SetGamepadVibration(gamepad, leftMotor, rightMotor, duration)
end
---Check if mouse button has been pressed once
---@param button integer
---@return boolean
function M.IsMouseButtonPressed(button)
return C.IsMouseButtonPressed(button)
end
---Check if mouse button is being pressed
---@param button integer
---@return boolean
function M.IsMouseButtonDown(button)
return C.IsMouseButtonDown(button)
end
---Check if mouse button has been released once
---@param button integer
---@return boolean
function M.IsMouseButtonReleased(button)
return C.IsMouseButtonReleased(button)
end
---Check if mouse button is NOT being pressed
---@param button integer
---@return boolean
function M.IsMouseButtonUp(button)
return C.IsMouseButtonUp(button)
end
---Get mouse position X
---@return integer
function M.GetMouseX()
return C.GetMouseX()
end
---Get mouse position Y
---@return integer
function M.GetMouseY()
return C.GetMouseY()
end
---Get mouse position XY
---@return raylib.Vector2
function M.GetMousePosition()
return C.GetMousePosition()
end
---Get mouse delta between frames
---@return raylib.Vector2
function M.GetMouseDelta()
return C.GetMouseDelta()
end
---Set mouse position XY
---@param x integer
---@param y integer
---@return nil
function M.SetMousePosition(x, y)
C.SetMousePosition(x, y)
end
---Set mouse offset
---@param offsetX integer
---@param offsetY integer
---@return nil
function M.SetMouseOffset(offsetX, offsetY)
C.SetMouseOffset(offsetX, offsetY)
end
---Set mouse scaling
---@param scaleX number
---@param scaleY number
---@return nil
function M.SetMouseScale(scaleX, scaleY)
C.SetMouseScale(scaleX, scaleY)
end
---Get mouse wheel movement for X or Y, whichever is larger
---@return number
function M.GetMouseWheelMove()
return C.GetMouseWheelMove()
end
---Get mouse wheel movement for both X and Y
---@return raylib.Vector2
function M.GetMouseWheelMoveV()
return C.GetMouseWheelMoveV()
end
---Set mouse cursor
---@param cursor integer
---@return nil
function M.SetMouseCursor(cursor)
C.SetMouseCursor(cursor)
end
---Get touch position X for touch point 0 (relative to screen size)
---@return integer
function M.GetTouchX()
return C.GetTouchX()
end
---Get touch position Y for touch point 0 (relative to screen size)
---@return integer
function M.GetTouchY()
return C.GetTouchY()
end
---Get touch position XY for a touch point index (relative to screen size)
---@param index integer
---@return raylib.Vector2
function M.GetTouchPosition(index)
return C.GetTouchPosition(index)
end
---Get touch point identifier for provided index
---@param index integer
---@return integer
function M.GetTouchPointId(index)
return C.GetTouchPointId(index)
end
---Get number of touch points
---@return integer
function M.GetTouchPointCount()
return C.GetTouchPointCount()
end
---Enable a set of gestures using flags
---@param flags integer
---@return nil
function M.SetGesturesEnabled(flags)
C.SetGesturesEnabled(flags)
end
---Check if gesture has been detected
---@param gesture integer
---@return boolean
function M.IsGestureDetected(gesture)
return C.IsGestureDetected(gesture)
end
---Get latest detected gesture
---@return integer
function M.GetGestureDetected()
return C.GetGestureDetected()
end
---Get gesture hold time in seconds
---@return number
function M.GetGestureHoldDuration()
return C.GetGestureHoldDuration()
end
---Get gesture drag vector
---@return raylib.Vector2
function M.GetGestureDragVector()
return C.GetGestureDragVector()
end
---Get gesture drag angle
---@return number
function M.GetGestureDragAngle()
return C.GetGestureDragAngle()
end
---Get gesture pinch delta
---@return raylib.Vector2
function M.GetGesturePinchVector()
return C.GetGesturePinchVector()
end
---Get gesture pinch angle
---@return number
function M.GetGesturePinchAngle()
return C.GetGesturePinchAngle()
end
---Update camera position for selected mode
---@param camera raylib.Camera
---@param mode integer
---@return raylib.Camera
function M.UpdateCamera(camera, mode)
local _o1 = ffi.new("Camera[1]", camera)
C.UpdateCamera(_o1, mode)
return _o1[0]
end
---Update camera movement/rotation
---@param camera raylib.Camera
---@param movement raylib.Vector3
---@param rotation raylib.Vector3
---@param zoom number
---@return raylib.Camera
function M.UpdateCameraPro(camera, movement, rotation, zoom)
local _o1 = ffi.new("Camera[1]", camera)
C.UpdateCameraPro(_o1, movement, rotation, zoom)
return _o1[0]
end
---Set texture and rectangle to be used on shapes drawing
---@param texture raylib.Texture2D
---@param rec raylib.Rectangle
---@return nil
function M.SetShapesTexture(texture, rec)
C.SetShapesTexture(texture, rec)
end
---Get texture that is used for shapes drawing
---@return raylib.Texture2D
function M.GetShapesTexture()
return C.GetShapesTexture()
end
---Get texture source rectangle that is used for shapes drawing
---@return raylib.Rectangle
function M.GetShapesTextureRectangle()
return C.GetShapesTextureRectangle()
end
---Draw a pixel using geometry [Can be slow, use with care]
---@param posX integer
---@param posY integer
---@param color raylib.Color
---@return nil
function M.DrawPixel(posX, posY, color)
C.DrawPixel(posX, posY, color)
end
---Draw a pixel using geometry (Vector version) [Can be slow, use with care]
---@param position raylib.Vector2
---@param color raylib.Color
---@return nil
function M.DrawPixelV(position, color)
C.DrawPixelV(position, color)
end
---Draw a line
---@param startPosX integer
---@param startPosY integer
---@param endPosX integer
---@param endPosY integer
---@param color raylib.Color
---@return nil
function M.DrawLine(startPosX, startPosY, endPosX, endPosY, color)
C.DrawLine(startPosX, startPosY, endPosX, endPosY, color)
end
---Draw a line (using gl lines)
---@param startPos raylib.Vector2
---@param endPos raylib.Vector2
---@param color raylib.Color
---@return nil
function M.DrawLineV(startPos, endPos, color)
C.DrawLineV(startPos, endPos, color)
end
---Draw a line (using triangles/quads)
---@param startPos raylib.Vector2
---@param endPos raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawLineEx(startPos, endPos, thick, color)
C.DrawLineEx(startPos, endPos, thick, color)
end
---Draw lines sequence (using gl lines)
---@param points raylib.Vector2[]
---@param pointCount integer
---@param color raylib.Color
---@return nil
function M.DrawLineStrip(points, pointCount, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawLineStrip(_a1, pointCount, color)
end
---Draw line segment cubic-bezier in-out interpolation
---@param startPos raylib.Vector2
---@param endPos raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawLineBezier(startPos, endPos, thick, color)
C.DrawLineBezier(startPos, endPos, thick, color)
end
---Draw a dashed line
---@param startPos raylib.Vector2
---@param endPos raylib.Vector2
---@param dashSize integer
---@param spaceSize integer
---@param color raylib.Color
---@return nil
function M.DrawLineDashed(startPos, endPos, dashSize, spaceSize, color)
C.DrawLineDashed(startPos, endPos, dashSize, spaceSize, color)
end
---Draw a color-filled triangle, counter-clockwise vertex order
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param color raylib.Color
---@return nil
function M.DrawTriangle(v1, v2, v3, color)
C.DrawTriangle(v1, v2, v3, color)
end
---Draw triangle with interpolated colors, counter-clockwise vertex/color order
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param c1 raylib.Color
---@param c2 raylib.Color
---@param c3 raylib.Color
---@return nil
function M.DrawTriangleGradient(v1, v2, v3, c1, c2, c3)
C.DrawTriangleGradient(v1, v2, v3, c1, c2, c3)
end
---Draw triangle outline, counter-clockwise vertex order
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param color raylib.Color
---@return nil
function M.DrawTriangleLines(v1, v2, v3, color)
C.DrawTriangleLines(v1, v2, v3, color)
end
---Draw triangle outline with line thickness, counter-clockwise vertex order
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawTriangleLinesEx(v1, v2, v3, thick, color)
C.DrawTriangleLinesEx(v1, v2, v3, thick, color)
end
---Draw a triangle fan defined by points (first vertex is the center)
---@param points raylib.Vector2[]
---@param pointCount integer
---@param color raylib.Color
---@return nil
function M.DrawTriangleFan(points, pointCount, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawTriangleFan(_a1, pointCount, color)
end
---Draw a triangle strip defined by points
---@param points raylib.Vector2[]
---@param pointCount integer
---@param color raylib.Color
---@return nil
function M.DrawTriangleStrip(points, pointCount, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawTriangleStrip(_a1, pointCount, color)
end
---Draw a color-filled rectangle
---@param posX integer
---@param posY integer
---@param width integer
---@param height integer
---@param color raylib.Color
---@return nil
function M.DrawRectangle(posX, posY, width, height, color)
C.DrawRectangle(posX, posY, width, height, color)
end
---Draw a color-filled rectangle (Vector version)
---@param position raylib.Vector2
---@param size raylib.Vector2
---@param color raylib.Color
---@return nil
function M.DrawRectangleV(position, size, color)
C.DrawRectangleV(position, size, color)
end
---Draw a color-filled rectangle
---@param rec raylib.Rectangle
---@param color raylib.Color
---@return nil
function M.DrawRectangleRec(rec, color)
C.DrawRectangleRec(rec, color)
end
---Draw a color-filled rectangle with pro parameters
---@param rec raylib.Rectangle
---@param origin raylib.Vector2
---@param rotation number
---@param color raylib.Color
---@return nil
function M.DrawRectanglePro(rec, origin, rotation, color)
C.DrawRectanglePro(rec, origin, rotation, color)
end
---Draw a vertical-gradient-filled rectangle
---@param posX integer
---@param posY integer
---@param width integer
---@param height integer
---@param top raylib.Color
---@param bottom raylib.Color
---@return nil
function M.DrawRectangleGradientV(posX, posY, width, height, top, bottom)
C.DrawRectangleGradientV(posX, posY, width, height, top, bottom)
end
---Draw a horizontal-gradient-filled rectangle
---@param posX integer
---@param posY integer
---@param width integer
---@param height integer
---@param left raylib.Color
---@param right raylib.Color
---@return nil
function M.DrawRectangleGradientH(posX, posY, width, height, left, right)
C.DrawRectangleGradientH(posX, posY, width, height, left, right)
end
---Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order
---@param rec raylib.Rectangle
---@param col1 raylib.Color
---@param col2 raylib.Color
---@param col3 raylib.Color
---@param col4 raylib.Color
---@return nil
function M.DrawRectangleGradientEx(rec, col1, col2, col3, col4)
C.DrawRectangleGradientEx(rec, col1, col2, col3, col4)
end
---Draw rectangle outline
---@param posX integer
---@param posY integer
---@param width integer
---@param height integer
---@param color raylib.Color
---@return nil
function M.DrawRectangleLines(posX, posY, width, height, color)
C.DrawRectangleLines(posX, posY, width, height, color)
end
---Draw rectangle outline with line thickness
---@param rec raylib.Rectangle
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawRectangleLinesEx(rec, thick, color)
C.DrawRectangleLinesEx(rec, thick, color)
end
---Draw rectangle with rounded edges
---@param rec raylib.Rectangle
---@param roundness number
---@param segments integer
---@param color raylib.Color
---@return nil
function M.DrawRectangleRounded(rec, roundness, segments, color)
C.DrawRectangleRounded(rec, roundness, segments, color)
end
---Draw rectangle lines with rounded edges
---@param rec raylib.Rectangle
---@param roundness number
---@param segments integer
---@param color raylib.Color
---@return nil
function M.DrawRectangleRoundedLines(rec, roundness, segments, color)
C.DrawRectangleRoundedLines(rec, roundness, segments, color)
end
---Draw rectangle lines with rounded edges outline and line thickness
---@param rec raylib.Rectangle
---@param roundness number
---@param segments integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawRectangleRoundedLinesEx(rec, roundness, segments, thick, color)
C.DrawRectangleRoundedLinesEx(rec, roundness, segments, thick, color)
end
---Draw a polygon of n sides
---@param center raylib.Vector2
---@param sides integer
---@param radius number
---@param rotation number
---@param color raylib.Color
---@return nil
function M.DrawPoly(center, sides, radius, rotation, color)
C.DrawPoly(center, sides, radius, rotation, color)
end
---Draw a polygon outline of n sides
---@param center raylib.Vector2
---@param sides integer
---@param radius number
---@param rotation number
---@param color raylib.Color
---@return nil
function M.DrawPolyLines(center, sides, radius, rotation, color)
C.DrawPolyLines(center, sides, radius, rotation, color)
end
---Draw a polygon outline of n sides with line thickness
---@param center raylib.Vector2
---@param sides integer
---@param radius number
---@param rotation number
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawPolyLinesEx(center, sides, radius, rotation, thick, color)
C.DrawPolyLinesEx(center, sides, radius, rotation, thick, color)
end
---Draw a color-filled circle
---@param centerX integer
---@param centerY integer
---@param radius number
---@param color raylib.Color
---@return nil
function M.DrawCircle(centerX, centerY, radius, color)
C.DrawCircle(centerX, centerY, radius, color)
end
---Draw a color-filled circle (Vector version)
---@param center raylib.Vector2
---@param radius number
---@param color raylib.Color
---@return nil
function M.DrawCircleV(center, radius, color)
C.DrawCircleV(center, radius, color)
end
---Draw a gradient-filled circle
---@param center raylib.Vector2
---@param radius number
---@param inner raylib.Color
---@param outer raylib.Color
---@return nil
function M.DrawCircleGradient(center, radius, inner, outer)
C.DrawCircleGradient(center, radius, inner, outer)
end
---Draw a piece of a circle
---@param center raylib.Vector2
---@param radius number
---@param startAngle number
---@param endAngle number
---@param segments integer
---@param color raylib.Color
---@return nil
function M.DrawCircleSector(center, radius, startAngle, endAngle, segments, color)
C.DrawCircleSector(center, radius, startAngle, endAngle, segments, color)
end
---Draw circle sector outline
---@param center raylib.Vector2
---@param radius number
---@param startAngle number
---@param endAngle number
---@param segments integer
---@param color raylib.Color
---@return nil
function M.DrawCircleSectorLines(center, radius, startAngle, endAngle, segments, color)
C.DrawCircleSectorLines(center, radius, startAngle, endAngle, segments, color)
end
---Draw circle sector outline with thickness
---@param center raylib.Vector2
---@param radius number
---@param startAngle number
---@param endAngle number
---@param segments integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawCircleSectorLinesEx(center, radius, startAngle, endAngle, segments, thick, color)
C.DrawCircleSectorLinesEx(center, radius, startAngle, endAngle, segments, thick, color)
end
---Draw circle outline
---@param centerX integer
---@param centerY integer
---@param radius number
---@param color raylib.Color
---@return nil
function M.DrawCircleLines(centerX, centerY, radius, color)
C.DrawCircleLines(centerX, centerY, radius, color)
end
---Draw circle outline (Vector version)
---@param center raylib.Vector2
---@param radius number
---@param color raylib.Color
---@return nil
function M.DrawCircleLinesV(center, radius, color)
C.DrawCircleLinesV(center, radius, color)
end
---Draw circle outline with line thickness
---@param center raylib.Vector2
---@param radius number
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawCircleLinesEx(center, radius, thick, color)
C.DrawCircleLinesEx(center, radius, thick, color)
end
---Draw ellipse
---@param centerX integer
---@param centerY integer
---@param radiusH number
---@param radiusV number
---@param color raylib.Color
---@return nil
function M.DrawEllipse(centerX, centerY, radiusH, radiusV, color)
C.DrawEllipse(centerX, centerY, radiusH, radiusV, color)
end
---Draw ellipse (Vector version)
---@param center raylib.Vector2
---@param radiusH number
---@param radiusV number
---@param color raylib.Color
---@return nil
function M.DrawEllipseV(center, radiusH, radiusV, color)
C.DrawEllipseV(center, radiusH, radiusV, color)
end
---Draw ellipse outline
---@param centerX integer
---@param centerY integer
---@param radiusH number
---@param radiusV number
---@param color raylib.Color
---@return nil
function M.DrawEllipseLines(centerX, centerY, radiusH, radiusV, color)
C.DrawEllipseLines(centerX, centerY, radiusH, radiusV, color)
end
---Draw ellipse outline (Vector version)
---@param center raylib.Vector2
---@param radiusH number
---@param radiusV number
---@param color raylib.Color
---@return nil
function M.DrawEllipseLinesV(center, radiusH, radiusV, color)
C.DrawEllipseLinesV(center, radiusH, radiusV, color)
end
---Draw ellipse outline with line thickness
---@param center raylib.Vector2
---@param radiusH number
---@param radiusV number
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawEllipseLinesEx(center, radiusH, radiusV, thick, color)
C.DrawEllipseLinesEx(center, radiusH, radiusV, thick, color)
end
---Draw ring
---@param center raylib.Vector2
---@param innerRadius number
---@param outerRadius number
---@param startAngle number
---@param endAngle number
---@param segments integer
---@param color raylib.Color
---@return nil
function M.DrawRing(center, innerRadius, outerRadius, startAngle, endAngle, segments, color)
C.DrawRing(center, innerRadius, outerRadius, startAngle, endAngle, segments, color)
end
---Draw ring outline
---@param center raylib.Vector2
---@param innerRadius number
---@param outerRadius number
---@param startAngle number
---@param endAngle number
---@param segments integer
---@param color raylib.Color
---@return nil
function M.DrawRingLines(center, innerRadius, outerRadius, startAngle, endAngle, segments, color)
C.DrawRingLines(center, innerRadius, outerRadius, startAngle, endAngle, segments, color)
end
---Draw ring outline with line thickness
---@param center raylib.Vector2
---@param innerRadius number
---@param outerRadius number
---@param startAngle number
---@param endAngle number
---@param segments integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawRingLinesEx(center, innerRadius, outerRadius, startAngle, endAngle, segments, thick, color)
C.DrawRingLinesEx(center, innerRadius, outerRadius, startAngle, endAngle, segments, thick, color)
end
---Draw spline: Linear, minimum 2 points
---@param points raylib.Vector2[]
---@param pointCount integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineLinear(points, pointCount, thick, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawSplineLinear(_a1, pointCount, thick, color)
end
---Draw spline: B-Spline, minimum 4 points
---@param points raylib.Vector2[]
---@param pointCount integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineBasis(points, pointCount, thick, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawSplineBasis(_a1, pointCount, thick, color)
end
---Draw spline: Catmull-Rom, minimum 4 points
---@param points raylib.Vector2[]
---@param pointCount integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineCatmullRom(points, pointCount, thick, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawSplineCatmullRom(_a1, pointCount, thick, color)
end
---Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
---@param points raylib.Vector2[]
---@param pointCount integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineBezierQuadratic(points, pointCount, thick, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawSplineBezierQuadratic(_a1, pointCount, thick, color)
end
---Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
---@param points raylib.Vector2[]
---@param pointCount integer
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineBezierCubic(points, pointCount, thick, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector2", points)
else _a1 = points end
C.DrawSplineBezierCubic(_a1, pointCount, thick, color)
end
---Draw spline segment: Linear, 2 points
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineSegmentLinear(p1, p2, thick, color)
C.DrawSplineSegmentLinear(p1, p2, thick, color)
end
---Draw spline segment: B-Spline, 4 points
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param p3 raylib.Vector2
---@param p4 raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineSegmentBasis(p1, p2, p3, p4, thick, color)
C.DrawSplineSegmentBasis(p1, p2, p3, p4, thick, color)
end
---Draw spline segment: Catmull-Rom, 4 points
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param p3 raylib.Vector2
---@param p4 raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineSegmentCatmullRom(p1, p2, p3, p4, thick, color)
C.DrawSplineSegmentCatmullRom(p1, p2, p3, p4, thick, color)
end
---Draw spline segment: Quadratic Bezier, 2 points, 1 control point
---@param p1 raylib.Vector2
---@param c2 raylib.Vector2
---@param p3 raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineSegmentBezierQuadratic(p1, c2, p3, thick, color)
C.DrawSplineSegmentBezierQuadratic(p1, c2, p3, thick, color)
end
---Draw spline segment: Cubic Bezier, 2 points, 2 control points
---@param p1 raylib.Vector2
---@param c2 raylib.Vector2
---@param c3 raylib.Vector2
---@param p4 raylib.Vector2
---@param thick number
---@param color raylib.Color
---@return nil
function M.DrawSplineSegmentBezierCubic(p1, c2, c3, p4, thick, color)
C.DrawSplineSegmentBezierCubic(p1, c2, c3, p4, thick, color)
end
---Get (evaluate) spline point: Linear
---@param startPos raylib.Vector2
---@param endPos raylib.Vector2
---@param t number
---@return raylib.Vector2
function M.GetSplinePointLinear(startPos, endPos, t)
return C.GetSplinePointLinear(startPos, endPos, t)
end
---Get (evaluate) spline point: B-Spline
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param p3 raylib.Vector2
---@param p4 raylib.Vector2
---@param t number
---@return raylib.Vector2
function M.GetSplinePointBasis(p1, p2, p3, p4, t)
return C.GetSplinePointBasis(p1, p2, p3, p4, t)
end
---Get (evaluate) spline point: Catmull-Rom
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param p3 raylib.Vector2
---@param p4 raylib.Vector2
---@param t number
---@return raylib.Vector2
function M.GetSplinePointCatmullRom(p1, p2, p3, p4, t)
return C.GetSplinePointCatmullRom(p1, p2, p3, p4, t)
end
---Get (evaluate) spline point: Quadratic Bezier
---@param p1 raylib.Vector2
---@param c2 raylib.Vector2
---@param p3 raylib.Vector2
---@param t number
---@return raylib.Vector2
function M.GetSplinePointBezierQuadratic(p1, c2, p3, t)
return C.GetSplinePointBezierQuadratic(p1, c2, p3, t)
end
---Get (evaluate) spline point: Cubic Bezier
---@param p1 raylib.Vector2
---@param c2 raylib.Vector2
---@param c3 raylib.Vector2
---@param p4 raylib.Vector2
---@param t number
---@return raylib.Vector2
function M.GetSplinePointBezierCubic(p1, c2, c3, p4, t)
return C.GetSplinePointBezierCubic(p1, c2, c3, p4, t)
end
---Check collision between two rectangles
---@param rec1 raylib.Rectangle
---@param rec2 raylib.Rectangle
---@return boolean
function M.CheckCollisionRecs(rec1, rec2)
return C.CheckCollisionRecs(rec1, rec2)
end
---Check collision between two circles
---@param center1 raylib.Vector2
---@param radius1 number
---@param center2 raylib.Vector2
---@param radius2 number
---@return boolean
function M.CheckCollisionCircles(center1, radius1, center2, radius2)
return C.CheckCollisionCircles(center1, radius1, center2, radius2)
end
---Check collision between circle and rectangle
---@param center raylib.Vector2
---@param radius number
---@param rec raylib.Rectangle
---@return boolean
function M.CheckCollisionCircleRec(center, radius, rec)
return C.CheckCollisionCircleRec(center, radius, rec)
end
---Check if circle collides with a line created between two points [p1] and [p2]
---@param center raylib.Vector2
---@param radius number
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@return boolean
function M.CheckCollisionCircleLine(center, radius, p1, p2)
return C.CheckCollisionCircleLine(center, radius, p1, p2)
end
---Check if point is inside rectangle
---@param point raylib.Vector2
---@param rec raylib.Rectangle
---@return boolean
function M.CheckCollisionPointRec(point, rec)
return C.CheckCollisionPointRec(point, rec)
end
---Check if point is inside circle
---@param point raylib.Vector2
---@param center raylib.Vector2
---@param radius number
---@return boolean
function M.CheckCollisionPointCircle(point, center, radius)
return C.CheckCollisionPointCircle(point, center, radius)
end
---Check if point is inside a triangle
---@param point raylib.Vector2
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param p3 raylib.Vector2
---@return boolean
function M.CheckCollisionPointTriangle(point, p1, p2, p3)
return C.CheckCollisionPointTriangle(point, p1, p2, p3)
end
---Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
---@param point raylib.Vector2
---@param p1 raylib.Vector2
---@param p2 raylib.Vector2
---@param threshold integer
---@return boolean
function M.CheckCollisionPointLine(point, p1, p2, threshold)
return C.CheckCollisionPointLine(point, p1, p2, threshold)
end
---Check if point is within a polygon described by array of vertices
---@param point raylib.Vector2
---@param points raylib.Vector2[]
---@param pointCount integer
---@return boolean
function M.CheckCollisionPointPoly(point, points, pointCount)
local _a2
if type(points) == "table" then _a2 = to_array("Vector2", points)
else _a2 = points end
return C.CheckCollisionPointPoly(point, _a2, pointCount)
end
---Check the collision between two lines defined by two points each, returns collision point by reference
---@param startPos1 raylib.Vector2
---@param endPos1 raylib.Vector2
---@param startPos2 raylib.Vector2
---@param endPos2 raylib.Vector2
---@param collisionPoint ffi.cdata*
---@return boolean
function M.CheckCollisionLines(startPos1, endPos1, startPos2, endPos2, collisionPoint)
return C.CheckCollisionLines(startPos1, endPos1, startPos2, endPos2, collisionPoint)
end
---Get collision rectangle for two rectangles collision
---@param rec1 raylib.Rectangle
---@param rec2 raylib.Rectangle
---@return raylib.Rectangle
function M.GetCollisionRec(rec1, rec2)
return C.GetCollisionRec(rec1, rec2)
end
---Load image from file into CPU memory (RAM)
---@param fileName string
---@return raylib.Image
function M.LoadImage(fileName)
return C.LoadImage(fileName)
end
---Load image from RAW file data
---@param fileName string
---@param width integer
---@param height integer
---@param format integer
---@param headerSize integer
---@return raylib.Image
function M.LoadImageRaw(fileName, width, height, format, headerSize)
return C.LoadImageRaw(fileName, width, height, format, headerSize)
end
---Load image sequence from file (frames appended to image.data)
---@param fileName string
---@param frames ffi.cdata*
---@return raylib.Image
function M.LoadImageAnim(fileName, frames)
return C.LoadImageAnim(fileName, frames)
end
---Load image sequence from memory buffer
---@param fileType string
---@param fileData string|integer[]
---@param dataSize integer
---@param frames ffi.cdata*
---@return raylib.Image
function M.LoadImageAnimFromMemory(fileType, fileData, dataSize, frames)
local _a2
if type(fileData) == "string" then _a2 = ffi.cast("const unsigned char *", fileData)
elseif type(fileData) == "table" then _a2 = to_array("unsigned char", fileData)
else _a2 = fileData end
return C.LoadImageAnimFromMemory(fileType, _a2, dataSize, frames)
end
---Load image from memory buffer, fileType refers to extension: i.e. '.png'
---@param fileType string
---@param fileData string|integer[]
---@param dataSize integer
---@return raylib.Image
function M.LoadImageFromMemory(fileType, fileData, dataSize)
local _a2
if type(fileData) == "string" then _a2 = ffi.cast("const unsigned char *", fileData)
elseif type(fileData) == "table" then _a2 = to_array("unsigned char", fileData)
else _a2 = fileData end
return C.LoadImageFromMemory(fileType, _a2, dataSize)
end
---Load image from GPU texture data
---@param texture raylib.Texture2D
---@return raylib.Image
function M.LoadImageFromTexture(texture)
return C.LoadImageFromTexture(texture)
end
---Load image from screen buffer (screenshot)
---@return raylib.Image
function M.LoadImageFromScreen()
return C.LoadImageFromScreen()
end
---Check if an image is valid (data and parameters)
---@param image raylib.Image
---@return boolean
function M.IsImageValid(image)
return C.IsImageValid(image)
end
---Unload image from CPU memory (RAM)
---@param image raylib.Image
---@return nil
function M.UnloadImage(image)
C.UnloadImage(image)
end
---Export image data to file, returns true on success
---@param image raylib.Image
---@param fileName string
---@return boolean
function M.ExportImage(image, fileName)
return C.ExportImage(image, fileName)
end
---Export image to memory buffer, memory must be MemFree()
---@param image raylib.Image
---@param fileType string
---@param fileSize ffi.cdata*
---@return ffi.cdata*
function M.ExportImageToMemory(image, fileType, fileSize)
return C.ExportImageToMemory(image, fileType, fileSize)
end
---Export image as code file defining an array of bytes, returns true on success
---@param image raylib.Image
---@param fileName string
---@return boolean
function M.ExportImageAsCode(image, fileName)
return C.ExportImageAsCode(image, fileName)
end
---Generate image: plain color
---@param width integer
---@param height integer
---@param color raylib.Color
---@return raylib.Image
function M.GenImageColor(width, height, color)
return C.GenImageColor(width, height, color)
end
---Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
---@param width integer
---@param height integer
---@param direction integer
---@param start raylib.Color
---@param end_ raylib.Color
---@return raylib.Image
function M.GenImageGradientLinear(width, height, direction, start, end_)
return C.GenImageGradientLinear(width, height, direction, start, end_)
end
---Generate image: radial gradient
---@param width integer
---@param height integer
---@param density number
---@param inner raylib.Color
---@param outer raylib.Color
---@return raylib.Image
function M.GenImageGradientRadial(width, height, density, inner, outer)
return C.GenImageGradientRadial(width, height, density, inner, outer)
end
---Generate image: square gradient
---@param width integer
---@param height integer
---@param density number
---@param inner raylib.Color
---@param outer raylib.Color
---@return raylib.Image
function M.GenImageGradientSquare(width, height, density, inner, outer)
return C.GenImageGradientSquare(width, height, density, inner, outer)
end
---Generate image: checked
---@param width integer
---@param height integer
---@param checksX integer
---@param checksY integer
---@param col1 raylib.Color
---@param col2 raylib.Color
---@return raylib.Image
function M.GenImageChecked(width, height, checksX, checksY, col1, col2)
return C.GenImageChecked(width, height, checksX, checksY, col1, col2)
end
---Generate image: white noise
---@param width integer
---@param height integer
---@param factor number
---@return raylib.Image
function M.GenImageWhiteNoise(width, height, factor)
return C.GenImageWhiteNoise(width, height, factor)
end
---Generate image: perlin noise
---@param width integer
---@param height integer
---@param offsetX integer
---@param offsetY integer
---@param scale number
---@return raylib.Image
function M.GenImagePerlinNoise(width, height, offsetX, offsetY, scale)
return C.GenImagePerlinNoise(width, height, offsetX, offsetY, scale)
end
---Generate image: cellular algorithm, bigger tileSize means bigger cells
---@param width integer
---@param height integer
---@param tileSize integer
---@return raylib.Image
function M.GenImageCellular(width, height, tileSize)
return C.GenImageCellular(width, height, tileSize)
end
---Generate image: grayscale image from text data
---@param width integer
---@param height integer
---@param text string
---@return raylib.Image
function M.GenImageText(width, height, text)
return C.GenImageText(width, height, text)
end
---Create an image duplicate (useful for transformations)
---@param image raylib.Image
---@return raylib.Image
function M.ImageCopy(image)
return C.ImageCopy(image)
end
---Create an image from another image piece
---@param image raylib.Image
---@param rec raylib.Rectangle
---@return raylib.Image
function M.ImageFromImage(image, rec)
return C.ImageFromImage(image, rec)
end
---Create an image from a selected channel of another image (GRAYSCALE)
---@param image raylib.Image
---@param selectedChannel integer
---@return raylib.Image
function M.ImageFromChannel(image, selectedChannel)
return C.ImageFromChannel(image, selectedChannel)
end
---Create an image from text (default font)
---@param text string
---@param fontSize integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageText(text, fontSize, color)
return C.ImageText(text, fontSize, color)
end
---Create an image from text (custom sprite font)
---@param font raylib.Font
---@param text string
---@param fontSize number
---@param spacing number
---@param tint raylib.Color
---@return raylib.Image
function M.ImageTextEx(font, text, fontSize, spacing, tint)
return C.ImageTextEx(font, text, fontSize, spacing, tint)
end
---Convert image data to desired format
---@param image raylib.Image
---@param newFormat integer
---@return raylib.Image
function M.ImageFormat(image, newFormat)
local _o1 = ffi.new("Image[1]", image)
C.ImageFormat(_o1, newFormat)
return _o1[0]
end
---Convert image to POT (power-of-two)
---@param image raylib.Image
---@param fill raylib.Color
---@return raylib.Image
function M.ImageToPOT(image, fill)
local _o1 = ffi.new("Image[1]", image)
C.ImageToPOT(_o1, fill)
return _o1[0]
end
---Crop an image to a defined rectangle
---@param image raylib.Image
---@param crop raylib.Rectangle
---@return raylib.Image
function M.ImageCrop(image, crop)
local _o1 = ffi.new("Image[1]", image)
C.ImageCrop(_o1, crop)
return _o1[0]
end
---Crop image depending on alpha value
---@param image raylib.Image
---@param threshold number
---@return raylib.Image
function M.ImageAlphaCrop(image, threshold)
local _o1 = ffi.new("Image[1]", image)
C.ImageAlphaCrop(_o1, threshold)
return _o1[0]
end
---Clear alpha channel to desired color
---@param image raylib.Image
---@param color raylib.Color
---@param threshold number
---@return raylib.Image
function M.ImageAlphaClear(image, color, threshold)
local _o1 = ffi.new("Image[1]", image)
C.ImageAlphaClear(_o1, color, threshold)
return _o1[0]
end
---Apply alpha mask to image
---@param image raylib.Image
---@param alphaMask raylib.Image
---@return raylib.Image
function M.ImageAlphaMask(image, alphaMask)
local _o1 = ffi.new("Image[1]", image)
C.ImageAlphaMask(_o1, alphaMask)
return _o1[0]
end
---Premultiply alpha channel
---@param image raylib.Image
---@return raylib.Image
function M.ImageAlphaPremultiply(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageAlphaPremultiply(_o1)
return _o1[0]
end
---Apply Gaussian blur using a box blur approximation
---@param image raylib.Image
---@param blurSize integer
---@return raylib.Image
function M.ImageBlurGaussian(image, blurSize)
local _o1 = ffi.new("Image[1]", image)
C.ImageBlurGaussian(_o1, blurSize)
return _o1[0]
end
---Apply custom square convolution kernel to image
---@param image raylib.Image
---@param kernel number[]
---@param kernelSize integer
---@return raylib.Image
function M.ImageKernelConvolution(image, kernel, kernelSize)
local _o1 = ffi.new("Image[1]", image)
local _a2
if type(kernel) == "table" then _a2 = to_array("float", kernel)
else _a2 = kernel end
C.ImageKernelConvolution(_o1, _a2, kernelSize)
return _o1[0]
end
---Resize image (Bicubic scaling algorithm)
---@param image raylib.Image
---@param newWidth integer
---@param newHeight integer
---@return raylib.Image
function M.ImageResize(image, newWidth, newHeight)
local _o1 = ffi.new("Image[1]", image)
C.ImageResize(_o1, newWidth, newHeight)
return _o1[0]
end
---Resize image (Nearest-Neighbor scaling algorithm)
---@param image raylib.Image
---@param newWidth integer
---@param newHeight integer
---@return raylib.Image
function M.ImageResizeNN(image, newWidth, newHeight)
local _o1 = ffi.new("Image[1]", image)
C.ImageResizeNN(_o1, newWidth, newHeight)
return _o1[0]
end
---Resize canvas and fill with color
---@param image raylib.Image
---@param newWidth integer
---@param newHeight integer
---@param offsetX integer
---@param offsetY integer
---@param fill raylib.Color
---@return raylib.Image
function M.ImageResizeCanvas(image, newWidth, newHeight, offsetX, offsetY, fill)
local _o1 = ffi.new("Image[1]", image)
C.ImageResizeCanvas(_o1, newWidth, newHeight, offsetX, offsetY, fill)
return _o1[0]
end
---Compute all mipmap levels for a provided image
---@param image raylib.Image
---@return raylib.Image
function M.ImageMipmaps(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageMipmaps(_o1)
return _o1[0]
end
---Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
---@param image raylib.Image
---@param rBpp integer
---@param gBpp integer
---@param bBpp integer
---@param aBpp integer
---@return raylib.Image
function M.ImageDither(image, rBpp, gBpp, bBpp, aBpp)
local _o1 = ffi.new("Image[1]", image)
C.ImageDither(_o1, rBpp, gBpp, bBpp, aBpp)
return _o1[0]
end
---Flip image vertically
---@param image raylib.Image
---@return raylib.Image
function M.ImageFlipVertical(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageFlipVertical(_o1)
return _o1[0]
end
---Flip image horizontally
---@param image raylib.Image
---@return raylib.Image
function M.ImageFlipHorizontal(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageFlipHorizontal(_o1)
return _o1[0]
end
---Rotate image by input angle in degrees (-359 to 359)
---@param image raylib.Image
---@param degrees integer
---@return raylib.Image
function M.ImageRotate(image, degrees)
local _o1 = ffi.new("Image[1]", image)
C.ImageRotate(_o1, degrees)
return _o1[0]
end
---Rotate image clockwise 90deg
---@param image raylib.Image
---@return raylib.Image
function M.ImageRotateCW(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageRotateCW(_o1)
return _o1[0]
end
---Rotate image counter-clockwise 90deg
---@param image raylib.Image
---@return raylib.Image
function M.ImageRotateCCW(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageRotateCCW(_o1)
return _o1[0]
end
---Modify image color: tint
---@param image raylib.Image
---@param color raylib.Color
---@return raylib.Image
function M.ImageColorTint(image, color)
local _o1 = ffi.new("Image[1]", image)
C.ImageColorTint(_o1, color)
return _o1[0]
end
---Modify image color: invert
---@param image raylib.Image
---@return raylib.Image
function M.ImageColorInvert(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageColorInvert(_o1)
return _o1[0]
end
---Modify image color: grayscale
---@param image raylib.Image
---@return raylib.Image
function M.ImageColorGrayscale(image)
local _o1 = ffi.new("Image[1]", image)
C.ImageColorGrayscale(_o1)
return _o1[0]
end
---Modify image color: contrast (-100 to 100)
---@param image raylib.Image
---@param contrast integer
---@return raylib.Image
function M.ImageColorContrast(image, contrast)
local _o1 = ffi.new("Image[1]", image)
C.ImageColorContrast(_o1, contrast)
return _o1[0]
end
---Modify image color: brightness (-255 to 255)
---@param image raylib.Image
---@param brightness integer
---@return raylib.Image
function M.ImageColorBrightness(image, brightness)
local _o1 = ffi.new("Image[1]", image)
C.ImageColorBrightness(_o1, brightness)
return _o1[0]
end
---Modify image color: replace color
---@param image raylib.Image
---@param color raylib.Color
---@param replace raylib.Color
---@return raylib.Image
function M.ImageColorReplace(image, color, replace)
local _o1 = ffi.new("Image[1]", image)
C.ImageColorReplace(_o1, color, replace)
return _o1[0]
end
---Load color data from image as a Color array (RGBA - 32bit)
---@param image raylib.Image
---@return ffi.cdata*
function M.LoadImageColors(image)
return C.LoadImageColors(image)
end
---Load colors palette from image as a Color array (RGBA - 32bit)
---@param image raylib.Image
---@param maxPaletteSize integer
---@param colorCount ffi.cdata*
---@return ffi.cdata*
function M.LoadImagePalette(image, maxPaletteSize, colorCount)
return C.LoadImagePalette(image, maxPaletteSize, colorCount)
end
---Unload color data loaded with LoadImageColors()
---@param colors ffi.cdata*
---@return nil
function M.UnloadImageColors(colors)
C.UnloadImageColors(colors)
end
---Unload colors palette loaded with LoadImagePalette()
---@param colors ffi.cdata*
---@return nil
function M.UnloadImagePalette(colors)
C.UnloadImagePalette(colors)
end
---Get image alpha border rectangle
---@param image raylib.Image
---@param threshold number
---@return raylib.Rectangle
function M.GetImageAlphaBorder(image, threshold)
return C.GetImageAlphaBorder(image, threshold)
end
---Get image pixel color at (x, y) position
---@param image raylib.Image
---@param x integer
---@param y integer
---@return raylib.Color
function M.GetImageColor(image, x, y)
return C.GetImageColor(image, x, y)
end
---Clear image background with provided color
---@param dst raylib.Image
---@param color raylib.Color
---@return raylib.Image
function M.ImageClearBackground(dst, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageClearBackground(_o1, color)
return _o1[0]
end
---Draw pixel within an image
---@param dst raylib.Image
---@param posX integer
---@param posY integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawPixel(dst, posX, posY, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawPixel(_o1, posX, posY, color)
return _o1[0]
end
---Draw pixel within an image (Vector version)
---@param dst raylib.Image
---@param position raylib.Vector2
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawPixelV(dst, position, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawPixelV(_o1, position, color)
return _o1[0]
end
---Draw line within an image
---@param dst raylib.Image
---@param startPosX integer
---@param startPosY integer
---@param endPosX integer
---@param endPosY integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawLine(dst, startPosX, startPosY, endPosX, endPosY, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawLine(_o1, startPosX, startPosY, endPosX, endPosY, color)
return _o1[0]
end
---Draw line within an image (Vector version)
---@param dst raylib.Image
---@param start raylib.Vector2
---@param end_ raylib.Vector2
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawLineV(dst, start, end_, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawLineV(_o1, start, end_, color)
return _o1[0]
end
---Draw a line defining thickness within an image
---@param dst raylib.Image
---@param start raylib.Vector2
---@param end_ raylib.Vector2
---@param thick integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawLineEx(dst, start, end_, thick, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawLineEx(_o1, start, end_, thick, color)
return _o1[0]
end
---Draw a lines sequence within an image
---@param dst raylib.Image
---@param points raylib.Vector2[]
---@param pointCount integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawLineStrip(dst, points, pointCount, color)
local _o1 = ffi.new("Image[1]", dst)
local _a2
if type(points) == "table" then _a2 = to_array("Vector2", points)
else _a2 = points end
C.ImageDrawLineStrip(_o1, _a2, pointCount, color)
return _o1[0]
end
---Draw triangle within an image
---@param dst raylib.Image
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawTriangle(dst, v1, v2, v3, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawTriangle(_o1, v1, v2, v3, color)
return _o1[0]
end
---Draw triangle with interpolated colors within an image
---@param dst raylib.Image
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param c1 raylib.Color
---@param c2 raylib.Color
---@param c3 raylib.Color
---@return raylib.Image
function M.ImageDrawTriangleGradient(dst, v1, v2, v3, c1, c2, c3)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawTriangleGradient(_o1, v1, v2, v3, c1, c2, c3)
return _o1[0]
end
---Draw triangle outline within an image
---@param dst raylib.Image
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param v3 raylib.Vector2
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawTriangleLines(dst, v1, v2, v3, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawTriangleLines(_o1, v1, v2, v3, color)
return _o1[0]
end
---Draw a triangle fan defined by points within an image (first vertex is the center)
---@param dst raylib.Image
---@param points raylib.Vector2[]
---@param pointCount integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawTriangleFan(dst, points, pointCount, color)
local _o1 = ffi.new("Image[1]", dst)
local _a2
if type(points) == "table" then _a2 = to_array("Vector2", points)
else _a2 = points end
C.ImageDrawTriangleFan(_o1, _a2, pointCount, color)
return _o1[0]
end
---Draw a triangle strip defined by points within an image
---@param dst raylib.Image
---@param points raylib.Vector2[]
---@param pointCount integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawTriangleStrip(dst, points, pointCount, color)
local _o1 = ffi.new("Image[1]", dst)
local _a2
if type(points) == "table" then _a2 = to_array("Vector2", points)
else _a2 = points end
C.ImageDrawTriangleStrip(_o1, _a2, pointCount, color)
return _o1[0]
end
---Draw rectangle within an image
---@param dst raylib.Image
---@param posX integer
---@param posY integer
---@param width integer
---@param height integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawRectangle(dst, posX, posY, width, height, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectangle(_o1, posX, posY, width, height, color)
return _o1[0]
end
---Draw rectangle within an image (Vector version)
---@param dst raylib.Image
---@param position raylib.Vector2
---@param size raylib.Vector2
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawRectangleV(dst, position, size, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectangleV(_o1, position, size, color)
return _o1[0]
end
---Draw rectangle within an image
---@param dst raylib.Image
---@param rec raylib.Rectangle
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawRectangleRec(dst, rec, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectangleRec(_o1, rec, color)
return _o1[0]
end
---Draw a color-filled rectangle with pro parameters within and image
---@param dst raylib.Image
---@param rec raylib.Rectangle
---@param origin raylib.Vector2
---@param rotation number
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawRectanglePro(dst, rec, origin, rotation, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectanglePro(_o1, rec, origin, rotation, color)
return _o1[0]
end
---Draw rectangle lines within an image
---@param dst raylib.Image
---@param posX integer
---@param posY integer
---@param width integer
---@param height integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawRectangleLines(dst, posX, posY, width, height, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectangleLines(_o1, posX, posY, width, height, color)
return _o1[0]
end
---Draw rectangle lines within an image with line thickness
---@param dst raylib.Image
---@param rec raylib.Rectangle
---@param thick integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawRectangleLinesEx(dst, rec, thick, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectangleLinesEx(_o1, rec, thick, color)
return _o1[0]
end
---Draw rectangle with gradient colors within an image, counter-clockwise color order
---@param dst raylib.Image
---@param rec raylib.Rectangle
---@param col1 raylib.Color
---@param col2 raylib.Color
---@param col3 raylib.Color
---@param col4 raylib.Color
---@return raylib.Image
function M.ImageDrawRectangleGradientEx(dst, rec, col1, col2, col3, col4)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawRectangleGradientEx(_o1, rec, col1, col2, col3, col4)
return _o1[0]
end
---Draw a filled circle within an image
---@param dst raylib.Image
---@param centerX integer
---@param centerY integer
---@param radius integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawCircle(dst, centerX, centerY, radius, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawCircle(_o1, centerX, centerY, radius, color)
return _o1[0]
end
---Draw a filled circle within an image (Vector version)
---@param dst raylib.Image
---@param center raylib.Vector2
---@param radius integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawCircleV(dst, center, radius, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawCircleV(_o1, center, radius, color)
return _o1[0]
end
---Draw circle outline within an image
---@param dst raylib.Image
---@param centerX integer
---@param centerY integer
---@param radius integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawCircleLines(dst, centerX, centerY, radius, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawCircleLines(_o1, centerX, centerY, radius, color)
return _o1[0]
end
---Draw circle outline within an image (Vector version)
---@param dst raylib.Image
---@param center raylib.Vector2
---@param radius integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawCircleLinesV(dst, center, radius, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawCircleLinesV(_o1, center, radius, color)
return _o1[0]
end
---Draw a gradient-filled circle within an image
---@param dst raylib.Image
---@param center raylib.Vector2
---@param radius number
---@param inner raylib.Color
---@param outer raylib.Color
---@return raylib.Image
function M.ImageDrawCircleGradient(dst, center, radius, inner, outer)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawCircleGradient(_o1, center, radius, inner, outer)
return _o1[0]
end
---Draw an image within an image
---@param dst raylib.Image
---@param src raylib.Image
---@param posX integer
---@param posY integer
---@param tint raylib.Color
---@return raylib.Image
function M.ImageDrawImage(dst, src, posX, posY, tint)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawImage(_o1, src, posX, posY, tint)
return _o1[0]
end
---Draw an image with scaling and rotation within an image
---@param dst raylib.Image
---@param src raylib.Image
---@param position raylib.Vector2
---@param rotation number
---@param scale number
---@param tint raylib.Color
---@return raylib.Image
function M.ImageDrawImageEx(dst, src, position, rotation, scale, tint)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawImageEx(_o1, src, position, rotation, scale, tint)
return _o1[0]
end
---Draw a part of an image defined by a rectangle within an image
---@param dst raylib.Image
---@param src raylib.Image
---@param srcRec raylib.Rectangle
---@param position raylib.Vector2
---@param tint raylib.Color
---@return raylib.Image
function M.ImageDrawImageRec(dst, src, srcRec, position, tint)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawImageRec(_o1, src, srcRec, position, tint)
return _o1[0]
end
---Draw a part of an image defined by a rectangle into destination rectangle, with scaling and rotation, within an image
---@param dst raylib.Image
---@param src raylib.Image
---@param srcRec raylib.Rectangle
---@param dstRec raylib.Rectangle
---@param origin raylib.Vector2
---@param rotation number
---@param tint raylib.Color
---@return raylib.Image
function M.ImageDrawImagePro(dst, src, srcRec, dstRec, origin, rotation, tint)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawImagePro(_o1, src, srcRec, dstRec, origin, rotation, tint)
return _o1[0]
end
---Draw text (using default font) within an image (destination)
---@param dst raylib.Image
---@param text string
---@param posX integer
---@param posY integer
---@param fontSize integer
---@param color raylib.Color
---@return raylib.Image
function M.ImageDrawText(dst, text, posX, posY, fontSize, color)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawText(_o1, text, posX, posY, fontSize, color)
return _o1[0]
end
---Draw text (custom sprite font) within an image (destination)
---@param dst raylib.Image
---@param font raylib.Font
---@param text string
---@param position raylib.Vector2
---@param fontSize number
---@param spacing number
---@param tint raylib.Color
---@return raylib.Image
function M.ImageDrawTextEx(dst, font, text, position, fontSize, spacing, tint)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawTextEx(_o1, font, text, position, fontSize, spacing, tint)
return _o1[0]
end
---Draw text using Font and pro parameters (rotation)
---@param dst raylib.Image
---@param font raylib.Font
---@param text string
---@param position raylib.Vector2
---@param origin raylib.Vector2
---@param rotation number
---@param fontSize number
---@param spacing number
---@param tint raylib.Color
---@return raylib.Image
function M.ImageDrawTextPro(dst, font, text, position, origin, rotation, fontSize, spacing, tint)
local _o1 = ffi.new("Image[1]", dst)
C.ImageDrawTextPro(_o1, font, text, position, origin, rotation, fontSize, spacing, tint)
return _o1[0]
end
---Load texture from file into GPU memory (VRAM)
---@param fileName string
---@return raylib.Texture2D
function M.LoadTexture(fileName)
return C.LoadTexture(fileName)
end
---Load texture from image data
---@param image raylib.Image
---@return raylib.Texture2D
function M.LoadTextureFromImage(image)
return C.LoadTextureFromImage(image)
end
---Load cubemap from image, multiple image cubemap layouts supported
---@param image raylib.Image
---@param layout integer
---@return raylib.TextureCubemap
function M.LoadTextureCubemap(image, layout)
return C.LoadTextureCubemap(image, layout)
end
---Load texture for rendering (framebuffer)
---@param width integer
---@param height integer
---@return raylib.RenderTexture2D
function M.LoadRenderTexture(width, height)
return C.LoadRenderTexture(width, height)
end
---Load texture for rendering (framebuffer), with specific format
---@param width integer
---@param height integer
---@param format integer
---@return raylib.RenderTexture2D
function M.LoadRenderTextureEx(width, height, format)
return C.LoadRenderTextureEx(width, height, format)
end
---Check if texture is valid (loaded in GPU)
---@param texture raylib.Texture2D
---@return boolean
function M.IsTextureValid(texture)
return C.IsTextureValid(texture)
end
---Unload texture from GPU memory (VRAM)
---@param texture raylib.Texture2D
---@return nil
function M.UnloadTexture(texture)
C.UnloadTexture(texture)
end
---Check if render texture is valid (loaded in GPU)
---@param target raylib.RenderTexture2D
---@return boolean
function M.IsRenderTextureValid(target)
return C.IsRenderTextureValid(target)
end
---Unload render texture from GPU memory (VRAM)
---@param target raylib.RenderTexture2D
---@return nil
function M.UnloadRenderTexture(target)
C.UnloadRenderTexture(target)
end
---Update GPU texture with new data (pixels should be able to fill texture)
---@param texture raylib.Texture2D
---@param pixels ffi.cdata*|string
---@return nil
function M.UpdateTexture(texture, pixels)
local _a2
if type(pixels) == "string" then _a2 = ffi.cast("const void *", pixels)
else _a2 = pixels end
C.UpdateTexture(texture, _a2)
end
---Update GPU texture rectangle with new data (pixels and rec should fit in texture)
---@param texture raylib.Texture2D
---@param rec raylib.Rectangle
---@param pixels ffi.cdata*|string
---@return nil
function M.UpdateTextureRec(texture, rec, pixels)
local _a3
if type(pixels) == "string" then _a3 = ffi.cast("const void *", pixels)
else _a3 = pixels end
C.UpdateTextureRec(texture, rec, _a3)
end
---Generate GPU mipmaps for a texture
---@param texture raylib.Texture2D
---@return raylib.Texture2D
function M.GenTextureMipmaps(texture)
local _o1 = ffi.new("Texture2D[1]", texture)
C.GenTextureMipmaps(_o1)
return _o1[0]
end
---Set texture scaling filter mode
---@param texture raylib.Texture2D
---@param filter integer
---@return nil
function M.SetTextureFilter(texture, filter)
C.SetTextureFilter(texture, filter)
end
---Set texture wrapping mode
---@param texture raylib.Texture2D
---@param wrap integer
---@return nil
function M.SetTextureWrap(texture, wrap)
C.SetTextureWrap(texture, wrap)
end
---Draw a Texture2D
---@param texture raylib.Texture2D
---@param posX integer
---@param posY integer
---@param tint raylib.Color
---@return nil
function M.DrawTexture(texture, posX, posY, tint)
C.DrawTexture(texture, posX, posY, tint)
end
---Draw a Texture2D with position defined as Vector2
---@param texture raylib.Texture2D
---@param position raylib.Vector2
---@param tint raylib.Color
---@return nil
function M.DrawTextureV(texture, position, tint)
C.DrawTextureV(texture, position, tint)
end
---Draw a Texture2D with rotation and scale
---@param texture raylib.Texture2D
---@param position raylib.Vector2
---@param rotation number
---@param scale number
---@param tint raylib.Color
---@return nil
function M.DrawTextureEx(texture, position, rotation, scale, tint)
C.DrawTextureEx(texture, position, rotation, scale, tint)
end
---Draw a part of a texture defined by a rectangle
---@param texture raylib.Texture2D
---@param rec raylib.Rectangle
---@param position raylib.Vector2
---@param tint raylib.Color
---@return nil
function M.DrawTextureRec(texture, rec, position, tint)
C.DrawTextureRec(texture, rec, position, tint)
end
---Draw a part of a texture defined by a source rectangle to destination rectangle, with scaling and rotation
---@param texture raylib.Texture2D
---@param srcrec raylib.Rectangle
---@param dstrec raylib.Rectangle
---@param origin raylib.Vector2
---@param rotation number
---@param tint raylib.Color
---@return nil
function M.DrawTexturePro(texture, srcrec, dstrec, origin, rotation, tint)
C.DrawTexturePro(texture, srcrec, dstrec, origin, rotation, tint)
end
---Draw a texture (or part of it) that stretches or shrinks nicely
---@param texture raylib.Texture2D
---@param nPatchInfo raylib.NPatchInfo
---@param dstrec raylib.Rectangle
---@param origin raylib.Vector2
---@param rotation number
---@param tint raylib.Color
---@return nil
function M.DrawTextureNPatch(texture, nPatchInfo, dstrec, origin, rotation, tint)
C.DrawTextureNPatch(texture, nPatchInfo, dstrec, origin, rotation, tint)
end
---Check if two colors are equal
---@param col1 raylib.Color
---@param col2 raylib.Color
---@return boolean
function M.ColorIsEqual(col1, col2)
return C.ColorIsEqual(col1, col2)
end
---Get color with alpha applied, alpha goes from 0.0f to 1.0f
---@param color raylib.Color
---@param alpha number
---@return raylib.Color
function M.Fade(color, alpha)
return C.Fade(color, alpha)
end
---Get hexadecimal value for a Color (0xRRGGBBAA)
---@param color raylib.Color
---@return integer
function M.ColorToInt(color)
return C.ColorToInt(color)
end
---Get Color normalized as float [0..1]
---@param color raylib.Color
---@return raylib.Vector4
function M.ColorNormalize(color)
return C.ColorNormalize(color)
end
---Get Color from normalized values [0..1]
---@param normalized raylib.Vector4
---@return raylib.Color
function M.ColorFromNormalized(normalized)
return C.ColorFromNormalized(normalized)
end
---Get HSV values for a Color, hue [0..360], saturation/value [0..1]
---@param color raylib.Color
---@return raylib.Vector3
function M.ColorToHSV(color)
return C.ColorToHSV(color)
end
---Get a Color from HSV values, hue [0..360], saturation/value [0..1]
---@param hue number
---@param saturation number
---@param value number
---@return raylib.Color
function M.ColorFromHSV(hue, saturation, value)
return C.ColorFromHSV(hue, saturation, value)
end
---Get color multiplied with another color
---@param color raylib.Color
---@param tint raylib.Color
---@return raylib.Color
function M.ColorTint(color, tint)
return C.ColorTint(color, tint)
end
---Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
---@param color raylib.Color
---@param factor number
---@return raylib.Color
function M.ColorBrightness(color, factor)
return C.ColorBrightness(color, factor)
end
---Get color with contrast correction, contrast values between -1.0f and 1.0f
---@param color raylib.Color
---@param contrast number
---@return raylib.Color
function M.ColorContrast(color, contrast)
return C.ColorContrast(color, contrast)
end
---Get color with alpha applied, alpha goes from 0.0f to 1.0f
---@param color raylib.Color
---@param alpha number
---@return raylib.Color
function M.ColorAlpha(color, alpha)
return C.ColorAlpha(color, alpha)
end
---Get src alpha-blended into dst color with tint
---@param dst raylib.Color
---@param src raylib.Color
---@param tint raylib.Color
---@return raylib.Color
function M.ColorAlphaBlend(dst, src, tint)
return C.ColorAlphaBlend(dst, src, tint)
end
---Get color lerp interpolation between two colors, factor [0.0f..1.0f]
---@param color1 raylib.Color
---@param color2 raylib.Color
---@param factor number
---@return raylib.Color
function M.ColorLerp(color1, color2, factor)
return C.ColorLerp(color1, color2, factor)
end
---Get Color structure from hexadecimal value
---@param hexValue integer
---@return raylib.Color
function M.GetColor(hexValue)
return C.GetColor(hexValue)
end
---Get Color from a source pixel pointer of certain format
---@param srcPtr ffi.cdata*|string
---@param format integer
---@return raylib.Color
function M.GetPixelColor(srcPtr, format)
local _a1
if type(srcPtr) == "string" then _a1 = ffi.cast("const void *", srcPtr)
else _a1 = srcPtr end
return C.GetPixelColor(_a1, format)
end
---Set color formatted into destination pixel pointer
---@param dstPtr ffi.cdata*|string
---@param color raylib.Color
---@param format integer
---@return nil
function M.SetPixelColor(dstPtr, color, format)
local _a1
if type(dstPtr) == "string" then _a1 = ffi.cast("const void *", dstPtr)
else _a1 = dstPtr end
C.SetPixelColor(_a1, color, format)
end
---Get pixel data size in bytes for certain format
---@param width integer
---@param height integer
---@param format integer
---@return integer
function M.GetPixelDataSize(width, height, format)
return C.GetPixelDataSize(width, height, format)
end
---Get the default Font
---@return raylib.Font
function M.GetFontDefault()
return C.GetFontDefault()
end
---Load font from file into GPU memory (VRAM)
---@param fileName string
---@return raylib.Font
function M.LoadFont(fileName)
return C.LoadFont(fileName)
end
---Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height
---@param fileName string
---@param fontSize integer
---@param codepoints integer[]
---@param codepointCount integer
---@return raylib.Font
function M.LoadFontEx(fileName, fontSize, codepoints, codepointCount)
local _a3
if type(codepoints) == "table" then _a3 = to_array("int", codepoints)
else _a3 = codepoints end
return C.LoadFontEx(fileName, fontSize, _a3, codepointCount)
end
---Load font from Image (XNA style)
---@param image raylib.Image
---@param key raylib.Color
---@param firstChar integer
---@return raylib.Font
function M.LoadFontFromImage(image, key, firstChar)
return C.LoadFontFromImage(image, key, firstChar)
end
---Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
---@param fileType string
---@param fileData string|integer[]
---@param dataSize integer
---@param fontSize integer
---@param codepoints integer[]
---@param codepointCount integer
---@return raylib.Font
function M.LoadFontFromMemory(fileType, fileData, dataSize, fontSize, codepoints, codepointCount)
local _a2
if type(fileData) == "string" then _a2 = ffi.cast("const unsigned char *", fileData)
elseif type(fileData) == "table" then _a2 = to_array("unsigned char", fileData)
else _a2 = fileData end
local _a5
if type(codepoints) == "table" then _a5 = to_array("int", codepoints)
else _a5 = codepoints end
return C.LoadFontFromMemory(fileType, _a2, dataSize, fontSize, _a5, codepointCount)
end
---Check if font is valid (font data loaded, WARNING: GPU texture not checked)
---@param font raylib.Font
---@return boolean
function M.IsFontValid(font)
return C.IsFontValid(font)
end
---Load font data for further use
---@param fileData string|integer[]
---@param dataSize integer
---@param fontSize integer
---@param codepoints integer[]
---@param codepointCount integer
---@param type integer
---@param glyphCount ffi.cdata*
---@return ffi.cdata*
function M.LoadFontData(fileData, dataSize, fontSize, codepoints, codepointCount, type, glyphCount)
local _a1
if type(fileData) == "string" then _a1 = ffi.cast("const unsigned char *", fileData)
elseif type(fileData) == "table" then _a1 = to_array("unsigned char", fileData)
else _a1 = fileData end
local _a4
if type(codepoints) == "table" then _a4 = to_array("int", codepoints)
else _a4 = codepoints end
return C.LoadFontData(_a1, dataSize, fontSize, _a4, codepointCount, type, glyphCount)
end
---Generate image font atlas using chars info
---@param glyphs raylib.GlyphInfo[]
---@param glyphRecs ffi.cdata*
---@param glyphCount integer
---@param fontSize integer
---@param padding integer
---@param packMethod integer
---@return raylib.Image
function M.GenImageFontAtlas(glyphs, glyphRecs, glyphCount, fontSize, padding, packMethod)
local _a1
if type(glyphs) == "table" then _a1 = to_array("GlyphInfo", glyphs)
else _a1 = glyphs end
return C.GenImageFontAtlas(_a1, glyphRecs, glyphCount, fontSize, padding, packMethod)
end
---Unload font chars info data (RAM)
---@param glyphs ffi.cdata*
---@param glyphCount integer
---@return nil
function M.UnloadFontData(glyphs, glyphCount)
C.UnloadFontData(glyphs, glyphCount)
end
---Unload font from GPU memory (VRAM)
---@param font raylib.Font
---@return nil
function M.UnloadFont(font)
C.UnloadFont(font)
end
---Export font as code file, returns true on success
---@param font raylib.Font
---@param fileName string
---@return boolean
function M.ExportFontAsCode(font, fileName)
return C.ExportFontAsCode(font, fileName)
end
---Draw current FPS
---@param posX integer
---@param posY integer
---@return nil
function M.DrawFPS(posX, posY)
C.DrawFPS(posX, posY)
end
---Draw text (using default font)
---@param text string
---@param posX integer
---@param posY integer
---@param fontSize integer
---@param color raylib.Color
---@return nil
function M.DrawText(text, posX, posY, fontSize, color)
C.DrawText(text, posX, posY, fontSize, color)
end
---Draw text using font and additional parameters
---@param font raylib.Font
---@param text string
---@param position raylib.Vector2
---@param fontSize number
---@param spacing number
---@param tint raylib.Color
---@return nil
function M.DrawTextEx(font, text, position, fontSize, spacing, tint)
C.DrawTextEx(font, text, position, fontSize, spacing, tint)
end
---Draw text using Font and pro parameters (rotation)
---@param font raylib.Font
---@param text string
---@param position raylib.Vector2
---@param origin raylib.Vector2
---@param rotation number
---@param fontSize number
---@param spacing number
---@param tint raylib.Color
---@return nil
function M.DrawTextPro(font, text, position, origin, rotation, fontSize, spacing, tint)
C.DrawTextPro(font, text, position, origin, rotation, fontSize, spacing, tint)
end
---Draw one character (codepoint)
---@param font raylib.Font
---@param codepoint integer
---@param position raylib.Vector2
---@param fontSize number
---@param tint raylib.Color
---@return nil
function M.DrawTextCodepoint(font, codepoint, position, fontSize, tint)
C.DrawTextCodepoint(font, codepoint, position, fontSize, tint)
end
---Draw multiple characters (codepoint)
---@param font raylib.Font
---@param codepoints integer[]
---@param codepointCount integer
---@param position raylib.Vector2
---@param fontSize number
---@param spacing number
---@param tint raylib.Color
---@return nil
function M.DrawTextCodepoints(font, codepoints, codepointCount, position, fontSize, spacing, tint)
local _a2
if type(codepoints) == "table" then _a2 = to_array("int", codepoints)
else _a2 = codepoints end
C.DrawTextCodepoints(font, _a2, codepointCount, position, fontSize, spacing, tint)
end
---Set vertical line spacing when drawing with line-breaks
---@param spacing integer
---@return nil
function M.SetTextLineSpacing(spacing)
C.SetTextLineSpacing(spacing)
end
---Measure string width for default font
---@param text string
---@param fontSize integer
---@return integer
function M.MeasureText(text, fontSize)
return C.MeasureText(text, fontSize)
end
---Measure string size for Font
---@param font raylib.Font
---@param text string
---@param fontSize number
---@param spacing number
---@return raylib.Vector2
function M.MeasureTextEx(font, text, fontSize, spacing)
return C.MeasureTextEx(font, text, fontSize, spacing)
end
---Measure string size for an existing array of codepoints for Font
---@param font raylib.Font
---@param codepoints integer[]
---@param length integer
---@param fontSize number
---@param spacing number
---@return raylib.Vector2
function M.MeasureTextCodepoints(font, codepoints, length, fontSize, spacing)
local _a2
if type(codepoints) == "table" then _a2 = to_array("int", codepoints)
else _a2 = codepoints end
return C.MeasureTextCodepoints(font, _a2, length, fontSize, spacing)
end
---Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
---@param font raylib.Font
---@param codepoint integer
---@return integer
function M.GetGlyphIndex(font, codepoint)
return C.GetGlyphIndex(font, codepoint)
end
---Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
---@param font raylib.Font
---@param codepoint integer
---@return raylib.GlyphInfo
function M.GetGlyphInfo(font, codepoint)
return C.GetGlyphInfo(font, codepoint)
end
---Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
---@param font raylib.Font
---@param codepoint integer
---@return raylib.Rectangle
function M.GetGlyphAtlasRec(font, codepoint)
return C.GetGlyphAtlasRec(font, codepoint)
end
---Load UTF-8 text encoded from codepoints array
---@param codepoints integer[]
---@param length integer
---@return string|nil
function M.LoadUTF8(codepoints, length)
local _a1
if type(codepoints) == "table" then _a1 = to_array("int", codepoints)
else _a1 = codepoints end
local _p = C.LoadUTF8(_a1, length)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
C.UnloadUTF8(_p)
return _s
end
---Unload UTF-8 text encoded from codepoints array
---@param text raylib.char_buffer|string
---@return nil
function M.UnloadUTF8(text)
C.UnloadUTF8(text)
end
---Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
---@param text string
---@param count ffi.cdata*
---@return ffi.cdata*
function M.LoadCodepoints(text, count)
return C.LoadCodepoints(text, count)
end
---Unload codepoints data from memory
---@param codepoints ffi.cdata*
---@return nil
function M.UnloadCodepoints(codepoints)
C.UnloadCodepoints(codepoints)
end
---Get total number of codepoints in a UTF-8 encoded string
---@param text string
---@return integer
function M.GetCodepointCount(text)
return C.GetCodepointCount(text)
end
---Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
---@param text string
---@param codepointSize ffi.cdata*
---@return integer
function M.GetCodepoint(text, codepointSize)
return C.GetCodepoint(text, codepointSize)
end
---Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
---@param text string
---@param codepointSize ffi.cdata*
---@return integer
function M.GetCodepointNext(text, codepointSize)
return C.GetCodepointNext(text, codepointSize)
end
---Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
---@param text string
---@param codepointSize ffi.cdata*
---@return integer
function M.GetCodepointPrevious(text, codepointSize)
return C.GetCodepointPrevious(text, codepointSize)
end
---Encode one codepoint into UTF-8 byte array (array length returned as parameter)
---@param codepoint integer
---@return string|nil
function M.CodepointToUTF8(codepoint)
local size = ffi.new("int[1]")
local p = C.CodepointToUTF8(codepoint, size)
if p == nil then return nil end
return ffi_string(p, size[0])
end
---Load text as separate lines ('\n')
---@param text string
---@param count ffi.cdata*
---@return ffi.cdata*
function M.LoadTextLines(text, count)
return C.LoadTextLines(text, count)
end
---Unload text lines
---@param text string[]|raylib.cstring_array
---@param lineCount integer
---@return nil
function M.UnloadTextLines(text, lineCount)
local _a1
if type(text) == "table" then _a1 = ffi.cast("char **", to_array("const char *", text))
else _a1 = text end
C.UnloadTextLines(_a1, lineCount)
end
---Copy one string to another, returns bytes copied
---@param dst raylib.char_buffer|string
---@param src string
---@return integer
function M.TextCopy(dst, src)
return C.TextCopy(dst, src)
end
---Check if two text strings are equal
---@param text1 string
---@param text2 string
---@return boolean
function M.TextIsEqual(text1, text2)
return C.TextIsEqual(text1, text2)
end
---Get text length, checks for '\0' ending
---@param text string
---@return integer
function M.TextLength(text)
return C.TextLength(text)
end
---Text formatting with variables (sprintf() style)
---@param fmt string
---@param ... any
---@return string
function M.TextFormat(fmt, ...)
if select("#", ...) == 0 then
return fmt
end
return string_format(fmt, ...)
end
---Get a piece of a text string
---@param text string
---@param position integer
---@param length integer
---@return string|nil
function M.TextSubtext(text, position, length)
local _p = C.TextSubtext(text, position, length)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Remove text spaces, concat words
---@param text string
---@return string|nil
function M.TextRemoveSpaces(text)
local _p = C.TextRemoveSpaces(text)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get text between two strings
---@param text string
---@param begin string
---@param end_ string
---@return string|nil
function M.GetTextBetween(text, begin, end_)
local _p = C.GetTextBetween(text, begin, end_)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Replace text string with new string
---@param text string
---@param search string
---@param replacement string
---@return string|nil
function M.TextReplace(text, search, replacement)
local _p = C.TextReplace(text, search, replacement)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Replace text string with new string, memory must be MemFree()
---@param text string
---@param search string
---@param replacement string
---@return string|nil
function M.TextReplaceAlloc(text, search, replacement)
local _p = C.TextReplaceAlloc(text, search, replacement)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
C.MemFree(_p)
return _s
end
---Replace text between two specific strings
---@param text string
---@param begin string
---@param end_ string
---@param replacement string
---@return string|nil
function M.TextReplaceBetween(text, begin, end_, replacement)
local _p = C.TextReplaceBetween(text, begin, end_, replacement)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Replace text between two specific strings, memory must be MemFree()
---@param text string
---@param begin string
---@param end_ string
---@param replacement string
---@return string|nil
function M.TextReplaceBetweenAlloc(text, begin, end_, replacement)
local _p = C.TextReplaceBetweenAlloc(text, begin, end_, replacement)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
C.MemFree(_p)
return _s
end
---Insert text in a defined byte position
---@param text string
---@param insert string
---@param position integer
---@return string|nil
function M.TextInsert(text, insert, position)
local _p = C.TextInsert(text, insert, position)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Insert text in a defined byte position, memory must be MemFree()
---@param text string
---@param insert string
---@param position integer
---@return string|nil
function M.TextInsertAlloc(text, insert, position)
local _p = C.TextInsertAlloc(text, insert, position)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
C.MemFree(_p)
return _s
end
---Join text strings with delimiter
---@param textList string[]|raylib.cstring_array
---@param count integer
---@param delimiter string
---@return string|nil
function M.TextJoin(textList, count, delimiter)
local _a1
if type(textList) == "table" then _a1 = ffi.cast("char **", to_array("const char *", textList))
else _a1 = textList end
local _p = C.TextJoin(_a1, count, delimiter)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Split text into multiple strings, using MAX_TEXTSPLIT_COUNT static strings
---@param text string
---@param delimiter integer
---@param count ffi.cdata*
---@return ffi.cdata*
function M.TextSplit(text, delimiter, count)
return C.TextSplit(text, delimiter, count)
end
---Append text at specific position and move cursor
---@param text raylib.char_buffer|string
---@param append string
---@param position ffi.cdata*
---@return nil
function M.TextAppend(text, append, position)
C.TextAppend(text, append, position)
end
---Find first text occurrence within a string, -1 if not found
---@param text string
---@param search string
---@return integer
function M.TextFindIndex(text, search)
return C.TextFindIndex(text, search)
end
---Get upper case version of provided string
---@param text string
---@return string|nil
function M.TextToUpper(text)
local _p = C.TextToUpper(text)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get lower case version of provided string
---@param text string
---@return string|nil
function M.TextToLower(text)
local _p = C.TextToLower(text)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get Pascal case notation version of provided string
---@param text string
---@return string|nil
function M.TextToPascal(text)
local _p = C.TextToPascal(text)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get Snake case notation version of provided string
---@param text string
---@return string|nil
function M.TextToSnake(text)
local _p = C.TextToSnake(text)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get Camel case notation version of provided string
---@param text string
---@return string|nil
function M.TextToCamel(text)
local _p = C.TextToCamel(text)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Get integer value from text
---@param text string
---@return integer
function M.TextToInteger(text)
return C.TextToInteger(text)
end
---Get float value from text
---@param text string
---@return number
function M.TextToFloat(text)
return C.TextToFloat(text)
end
---Draw a line in 3D world space
---@param startPos raylib.Vector3
---@param endPos raylib.Vector3
---@param color raylib.Color
---@return nil
function M.DrawLine3D(startPos, endPos, color)
C.DrawLine3D(startPos, endPos, color)
end
---Draw a point in 3D space, actually a small line
---@param position raylib.Vector3
---@param color raylib.Color
---@return nil
function M.DrawPoint3D(position, color)
C.DrawPoint3D(position, color)
end
---Draw a circle in 3D world space
---@param center raylib.Vector3
---@param radius number
---@param rotationAxis raylib.Vector3
---@param rotationAngle number
---@param color raylib.Color
---@return nil
function M.DrawCircle3D(center, radius, rotationAxis, rotationAngle, color)
C.DrawCircle3D(center, radius, rotationAxis, rotationAngle, color)
end
---Draw a color-filled triangle, counter-clockwise vertex order
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@param v3 raylib.Vector3
---@param color raylib.Color
---@return nil
function M.DrawTriangle3D(v1, v2, v3, color)
C.DrawTriangle3D(v1, v2, v3, color)
end
---Draw a triangle strip defined by points
---@param points raylib.Vector3[]
---@param pointCount integer
---@param color raylib.Color
---@return nil
function M.DrawTriangleStrip3D(points, pointCount, color)
local _a1
if type(points) == "table" then _a1 = to_array("Vector3", points)
else _a1 = points end
C.DrawTriangleStrip3D(_a1, pointCount, color)
end
---Draw cube
---@param position raylib.Vector3
---@param width number
---@param height number
---@param length number
---@param color raylib.Color
---@return nil
function M.DrawCube(position, width, height, length, color)
C.DrawCube(position, width, height, length, color)
end
---Draw cube (Vector version)
---@param position raylib.Vector3
---@param size raylib.Vector3
---@param color raylib.Color
---@return nil
function M.DrawCubeV(position, size, color)
C.DrawCubeV(position, size, color)
end
---Draw cube wires
---@param position raylib.Vector3
---@param width number
---@param height number
---@param length number
---@param color raylib.Color
---@return nil
function M.DrawCubeWires(position, width, height, length, color)
C.DrawCubeWires(position, width, height, length, color)
end
---Draw cube wires (Vector version)
---@param position raylib.Vector3
---@param size raylib.Vector3
---@param color raylib.Color
---@return nil
function M.DrawCubeWiresV(position, size, color)
C.DrawCubeWiresV(position, size, color)
end
---Draw sphere
---@param centerPos raylib.Vector3
---@param radius number
---@param color raylib.Color
---@return nil
function M.DrawSphere(centerPos, radius, color)
C.DrawSphere(centerPos, radius, color)
end
---Draw sphere with defined rings and slices
---@param centerPos raylib.Vector3
---@param radius number
---@param rings integer
---@param slices integer
---@param color raylib.Color
---@return nil
function M.DrawSphereEx(centerPos, radius, rings, slices, color)
C.DrawSphereEx(centerPos, radius, rings, slices, color)
end
---Draw sphere wires
---@param centerPos raylib.Vector3
---@param radius number
---@param rings integer
---@param slices integer
---@param color raylib.Color
---@return nil
function M.DrawSphereWires(centerPos, radius, rings, slices, color)
C.DrawSphereWires(centerPos, radius, rings, slices, color)
end
---Draw a cylinder/cone
---@param position raylib.Vector3
---@param radiusTop number
---@param radiusBottom number
---@param height number
---@param sides integer
---@param color raylib.Color
---@return nil
function M.DrawCylinder(position, radiusTop, radiusBottom, height, sides, color)
C.DrawCylinder(position, radiusTop, radiusBottom, height, sides, color)
end
---Draw a cylinder with base at startPos and top at endPos
---@param startPos raylib.Vector3
---@param endPos raylib.Vector3
---@param startRadius number
---@param endRadius number
---@param sides integer
---@param color raylib.Color
---@return nil
function M.DrawCylinderEx(startPos, endPos, startRadius, endRadius, sides, color)
C.DrawCylinderEx(startPos, endPos, startRadius, endRadius, sides, color)
end
---Draw a cylinder/cone wires
---@param position raylib.Vector3
---@param radiusTop number
---@param radiusBottom number
---@param height number
---@param sides integer
---@param color raylib.Color
---@return nil
function M.DrawCylinderWires(position, radiusTop, radiusBottom, height, sides, color)
C.DrawCylinderWires(position, radiusTop, radiusBottom, height, sides, color)
end
---Draw a cylinder wires with base at startPos and top at endPos
---@param startPos raylib.Vector3
---@param endPos raylib.Vector3
---@param startRadius number
---@param endRadius number
---@param sides integer
---@param color raylib.Color
---@return nil
function M.DrawCylinderWiresEx(startPos, endPos, startRadius, endRadius, sides, color)
C.DrawCylinderWiresEx(startPos, endPos, startRadius, endRadius, sides, color)
end
---Draw a capsule with the center of its sphere caps at startPos and endPos
---@param startPos raylib.Vector3
---@param endPos raylib.Vector3
---@param radius number
---@param rings integer
---@param slices integer
---@param color raylib.Color
---@return nil
function M.DrawCapsule(startPos, endPos, radius, rings, slices, color)
C.DrawCapsule(startPos, endPos, radius, rings, slices, color)
end
---Draw capsule wireframe with the center of its sphere caps at startPos and endPos
---@param startPos raylib.Vector3
---@param endPos raylib.Vector3
---@param radius number
---@param rings integer
---@param slices integer
---@param color raylib.Color
---@return nil
function M.DrawCapsuleWires(startPos, endPos, radius, rings, slices, color)
C.DrawCapsuleWires(startPos, endPos, radius, rings, slices, color)
end
---Draw a plane XZ
---@param centerPos raylib.Vector3
---@param size raylib.Vector2
---@param color raylib.Color
---@return nil
function M.DrawPlane(centerPos, size, color)
C.DrawPlane(centerPos, size, color)
end
---Draw a ray line
---@param ray raylib.Ray
---@param color raylib.Color
---@return nil
function M.DrawRay(ray, color)
C.DrawRay(ray, color)
end
---Draw a grid (centered at (0, 0, 0))
---@param slices integer
---@param spacing number
---@return nil
function M.DrawGrid(slices, spacing)
C.DrawGrid(slices, spacing)
end
---Load model from files (meshes and materials)
---@param fileName string
---@return raylib.Model
function M.LoadModel(fileName)
return C.LoadModel(fileName)
end
---Load model from generated mesh (default material)
---@param mesh raylib.Mesh
---@return raylib.Model
function M.LoadModelFromMesh(mesh)
return C.LoadModelFromMesh(mesh)
end
---Check if model is valid (loaded in GPU, VAO/VBOs)
---@param model raylib.Model
---@return boolean
function M.IsModelValid(model)
return C.IsModelValid(model)
end
---Unload model (including meshes) from memory (RAM and/or VRAM)
---@param model raylib.Model
---@return nil
function M.UnloadModel(model)
C.UnloadModel(model)
end
---Compute model bounding box limits (considers all meshes)
---@param model raylib.Model
---@return raylib.BoundingBox
function M.GetModelBoundingBox(model)
return C.GetModelBoundingBox(model)
end
---Draw a model (with texture if set)
---@param model raylib.Model
---@param position raylib.Vector3
---@param scale number
---@param tint raylib.Color
---@return nil
function M.DrawModel(model, position, scale, tint)
C.DrawModel(model, position, scale, tint)
end
---Draw a model with custom transform
---@param model raylib.Model
---@param position raylib.Vector3
---@param rotationAxis raylib.Vector3
---@param rotationAngle number
---@param scale raylib.Vector3
---@param tint raylib.Color
---@return nil
function M.DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint)
C.DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint)
end
---Draw a model wires (with texture if set)
---@param model raylib.Model
---@param position raylib.Vector3
---@param scale number
---@param tint raylib.Color
---@return nil
function M.DrawModelWires(model, position, scale, tint)
C.DrawModelWires(model, position, scale, tint)
end
---Draw a model wires with custom transform
---@param model raylib.Model
---@param position raylib.Vector3
---@param rotationAxis raylib.Vector3
---@param rotationAngle number
---@param scale raylib.Vector3
---@param tint raylib.Color
---@return nil
function M.DrawModelWiresEx(model, position, rotationAxis, rotationAngle, scale, tint)
C.DrawModelWiresEx(model, position, rotationAxis, rotationAngle, scale, tint)
end
---Draw bounding box (wires)
---@param box raylib.BoundingBox
---@param color raylib.Color
---@return nil
function M.DrawBoundingBox(box, color)
C.DrawBoundingBox(box, color)
end
---Draw a billboard texture
---@param camera raylib.Camera
---@param texture raylib.Texture2D
---@param position raylib.Vector3
---@param scale number
---@param tint raylib.Color
---@return nil
function M.DrawBillboard(camera, texture, position, scale, tint)
C.DrawBillboard(camera, texture, position, scale, tint)
end
---Draw a billboard texture defined by rectangle
---@param camera raylib.Camera
---@param texture raylib.Texture2D
---@param rec raylib.Rectangle
---@param position raylib.Vector3
---@param size raylib.Vector2
---@param tint raylib.Color
---@return nil
function M.DrawBillboardRec(camera, texture, rec, position, size, tint)
C.DrawBillboardRec(camera, texture, rec, position, size, tint)
end
---Draw a billboard texture defined by source rectangle with scaling and rotation
---@param camera raylib.Camera
---@param texture raylib.Texture2D
---@param rec raylib.Rectangle
---@param position raylib.Vector3
---@param up raylib.Vector3
---@param size raylib.Vector2
---@param origin raylib.Vector2
---@param rotation number
---@param tint raylib.Color
---@return nil
function M.DrawBillboardPro(camera, texture, rec, position, up, size, origin, rotation, tint)
C.DrawBillboardPro(camera, texture, rec, position, up, size, origin, rotation, tint)
end
---Upload mesh vertex data in GPU and provide VAO/VBO ids
---@param mesh raylib.Mesh
---@param dynamic boolean
---@return raylib.Mesh
function M.UploadMesh(mesh, dynamic)
local _o1 = ffi.new("Mesh[1]", mesh)
C.UploadMesh(_o1, dynamic)
return _o1[0]
end
---Update mesh vertex data in GPU for a specific buffer index
---@param mesh raylib.Mesh
---@param index integer
---@param data ffi.cdata*|string
---@param dataSize integer
---@param offset integer
---@return nil
function M.UpdateMeshBuffer(mesh, index, data, dataSize, offset)
local _a3
if type(data) == "string" then _a3 = ffi.cast("const void *", data)
else _a3 = data end
C.UpdateMeshBuffer(mesh, index, _a3, dataSize, offset)
end
---Unload mesh data from CPU and GPU
---@param mesh raylib.Mesh
---@return nil
function M.UnloadMesh(mesh)
C.UnloadMesh(mesh)
end
---Draw a 3d mesh with material and transform
---@param mesh raylib.Mesh
---@param material raylib.Material
---@param transform raylib.Matrix
---@return nil
function M.DrawMesh(mesh, material, transform)
C.DrawMesh(mesh, material, transform)
end
---Draw multiple mesh instances with material and different transforms
---@param mesh raylib.Mesh
---@param material raylib.Material
---@param transforms raylib.Matrix[]
---@param instances integer
---@return nil
function M.DrawMeshInstanced(mesh, material, transforms, instances)
local _a3
if type(transforms) == "table" then _a3 = to_array("Matrix", transforms)
else _a3 = transforms end
C.DrawMeshInstanced(mesh, material, _a3, instances)
end
---Compute mesh bounding box limits
---@param mesh raylib.Mesh
---@return raylib.BoundingBox
function M.GetMeshBoundingBox(mesh)
return C.GetMeshBoundingBox(mesh)
end
---Compute mesh tangents
---@param mesh raylib.Mesh
---@return raylib.Mesh
function M.GenMeshTangents(mesh)
local _o1 = ffi.new("Mesh[1]", mesh)
C.GenMeshTangents(_o1)
return _o1[0]
end
---Export mesh data to file, returns true on success
---@param mesh raylib.Mesh
---@param fileName string
---@return boolean
function M.ExportMesh(mesh, fileName)
return C.ExportMesh(mesh, fileName)
end
---Export mesh as code file (.h) defining multiple arrays of vertex attributes
---@param mesh raylib.Mesh
---@param fileName string
---@return boolean
function M.ExportMeshAsCode(mesh, fileName)
return C.ExportMeshAsCode(mesh, fileName)
end
---Generate polygonal mesh
---@param sides integer
---@param radius number
---@return raylib.Mesh
function M.GenMeshPoly(sides, radius)
return C.GenMeshPoly(sides, radius)
end
---Generate plane mesh (with subdivisions)
---@param width number
---@param length number
---@param resX integer
---@param resZ integer
---@return raylib.Mesh
function M.GenMeshPlane(width, length, resX, resZ)
return C.GenMeshPlane(width, length, resX, resZ)
end
---Generate cuboid mesh
---@param width number
---@param height number
---@param length number
---@return raylib.Mesh
function M.GenMeshCube(width, height, length)
return C.GenMeshCube(width, height, length)
end
---Generate sphere mesh (standard sphere)
---@param radius number
---@param rings integer
---@param slices integer
---@return raylib.Mesh
function M.GenMeshSphere(radius, rings, slices)
return C.GenMeshSphere(radius, rings, slices)
end
---Generate half-sphere mesh (no bottom cap)
---@param radius number
---@param rings integer
---@param slices integer
---@return raylib.Mesh
function M.GenMeshHemiSphere(radius, rings, slices)
return C.GenMeshHemiSphere(radius, rings, slices)
end
---Generate cylinder mesh
---@param radius number
---@param height number
---@param slices integer
---@return raylib.Mesh
function M.GenMeshCylinder(radius, height, slices)
return C.GenMeshCylinder(radius, height, slices)
end
---Generate cone/pyramid mesh
---@param radius number
---@param height number
---@param slices integer
---@return raylib.Mesh
function M.GenMeshCone(radius, height, slices)
return C.GenMeshCone(radius, height, slices)
end
---Generate torus mesh
---@param radius number
---@param size number
---@param radSeg integer
---@param sides integer
---@return raylib.Mesh
function M.GenMeshTorus(radius, size, radSeg, sides)
return C.GenMeshTorus(radius, size, radSeg, sides)
end
---Generate trefoil knot mesh
---@param radius number
---@param size number
---@param radSeg integer
---@param sides integer
---@return raylib.Mesh
function M.GenMeshKnot(radius, size, radSeg, sides)
return C.GenMeshKnot(radius, size, radSeg, sides)
end
---Generate heightmap mesh from image data
---@param heightmap raylib.Image
---@param size raylib.Vector3
---@return raylib.Mesh
function M.GenMeshHeightmap(heightmap, size)
return C.GenMeshHeightmap(heightmap, size)
end
---Generate cubes-based map mesh from image data
---@param cubicmap raylib.Image
---@param cubeSize raylib.Vector3
---@return raylib.Mesh
function M.GenMeshCubicmap(cubicmap, cubeSize)
return C.GenMeshCubicmap(cubicmap, cubeSize)
end
---Load materials from model file
---@param fileName string
---@param materialCount ffi.cdata*
---@return ffi.cdata*
function M.LoadMaterials(fileName, materialCount)
return C.LoadMaterials(fileName, materialCount)
end
---Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
---@return raylib.Material
function M.LoadMaterialDefault()
return C.LoadMaterialDefault()
end
---Check if material is valid (shader assigned, map textures loaded in GPU)
---@param material raylib.Material
---@return boolean
function M.IsMaterialValid(material)
return C.IsMaterialValid(material)
end
---Unload material from GPU memory (VRAM)
---@param material raylib.Material
---@return nil
function M.UnloadMaterial(material)
C.UnloadMaterial(material)
end
---Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
---@param material raylib.Material
---@param mapType integer
---@param texture raylib.Texture2D
---@return raylib.Material
function M.SetMaterialTexture(material, mapType, texture)
local _o1 = ffi.new("Material[1]", material)
C.SetMaterialTexture(_o1, mapType, texture)
return _o1[0]
end
---Set material for a mesh
---@param model raylib.Model
---@param meshId integer
---@param materialId integer
---@return raylib.Model
function M.SetModelMeshMaterial(model, meshId, materialId)
local _o1 = ffi.new("Model[1]", model)
C.SetModelMeshMaterial(_o1, meshId, materialId)
return _o1[0]
end
---Load model animations from file
---@param fileName string
---@param animCount ffi.cdata*
---@return ffi.cdata*
function M.LoadModelAnimations(fileName, animCount)
return C.LoadModelAnimations(fileName, animCount)
end
---Update model animation pose (vertex buffers and bone matrices)
---@param model raylib.Model
---@param anim raylib.ModelAnimation
---@param frame number
---@return nil
function M.UpdateModelAnimation(model, anim, frame)
C.UpdateModelAnimation(model, anim, frame)
end
---Update model animation pose, blending two animations
---@param model raylib.Model
---@param animA raylib.ModelAnimation
---@param frameA number
---@param animB raylib.ModelAnimation
---@param frameB number
---@param blend number
---@return nil
function M.UpdateModelAnimationEx(model, animA, frameA, animB, frameB, blend)
C.UpdateModelAnimationEx(model, animA, frameA, animB, frameB, blend)
end
---Unload animation array data
---@param animations ffi.cdata*
---@param animCount integer
---@return nil
function M.UnloadModelAnimations(animations, animCount)
C.UnloadModelAnimations(animations, animCount)
end
---Check model animation skeleton match
---@param model raylib.Model
---@param anim raylib.ModelAnimation
---@return boolean
function M.IsModelAnimationValid(model, anim)
return C.IsModelAnimationValid(model, anim)
end
---Check collision between two spheres
---@param center1 raylib.Vector3
---@param radius1 number
---@param center2 raylib.Vector3
---@param radius2 number
---@return boolean
function M.CheckCollisionSpheres(center1, radius1, center2, radius2)
return C.CheckCollisionSpheres(center1, radius1, center2, radius2)
end
---Check collision between two bounding boxes
---@param box1 raylib.BoundingBox
---@param box2 raylib.BoundingBox
---@return boolean
function M.CheckCollisionBoxes(box1, box2)
return C.CheckCollisionBoxes(box1, box2)
end
---Check collision between box and sphere
---@param box raylib.BoundingBox
---@param center raylib.Vector3
---@param radius number
---@return boolean
function M.CheckCollisionBoxSphere(box, center, radius)
return C.CheckCollisionBoxSphere(box, center, radius)
end
---Get collision info between ray and sphere
---@param ray raylib.Ray
---@param center raylib.Vector3
---@param radius number
---@return raylib.RayCollision
function M.GetRayCollisionSphere(ray, center, radius)
return C.GetRayCollisionSphere(ray, center, radius)
end
---Get collision info between ray and box
---@param ray raylib.Ray
---@param box raylib.BoundingBox
---@return raylib.RayCollision
function M.GetRayCollisionBox(ray, box)
return C.GetRayCollisionBox(ray, box)
end
---Get collision info between ray and mesh
---@param ray raylib.Ray
---@param mesh raylib.Mesh
---@param transform raylib.Matrix
---@return raylib.RayCollision
function M.GetRayCollisionMesh(ray, mesh, transform)
return C.GetRayCollisionMesh(ray, mesh, transform)
end
---Get collision info between ray and triangle
---@param ray raylib.Ray
---@param p1 raylib.Vector3
---@param p2 raylib.Vector3
---@param p3 raylib.Vector3
---@return raylib.RayCollision
function M.GetRayCollisionTriangle(ray, p1, p2, p3)
return C.GetRayCollisionTriangle(ray, p1, p2, p3)
end
---Get collision info between ray and quad
---@param ray raylib.Ray
---@param p1 raylib.Vector3
---@param p2 raylib.Vector3
---@param p3 raylib.Vector3
---@param p4 raylib.Vector3
---@return raylib.RayCollision
function M.GetRayCollisionQuad(ray, p1, p2, p3, p4)
return C.GetRayCollisionQuad(ray, p1, p2, p3, p4)
end
---Initialize audio device and context
---@return nil
function M.InitAudioDevice()
C.InitAudioDevice()
end
---Close the audio device and context
---@return nil
function M.CloseAudioDevice()
C.CloseAudioDevice()
end
---Check if audio device has been initialized successfully
---@return boolean
function M.IsAudioDeviceReady()
return C.IsAudioDeviceReady()
end
---Set master volume (listener)
---@param volume number
---@return nil
function M.SetMasterVolume(volume)
C.SetMasterVolume(volume)
end
---Get master volume (listener)
---@return number
function M.GetMasterVolume()
return C.GetMasterVolume()
end
---Load wave data from file
---@param fileName string
---@return raylib.Wave
function M.LoadWave(fileName)
return C.LoadWave(fileName)
end
---Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
---@param fileType string
---@param fileData string|integer[]
---@param dataSize integer
---@return raylib.Wave
function M.LoadWaveFromMemory(fileType, fileData, dataSize)
local _a2
if type(fileData) == "string" then _a2 = ffi.cast("const unsigned char *", fileData)
elseif type(fileData) == "table" then _a2 = to_array("unsigned char", fileData)
else _a2 = fileData end
return C.LoadWaveFromMemory(fileType, _a2, dataSize)
end
---Check if wave data is valid (data loaded and parameters)
---@param wave raylib.Wave
---@return boolean
function M.IsWaveValid(wave)
return C.IsWaveValid(wave)
end
---Load sound from file
---@param fileName string
---@return raylib.Sound
function M.LoadSound(fileName)
return C.LoadSound(fileName)
end
---Load sound from wave data
---@param wave raylib.Wave
---@return raylib.Sound
function M.LoadSoundFromWave(wave)
return C.LoadSoundFromWave(wave)
end
---Load sound alias, new sound that shares the same sample data as the source sound, does not own the sound data
---@param source raylib.Sound
---@return raylib.Sound
function M.LoadSoundAlias(source)
return C.LoadSoundAlias(source)
end
---Check if sound is valid (data loaded and buffers initialized)
---@param sound raylib.Sound
---@return boolean
function M.IsSoundValid(sound)
return C.IsSoundValid(sound)
end
---Update sound buffer with new data (default data format: 32 bit float, stereo)
---@param sound raylib.Sound
---@param data ffi.cdata*|string
---@param frameCount integer
---@return nil
function M.UpdateSound(sound, data, frameCount)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
C.UpdateSound(sound, _a2, frameCount)
end
---Unload wave data
---@param wave raylib.Wave
---@return nil
function M.UnloadWave(wave)
C.UnloadWave(wave)
end
---Unload sound
---@param sound raylib.Sound
---@return nil
function M.UnloadSound(sound)
C.UnloadSound(sound)
end
---Unload sound alias (does not deallocate sample data)
---@param alias raylib.Sound
---@return nil
function M.UnloadSoundAlias(alias)
C.UnloadSoundAlias(alias)
end
---Export wave data to file, returns true on success
---@param wave raylib.Wave
---@param fileName string
---@return boolean
function M.ExportWave(wave, fileName)
return C.ExportWave(wave, fileName)
end
---Export wave sample data to code (.h), returns true on success
---@param wave raylib.Wave
---@param fileName string
---@return boolean
function M.ExportWaveAsCode(wave, fileName)
return C.ExportWaveAsCode(wave, fileName)
end
---Play a sound
---@param sound raylib.Sound
---@return nil
function M.PlaySound(sound)
C.PlaySound(sound)
end
---Stop playing a sound
---@param sound raylib.Sound
---@return nil
function M.StopSound(sound)
C.StopSound(sound)
end
---Pause a sound
---@param sound raylib.Sound
---@return nil
function M.PauseSound(sound)
C.PauseSound(sound)
end
---Resume a paused sound
---@param sound raylib.Sound
---@return nil
function M.ResumeSound(sound)
C.ResumeSound(sound)
end
---Check if sound is currently playing
---@param sound raylib.Sound
---@return boolean
function M.IsSoundPlaying(sound)
return C.IsSoundPlaying(sound)
end
---Set volume for a sound (1.0 is max level)
---@param sound raylib.Sound
---@param volume number
---@return nil
function M.SetSoundVolume(sound, volume)
C.SetSoundVolume(sound, volume)
end
---Set pitch for a sound (1.0 is base level)
---@param sound raylib.Sound
---@param pitch number
---@return nil
function M.SetSoundPitch(sound, pitch)
C.SetSoundPitch(sound, pitch)
end
---Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)
---@param sound raylib.Sound
---@param pan number
---@return nil
function M.SetSoundPan(sound, pan)
C.SetSoundPan(sound, pan)
end
---Copy a wave to a new wave
---@param wave raylib.Wave
---@return raylib.Wave
function M.WaveCopy(wave)
return C.WaveCopy(wave)
end
---Crop a wave to defined frames range
---@param wave raylib.Wave
---@param initFrame integer
---@param finalFrame integer
---@return raylib.Wave
function M.WaveCrop(wave, initFrame, finalFrame)
local _o1 = ffi.new("Wave[1]", wave)
C.WaveCrop(_o1, initFrame, finalFrame)
return _o1[0]
end
---Convert wave data to desired format
---@param wave raylib.Wave
---@param sampleRate integer
---@param sampleSize integer
---@param channels integer
---@return raylib.Wave
function M.WaveFormat(wave, sampleRate, sampleSize, channels)
local _o1 = ffi.new("Wave[1]", wave)
C.WaveFormat(_o1, sampleRate, sampleSize, channels)
return _o1[0]
end
---Load samples data from wave as a 32bit float data array
---@param wave raylib.Wave
---@return ffi.cdata*
function M.LoadWaveSamples(wave)
return C.LoadWaveSamples(wave)
end
---Unload samples data loaded with LoadWaveSamples()
---@param samples ffi.cdata*
---@return nil
function M.UnloadWaveSamples(samples)
C.UnloadWaveSamples(samples)
end
---Load music stream from file
---@param fileName string
---@return raylib.Music
function M.LoadMusicStream(fileName)
return C.LoadMusicStream(fileName)
end
---Load music stream from data
---@param fileType string
---@param data string|integer[]
---@param dataSize integer
---@return raylib.Music
function M.LoadMusicStreamFromMemory(fileType, data, dataSize)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const unsigned char *", data)
elseif type(data) == "table" then _a2 = to_array("unsigned char", data)
else _a2 = data end
return C.LoadMusicStreamFromMemory(fileType, _a2, dataSize)
end
---Check if music stream is valid (context and buffers initialized)
---@param music raylib.Music
---@return boolean
function M.IsMusicValid(music)
return C.IsMusicValid(music)
end
---Unload music stream
---@param music raylib.Music
---@return nil
function M.UnloadMusicStream(music)
C.UnloadMusicStream(music)
end
---Start music playing
---@param music raylib.Music
---@return nil
function M.PlayMusicStream(music)
C.PlayMusicStream(music)
end
---Check if music is playing
---@param music raylib.Music
---@return boolean
function M.IsMusicStreamPlaying(music)
return C.IsMusicStreamPlaying(music)
end
---Update buffers for music streaming
---@param music raylib.Music
---@return nil
function M.UpdateMusicStream(music)
C.UpdateMusicStream(music)
end
---Stop music playing
---@param music raylib.Music
---@return nil
function M.StopMusicStream(music)
C.StopMusicStream(music)
end
---Pause music playing
---@param music raylib.Music
---@return nil
function M.PauseMusicStream(music)
C.PauseMusicStream(music)
end
---Resume playing paused music
---@param music raylib.Music
---@return nil
function M.ResumeMusicStream(music)
C.ResumeMusicStream(music)
end
---Seek music to a position (in seconds)
---@param music raylib.Music
---@param position number
---@return nil
function M.SeekMusicStream(music, position)
C.SeekMusicStream(music, position)
end
---Set volume for music (1.0 is max level)
---@param music raylib.Music
---@param volume number
---@return nil
function M.SetMusicVolume(music, volume)
C.SetMusicVolume(music, volume)
end
---Set pitch for music (1.0 is base level)
---@param music raylib.Music
---@param pitch number
---@return nil
function M.SetMusicPitch(music, pitch)
C.SetMusicPitch(music, pitch)
end
---Set pan for music (-1.0 left, 0.0 center, 1.0 right)
---@param music raylib.Music
---@param pan number
---@return nil
function M.SetMusicPan(music, pan)
C.SetMusicPan(music, pan)
end
---Get music time length (in seconds)
---@param music raylib.Music
---@return number
function M.GetMusicTimeLength(music)
return C.GetMusicTimeLength(music)
end
---Get current music time played (in seconds)
---@param music raylib.Music
---@return number
function M.GetMusicTimePlayed(music)
return C.GetMusicTimePlayed(music)
end
---Load audio stream (to stream raw audio pcm data)
---@param sampleRate integer
---@param sampleSize integer
---@param channels integer
---@return raylib.AudioStream
function M.LoadAudioStream(sampleRate, sampleSize, channels)
return C.LoadAudioStream(sampleRate, sampleSize, channels)
end
---Check if an audio stream is valid (buffers initialized)
---@param stream raylib.AudioStream
---@return boolean
function M.IsAudioStreamValid(stream)
return C.IsAudioStreamValid(stream)
end
---Unload audio stream and free memory
---@param stream raylib.AudioStream
---@return nil
function M.UnloadAudioStream(stream)
C.UnloadAudioStream(stream)
end
---Update audio stream buffers with data
---@param stream raylib.AudioStream
---@param data ffi.cdata*|string
---@param frameCount integer
---@return nil
function M.UpdateAudioStream(stream, data, frameCount)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
C.UpdateAudioStream(stream, _a2, frameCount)
end
---Check if any audio stream buffers requires refill
---@param stream raylib.AudioStream
---@return boolean
function M.IsAudioStreamProcessed(stream)
return C.IsAudioStreamProcessed(stream)
end
---Play audio stream
---@param stream raylib.AudioStream
---@return nil
function M.PlayAudioStream(stream)
C.PlayAudioStream(stream)
end
---Pause audio stream
---@param stream raylib.AudioStream
---@return nil
function M.PauseAudioStream(stream)
C.PauseAudioStream(stream)
end
---Resume audio stream
---@param stream raylib.AudioStream
---@return nil
function M.ResumeAudioStream(stream)
C.ResumeAudioStream(stream)
end
---Check if audio stream is playing
---@param stream raylib.AudioStream
---@return boolean
function M.IsAudioStreamPlaying(stream)
return C.IsAudioStreamPlaying(stream)
end
---Stop audio stream
---@param stream raylib.AudioStream
---@return nil
function M.StopAudioStream(stream)
C.StopAudioStream(stream)
end
---Set volume for audio stream (1.0 is max level)
---@param stream raylib.AudioStream
---@param volume number
---@return nil
function M.SetAudioStreamVolume(stream, volume)
C.SetAudioStreamVolume(stream, volume)
end
---Set pitch for audio stream (1.0 is base level)
---@param stream raylib.AudioStream
---@param pitch number
---@return nil
function M.SetAudioStreamPitch(stream, pitch)
C.SetAudioStreamPitch(stream, pitch)
end
---Set pan for audio stream (-1.0 left, 0.0 center, 1.0 right)
---@param stream raylib.AudioStream
---@param pan number
---@return nil
function M.SetAudioStreamPan(stream, pan)
C.SetAudioStreamPan(stream, pan)
end
---Default size for new audio streams
---@param size integer
---@return nil
function M.SetAudioStreamBufferSizeDefault(size)
C.SetAudioStreamBufferSizeDefault(size)
end
---Audio thread callback to request new data
---@param stream raylib.AudioStream
---@param callback raylib.AudioCallback
---@return nil
function M.SetAudioStreamCallback(stream, callback)
local _cb2 = pin("AudioCallback", callback)
C.SetAudioStreamCallback(stream, _cb2)
end
---Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo)
---@param stream raylib.AudioStream
---@param processor raylib.AudioCallback
---@return nil
function M.AttachAudioStreamProcessor(stream, processor)
local _cb2 = pin("AudioCallback", processor)
C.AttachAudioStreamProcessor(stream, _cb2)
end
---Detach audio stream processor from stream
---@param stream raylib.AudioStream
---@param processor raylib.AudioCallback
---@return nil
function M.DetachAudioStreamProcessor(stream, processor)
local _cb2 = pin("AudioCallback", processor)
C.DetachAudioStreamProcessor(stream, _cb2)
end
---Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)
---@param processor raylib.AudioCallback
---@return nil
function M.AttachAudioMixedProcessor(processor)
local _cb1 = pin("AudioCallback", processor)
C.AttachAudioMixedProcessor(_cb1)
end
---Detach audio stream processor from the entire audio pipeline
---@param processor raylib.AudioCallback
---@return nil
function M.DetachAudioMixedProcessor(processor)
local _cb1 = pin("AudioCallback", processor)
C.DetachAudioMixedProcessor(_cb1)
end
---Choose the current matrix to be transformed
---@param mode integer
---@return nil
function M.rlMatrixMode(mode)
C.rlMatrixMode(mode)
end
---Push the current matrix to stack
---@return nil
function M.rlPushMatrix()
C.rlPushMatrix()
end
---Pop latest inserted matrix from stack
---@return nil
function M.rlPopMatrix()
C.rlPopMatrix()
end
---Reset current matrix to identity matrix
---@return nil
function M.rlLoadIdentity()
C.rlLoadIdentity()
end
---Multiply the current matrix by a translation matrix
---@param x number
---@param y number
---@param z number
---@return nil
function M.rlTranslatef(x, y, z)
C.rlTranslatef(x, y, z)
end
---Multiply the current matrix by a rotation matrix
---@param angle number
---@param x number
---@param y number
---@param z number
---@return nil
function M.rlRotatef(angle, x, y, z)
C.rlRotatef(angle, x, y, z)
end
---Multiply the current matrix by a scaling matrix
---@param x number
---@param y number
---@param z number
---@return nil
function M.rlScalef(x, y, z)
C.rlScalef(x, y, z)
end
---Multiply the current matrix by another matrix
---@param matf number[]
---@return nil
function M.rlMultMatrixf(matf)
local _a1
if type(matf) == "table" then _a1 = to_array("float", matf)
else _a1 = matf end
C.rlMultMatrixf(_a1)
end
---@param left number
---@param right number
---@param bottom number
---@param top number
---@param znear number
---@param zfar number
---@return nil
function M.rlFrustum(left, right, bottom, top, znear, zfar)
C.rlFrustum(left, right, bottom, top, znear, zfar)
end
---@param left number
---@param right number
---@param bottom number
---@param top number
---@param znear number
---@param zfar number
---@return nil
function M.rlOrtho(left, right, bottom, top, znear, zfar)
C.rlOrtho(left, right, bottom, top, znear, zfar)
end
---Set the viewport area
---@param x integer
---@param y integer
---@param width integer
---@param height integer
---@return nil
function M.rlViewport(x, y, width, height)
C.rlViewport(x, y, width, height)
end
---Set clip planes distances
---@param nearPlane number
---@param farPlane number
---@return nil
function M.rlSetClipPlanes(nearPlane, farPlane)
C.rlSetClipPlanes(nearPlane, farPlane)
end
---Get cull plane distance near
---@return number
function M.rlGetCullDistanceNear()
return C.rlGetCullDistanceNear()
end
---Get cull plane distance far
---@return number
function M.rlGetCullDistanceFar()
return C.rlGetCullDistanceFar()
end
---Initialize drawing mode (how to organize vertex)
---@param mode integer
---@return nil
function M.rlBegin(mode)
C.rlBegin(mode)
end
---Finish vertex providing
---@return nil
function M.rlEnd()
C.rlEnd()
end
---Define one vertex (position) - 2 int
---@param x integer
---@param y integer
---@return nil
function M.rlVertex2i(x, y)
C.rlVertex2i(x, y)
end
---Define one vertex (position) - 2 float
---@param x number
---@param y number
---@return nil
function M.rlVertex2f(x, y)
C.rlVertex2f(x, y)
end
---Define one vertex (position) - 3 float
---@param x number
---@param y number
---@param z number
---@return nil
function M.rlVertex3f(x, y, z)
C.rlVertex3f(x, y, z)
end
---Define one vertex (texture coordinate) - 2 float
---@param x number
---@param y number
---@return nil
function M.rlTexCoord2f(x, y)
C.rlTexCoord2f(x, y)
end
---Define one vertex (normal) - 3 float
---@param x number
---@param y number
---@param z number
---@return nil
function M.rlNormal3f(x, y, z)
C.rlNormal3f(x, y, z)
end
---Define one vertex (color) - 4 byte
---@param r integer
---@param g integer
---@param b integer
---@param a integer
---@return nil
function M.rlColor4ub(r, g, b, a)
C.rlColor4ub(r, g, b, a)
end
---Define one vertex (color) - 3 float
---@param x number
---@param y number
---@param z number
---@return nil
function M.rlColor3f(x, y, z)
C.rlColor3f(x, y, z)
end
---Define one vertex (color) - 4 float
---@param x number
---@param y number
---@param z number
---@param w number
---@return nil
function M.rlColor4f(x, y, z, w)
C.rlColor4f(x, y, z, w)
end
---Enable vertex array (VAO, if supported)
---@param vaoId integer
---@return boolean
function M.rlEnableVertexArray(vaoId)
return C.rlEnableVertexArray(vaoId)
end
---Disable vertex array (VAO, if supported)
---@return nil
function M.rlDisableVertexArray()
C.rlDisableVertexArray()
end
---Enable vertex buffer (VBO)
---@param id integer
---@return nil
function M.rlEnableVertexBuffer(id)
C.rlEnableVertexBuffer(id)
end
---Disable vertex buffer (VBO)
---@return nil
function M.rlDisableVertexBuffer()
C.rlDisableVertexBuffer()
end
---Enable vertex buffer element (VBO element)
---@param id integer
---@return nil
function M.rlEnableVertexBufferElement(id)
C.rlEnableVertexBufferElement(id)
end
---Disable vertex buffer element (VBO element)
---@return nil
function M.rlDisableVertexBufferElement()
C.rlDisableVertexBufferElement()
end
---Enable vertex attribute index
---@param index integer
---@return nil
function M.rlEnableVertexAttribute(index)
C.rlEnableVertexAttribute(index)
end
---Disable vertex attribute index
---@param index integer
---@return nil
function M.rlDisableVertexAttribute(index)
C.rlDisableVertexAttribute(index)
end
---Enable attribute state pointer
---@param vertexAttribType integer
---@param buffer ffi.cdata*|string
---@return nil
function M.rlEnableStatePointer(vertexAttribType, buffer)
local _a2
if type(buffer) == "string" then _a2 = ffi.cast("const void *", buffer)
else _a2 = buffer end
C.rlEnableStatePointer(vertexAttribType, _a2)
end
---Disable attribute state pointer
---@param vertexAttribType integer
---@return nil
function M.rlDisableStatePointer(vertexAttribType)
C.rlDisableStatePointer(vertexAttribType)
end
---Select and active a texture slot
---@param slot integer
---@return nil
function M.rlActiveTextureSlot(slot)
C.rlActiveTextureSlot(slot)
end
---Enable texture
---@param id integer
---@return nil
function M.rlEnableTexture(id)
C.rlEnableTexture(id)
end
---Disable texture
---@return nil
function M.rlDisableTexture()
C.rlDisableTexture()
end
---Enable texture cubemap
---@param id integer
---@return nil
function M.rlEnableTextureCubemap(id)
C.rlEnableTextureCubemap(id)
end
---Disable texture cubemap
---@return nil
function M.rlDisableTextureCubemap()
C.rlDisableTextureCubemap()
end
---Set texture parameters (filter, wrap)
---@param id integer
---@param param integer
---@param value integer
---@return nil
function M.rlTextureParameters(id, param, value)
C.rlTextureParameters(id, param, value)
end
---Set cubemap parameters (filter, wrap)
---@param id integer
---@param param integer
---@param value integer
---@return nil
function M.rlCubemapParameters(id, param, value)
C.rlCubemapParameters(id, param, value)
end
---Enable shader program
---@param id integer
---@return nil
function M.rlEnableShader(id)
C.rlEnableShader(id)
end
---Disable shader program
---@return nil
function M.rlDisableShader()
C.rlDisableShader()
end
---Enable render texture (fbo)
---@param id integer
---@return nil
function M.rlEnableFramebuffer(id)
C.rlEnableFramebuffer(id)
end
---Disable render texture (fbo), return to default framebuffer
---@return nil
function M.rlDisableFramebuffer()
C.rlDisableFramebuffer()
end
---Get the currently active render texture (fbo), 0 for default framebuffer
---@return integer
function M.rlGetActiveFramebuffer()
return C.rlGetActiveFramebuffer()
end
---Activate multiple draw color buffers
---@param count integer
---@return nil
function M.rlActiveDrawBuffers(count)
C.rlActiveDrawBuffers(count)
end
---Blit active framebuffer to main framebuffer
---@param srcX integer
---@param srcY integer
---@param srcWidth integer
---@param srcHeight integer
---@param dstX integer
---@param dstY integer
---@param dstWidth integer
---@param dstHeight integer
---@param bufferMask integer
---@return nil
function M.rlBlitFramebuffer(srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight, bufferMask)
C.rlBlitFramebuffer(srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight, bufferMask)
end
---Bind framebuffer (FBO)
---@param target integer
---@param framebuffer integer
---@return nil
function M.rlBindFramebuffer(target, framebuffer)
C.rlBindFramebuffer(target, framebuffer)
end
---Enable color blending
---@return nil
function M.rlEnableColorBlend()
C.rlEnableColorBlend()
end
---Disable color blending
---@return nil
function M.rlDisableColorBlend()
C.rlDisableColorBlend()
end
---Enable depth test
---@return nil
function M.rlEnableDepthTest()
C.rlEnableDepthTest()
end
---Disable depth test
---@return nil
function M.rlDisableDepthTest()
C.rlDisableDepthTest()
end
---Enable depth write
---@return nil
function M.rlEnableDepthMask()
C.rlEnableDepthMask()
end
---Disable depth write
---@return nil
function M.rlDisableDepthMask()
C.rlDisableDepthMask()
end
---Enable backface culling
---@return nil
function M.rlEnableBackfaceCulling()
C.rlEnableBackfaceCulling()
end
---Disable backface culling
---@return nil
function M.rlDisableBackfaceCulling()
C.rlDisableBackfaceCulling()
end
---Color mask control
---@param r boolean
---@param g boolean
---@param b boolean
---@param a boolean
---@return nil
function M.rlColorMask(r, g, b, a)
C.rlColorMask(r, g, b, a)
end
---Set face culling mode
---@param mode integer
---@return nil
function M.rlSetCullFace(mode)
C.rlSetCullFace(mode)
end
---Enable scissor test
---@return nil
function M.rlEnableScissorTest()
C.rlEnableScissorTest()
end
---Disable scissor test
---@return nil
function M.rlDisableScissorTest()
C.rlDisableScissorTest()
end
---Scissor test
---@param x integer
---@param y integer
---@param width integer
---@param height integer
---@return nil
function M.rlScissor(x, y, width, height)
C.rlScissor(x, y, width, height)
end
---Enable point mode
---@return nil
function M.rlEnablePointMode()
C.rlEnablePointMode()
end
---Disable point mode
---@return nil
function M.rlDisablePointMode()
C.rlDisablePointMode()
end
---Set the point drawing size
---@param size number
---@return nil
function M.rlSetPointSize(size)
C.rlSetPointSize(size)
end
---Get the point drawing size
---@return number
function M.rlGetPointSize()
return C.rlGetPointSize()
end
---Enable wire mode
---@return nil
function M.rlEnableWireMode()
C.rlEnableWireMode()
end
---Disable wire mode
---@return nil
function M.rlDisableWireMode()
C.rlDisableWireMode()
end
---Set the line drawing width
---@param width number
---@return nil
function M.rlSetLineWidth(width)
C.rlSetLineWidth(width)
end
---Get the line drawing width
---@return number
function M.rlGetLineWidth()
return C.rlGetLineWidth()
end
---Enable line aliasing
---@return nil
function M.rlEnableSmoothLines()
C.rlEnableSmoothLines()
end
---Disable line aliasing
---@return nil
function M.rlDisableSmoothLines()
C.rlDisableSmoothLines()
end
---Enable stereo rendering
---@return nil
function M.rlEnableStereoRender()
C.rlEnableStereoRender()
end
---Disable stereo rendering
---@return nil
function M.rlDisableStereoRender()
C.rlDisableStereoRender()
end
---Check if stereo render is enabled
---@return boolean
function M.rlIsStereoRenderEnabled()
return C.rlIsStereoRenderEnabled()
end
---Clear color buffer with color
---@param r integer
---@param g integer
---@param b integer
---@param a integer
---@return nil
function M.rlClearColor(r, g, b, a)
C.rlClearColor(r, g, b, a)
end
---Clear used screen buffers (color and depth)
---@return nil
function M.rlClearScreenBuffers()
C.rlClearScreenBuffers()
end
---Check and log OpenGL error codes
---@return nil
function M.rlCheckErrors()
C.rlCheckErrors()
end
---Set blending mode
---@param mode integer
---@return nil
function M.rlSetBlendMode(mode)
C.rlSetBlendMode(mode)
end
---Set blending mode factor and equation (using OpenGL factors)
---@param glSrcFactor integer
---@param glDstFactor integer
---@param glEquation integer
---@return nil
function M.rlSetBlendFactors(glSrcFactor, glDstFactor, glEquation)
C.rlSetBlendFactors(glSrcFactor, glDstFactor, glEquation)
end
---Set blending mode factors and equations separately (using OpenGL factors)
---@param glSrcRGB integer
---@param glDstRGB integer
---@param glSrcAlpha integer
---@param glDstAlpha integer
---@param glEqRGB integer
---@param glEqAlpha integer
---@return nil
function M.rlSetBlendFactorsSeparate(glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, glEqAlpha)
C.rlSetBlendFactorsSeparate(glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, glEqAlpha)
end
---Initialize rlgl (buffers, shaders, textures, states)
---@param width integer
---@param height integer
---@return nil
function M.rlglInit(width, height)
C.rlglInit(width, height)
end
---De-initialize rlgl (buffers, shaders, textures)
---@return nil
function M.rlglClose()
C.rlglClose()
end
---Load OpenGL extensions (loader function required)
---@param loader ffi.cdata*|string
---@return nil
function M.rlLoadExtensions(loader)
local _a1
if type(loader) == "string" then _a1 = ffi.cast("const void *", loader)
else _a1 = loader end
C.rlLoadExtensions(_a1)
end
---Get OpenGL procedure address
---@param procName string
---@return ffi.cdata*
function M.rlGetProcAddress(procName)
return C.rlGetProcAddress(procName)
end
---Get current OpenGL version
---@return integer
function M.rlGetVersion()
return C.rlGetVersion()
end
---Set current framebuffer width
---@param width integer
---@return nil
function M.rlSetFramebufferWidth(width)
C.rlSetFramebufferWidth(width)
end
---Get default framebuffer width
---@return integer
function M.rlGetFramebufferWidth()
return C.rlGetFramebufferWidth()
end
---Set current framebuffer height
---@param height integer
---@return nil
function M.rlSetFramebufferHeight(height)
C.rlSetFramebufferHeight(height)
end
---Get default framebuffer height
---@return integer
function M.rlGetFramebufferHeight()
return C.rlGetFramebufferHeight()
end
---Get default texture id
---@return integer
function M.rlGetTextureIdDefault()
return C.rlGetTextureIdDefault()
end
---Get default shader id
---@return integer
function M.rlGetShaderIdDefault()
return C.rlGetShaderIdDefault()
end
---Get default shader locations
---@return ffi.cdata*
function M.rlGetShaderLocsDefault()
return C.rlGetShaderLocsDefault()
end
---Load a render batch system
---@param numBuffers integer
---@param bufferElements integer
---@return raylib.rlRenderBatch
function M.rlLoadRenderBatch(numBuffers, bufferElements)
return C.rlLoadRenderBatch(numBuffers, bufferElements)
end
---Unload render batch system
---@param batch raylib.rlRenderBatch
---@return nil
function M.rlUnloadRenderBatch(batch)
C.rlUnloadRenderBatch(batch)
end
---Draw render batch data (Update->Draw->Reset)
---@param batch ffi.cdata*
---@return nil
function M.rlDrawRenderBatch(batch)
C.rlDrawRenderBatch(batch)
end
---Set the active render batch for rlgl (NULL for default internal)
---@param batch ffi.cdata*
---@return nil
function M.rlSetRenderBatchActive(batch)
C.rlSetRenderBatchActive(batch)
end
---Update and draw internal render batch
---@return nil
function M.rlDrawRenderBatchActive()
C.rlDrawRenderBatchActive()
end
---Check internal buffer overflow for a given number of vertex
---@param vCount integer
---@return boolean
function M.rlCheckRenderBatchLimit(vCount)
return C.rlCheckRenderBatchLimit(vCount)
end
---Set current texture for render batch and check buffers limits
---@param id integer
---@return nil
function M.rlSetTexture(id)
C.rlSetTexture(id)
end
---Load vertex array (vao) if supported
---@return integer
function M.rlLoadVertexArray()
return C.rlLoadVertexArray()
end
---Load a vertex buffer object
---@param buffer ffi.cdata*|string
---@param size integer
---@param dynamic boolean
---@return integer
function M.rlLoadVertexBuffer(buffer, size, dynamic)
local _a1
if type(buffer) == "string" then _a1 = ffi.cast("const void *", buffer)
else _a1 = buffer end
return C.rlLoadVertexBuffer(_a1, size, dynamic)
end
---Load vertex buffer elements object
---@param buffer ffi.cdata*|string
---@param size integer
---@param dynamic boolean
---@return integer
function M.rlLoadVertexBufferElement(buffer, size, dynamic)
local _a1
if type(buffer) == "string" then _a1 = ffi.cast("const void *", buffer)
else _a1 = buffer end
return C.rlLoadVertexBufferElement(_a1, size, dynamic)
end
---Update vertex buffer object data on GPU buffer
---@param bufferId integer
---@param data ffi.cdata*|string
---@param dataSize integer
---@param offset integer
---@return nil
function M.rlUpdateVertexBuffer(bufferId, data, dataSize, offset)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
C.rlUpdateVertexBuffer(bufferId, _a2, dataSize, offset)
end
---Update vertex buffer elements data on GPU buffer
---@param id integer
---@param data ffi.cdata*|string
---@param dataSize integer
---@param offset integer
---@return nil
function M.rlUpdateVertexBufferElements(id, data, dataSize, offset)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
C.rlUpdateVertexBufferElements(id, _a2, dataSize, offset)
end
---Unload vertex array (vao)
---@param vaoId integer
---@return nil
function M.rlUnloadVertexArray(vaoId)
C.rlUnloadVertexArray(vaoId)
end
---Unload vertex buffer object
---@param vboId integer
---@return nil
function M.rlUnloadVertexBuffer(vboId)
C.rlUnloadVertexBuffer(vboId)
end
---Set vertex attribute data configuration
---@param index integer
---@param compSize integer
---@param type integer
---@param normalized boolean
---@param stride integer
---@param offset integer
---@return nil
function M.rlSetVertexAttribute(index, compSize, type, normalized, stride, offset)
C.rlSetVertexAttribute(index, compSize, type, normalized, stride, offset)
end
---Set vertex attribute data divisor
---@param index integer
---@param divisor integer
---@return nil
function M.rlSetVertexAttributeDivisor(index, divisor)
C.rlSetVertexAttributeDivisor(index, divisor)
end
---Set vertex attribute default value, when attribute to provided
---@param locIndex integer
---@param value ffi.cdata*|string
---@param attribType integer
---@param count integer
---@return nil
function M.rlSetVertexAttributeDefault(locIndex, value, attribType, count)
local _a2
if type(value) == "string" then _a2 = ffi.cast("const void *", value)
else _a2 = value end
C.rlSetVertexAttributeDefault(locIndex, _a2, attribType, count)
end
---Draw vertex array (currently active vao)
---@param offset integer
---@param count integer
---@return nil
function M.rlDrawVertexArray(offset, count)
C.rlDrawVertexArray(offset, count)
end
---Draw vertex array elements
---@param offset integer
---@param count integer
---@param buffer ffi.cdata*|string
---@return nil
function M.rlDrawVertexArrayElements(offset, count, buffer)
local _a3
if type(buffer) == "string" then _a3 = ffi.cast("const void *", buffer)
else _a3 = buffer end
C.rlDrawVertexArrayElements(offset, count, _a3)
end
---Draw vertex array (currently active vao) with instancing
---@param offset integer
---@param count integer
---@param instances integer
---@return nil
function M.rlDrawVertexArrayInstanced(offset, count, instances)
C.rlDrawVertexArrayInstanced(offset, count, instances)
end
---Draw vertex array elements with instancing
---@param offset integer
---@param count integer
---@param buffer ffi.cdata*|string
---@param instances integer
---@return nil
function M.rlDrawVertexArrayElementsInstanced(offset, count, buffer, instances)
local _a3
if type(buffer) == "string" then _a3 = ffi.cast("const void *", buffer)
else _a3 = buffer end
C.rlDrawVertexArrayElementsInstanced(offset, count, _a3, instances)
end
---Load texture data
---@param data ffi.cdata*|string
---@param width integer
---@param height integer
---@param format integer
---@param mipmapCount integer
---@return integer
function M.rlLoadTexture(data, width, height, format, mipmapCount)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const void *", data)
else _a1 = data end
return C.rlLoadTexture(_a1, width, height, format, mipmapCount)
end
---Load depth texture/renderbuffer (to be attached to fbo)
---@param width integer
---@param height integer
---@param useRenderBuffer boolean
---@return integer
function M.rlLoadTextureDepth(width, height, useRenderBuffer)
return C.rlLoadTextureDepth(width, height, useRenderBuffer)
end
---Load texture cubemap data
---@param data ffi.cdata*|string
---@param size integer
---@param format integer
---@param mipmapCount integer
---@return integer
function M.rlLoadTextureCubemap(data, size, format, mipmapCount)
local _a1
if type(data) == "string" then _a1 = ffi.cast("const void *", data)
else _a1 = data end
return C.rlLoadTextureCubemap(_a1, size, format, mipmapCount)
end
---Update texture with new data on GPU
---@param id integer
---@param offsetX integer
---@param offsetY integer
---@param width integer
---@param height integer
---@param format integer
---@param data ffi.cdata*|string
---@return nil
function M.rlUpdateTexture(id, offsetX, offsetY, width, height, format, data)
local _a7
if type(data) == "string" then _a7 = ffi.cast("const void *", data)
else _a7 = data end
C.rlUpdateTexture(id, offsetX, offsetY, width, height, format, _a7)
end
---Get OpenGL internal formats
---@param format integer
---@param glInternalFormat ffi.cdata*
---@param glFormat ffi.cdata*
---@param glType ffi.cdata*
---@return nil
function M.rlGetGlTextureFormats(format, glInternalFormat, glFormat, glType)
C.rlGetGlTextureFormats(format, glInternalFormat, glFormat, glType)
end
---Get name string for pixel format
---@param format integer
---@return string|nil
function M.rlGetPixelFormatName(format)
local _p = C.rlGetPixelFormatName(format)
if _p == nil then
return nil
end
local _s = ffi_string(_p)
return _s
end
---Unload texture from GPU memory
---@param id integer
---@return nil
function M.rlUnloadTexture(id)
C.rlUnloadTexture(id)
end
---Generate mipmap data for selected texture
---@param id integer
---@param width integer
---@param height integer
---@param format integer
---@param mipmaps ffi.cdata*
---@return nil
function M.rlGenTextureMipmaps(id, width, height, format, mipmaps)
C.rlGenTextureMipmaps(id, width, height, format, mipmaps)
end
---Read texture pixel data
---@param id integer
---@param width integer
---@param height integer
---@param format integer
---@return ffi.cdata*
function M.rlReadTexturePixels(id, width, height, format)
return C.rlReadTexturePixels(id, width, height, format)
end
---Read screen pixel data (color buffer)
---@param width integer
---@param height integer
---@return ffi.cdata*
function M.rlReadScreenPixels(width, height)
return C.rlReadScreenPixels(width, height)
end
---Load an empty framebuffer
---@return integer
function M.rlLoadFramebuffer()
return C.rlLoadFramebuffer()
end
---Attach texture/renderbuffer to a framebuffer
---@param id integer
---@param texId integer
---@param attachType integer
---@param texType integer
---@param mipLevel integer
---@return nil
function M.rlFramebufferAttach(id, texId, attachType, texType, mipLevel)
C.rlFramebufferAttach(id, texId, attachType, texType, mipLevel)
end
---Verify framebuffer is complete
---@param id integer
---@return boolean
function M.rlFramebufferComplete(id)
return C.rlFramebufferComplete(id)
end
---Delete framebuffer from GPU
---@param id integer
---@return nil
function M.rlUnloadFramebuffer(id)
C.rlUnloadFramebuffer(id)
end
---Copy framebuffer pixel data to internal buffer
---@param x integer
---@param y integer
---@param width integer
---@param height integer
---@param format integer
---@param pixels ffi.cdata*|string
---@return nil
function M.rlCopyFramebuffer(x, y, width, height, format, pixels)
local _a6
if type(pixels) == "string" then _a6 = ffi.cast("const void *", pixels)
else _a6 = pixels end
C.rlCopyFramebuffer(x, y, width, height, format, _a6)
end
---Resize internal framebuffer
---@param width integer
---@param height integer
---@return nil
function M.rlResizeFramebuffer(width, height)
C.rlResizeFramebuffer(width, height)
end
---Load (compile) shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
---@param code string
---@param type integer
---@return integer
function M.rlLoadShader(code, type)
return C.rlLoadShader(code, type)
end
---Load shader from code strings
---@param vsCode string
---@param fsCode string
---@return integer
function M.rlLoadShaderProgram(vsCode, fsCode)
return C.rlLoadShaderProgram(vsCode, fsCode)
end
---Load shader program, using already loaded shader ids
---@param vsId integer
---@param fsId integer
---@return integer
function M.rlLoadShaderProgramEx(vsId, fsId)
return C.rlLoadShaderProgramEx(vsId, fsId)
end
---Load compute shader program
---@param csId integer
---@return integer
function M.rlLoadShaderProgramCompute(csId)
return C.rlLoadShaderProgramCompute(csId)
end
---Unload shader, loaded with rlLoadShader()
---@param id integer
---@return nil
function M.rlUnloadShader(id)
C.rlUnloadShader(id)
end
---Unload shader program
---@param id integer
---@return nil
function M.rlUnloadShaderProgram(id)
C.rlUnloadShaderProgram(id)
end
---Get shader location uniform, requires shader program id
---@param id integer
---@param uniformName string
---@return integer
function M.rlGetLocationUniform(id, uniformName)
return C.rlGetLocationUniform(id, uniformName)
end
---Get shader location attribute, requires shader program id
---@param id integer
---@param attribName string
---@return integer
function M.rlGetLocationAttrib(id, attribName)
return C.rlGetLocationAttrib(id, attribName)
end
---Set shader value uniform
---@param locIndex integer
---@param value ffi.cdata*|string
---@param uniformType integer
---@param count integer
---@return nil
function M.rlSetUniform(locIndex, value, uniformType, count)
local _a2
if type(value) == "string" then _a2 = ffi.cast("const void *", value)
else _a2 = value end
C.rlSetUniform(locIndex, _a2, uniformType, count)
end
---Set shader value matrix
---@param locIndex integer
---@param mat raylib.Matrix
---@return nil
function M.rlSetUniformMatrix(locIndex, mat)
C.rlSetUniformMatrix(locIndex, mat)
end
---Set shader value matrices
---@param locIndex integer
---@param mat raylib.Matrix[]
---@param count integer
---@return nil
function M.rlSetUniformMatrices(locIndex, mat, count)
local _a2
if type(mat) == "table" then _a2 = to_array("Matrix", mat)
else _a2 = mat end
C.rlSetUniformMatrices(locIndex, _a2, count)
end
---Set shader value sampler
---@param locIndex integer
---@param textureId integer
---@return nil
function M.rlSetUniformSampler(locIndex, textureId)
C.rlSetUniformSampler(locIndex, textureId)
end
---Set shader currently active (id and locations)
---@param id integer
---@param locs ffi.cdata*
---@return nil
function M.rlSetShader(id, locs)
C.rlSetShader(id, locs)
end
---Dispatch compute shader (equivalent to *draw* for graphics pipeline)
---@param groupX integer
---@param groupY integer
---@param groupZ integer
---@return nil
function M.rlComputeShaderDispatch(groupX, groupY, groupZ)
C.rlComputeShaderDispatch(groupX, groupY, groupZ)
end
---Load shader storage buffer object (SSBO)
---@param size integer
---@param data ffi.cdata*|string
---@param usageHint integer
---@return integer
function M.rlLoadShaderBuffer(size, data, usageHint)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
return C.rlLoadShaderBuffer(size, _a2, usageHint)
end
---Unload shader storage buffer object (SSBO)
---@param ssboId integer
---@return nil
function M.rlUnloadShaderBuffer(ssboId)
C.rlUnloadShaderBuffer(ssboId)
end
---Update SSBO buffer data
---@param id integer
---@param data ffi.cdata*|string
---@param dataSize integer
---@param offset integer
---@return nil
function M.rlUpdateShaderBuffer(id, data, dataSize, offset)
local _a2
if type(data) == "string" then _a2 = ffi.cast("const void *", data)
else _a2 = data end
C.rlUpdateShaderBuffer(id, _a2, dataSize, offset)
end
---Bind SSBO buffer
---@param id integer
---@param index integer
---@return nil
function M.rlBindShaderBuffer(id, index)
C.rlBindShaderBuffer(id, index)
end
---Read SSBO buffer data (GPU->CPU)
---@param id integer
---@param dest ffi.cdata*|string
---@param count integer
---@param offset integer
---@return nil
function M.rlReadShaderBuffer(id, dest, count, offset)
local _a2
if type(dest) == "string" then _a2 = ffi.cast("const void *", dest)
else _a2 = dest end
C.rlReadShaderBuffer(id, _a2, count, offset)
end
---Copy SSBO data between buffers
---@param destId integer
---@param srcId integer
---@param destOffset integer
---@param srcOffset integer
---@param count integer
---@return nil
function M.rlCopyShaderBuffer(destId, srcId, destOffset, srcOffset, count)
C.rlCopyShaderBuffer(destId, srcId, destOffset, srcOffset, count)
end
---Get SSBO buffer size
---@param id integer
---@return integer
function M.rlGetShaderBufferSize(id)
return C.rlGetShaderBufferSize(id)
end
---Bind image texture
---@param id integer
---@param index integer
---@param format integer
---@param readonly boolean
---@return nil
function M.rlBindImageTexture(id, index, format, readonly)
C.rlBindImageTexture(id, index, format, readonly)
end
---Get internal modelview matrix
---@return raylib.Matrix
function M.rlGetMatrixModelview()
return C.rlGetMatrixModelview()
end
---Get internal projection matrix
---@return raylib.Matrix
function M.rlGetMatrixProjection()
return C.rlGetMatrixProjection()
end
---Get internal accumulated transform matrix
---@return raylib.Matrix
function M.rlGetMatrixTransform()
return C.rlGetMatrixTransform()
end
---Get internal projection matrix for stereo render (selected eye)
---@param eye integer
---@return raylib.Matrix
function M.rlGetMatrixProjectionStereo(eye)
return C.rlGetMatrixProjectionStereo(eye)
end
---Get internal view offset matrix for stereo render (selected eye)
---@param eye integer
---@return raylib.Matrix
function M.rlGetMatrixViewOffsetStereo(eye)
return C.rlGetMatrixViewOffsetStereo(eye)
end
---Set a custom projection matrix (replaces internal projection matrix)
---@param proj raylib.Matrix
---@return nil
function M.rlSetMatrixProjection(proj)
C.rlSetMatrixProjection(proj)
end
---Set a custom modelview matrix (replaces internal modelview matrix)
---@param view raylib.Matrix
---@return nil
function M.rlSetMatrixModelview(view)
C.rlSetMatrixModelview(view)
end
---Set eyes projection matrices for stereo rendering
---@param right raylib.Matrix
---@param left raylib.Matrix
---@return nil
function M.rlSetMatrixProjectionStereo(right, left)
C.rlSetMatrixProjectionStereo(right, left)
end
---Set eyes view offsets matrices for stereo rendering
---@param right raylib.Matrix
---@param left raylib.Matrix
---@return nil
function M.rlSetMatrixViewOffsetStereo(right, left)
C.rlSetMatrixViewOffsetStereo(right, left)
end
---Load and draw a cube
---@return nil
function M.rlLoadDrawCube()
C.rlLoadDrawCube()
end
---Load and draw a quad
---@return nil
function M.rlLoadDrawQuad()
C.rlLoadDrawQuad()
end
---@param value number
---@param min number
---@param max number
---@return number
function M.Clamp(value, min, max)
return C.Clamp(value, min, max)
end
---@param start number
---@param end_ number
---@param amount number
---@return number
function M.Lerp(start, end_, amount)
return C.Lerp(start, end_, amount)
end
---@param value number
---@param start number
---@param end_ number
---@return number
function M.Normalize(value, start, end_)
return C.Normalize(value, start, end_)
end
---@param value number
---@param inputStart number
---@param inputEnd number
---@param outputStart number
---@param outputEnd number
---@return number
function M.Remap(value, inputStart, inputEnd, outputStart, outputEnd)
return C.Remap(value, inputStart, inputEnd, outputStart, outputEnd)
end
---@param value number
---@param min number
---@param max number
---@return number
function M.Wrap(value, min, max)
return C.Wrap(value, min, max)
end
---@param x number
---@param y number
---@return integer
function M.FloatEquals(x, y)
return C.FloatEquals(x, y)
end
---@return raylib.Vector2
function M.Vector2Zero()
return C.Vector2Zero()
end
---@return raylib.Vector2
function M.Vector2One()
return C.Vector2One()
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return raylib.Vector2
function M.Vector2Add(v1, v2)
return C.Vector2Add(v1, v2)
end
---@param v raylib.Vector2
---@param add number
---@return raylib.Vector2
function M.Vector2AddValue(v, add)
return C.Vector2AddValue(v, add)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return raylib.Vector2
function M.Vector2Subtract(v1, v2)
return C.Vector2Subtract(v1, v2)
end
---@param v raylib.Vector2
---@param sub number
---@return raylib.Vector2
function M.Vector2SubtractValue(v, sub)
return C.Vector2SubtractValue(v, sub)
end
---@param v raylib.Vector2
---@return number
function M.Vector2Length(v)
return C.Vector2Length(v)
end
---@param v raylib.Vector2
---@return number
function M.Vector2LengthSqr(v)
return C.Vector2LengthSqr(v)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return number
function M.Vector2DotProduct(v1, v2)
return C.Vector2DotProduct(v1, v2)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return number
function M.Vector2CrossProduct(v1, v2)
return C.Vector2CrossProduct(v1, v2)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return number
function M.Vector2Distance(v1, v2)
return C.Vector2Distance(v1, v2)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return number
function M.Vector2DistanceSqr(v1, v2)
return C.Vector2DistanceSqr(v1, v2)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return number
function M.Vector2Angle(v1, v2)
return C.Vector2Angle(v1, v2)
end
---@param start raylib.Vector2
---@param end_ raylib.Vector2
---@return number
function M.Vector2LineAngle(start, end_)
return C.Vector2LineAngle(start, end_)
end
---@param v raylib.Vector2
---@param scale number
---@return raylib.Vector2
function M.Vector2Scale(v, scale)
return C.Vector2Scale(v, scale)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return raylib.Vector2
function M.Vector2Multiply(v1, v2)
return C.Vector2Multiply(v1, v2)
end
---@param v raylib.Vector2
---@return raylib.Vector2
function M.Vector2Negate(v)
return C.Vector2Negate(v)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return raylib.Vector2
function M.Vector2Divide(v1, v2)
return C.Vector2Divide(v1, v2)
end
---@param v raylib.Vector2
---@return raylib.Vector2
function M.Vector2Normalize(v)
return C.Vector2Normalize(v)
end
---@param v raylib.Vector2
---@param mat raylib.Matrix
---@return raylib.Vector2
function M.Vector2Transform(v, mat)
return C.Vector2Transform(v, mat)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@param amount number
---@return raylib.Vector2
function M.Vector2Lerp(v1, v2, amount)
return C.Vector2Lerp(v1, v2, amount)
end
---@param v raylib.Vector2
---@param normal raylib.Vector2
---@return raylib.Vector2
function M.Vector2Reflect(v, normal)
return C.Vector2Reflect(v, normal)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return raylib.Vector2
function M.Vector2Min(v1, v2)
return C.Vector2Min(v1, v2)
end
---@param v1 raylib.Vector2
---@param v2 raylib.Vector2
---@return raylib.Vector2
function M.Vector2Max(v1, v2)
return C.Vector2Max(v1, v2)
end
---@param v raylib.Vector2
---@param angle number
---@return raylib.Vector2
function M.Vector2Rotate(v, angle)
return C.Vector2Rotate(v, angle)
end
---@param v raylib.Vector2
---@param target raylib.Vector2
---@param maxDistance number
---@return raylib.Vector2
function M.Vector2MoveTowards(v, target, maxDistance)
return C.Vector2MoveTowards(v, target, maxDistance)
end
---@param v raylib.Vector2
---@return raylib.Vector2
function M.Vector2Invert(v)
return C.Vector2Invert(v)
end
---@param v raylib.Vector2
---@param min raylib.Vector2
---@param max raylib.Vector2
---@return raylib.Vector2
function M.Vector2Clamp(v, min, max)
return C.Vector2Clamp(v, min, max)
end
---@param v raylib.Vector2
---@param min number
---@param max number
---@return raylib.Vector2
function M.Vector2ClampValue(v, min, max)
return C.Vector2ClampValue(v, min, max)
end
---@param p raylib.Vector2
---@param q raylib.Vector2
---@return integer
function M.Vector2Equals(p, q)
return C.Vector2Equals(p, q)
end
---@param v raylib.Vector2
---@param n raylib.Vector2
---@param r number
---@return raylib.Vector2
function M.Vector2Refract(v, n, r)
return C.Vector2Refract(v, n, r)
end
---@return raylib.Vector3
function M.Vector3Zero()
return C.Vector3Zero()
end
---@return raylib.Vector3
function M.Vector3One()
return C.Vector3One()
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Add(v1, v2)
return C.Vector3Add(v1, v2)
end
---@param v raylib.Vector3
---@param add number
---@return raylib.Vector3
function M.Vector3AddValue(v, add)
return C.Vector3AddValue(v, add)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Subtract(v1, v2)
return C.Vector3Subtract(v1, v2)
end
---@param v raylib.Vector3
---@param sub number
---@return raylib.Vector3
function M.Vector3SubtractValue(v, sub)
return C.Vector3SubtractValue(v, sub)
end
---@param v raylib.Vector3
---@param scalar number
---@return raylib.Vector3
function M.Vector3Scale(v, scalar)
return C.Vector3Scale(v, scalar)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Multiply(v1, v2)
return C.Vector3Multiply(v1, v2)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3CrossProduct(v1, v2)
return C.Vector3CrossProduct(v1, v2)
end
---@param v raylib.Vector3
---@return raylib.Vector3
function M.Vector3Perpendicular(v)
return C.Vector3Perpendicular(v)
end
---@param v raylib.Vector3
---@return number
function M.Vector3Length(v)
return C.Vector3Length(v)
end
---@param v raylib.Vector3
---@return number
function M.Vector3LengthSqr(v)
return C.Vector3LengthSqr(v)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return number
function M.Vector3DotProduct(v1, v2)
return C.Vector3DotProduct(v1, v2)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return number
function M.Vector3Distance(v1, v2)
return C.Vector3Distance(v1, v2)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return number
function M.Vector3DistanceSqr(v1, v2)
return C.Vector3DistanceSqr(v1, v2)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return number
function M.Vector3Angle(v1, v2)
return C.Vector3Angle(v1, v2)
end
---@param v raylib.Vector3
---@return raylib.Vector3
function M.Vector3Negate(v)
return C.Vector3Negate(v)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Divide(v1, v2)
return C.Vector3Divide(v1, v2)
end
---@param v raylib.Vector3
---@return raylib.Vector3
function M.Vector3Normalize(v)
return C.Vector3Normalize(v)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Project(v1, v2)
return C.Vector3Project(v1, v2)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Reject(v1, v2)
return C.Vector3Reject(v1, v2)
end
---@param v1 ffi.cdata*
---@param v2 ffi.cdata*
---@return nil
function M.Vector3OrthoNormalize(v1, v2)
C.Vector3OrthoNormalize(v1, v2)
end
---@param v raylib.Vector3
---@param mat raylib.Matrix
---@return raylib.Vector3
function M.Vector3Transform(v, mat)
return C.Vector3Transform(v, mat)
end
---@param v raylib.Vector3
---@param q raylib.Quaternion
---@return raylib.Vector3
function M.Vector3RotateByQuaternion(v, q)
return C.Vector3RotateByQuaternion(v, q)
end
---@param v raylib.Vector3
---@param axis raylib.Vector3
---@param angle number
---@return raylib.Vector3
function M.Vector3RotateByAxisAngle(v, axis, angle)
return C.Vector3RotateByAxisAngle(v, axis, angle)
end
---@param v raylib.Vector3
---@param target raylib.Vector3
---@param maxDistance number
---@return raylib.Vector3
function M.Vector3MoveTowards(v, target, maxDistance)
return C.Vector3MoveTowards(v, target, maxDistance)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@param amount number
---@return raylib.Vector3
function M.Vector3Lerp(v1, v2, amount)
return C.Vector3Lerp(v1, v2, amount)
end
---@param v1 raylib.Vector3
---@param tangent1 raylib.Vector3
---@param v2 raylib.Vector3
---@param tangent2 raylib.Vector3
---@param amount number
---@return raylib.Vector3
function M.Vector3CubicHermite(v1, tangent1, v2, tangent2, amount)
return C.Vector3CubicHermite(v1, tangent1, v2, tangent2, amount)
end
---@param v raylib.Vector3
---@param normal raylib.Vector3
---@return raylib.Vector3
function M.Vector3Reflect(v, normal)
return C.Vector3Reflect(v, normal)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Min(v1, v2)
return C.Vector3Min(v1, v2)
end
---@param v1 raylib.Vector3
---@param v2 raylib.Vector3
---@return raylib.Vector3
function M.Vector3Max(v1, v2)
return C.Vector3Max(v1, v2)
end
---@param p raylib.Vector3
---@param a raylib.Vector3
---@param b raylib.Vector3
---@param c raylib.Vector3
---@return raylib.Vector3
function M.Vector3Barycenter(p, a, b, c)
return C.Vector3Barycenter(p, a, b, c)
end
---@param source raylib.Vector3
---@param projection raylib.Matrix
---@param view raylib.Matrix
---@return raylib.Vector3
function M.Vector3Unproject(source, projection, view)
return C.Vector3Unproject(source, projection, view)
end
---@param v raylib.Vector3
---@return raylib.float3
function M.Vector3ToFloatV(v)
return C.Vector3ToFloatV(v)
end
---@param v raylib.Vector3
---@return raylib.Vector3
function M.Vector3Invert(v)
return C.Vector3Invert(v)
end
---@param v raylib.Vector3
---@param min raylib.Vector3
---@param max raylib.Vector3
---@return raylib.Vector3
function M.Vector3Clamp(v, min, max)
return C.Vector3Clamp(v, min, max)
end
---@param v raylib.Vector3
---@param min number
---@param max number
---@return raylib.Vector3
function M.Vector3ClampValue(v, min, max)
return C.Vector3ClampValue(v, min, max)
end
---@param p raylib.Vector3
---@param q raylib.Vector3
---@return integer
function M.Vector3Equals(p, q)
return C.Vector3Equals(p, q)
end
---@param v raylib.Vector3
---@param n raylib.Vector3
---@param r number
---@return raylib.Vector3
function M.Vector3Refract(v, n, r)
return C.Vector3Refract(v, n, r)
end
---@return raylib.Vector4
function M.Vector4Zero()
return C.Vector4Zero()
end
---@return raylib.Vector4
function M.Vector4One()
return C.Vector4One()
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return raylib.Vector4
function M.Vector4Add(v1, v2)
return C.Vector4Add(v1, v2)
end
---@param v raylib.Vector4
---@param add number
---@return raylib.Vector4
function M.Vector4AddValue(v, add)
return C.Vector4AddValue(v, add)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return raylib.Vector4
function M.Vector4Subtract(v1, v2)
return C.Vector4Subtract(v1, v2)
end
---@param v raylib.Vector4
---@param add number
---@return raylib.Vector4
function M.Vector4SubtractValue(v, add)
return C.Vector4SubtractValue(v, add)
end
---@param v raylib.Vector4
---@return number
function M.Vector4Length(v)
return C.Vector4Length(v)
end
---@param v raylib.Vector4
---@return number
function M.Vector4LengthSqr(v)
return C.Vector4LengthSqr(v)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return number
function M.Vector4DotProduct(v1, v2)
return C.Vector4DotProduct(v1, v2)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return number
function M.Vector4Distance(v1, v2)
return C.Vector4Distance(v1, v2)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return number
function M.Vector4DistanceSqr(v1, v2)
return C.Vector4DistanceSqr(v1, v2)
end
---@param v raylib.Vector4
---@param scale number
---@return raylib.Vector4
function M.Vector4Scale(v, scale)
return C.Vector4Scale(v, scale)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return raylib.Vector4
function M.Vector4Multiply(v1, v2)
return C.Vector4Multiply(v1, v2)
end
---@param v raylib.Vector4
---@return raylib.Vector4
function M.Vector4Negate(v)
return C.Vector4Negate(v)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return raylib.Vector4
function M.Vector4Divide(v1, v2)
return C.Vector4Divide(v1, v2)
end
---@param v raylib.Vector4
---@return raylib.Vector4
function M.Vector4Normalize(v)
return C.Vector4Normalize(v)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return raylib.Vector4
function M.Vector4Min(v1, v2)
return C.Vector4Min(v1, v2)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@return raylib.Vector4
function M.Vector4Max(v1, v2)
return C.Vector4Max(v1, v2)
end
---@param v1 raylib.Vector4
---@param v2 raylib.Vector4
---@param amount number
---@return raylib.Vector4
function M.Vector4Lerp(v1, v2, amount)
return C.Vector4Lerp(v1, v2, amount)
end
---@param v raylib.Vector4
---@param target raylib.Vector4
---@param maxDistance number
---@return raylib.Vector4
function M.Vector4MoveTowards(v, target, maxDistance)
return C.Vector4MoveTowards(v, target, maxDistance)
end
---@param v raylib.Vector4
---@return raylib.Vector4
function M.Vector4Invert(v)
return C.Vector4Invert(v)
end
---@param p raylib.Vector4
---@param q raylib.Vector4
---@return integer
function M.Vector4Equals(p, q)
return C.Vector4Equals(p, q)
end
---@param mat raylib.Matrix
---@return number
function M.MatrixDeterminant(mat)
return C.MatrixDeterminant(mat)
end
---@param mat raylib.Matrix
---@return number
function M.MatrixTrace(mat)
return C.MatrixTrace(mat)
end
---@param mat raylib.Matrix
---@return raylib.Matrix
function M.MatrixTranspose(mat)
return C.MatrixTranspose(mat)
end
---@param mat raylib.Matrix
---@return raylib.Matrix
function M.MatrixInvert(mat)
return C.MatrixInvert(mat)
end
---@return raylib.Matrix
function M.MatrixIdentity()
return C.MatrixIdentity()
end
---@param left raylib.Matrix
---@param right raylib.Matrix
---@return raylib.Matrix
function M.MatrixAdd(left, right)
return C.MatrixAdd(left, right)
end
---@param left raylib.Matrix
---@param right raylib.Matrix
---@return raylib.Matrix
function M.MatrixSubtract(left, right)
return C.MatrixSubtract(left, right)
end
---@param left raylib.Matrix
---@param right raylib.Matrix
---@return raylib.Matrix
function M.MatrixMultiply(left, right)
return C.MatrixMultiply(left, right)
end
---@param left raylib.Matrix
---@param value number
---@return raylib.Matrix
function M.MatrixMultiplyValue(left, value)
return C.MatrixMultiplyValue(left, value)
end
---@param x number
---@param y number
---@param z number
---@return raylib.Matrix
function M.MatrixTranslate(x, y, z)
return C.MatrixTranslate(x, y, z)
end
---@param axis raylib.Vector3
---@param angle number
---@return raylib.Matrix
function M.MatrixRotate(axis, angle)
return C.MatrixRotate(axis, angle)
end
---@param angle number
---@return raylib.Matrix
function M.MatrixRotateX(angle)
return C.MatrixRotateX(angle)
end
---@param angle number
---@return raylib.Matrix
function M.MatrixRotateY(angle)
return C.MatrixRotateY(angle)
end
---@param angle number
---@return raylib.Matrix
function M.MatrixRotateZ(angle)
return C.MatrixRotateZ(angle)
end
---@param angle raylib.Vector3
---@return raylib.Matrix
function M.MatrixRotateXYZ(angle)
return C.MatrixRotateXYZ(angle)
end
---@param angle raylib.Vector3
---@return raylib.Matrix
function M.MatrixRotateZYX(angle)
return C.MatrixRotateZYX(angle)
end
---@param x number
---@param y number
---@param z number
---@return raylib.Matrix
function M.MatrixScale(x, y, z)
return C.MatrixScale(x, y, z)
end
---@param left number
---@param right number
---@param bottom number
---@param top number
---@param nearPlane number
---@param farPlane number
---@return raylib.Matrix
function M.MatrixFrustum(left, right, bottom, top, nearPlane, farPlane)
return C.MatrixFrustum(left, right, bottom, top, nearPlane, farPlane)
end
---@param fovY number
---@param aspect number
---@param nearPlane number
---@param farPlane number
---@return raylib.Matrix
function M.MatrixPerspective(fovY, aspect, nearPlane, farPlane)
return C.MatrixPerspective(fovY, aspect, nearPlane, farPlane)
end
---@param left number
---@param right number
---@param bottom number
---@param top number
---@param nearPlane number
---@param farPlane number
---@return raylib.Matrix
function M.MatrixOrtho(left, right, bottom, top, nearPlane, farPlane)
return C.MatrixOrtho(left, right, bottom, top, nearPlane, farPlane)
end
---@param eye raylib.Vector3
---@param target raylib.Vector3
---@param up raylib.Vector3
---@return raylib.Matrix
function M.MatrixLookAt(eye, target, up)
return C.MatrixLookAt(eye, target, up)
end
---@param mat raylib.Matrix
---@return raylib.float16
function M.MatrixToFloatV(mat)
return C.MatrixToFloatV(mat)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@return raylib.Quaternion
function M.QuaternionAdd(q1, q2)
return C.QuaternionAdd(q1, q2)
end
---@param q raylib.Quaternion
---@param add number
---@return raylib.Quaternion
function M.QuaternionAddValue(q, add)
return C.QuaternionAddValue(q, add)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@return raylib.Quaternion
function M.QuaternionSubtract(q1, q2)
return C.QuaternionSubtract(q1, q2)
end
---@param q raylib.Quaternion
---@param sub number
---@return raylib.Quaternion
function M.QuaternionSubtractValue(q, sub)
return C.QuaternionSubtractValue(q, sub)
end
---@return raylib.Quaternion
function M.QuaternionIdentity()
return C.QuaternionIdentity()
end
---@param q raylib.Quaternion
---@return number
function M.QuaternionLength(q)
return C.QuaternionLength(q)
end
---@param q raylib.Quaternion
---@return raylib.Quaternion
function M.QuaternionNormalize(q)
return C.QuaternionNormalize(q)
end
---@param q raylib.Quaternion
---@return raylib.Quaternion
function M.QuaternionInvert(q)
return C.QuaternionInvert(q)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@return raylib.Quaternion
function M.QuaternionMultiply(q1, q2)
return C.QuaternionMultiply(q1, q2)
end
---@param q raylib.Quaternion
---@param mul number
---@return raylib.Quaternion
function M.QuaternionScale(q, mul)
return C.QuaternionScale(q, mul)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@return raylib.Quaternion
function M.QuaternionDivide(q1, q2)
return C.QuaternionDivide(q1, q2)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@param amount number
---@return raylib.Quaternion
function M.QuaternionLerp(q1, q2, amount)
return C.QuaternionLerp(q1, q2, amount)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@param amount number
---@return raylib.Quaternion
function M.QuaternionNlerp(q1, q2, amount)
return C.QuaternionNlerp(q1, q2, amount)
end
---@param q1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@param amount number
---@return raylib.Quaternion
function M.QuaternionSlerp(q1, q2, amount)
return C.QuaternionSlerp(q1, q2, amount)
end
---@param q1 raylib.Quaternion
---@param outTangent1 raylib.Quaternion
---@param q2 raylib.Quaternion
---@param inTangent2 raylib.Quaternion
---@param t number
---@return raylib.Quaternion
function M.QuaternionCubicHermiteSpline(q1, outTangent1, q2, inTangent2, t)
return C.QuaternionCubicHermiteSpline(q1, outTangent1, q2, inTangent2, t)
end
---@param from raylib.Vector3
---@param to raylib.Vector3
---@return raylib.Quaternion
function M.QuaternionFromVector3ToVector3(from, to)
return C.QuaternionFromVector3ToVector3(from, to)
end
---@param mat raylib.Matrix
---@return raylib.Quaternion
function M.QuaternionFromMatrix(mat)
return C.QuaternionFromMatrix(mat)
end
---@param q raylib.Quaternion
---@return raylib.Matrix
function M.QuaternionToMatrix(q)
return C.QuaternionToMatrix(q)
end
---@param axis raylib.Vector3
---@param angle number
---@return raylib.Quaternion
function M.QuaternionFromAxisAngle(axis, angle)
return C.QuaternionFromAxisAngle(axis, angle)
end
---@param q raylib.Quaternion
---@param outAxis ffi.cdata*
---@param outAngle ffi.cdata*
---@return nil
function M.QuaternionToAxisAngle(q, outAxis, outAngle)
C.QuaternionToAxisAngle(q, outAxis, outAngle)
end
---@param pitch number
---@param yaw number
---@param roll number
---@return raylib.Quaternion
function M.QuaternionFromEuler(pitch, yaw, roll)
return C.QuaternionFromEuler(pitch, yaw, roll)
end
---@param q raylib.Quaternion
---@return raylib.Vector3
function M.QuaternionToEuler(q)
return C.QuaternionToEuler(q)
end
---@param q raylib.Quaternion
---@param mat raylib.Matrix
---@return raylib.Quaternion
function M.QuaternionTransform(q, mat)
return C.QuaternionTransform(q, mat)
end
---@param p raylib.Quaternion
---@param q raylib.Quaternion
---@return integer
function M.QuaternionEquals(p, q)
return C.QuaternionEquals(p, q)
end
---@param translation raylib.Vector3
---@param rotation raylib.Quaternion
---@param scale raylib.Vector3
---@return raylib.Matrix
function M.MatrixCompose(translation, rotation, scale)
return C.MatrixCompose(translation, rotation, scale)
end
---@param mat raylib.Matrix
---@param translation? raylib.Vector3
---@param rotation? raylib.Quaternion
---@param scale? raylib.Vector3
---@return raylib.Vector3
---@return raylib.Quaternion
---@return raylib.Vector3
function M.MatrixDecompose(mat, translation, rotation, scale)
local _o2 = ffi.new("Vector3[1]")
if translation ~= nil then _o2[0] = translation end
local _o3 = ffi.new("Quaternion[1]")
if rotation ~= nil then _o3[0] = rotation end
local _o4 = ffi.new("Vector3[1]")
if scale ~= nil then _o4[0] = scale end
C.MatrixDecompose(mat, _o2, _o3, _o4)
return _o2[0], _o3[0], _o4[0]
end
return M