From 9bb3957d5fd3f176e8bd888c53a65c54f62cfab6 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 3 Nov 2025 19:43:05 +0530 Subject: cleaned up root folder, organized files into docs/scripts/tools dirs --- API.md | 13179 ------------------------------------------ ASSET_LOADING.md | 285 - BUILD_SCRIPTS.md | 213 - CMakeLists.txt | 8 +- CUSTOMIZATION.md | 401 -- DOCUMENTATION_INDEX.md | 213 - EMBEDDING.md | 289 - README.md | 34 +- ReiLua_API.lua | 9054 ----------------------------- SPLASH_SCREENS.md | 230 - UPGRADE_SUMMARY.md | 186 - ZED_EDITOR_SETUP.md | 579 -- apiScanner.lua | 177 - build_dev.bat | 100 - build_dev.sh | 96 - build_release.bat | 144 - build_release.sh | 150 - docgen.lua | 457 -- docs/API.md | 13179 ++++++++++++++++++++++++++++++++++++++++++ docs/ASSET_LOADING.md | 285 + docs/BUILD_SCRIPTS.md | 213 + docs/CUSTOMIZATION.md | 401 ++ docs/DOCUMENTATION_INDEX.md | 213 + docs/EMBEDDING.md | 289 + docs/SPLASH_SCREENS.md | 230 + docs/UPGRADE_SUMMARY.md | 186 + docs/ZED_EDITOR_SETUP.md | 434 ++ embed_assets.py | 116 - embed_font.py | 57 - embed_logo.py | 64 - embed_lua.py | 92 - scripts/build_dev.bat | 100 + scripts/build_dev.sh | 96 + scripts/build_release.bat | 144 + scripts/build_release.sh | 150 + scripts/embed_assets.py | 116 + scripts/embed_font.py | 57 + scripts/embed_logo.py | 64 + scripts/embed_lua.py | 92 + tools/ReiLua_API.lua | 9054 +++++++++++++++++++++++++++++ tools/apiScanner.lua | 177 + tools/docgen.lua | 457 ++ 42 files changed, 25958 insertions(+), 26103 deletions(-) delete mode 100644 API.md delete mode 100644 ASSET_LOADING.md delete mode 100644 BUILD_SCRIPTS.md delete mode 100644 CUSTOMIZATION.md delete mode 100644 DOCUMENTATION_INDEX.md delete mode 100644 EMBEDDING.md delete mode 100644 ReiLua_API.lua delete mode 100644 SPLASH_SCREENS.md delete mode 100644 UPGRADE_SUMMARY.md delete mode 100644 ZED_EDITOR_SETUP.md delete mode 100644 apiScanner.lua delete mode 100644 build_dev.bat delete mode 100644 build_dev.sh delete mode 100644 build_release.bat delete mode 100644 build_release.sh delete mode 100644 docgen.lua create mode 100644 docs/API.md create mode 100644 docs/ASSET_LOADING.md create mode 100644 docs/BUILD_SCRIPTS.md create mode 100644 docs/CUSTOMIZATION.md create mode 100644 docs/DOCUMENTATION_INDEX.md create mode 100644 docs/EMBEDDING.md create mode 100644 docs/SPLASH_SCREENS.md create mode 100644 docs/UPGRADE_SUMMARY.md create mode 100644 docs/ZED_EDITOR_SETUP.md delete mode 100644 embed_assets.py delete mode 100644 embed_font.py delete mode 100644 embed_logo.py delete mode 100644 embed_lua.py create mode 100644 scripts/build_dev.bat create mode 100644 scripts/build_dev.sh create mode 100644 scripts/build_release.bat create mode 100644 scripts/build_release.sh create mode 100644 scripts/embed_assets.py create mode 100644 scripts/embed_font.py create mode 100644 scripts/embed_logo.py create mode 100644 scripts/embed_lua.py create mode 100644 tools/ReiLua_API.lua create mode 100644 tools/apiScanner.lua create mode 100644 tools/docgen.lua diff --git a/API.md b/API.md deleted file mode 100644 index 5359d3f..0000000 --- a/API.md +++ /dev/null @@ -1,13179 +0,0 @@ -# ReiLua API - -## Functions - -Application needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where "main.lua" is located can be given as argument. There are seven Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', 'RL.exit' and 'RL.config'. - ---- -> function RL.init() - -This function will be called after window has been initialized. Should be used as the main init point. - ---- - -> function RL.update( delta ) - -This function will be called every frame during execution. It will get time duration from last frame on argument 'delta' - ---- - -> function RL.draw() - -This function will be called every frame after update and it should have all rendering related functions. Note: Engine will call Raylib functions 'BeginDrawing()' before this function call and 'EndDrawing()' after it. You can still use RL.BeginDrawing() and RL.EndDrawing() manually from anywhere. - ---- - -> function RL.event( event ) - -This function will be called on events input. Content of event table is determined by event type. - ---- - -> function RL.log( logLevel, message ) - -This function can be used for custom log message handling. - ---- - -> function RL.exit() - -This function will be called on program close. Cleanup could be done here. - ---- - -> function RL.config() - -This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point. - ---- - -> function RL.load() - -This function will be called when loading resource that allocates memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures. - ---- - -> function RL.unload() - -This function will be called when unloading resource that has allocated memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures. - ---- - -## Object unloading - -Some objects allocate memory that needs to be freed when object is no longer needed. By default objects like Textures are unloaded by the Lua garbage collector. It is generatty however recommended to handle this manually in more complex projects. You can change the behavior with SetGCUnload. - -## Arguments - -Arguments are stored in 'RL.arg' array. - -## Structures - -Raylib structs in Lua - ---- - -> Vector2 = { 1.0, 1.0 } or { x = 1.0, y = 1.0 } - -Vector2, 2 components - ---- - -> Vector3 = { 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0 } - -Vector3, 3 components - ---- - -> Vector4 = { 1.0, 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0, w = 1.0 } - -Vector4, 4 components - ---- - -> Quaternion = { 0.0, 0.0, 0.0, 1.0 } or { x = 0.0, y = 0.0, z = 0.0, w = 1.0 } - -Quaternion, 4 components (Vector4 alias) - ---- - -> Matrix = { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } } - -Matrix, 4x4 components, column major, OpenGL style, right-handed. Identity matrix example - ---- - -> Color = { 255, 255, 255, 255 } or { r = 255, g = 255, b = 255, a = 255 } - -Color, 4 components, R8G8B8A8 (32bit) - ---- - -> Rectangle = { 0.0, 0.0, 1.0, 1.0 } or { x = 0.0, y = 0.0, width = 1.0, height = 1.0 } - -Rectangle, 4 components - ---- - -> Image = Userdata - -Image, pixel data stored in CPU memory (RAM) - ---- - -> Texture = Userdata - -Texture, tex data stored in GPU memory (VRAM) -``` -textureData = { - id = unsigned int, --OpenGL texture id - width = int, --Texture base width - height = int, --Texture base height - mipmaps = int, --Mipmap levels, 1 by default - format = int --Data format (PixelFormat type) -} -``` - ---- - -> RenderTexture = Userdata - -RenderTexture, fbo for texture rendering -``` -renderTextureData = { - id = unsigned int, --OpenGL framebuffer object id - texture = Texture, --Color buffer attachment texture - depth = Texture, --Depth buffer attachment texture -} -``` - ---- - -> Font = Userdata - -Font, font texture and GlyphInfo array data - ---- - -> Camera2D = Userdata - -Camera2D, defines position/orientation in 2d space - ---- - -> Camera3D = Userdata - -Camera, defines position/orientation in 3d space - ---- - -> Mesh = Userdata - -Mesh, vertex data and vao/vbo - -``` -meshData = { - vertices = Vector3{}, --Vertex position (XYZ - 3 components per vertex) (shader-location = 0) - texcoords = Vector2{}, --Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - texcoords2 = Vector2{}, --Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5) - normals = Vector3{}, --Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - tangents = Vector4{}, --Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) - colors = Color{}, --Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - indices = int{} --Vertex indices (in case vertex data comes indexed) -} -``` - ---- - -> Material = Userdata - -Material, includes shader and maps - -``` -materialData = { - shader = Shader, - maps = { --Material maps array (MAX_MATERIAL_MAPS) - { - MATERIAL_MAP_*, --Example MATERIAL_MAP_ALBEDO - { - texture = Texture, --Material map texture - color = Color, --Material map color - value = float, --Material map value - }, - }, - ... - }, - params = { float, float, float, float } --Material generic parameters (if required) -} -``` - ---- - -> Model = Userdata - -Model, meshes, materials and animation data - ---- - -> Ray = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 } } or { position = { 0.0, 0.0, 0.0 }, direction = { 1.0, 0.0, 0.0 } } - -Ray, ray for raycasting - ---- - -> RayCollision = { hit = true, distance = 1.0, point = { 0.0, 0.0, 0.0 }, normal = { 0.0, 0.0, 1.0 } } - -RayCollision, ray hit information - ---- - -> BoundingBox = { { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 } } or { min = { 0.0, 0.0, 0.0 }, max = { 1.0, 1.0, 1.0 } } - -BoundingBox - ---- - -> GlyphInfo = Userdata - -GlyphInfo, font characters glyphs info - -``` -glyphInfoData = { - value = int, --Character value (Unicode) - offsetX = int, --Character offset X when drawing - offsetY = int, --Character offset Y when drawing - advanceX = int, --Character advance position X - image = Image, --Character image data -} -``` - ---- - -> BoneInfo = { name = string[32], parent = int } - -Bone, skeletal animation bone - ---- - -> Transform = { translation = Vector3, rotation = Quaternion, scale = Vector3 } - -Transform, vertex transformation data - ---- - -> Wave = Userdata - -Wave, audio wave data - ---- - -> Sound = Userdata - -Sound - ---- - -> SoundAlias = Userdata - -SoundAlias - ---- - -> Music = Userdata - -Music, audio stream, anything longer than ~10 seconds should be streamed - ---- - -> NPatchInfo = { { 0, 0, 24, 24 }, 8, 8, 8, 8, NPATCH_NINE_PATCH } or { source = { 0, 0, 24, 24 }, left = 8, top = 8, right = 8, bottom = 8, layout = NPATCH_NINE_PATCH } - -NPatchInfo, n-patch layout info - ---- - -> ModelAnimations = Userdata - -ModelAnimation - ---- - -> AutomationEvent = Userdata - -Automation event - ---- - -> AutomationEventList = Userdata - -Automation event list - ---- - -> Buffer = Buffer userdata - -Data buffer for C primitive types. Type should be one of the Buffer types. - ---- - -## Defines - System/Window config flags -> FLAG_VSYNC_HINT = 64 - -Set to try enabling V-Sync on GPU - ---- - -> FLAG_FULLSCREEN_MODE = 2 - -Set to run program in fullscreen - ---- - -> FLAG_WINDOW_RESIZABLE = 4 - -Set to allow resizable window - ---- - -> FLAG_WINDOW_UNDECORATED = 8 - -Set to disable window decoration (frame and buttons) - ---- - -> FLAG_WINDOW_HIDDEN = 128 - -Set to hide window - ---- - -> FLAG_WINDOW_MINIMIZED = 512 - -Set to minimize window (iconify) - ---- - -> FLAG_WINDOW_MAXIMIZED = 1024 - -Set to maximize window (expanded to monitor) - ---- - -> FLAG_WINDOW_UNFOCUSED = 2048 - -Set to window non focused - ---- - -> FLAG_WINDOW_TOPMOST = 4096 - -Set to window always on top - ---- - -> FLAG_WINDOW_ALWAYS_RUN = 256 - -Set to allow windows running while minimized - ---- - -> FLAG_WINDOW_TRANSPARENT = 16 - -Set to allow transparent framebuffer - ---- - -> FLAG_WINDOW_HIGHDPI = 8192 - -Set to support HighDPI - ---- - -> FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384 - -Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED - ---- - -> FLAG_MSAA_4X_HINT = 32 - -Set to try enabling MSAA 4X - ---- - -> FLAG_INTERLACED_HINT = 65536 - -Set to try enabling interlaced video format (for V3D) - ---- - - -## Defines - Trace log level -> LOG_ALL = 0 - -Display all logs - ---- - -> LOG_TRACE = 1 - -Trace logging, intended for internal use only - ---- - -> LOG_DEBUG = 2 - -Debug logging, used for internal debugging, it should be disabled on release builds - ---- - -> LOG_INFO = 3 - -Info logging, used for program execution info - ---- - -> LOG_WARNING = 4 - -Warning logging, used on recoverable failures - ---- - -> LOG_ERROR = 5 - -Error logging, used on unrecoverable failures - ---- - -> LOG_FATAL = 6 - -Fatal logging, used to abort program: exit(EXIT_FAILURE) - ---- - -> LOG_NONE = 7 - -Disable logging - ---- - - -## Defines - Keyboard keys (US keyboard layout) -> KEY_NULL = 0 - -Key: NULL, used for no key pressed - ---- - -> KEY_APOSTROPHE = 39 - -Key: ' - ---- - -> KEY_COMMA = 44 - -Key: , - ---- - -> KEY_MINUS = 45 - -Key: - - ---- - -> KEY_PERIOD = 46 - -Key: . - ---- - -> KEY_SLASH = 47 - -Key: / - ---- - -> KEY_ZERO = 48 - -Key: 0 - ---- - -> KEY_ONE = 49 - -Key: 1 - ---- - -> KEY_TWO = 50 - -Key: 2 - ---- - -> KEY_THREE = 51 - -Key: 3 - ---- - -> KEY_FOUR = 52 - -Key: 4 - ---- - -> KEY_FIVE = 53 - -Key: 5 - ---- - -> KEY_SIX = 54 - -Key: 6 - ---- - -> KEY_SEVEN = 55 - -Key: 7 - ---- - -> KEY_EIGHT = 56 - -Key: 8 - ---- - -> KEY_NINE = 57 - -Key: 9 - ---- - -> KEY_SEMICOLON = 59 - -Key: ; - ---- - -> KEY_EQUAL = 61 - -Key: = - ---- - -> KEY_A = 65 - -Key: A | a - ---- - -> KEY_B = 66 - -Key: B | b - ---- - -> KEY_C = 67 - -Key: C | c - ---- - -> KEY_D = 68 - -Key: D | d - ---- - -> KEY_E = 69 - -Key: E | e - ---- - -> KEY_F = 70 - -Key: F | f - ---- - -> KEY_G = 71 - -Key: G | g - ---- - -> KEY_H = 72 - -Key: H | h - ---- - -> KEY_I = 73 - -Key: I | i - ---- - -> KEY_J = 74 - -Key: J | j - ---- - -> KEY_K = 75 - -Key: K | k - ---- - -> KEY_L = 76 - -Key: L | l - ---- - -> KEY_M = 77 - -Key: M | m - ---- - -> KEY_N = 78 - -Key: N | n - ---- - -> KEY_O = 79 - -Key: O | o - ---- - -> KEY_P = 80 - -Key: P | p - ---- - -> KEY_Q = 81 - -Key: Q | q - ---- - -> KEY_R = 82 - -Key: R | r - ---- - -> KEY_S = 83 - -Key: S | s - ---- - -> KEY_T = 84 - -Key: T | t - ---- - -> KEY_U = 85 - -Key: U | u - ---- - -> KEY_V = 86 - -Key: V | v - ---- - -> KEY_W = 87 - -Key: W | w - ---- - -> KEY_X = 88 - -Key: X | x - ---- - -> KEY_Y = 89 - -Key: Y | y - ---- - -> KEY_Z = 90 - -Key: Z | z - ---- - -> KEY_LEFT_BRACKET = 91 - -Key: [ - ---- - -> KEY_BACKSLASH = 92 - -Key: '\' - ---- - -> KEY_RIGHT_BRACKET = 93 - -Key: ] - ---- - -> KEY_GRAVE = 96 - -Key: ` - ---- - -> KEY_SPACE = 32 - -Key: Space - ---- - -> KEY_ESCAPE = 256 - -Key: Esc - ---- - -> KEY_ENTER = 257 - -Key: Enter - ---- - -> KEY_TAB = 258 - -Key: Tab - ---- - -> KEY_BACKSPACE = 259 - -Key: Backspace - ---- - -> KEY_INSERT = 260 - -Key: Ins - ---- - -> KEY_DELETE = 261 - -Key: Del - ---- - -> KEY_RIGHT = 262 - -Key: Cursor right - ---- - -> KEY_LEFT = 263 - -Key: Cursor left - ---- - -> KEY_DOWN = 264 - -Key: Cursor down - ---- - -> KEY_UP = 265 - -Key: Cursor up - ---- - -> KEY_PAGE_UP = 266 - -Key: Page up - ---- - -> KEY_PAGE_DOWN = 267 - -Key: Page down - ---- - -> KEY_HOME = 268 - -Key: Home - ---- - -> KEY_END = 269 - -Key: End - ---- - -> KEY_CAPS_LOCK = 280 - -Key: Caps lock - ---- - -> KEY_SCROLL_LOCK = 281 - -Key: Scroll down - ---- - -> KEY_NUM_LOCK = 282 - -Key: Num lock - ---- - -> KEY_PRINT_SCREEN = 283 - -Key: Print screen - ---- - -> KEY_PAUSE = 284 - -Key: Pause - ---- - -> KEY_F1 = 290 - -Key: F1 - ---- - -> KEY_F2 = 291 - -Key: F2 - ---- - -> KEY_F3 = 292 - -Key: F3 - ---- - -> KEY_F4 = 293 - -Key: F4 - ---- - -> KEY_F5 = 294 - -Key: F5 - ---- - -> KEY_F6 = 295 - -Key: F6 - ---- - -> KEY_F7 = 296 - -Key: F7 - ---- - -> KEY_F8 = 297 - -Key: F8 - ---- - -> KEY_F9 = 298 - -Key: F9 - ---- - -> KEY_F10 = 299 - -Key: F10 - ---- - -> KEY_F11 = 300 - -Key: F11 - ---- - -> KEY_F12 = 301 - -Key: F12 - ---- - -> KEY_LEFT_SHIFT = 340 - -Key: Shift left - ---- - -> KEY_LEFT_CONTROL = 341 - -Key: Control left - ---- - -> KEY_LEFT_ALT = 342 - -Key: Alt left - ---- - -> KEY_LEFT_SUPER = 343 - -Key: Super left - ---- - -> KEY_RIGHT_SHIFT = 344 - -Key: Shift right - ---- - -> KEY_RIGHT_CONTROL = 345 - -Key: Control right - ---- - -> KEY_RIGHT_ALT = 346 - -Key: Alt right - ---- - -> KEY_RIGHT_SUPER = 347 - -Key: Super right - ---- - -> KEY_KB_MENU = 348 - -Key: KB menu - ---- - -> KEY_KP_0 = 320 - -Key: Keypad 0 - ---- - -> KEY_KP_1 = 321 - -Key: Keypad 1 - ---- - -> KEY_KP_2 = 322 - -Key: Keypad 2 - ---- - -> KEY_KP_3 = 323 - -Key: Keypad 3 - ---- - -> KEY_KP_4 = 324 - -Key: Keypad 4 - ---- - -> KEY_KP_5 = 325 - -Key: Keypad 5 - ---- - -> KEY_KP_6 = 326 - -Key: Keypad 6 - ---- - -> KEY_KP_7 = 327 - -Key: Keypad 7 - ---- - -> KEY_KP_8 = 328 - -Key: Keypad 8 - ---- - -> KEY_KP_9 = 329 - -Key: Keypad 9 - ---- - -> KEY_KP_DECIMAL = 330 - -Key: Keypad . - ---- - -> KEY_KP_DIVIDE = 331 - -Key: Keypad / - ---- - -> KEY_KP_MULTIPLY = 332 - -Key: Keypad * - ---- - -> KEY_KP_SUBTRACT = 333 - -Key: Keypad - - ---- - -> KEY_KP_ADD = 334 - -Key: Keypad + - ---- - -> KEY_KP_ENTER = 335 - -Key: Keypad Enter - ---- - -> KEY_KP_EQUAL = 336 - -Key: Keypad = - ---- - -> KEY_BACK = 4 - -Key: Android back button - ---- - -> KEY_MENU = 5 - -Key: Android menu button - ---- - -> KEY_VOLUME_UP = 24 - -Key: Android volume up button - ---- - -> KEY_VOLUME_DOWN = 25 - -Key: Android volume down button - ---- - - -## Defines - Mouse buttons -> MOUSE_BUTTON_LEFT = 0 - -Mouse button left - ---- - -> MOUSE_BUTTON_RIGHT = 1 - -Mouse button right - ---- - -> MOUSE_BUTTON_MIDDLE = 2 - -Mouse button middle (pressed wheel) - ---- - -> MOUSE_BUTTON_SIDE = 3 - -Mouse button side (advanced mouse device) - ---- - -> MOUSE_BUTTON_EXTRA = 4 - -Mouse button extra (advanced mouse device) - ---- - -> MOUSE_BUTTON_FORWARD = 5 - -Mouse button forward (advanced mouse device) - ---- - -> MOUSE_BUTTON_BACK = 6 - -Mouse button back (advanced mouse device) - ---- - - -## Defines - Mouse cursor -> MOUSE_CURSOR_DEFAULT = 0 - -Default pointer shape - ---- - -> MOUSE_CURSOR_ARROW = 1 - -Arrow shape - ---- - -> MOUSE_CURSOR_IBEAM = 2 - -Text writing cursor shape - ---- - -> MOUSE_CURSOR_CROSSHAIR = 3 - -Cross shape - ---- - -> MOUSE_CURSOR_POINTING_HAND = 4 - -Pointing hand cursor - ---- - -> MOUSE_CURSOR_RESIZE_EW = 5 - -Horizontal resize/move arrow shape - ---- - -> MOUSE_CURSOR_RESIZE_NS = 6 - -Vertical resize/move arrow shape - ---- - -> MOUSE_CURSOR_RESIZE_NWSE = 7 - -Top-left to bottom-right diagonal resize/move arrow shape - ---- - -> MOUSE_CURSOR_RESIZE_NESW = 8 - -The top-right to bottom-left diagonal resize/move arrow shape - ---- - -> MOUSE_CURSOR_RESIZE_ALL = 9 - -The omnidirectional resize/move cursor shape - ---- - -> MOUSE_CURSOR_NOT_ALLOWED = 10 - -The operation-not-allowed shape - ---- - - -## Defines - Gamepad buttons -> GAMEPAD_BUTTON_UNKNOWN = 0 - -Unknown button, just for error checking - ---- - -> GAMEPAD_BUTTON_LEFT_FACE_UP = 1 - -Gamepad left DPAD up button - ---- - -> GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2 - -Gamepad left DPAD right button - ---- - -> GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3 - -Gamepad left DPAD down button - ---- - -> GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4 - -Gamepad left DPAD left button - ---- - -> GAMEPAD_BUTTON_RIGHT_FACE_UP = 5 - -Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) - ---- - -> GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6 - -Gamepad right button right (i.e. PS3: Square, Xbox: X) - ---- - -> GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7 - -Gamepad right button down (i.e. PS3: Cross, Xbox: A) - ---- - -> GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8 - -Gamepad right button left (i.e. PS3: Circle, Xbox: B) - ---- - -> GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9 - -Gamepad top/back trigger left (first), it could be a trailing button - ---- - -> GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10 - -Gamepad top/back trigger left (second), it could be a trailing button - ---- - -> GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11 - -Gamepad top/back trigger right (one), it could be a trailing button - ---- - -> GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12 - -Gamepad top/back trigger right (second), it could be a trailing button - ---- - -> GAMEPAD_BUTTON_MIDDLE_LEFT = 13 - -Gamepad center buttons, left one (i.e. PS3: Select) - ---- - -> GAMEPAD_BUTTON_MIDDLE = 14 - -Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) - ---- - -> GAMEPAD_BUTTON_MIDDLE_RIGHT = 15 - -Gamepad center buttons, right one (i.e. PS3: Start) - ---- - -> GAMEPAD_BUTTON_LEFT_THUMB = 16 - -Gamepad joystick pressed button left - ---- - -> GAMEPAD_BUTTON_RIGHT_THUMB = 17 - -Gamepad joystick pressed button right - ---- - - -## Defines - Gamepad axis -> GAMEPAD_AXIS_LEFT_X = 0 - -Gamepad left stick X axis - ---- - -> GAMEPAD_AXIS_LEFT_Y = 1 - -Gamepad left stick Y axis - ---- - -> GAMEPAD_AXIS_RIGHT_X = 2 - -Gamepad right stick X axis - ---- - -> GAMEPAD_AXIS_RIGHT_Y = 3 - -Gamepad right stick Y axis - ---- - -> GAMEPAD_AXIS_LEFT_TRIGGER = 4 - -Gamepad back trigger left, pressure level: [1..-1] - ---- - -> GAMEPAD_AXIS_RIGHT_TRIGGER = 5 - -Gamepad back trigger right, pressure level: [1..-1] - ---- - - -## Defines - Material map index -> MATERIAL_MAP_ALBEDO = 0 - -Albedo material (same as: MATERIAL_MAP_DIFFUSE) - ---- - -> MATERIAL_MAP_METALNESS = 1 - -Metalness material (same as: MATERIAL_MAP_SPECULAR) - ---- - -> MATERIAL_MAP_NORMAL = 2 - -Normal material - ---- - -> MATERIAL_MAP_ROUGHNESS = 3 - -Roughness material - ---- - -> MATERIAL_MAP_OCCLUSION = 4 - -Ambient occlusion material - ---- - -> MATERIAL_MAP_EMISSION = 5 - -Emission material - ---- - -> MATERIAL_MAP_HEIGHT = 6 - -Heightmap material - ---- - -> MATERIAL_MAP_CUBEMAP = 7 - -Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) - ---- - -> MATERIAL_MAP_IRRADIANCE = 8 - -Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) - ---- - -> MATERIAL_MAP_PREFILTER = 9 - -Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) - ---- - -> MATERIAL_MAP_BRDF = 10 - -Brdf material - ---- - -> MATERIAL_MAP_DIFFUSE = 0 - -Diffuce material (same as: MATERIAL_MAP_ALBEDO) - ---- - -> MATERIAL_MAP_SPECULAR = 1 - -Specular material (same as: MATERIAL_MAP_METALNESS) - ---- - - -## Defines - Shader location index -> SHADER_LOC_VERTEX_POSITION = 0 - -Shader location: vertex attribute: position - ---- - -> SHADER_LOC_VERTEX_TEXCOORD01 = 1 - -Shader location: vertex attribute: texcoord01 - ---- - -> SHADER_LOC_VERTEX_TEXCOORD02 = 2 - -Shader location: vertex attribute: texcoord02 - ---- - -> SHADER_LOC_VERTEX_NORMAL = 3 - -Shader location: vertex attribute: normal - ---- - -> SHADER_LOC_VERTEX_TANGENT = 4 - -Shader location: vertex attribute: tangent - ---- - -> SHADER_LOC_VERTEX_COLOR = 5 - -Shader location: vertex attribute: color - ---- - -> SHADER_LOC_MATRIX_MVP = 6 - -Shader location: matrix uniform: model-view-projection - ---- - -> SHADER_LOC_MATRIX_VIEW = 7 - -Shader location: matrix uniform: view (camera transform) - ---- - -> SHADER_LOC_MATRIX_PROJECTION = 8 - -Shader location: matrix uniform: projection - ---- - -> SHADER_LOC_MATRIX_MODEL = 9 - -Shader location: matrix uniform: model (transform) - ---- - -> SHADER_LOC_MATRIX_NORMAL = 10 - -Shader location: matrix uniform: normal - ---- - -> SHADER_LOC_VECTOR_VIEW = 11 - -Shader location: vector uniform: view - ---- - -> SHADER_LOC_COLOR_DIFFUSE = 12 - -Shader location: vector uniform: diffuse color - ---- - -> SHADER_LOC_COLOR_SPECULAR = 13 - -Shader location: vector uniform: specular color - ---- - -> SHADER_LOC_COLOR_AMBIENT = 14 - -Shader location: vector uniform: ambient color - ---- - -> SHADER_LOC_MAP_ALBEDO = 15 - -Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) - ---- - -> SHADER_LOC_MAP_METALNESS = 16 - -Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) - ---- - -> SHADER_LOC_MAP_NORMAL = 17 - -Shader location: sampler2d texture: normal - ---- - -> SHADER_LOC_MAP_ROUGHNESS = 18 - -Shader location: sampler2d texture: roughness - ---- - -> SHADER_LOC_MAP_OCCLUSION = 19 - -Shader location: sampler2d texture: occlusion - ---- - -> SHADER_LOC_MAP_EMISSION = 20 - -Shader location: sampler2d texture: emission - ---- - -> SHADER_LOC_MAP_HEIGHT = 21 - -Shader location: sampler2d texture: height - ---- - -> SHADER_LOC_MAP_CUBEMAP = 22 - -Shader location: samplerCube texture: cubemap - ---- - -> SHADER_LOC_MAP_IRRADIANCE = 23 - -Shader location: samplerCube texture: irradiance - ---- - -> SHADER_LOC_MAP_PREFILTER = 24 - -Shader location: samplerCube texture: prefilter - ---- - -> SHADER_LOC_MAP_BRDF = 25 - -Shader location: sampler2d texture: brdf - ---- - -> SHADER_LOC_VERTEX_BONEIDS = 26 - -Shader location: vertex attribute: boneIds - ---- - -> SHADER_LOC_VERTEX_BONEWEIGHTS = 27 - -Shader location: vertex attribute: boneWeights - ---- - -> SHADER_LOC_BONE_MATRICES = 28 - -Shader location: array of matrices uniform: boneMatrices - ---- - -> SHADER_LOC_MAP_DIFFUSE = 15 - -Shader location: sampler2d texture: diffuce (same as: SHADER_LOC_MAP_ALBEDO) - ---- - -> SHADER_LOC_MAP_SPECULAR = 16 - -Shader location: sampler2d texture: specular (same as: SHADER_LOC_MAP_METALNESS) - ---- - - -## Defines - Shader uniform data type -> SHADER_UNIFORM_FLOAT = 0 - -Shader uniform type: float - ---- - -> SHADER_UNIFORM_VEC2 = 1 - -Shader uniform type: vec2 (2 float) - ---- - -> SHADER_UNIFORM_VEC3 = 2 - -Shader uniform type: vec3 (3 float) - ---- - -> SHADER_UNIFORM_VEC4 = 3 - -Shader uniform type: vec4 (4 float) - ---- - -> SHADER_UNIFORM_INT = 4 - -Shader uniform type: int - ---- - -> SHADER_UNIFORM_IVEC2 = 5 - -Shader uniform type: ivec2 (2 int) - ---- - -> SHADER_UNIFORM_IVEC3 = 6 - -Shader uniform type: ivec3 (3 int) - ---- - -> SHADER_UNIFORM_IVEC4 = 7 - -Shader uniform type: ivec4 (4 int) - ---- - -> SHADER_UNIFORM_SAMPLER2D = 8 - -Shader uniform type: sampler2d - ---- - - -## Defines - Shader attribute data types -> SHADER_ATTRIB_FLOAT = 0 - -Shader attribute type: float - ---- - -> SHADER_ATTRIB_VEC2 = 1 - -Shader attribute type: vec2 (2 float) - ---- - -> SHADER_ATTRIB_VEC3 = 2 - -Shader attribute type: vec3 (3 float) - ---- - -> SHADER_ATTRIB_VEC4 = 3 - -Shader attribute type: vec4 (4 float) - ---- - - -## Defines - Pixel formats -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 - -8 bit per pixel (no alpha) - ---- - -> PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 - -8*2 bpp (2 channels) - ---- - -> PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 - -16 bpp - ---- - -> PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 - -24 bpp - ---- - -> PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 - -16 bpp (1 bit alpha) - ---- - -> PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 - -16 bpp (4 bit alpha) - ---- - -> PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 - -32 bpp - ---- - -> PIXELFORMAT_UNCOMPRESSED_R32 = 8 - -32 bpp (1 channel - float) - ---- - -> PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 - -32*3 bpp (3 channels - float) - ---- - -> PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 - -32*4 bpp (4 channels - float) - ---- - -> PIXELFORMAT_COMPRESSED_DXT1_RGB = 14 - -4 bpp (no alpha) - ---- - -> PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15 - -4 bpp (1 bit alpha) - ---- - -> PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16 - -8 bpp - ---- - -> PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17 - -8 bpp - ---- - -> PIXELFORMAT_COMPRESSED_ETC1_RGB = 18 - -4 bpp - ---- - -> PIXELFORMAT_COMPRESSED_ETC2_RGB = 19 - -4 bpp - ---- - -> PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20 - -8 bpp - ---- - -> PIXELFORMAT_COMPRESSED_PVRT_RGB = 21 - -4 bpp - ---- - -> PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22 - -4 bpp - ---- - -> PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23 - -8 bpp - ---- - -> PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24 - -2 bpp - ---- - - -## Defines - Texture parameters: filter mode -> TEXTURE_FILTER_POINT = 0 - -No filter, just pixel approximation - ---- - -> TEXTURE_FILTER_BILINEAR = 1 - -Linear filtering - ---- - -> TEXTURE_FILTER_TRILINEAR = 2 - -Trilinear filtering (linear with mipmaps) - ---- - -> TEXTURE_FILTER_ANISOTROPIC_4X = 3 - -Anisotropic filtering 4x - ---- - -> TEXTURE_FILTER_ANISOTROPIC_8X = 4 - -Anisotropic filtering 8x - ---- - -> TEXTURE_FILTER_ANISOTROPIC_16X = 5 - -Anisotropic filtering 16x - ---- - - -## Defines - Texture parameters: wrap mode -> TEXTURE_WRAP_REPEAT = 0 - -Repeats texture in tiled mode - ---- - -> TEXTURE_WRAP_CLAMP = 1 - -Clamps texture to edge pixel in tiled mode - ---- - -> TEXTURE_WRAP_MIRROR_REPEAT = 2 - -Mirrors and repeats the texture in tiled mode - ---- - -> TEXTURE_WRAP_MIRROR_CLAMP = 3 - -Mirrors and clamps to border the texture in tiled mode - ---- - - -## Defines - Cubemap layouts -> CUBEMAP_LAYOUT_AUTO_DETECT = 0 - -Automatically detect layout type - ---- - -> CUBEMAP_LAYOUT_LINE_VERTICAL = 1 - -Layout is defined by a vertical line with faces - ---- - -> CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2 - -Layout is defined by a horizontal line with faces - ---- - -> CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3 - -Layout is defined by a 3x4 cross with cubemap faces - ---- - -> CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4 - -Layout is defined by a 4x3 cross with cubemap faces - ---- - - -## Defines - Font type, defines generation method -> FONT_DEFAULT = 0 - -Default font generation, anti-aliased - ---- - -> FONT_BITMAP = 1 - -Bitmap font generation, no anti-aliasing - ---- - -> FONT_SDF = 2 - -SDF font generation, requires external shader - ---- - - -## Defines - Color blending modes (pre-defined) -> BLEND_ALPHA = 0 - -Blend textures considering alpha (default) - ---- - -> BLEND_ADDITIVE = 1 - -Blend textures adding colors - ---- - -> BLEND_MULTIPLIED = 2 - -Blend textures multiplying colors - ---- - -> BLEND_ADD_COLORS = 3 - -Blend textures adding colors (alternative) - ---- - -> BLEND_SUBTRACT_COLORS = 4 - -Blend textures subtracting colors (alternative) - ---- - -> BLEND_ALPHA_PREMULTIPLY = 5 - -Blend premultiplied textures considering alpha - ---- - -> BLEND_CUSTOM = 6 - -Blend textures using custom src/dst factors (use rlSetBlendFactors()) - ---- - -> BLEND_CUSTOM_SEPARATE = 7 - -Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) - ---- - - -## Defines - Gesture -> GESTURE_NONE = 0 - -No gesture - ---- - -> GESTURE_TAP = 1 - -Tap gesture - ---- - -> GESTURE_DOUBLETAP = 2 - -Double tap gesture - ---- - -> GESTURE_HOLD = 4 - -Hold gesture - ---- - -> GESTURE_DRAG = 8 - -Drag gesture - ---- - -> GESTURE_SWIPE_RIGHT = 16 - -Swipe right gesture - ---- - -> GESTURE_SWIPE_LEFT = 32 - -Swipe left gesture - ---- - -> GESTURE_SWIPE_UP = 64 - -Swipe up gesture - ---- - -> GESTURE_SWIPE_DOWN = 128 - -Swipe down gesture - ---- - -> GESTURE_PINCH_IN = 256 - -Pinch in gesture - ---- - -> GESTURE_PINCH_OUT = 512 - -Pinch out gesture - ---- - - -## Defines - Camera system modes -> CAMERA_CUSTOM = 0 - -Custom camera - ---- - -> CAMERA_FREE = 1 - -Free camera - ---- - -> CAMERA_ORBITAL = 2 - -Orbital camera - ---- - -> CAMERA_FIRST_PERSON = 3 - -First person camera - ---- - -> CAMERA_THIRD_PERSON = 4 - -Third person camera - ---- - - -## Defines - Camera projection -> CAMERA_PERSPECTIVE = 0 - -Perspective projection - ---- - -> CAMERA_ORTHOGRAPHIC = 1 - -Orthographic projection - ---- - - -## Defines - N-patch layout -> NPATCH_NINE_PATCH = 0 - -Npatch layout: 3x3 tiles - ---- - -> NPATCH_THREE_PATCH_VERTICAL = 1 - -Npatch layout: 1x3 tiles - ---- - -> NPATCH_THREE_PATCH_HORIZONTAL = 2 - -Npatch layout: 3x1 tiles - ---- - - -## Defines - Colors -LIGHTGRAY = { 200, 200, 200, 255 } - -Light Gray - ---- - -GRAY = { 130, 130, 130, 255 } - -Gray - ---- - -DARKGRAY = { 80, 80, 80, 255 } - -Dark Gray - ---- - -YELLOW = { 253, 249, 0, 255 } - -Yellow - ---- - -GOLD = { 255, 203, 0, 255 } - -Gold - ---- - -ORANGE = { 255, 161, 0, 255 } - -Orange - ---- - -PINK = { 255, 109, 194, 255 } - -Pink - ---- - -RED = { 230, 41, 55, 255 } - -Red - ---- - -MAROON = { 190, 33, 55, 255 } - -Maroon - ---- - -GREEN = { 0, 228, 48, 255 } - -Green - ---- - -LIME = { 0, 158, 47, 255 } - -Lime - ---- - -DARKGREEN = { 0, 117, 44, 255 } - -Dark Green - ---- - -SKYBLUE = { 102, 191, 255, 255 } - -Sky Blue - ---- - -BLUE = { 0, 121, 241, 255 } - -Blue - ---- - -DARKBLUE = { 0, 82, 172, 255 } - -Dark Blue - ---- - -PURPLE = { 200, 122, 255, 255 } - -Purple - ---- - -VIOLET = { 135, 60, 190, 255 } - -Violet - ---- - -DARKPURPLE = { 112, 31, 126, 255 } - -Dark Purple - ---- - -BEIGE = { 211, 176, 131, 255 } - -Beige - ---- - -BROWN = { 127, 106, 79, 255 } - -Brown - ---- - -DARKBROWN = { 76, 63, 47, 255 } - -Dark Brown - ---- - -WHITE = { 255, 255, 255, 255 } - -White - ---- - -BLACK = { 0, 0, 0, 255 } - -Black - ---- - -BLANK = { 0, 0, 0, 0 } - -Blank (Transparent) - ---- - -MAGENTA = { 255, 0, 255, 255 } - -Magenta - ---- - -RAYWHITE = { 245, 245, 245, 255 } - -My own White (raylib logo) - ---- - - -## Defines - Math -> PI = 3.1415927410126 - -Pi - ---- - -> EPSILON = 9.9999999747524e-07 - -Epsilon - ---- - -> DEG2RAD = 0.017453292384744 - -Degrees to radians - ---- - -> RAD2DEG = 57.295776367188 - -Radians to degrees - ---- - - -## Defines - Gui control state -> STATE_NORMAL = 0 - ---- - -> STATE_FOCUSED = 1 - ---- - -> STATE_PRESSED = 2 - ---- - -> STATE_DISABLED = 3 - ---- - - -## Defines - Gui control text alignment -> TEXT_ALIGN_LEFT = 0 - ---- - -> TEXT_ALIGN_CENTER = 1 - ---- - -> TEXT_ALIGN_RIGHT = 2 - ---- - - -## Defines - Gui control text alignment vertical -> TEXT_ALIGN_TOP = 0 - ---- - -> TEXT_ALIGN_MIDDLE = 1 - ---- - -> TEXT_ALIGN_BOTTOM = 2 - ---- - - -## Defines - Gui control text wrap mode -> TEXT_WRAP_NONE = 0 - ---- - -> TEXT_WRAP_CHAR = 1 - ---- - -> TEXT_WRAP_WORD = 2 - ---- - - -## Defines - Gui controls -> DEFAULT = 0 - ---- - -> LABEL = 1 - -Used also for: LABELBUTTON - ---- - -> BUTTON = 2 - ---- - -> TOGGLE = 3 - -Used also for: TOGGLEGROUP - ---- - -> SLIDER = 4 - -Used also for: SLIDERBAR - ---- - -> PROGRESSBAR = 5 - ---- - -> CHECKBOX = 6 - ---- - -> COMBOBOX = 7 - ---- - -> DROPDOWNBOX = 8 - ---- - -> TEXTBOX = 9 - -Used also for: TEXTBOXMULTI - ---- - -> VALUEBOX = 10 - ---- - -> SPINNER = 11 - -Uses: BUTTON, VALUEBOX - ---- - -> LISTVIEW = 12 - ---- - -> COLORPICKER = 13 - ---- - -> SCROLLBAR = 14 - ---- - -> STATUSBAR = 15 - ---- - - -## Defines - Gui base properties for every control -> BORDER_COLOR_NORMAL = 0 - ---- - -> BASE_COLOR_NORMAL = 1 - ---- - -> TEXT_COLOR_NORMAL = 2 - ---- - -> BORDER_COLOR_FOCUSED = 3 - ---- - -> BASE_COLOR_FOCUSED = 4 - ---- - -> TEXT_COLOR_FOCUSED = 5 - ---- - -> BORDER_COLOR_PRESSED = 6 - ---- - -> BASE_COLOR_PRESSED = 7 - ---- - -> TEXT_COLOR_PRESSED = 8 - ---- - -> BORDER_COLOR_DISABLED = 9 - ---- - -> BASE_COLOR_DISABLED = 10 - ---- - -> TEXT_COLOR_DISABLED = 11 - ---- - -> BORDER_WIDTH = 12 - ---- - -> TEXT_PADDING = 13 - ---- - -> TEXT_ALIGNMENT = 14 - ---- - - -## Defines - Gui extended properties depend on control -> TEXT_SIZE = 16 - -Text size (glyphs max height) - ---- - -> TEXT_SPACING = 17 - -Text spacing between glyphs - ---- - -> LINE_COLOR = 18 - -Line control color - ---- - -> BACKGROUND_COLOR = 19 - -Background color - ---- - -> TEXT_LINE_SPACING = 20 - -Text spacing between lines - ---- - -> TEXT_ALIGNMENT_VERTICAL = 21 - -Text vertical alignment inside text bounds (after border and padding) - ---- - -> TEXT_WRAP_MODE = 22 - -Text wrap-mode inside text bounds - ---- - - -## Defines - Gui Toggle/ToggleGroup -> GROUP_PADDING = 16 - -ToggleGroup separation between toggles - ---- - - -## Defines - Gui Slider/SliderBar -> SLIDER_WIDTH = 16 - -Slider size of internal bar - ---- - -> SLIDER_PADDING = 17 - -Slider/SliderBar internal bar padding - ---- - - -## Defines - Gui ProgressBar -> PROGRESS_PADDING = 16 - -ProgressBar internal padding - ---- - - -## Defines - Gui ScrollBar -> ARROWS_SIZE = 16 - ---- - -> ARROWS_VISIBLE = 17 - ---- - -> SCROLL_SLIDER_PADDING = 18 - -(SLIDERBAR, SLIDER_PADDING) - ---- - -> SCROLL_SLIDER_SIZE = 19 - ---- - -> SCROLL_PADDING = 20 - ---- - -> SCROLL_SPEED = 21 - ---- - - -## Defines - Gui CheckBox -> CHECK_PADDING = 16 - -CheckBox internal check padding - ---- - - -## Defines - Gui ComboBox -> COMBO_BUTTON_WIDTH = 16 - -ComboBox right button width - ---- - -> COMBO_BUTTON_SPACING = 17 - -ComboBox button separation - ---- - - -## Defines - Gui DropdownBox -> ARROW_PADDING = 16 - -DropdownBox arrow separation from border and items - ---- - -> DROPDOWN_ITEMS_SPACING = 17 - -DropdownBox items separation - ---- - - -## Defines - Gui TextBox/TextBoxMulti/ValueBox/Spinner -> TEXT_READONLY = 16 - -TextBox in read-only mode: 0-text editable, 1-text no-editable - ---- - - -## Defines - Gui Spinner -> SPIN_BUTTON_WIDTH = 16 - -Spinner left/right buttons width - ---- - -> SPIN_BUTTON_SPACING = 17 - -Spinner buttons separation - ---- - - -## Defines - Gui ListView -> LIST_ITEMS_HEIGHT = 16 - -ListView items height - ---- - -> LIST_ITEMS_SPACING = 17 - -ListView items separation - ---- - -> SCROLLBAR_WIDTH = 18 - -ListView scrollbar size (usually width) - ---- - -> SCROLLBAR_SIDE = 19 - -ListView scrollbar side (0-left, 1-right) - ---- - - -## Defines - Gui ColorPicker -> COLOR_SELECTOR_SIZE = 16 - ---- - -> HUEBAR_WIDTH = 17 - -ColorPicker right hue bar width - ---- - -> HUEBAR_PADDING = 18 - -ColorPicker right hue bar separation from panel - ---- - -> HUEBAR_SELECTOR_HEIGHT = 19 - -ColorPicker right hue bar selector height - ---- - -> HUEBAR_SELECTOR_OVERFLOW = 20 - -ColorPicker right hue bar selector overflow - ---- - - -## Defines - Gui Icons enumeration -> ICON_NONE = 0 - ---- - -> ICON_FOLDER_FILE_OPEN = 1 - ---- - -> ICON_FILE_SAVE_CLASSIC = 2 - ---- - -> ICON_FOLDER_OPEN = 3 - ---- - -> ICON_FOLDER_SAVE = 4 - ---- - -> ICON_FILE_OPEN = 5 - ---- - -> ICON_FILE_SAVE = 6 - ---- - -> ICON_FILE_EXPORT = 7 - ---- - -> ICON_FILE_ADD = 8 - ---- - -> ICON_FILE_DELETE = 9 - ---- - -> ICON_FILETYPE_TEXT = 10 - ---- - -> ICON_FILETYPE_AUDIO = 11 - ---- - -> ICON_FILETYPE_IMAGE = 12 - ---- - -> ICON_FILETYPE_PLAY = 13 - ---- - -> ICON_FILETYPE_VIDEO = 14 - ---- - -> ICON_FILETYPE_INFO = 15 - ---- - -> ICON_FILE_COPY = 16 - ---- - -> ICON_FILE_CUT = 17 - ---- - -> ICON_FILE_PASTE = 18 - ---- - -> ICON_CURSOR_HAND = 19 - ---- - -> ICON_CURSOR_POINTER = 20 - ---- - -> ICON_CURSOR_CLASSIC = 21 - ---- - -> ICON_PENCIL = 22 - ---- - -> ICON_PENCIL_BIG = 23 - ---- - -> ICON_BRUSH_CLASSIC = 24 - ---- - -> ICON_BRUSH_PAINTER = 25 - ---- - -> ICON_WATER_DROP = 26 - ---- - -> ICON_COLOR_PICKER = 27 - ---- - -> ICON_RUBBER = 28 - ---- - -> ICON_COLOR_BUCKET = 29 - ---- - -> ICON_TEXT_T = 30 - ---- - -> ICON_TEXT_A = 31 - ---- - -> ICON_SCALE = 32 - ---- - -> ICON_RESIZE = 33 - ---- - -> ICON_FILTER_POINT = 34 - ---- - -> ICON_FILTER_BILINEAR = 35 - ---- - -> ICON_CROP = 36 - ---- - -> ICON_CROP_ALPHA = 37 - ---- - -> ICON_SQUARE_TOGGLE = 38 - ---- - -> ICON_SYMMETRY = 39 - ---- - -> ICON_SYMMETRY_HORIZONTAL = 40 - ---- - -> ICON_SYMMETRY_VERTICAL = 41 - ---- - -> ICON_LENS = 42 - ---- - -> ICON_LENS_BIG = 43 - ---- - -> ICON_EYE_ON = 44 - ---- - -> ICON_EYE_OFF = 45 - ---- - -> ICON_FILTER_TOP = 46 - ---- - -> ICON_FILTER = 47 - ---- - -> ICON_TARGET_POINT = 48 - ---- - -> ICON_TARGET_SMALL = 49 - ---- - -> ICON_TARGET_BIG = 50 - ---- - -> ICON_TARGET_MOVE = 51 - ---- - -> ICON_CURSOR_MOVE = 52 - ---- - -> ICON_CURSOR_SCALE = 53 - ---- - -> ICON_CURSOR_SCALE_RIGHT = 54 - ---- - -> ICON_CURSOR_SCALE_LEFT = 55 - ---- - -> ICON_UNDO = 56 - ---- - -> ICON_REDO = 57 - ---- - -> ICON_REREDO = 58 - ---- - -> ICON_MUTATE = 59 - ---- - -> ICON_ROTATE = 60 - ---- - -> ICON_REPEAT = 61 - ---- - -> ICON_SHUFFLE = 62 - ---- - -> ICON_EMPTYBOX = 63 - ---- - -> ICON_TARGET = 64 - ---- - -> ICON_TARGET_SMALL_FILL = 65 - ---- - -> ICON_TARGET_BIG_FILL = 66 - ---- - -> ICON_TARGET_MOVE_FILL = 67 - ---- - -> ICON_CURSOR_MOVE_FILL = 68 - ---- - -> ICON_CURSOR_SCALE_FILL = 69 - ---- - -> ICON_CURSOR_SCALE_RIGHT_FILL = 70 - ---- - -> ICON_CURSOR_SCALE_LEFT_FILL = 71 - ---- - -> ICON_UNDO_FILL = 72 - ---- - -> ICON_REDO_FILL = 73 - ---- - -> ICON_REREDO_FILL = 74 - ---- - -> ICON_MUTATE_FILL = 75 - ---- - -> ICON_ROTATE_FILL = 76 - ---- - -> ICON_REPEAT_FILL = 77 - ---- - -> ICON_SHUFFLE_FILL = 78 - ---- - -> ICON_EMPTYBOX_SMALL = 79 - ---- - -> ICON_BOX = 80 - ---- - -> ICON_BOX_TOP = 81 - ---- - -> ICON_BOX_TOP_RIGHT = 82 - ---- - -> ICON_BOX_RIGHT = 83 - ---- - -> ICON_BOX_BOTTOM_RIGHT = 84 - ---- - -> ICON_BOX_BOTTOM = 85 - ---- - -> ICON_BOX_BOTTOM_LEFT = 86 - ---- - -> ICON_BOX_LEFT = 87 - ---- - -> ICON_BOX_TOP_LEFT = 88 - ---- - -> ICON_BOX_CENTER = 89 - ---- - -> ICON_BOX_CIRCLE_MASK = 90 - ---- - -> ICON_POT = 91 - ---- - -> ICON_ALPHA_MULTIPLY = 92 - ---- - -> ICON_ALPHA_CLEAR = 93 - ---- - -> ICON_DITHERING = 94 - ---- - -> ICON_MIPMAPS = 95 - ---- - -> ICON_BOX_GRID = 96 - ---- - -> ICON_GRID = 97 - ---- - -> ICON_BOX_CORNERS_SMALL = 98 - ---- - -> ICON_BOX_CORNERS_BIG = 99 - ---- - -> ICON_FOUR_BOXES = 100 - ---- - -> ICON_GRID_FILL = 101 - ---- - -> ICON_BOX_MULTISIZE = 102 - ---- - -> ICON_ZOOM_SMALL = 103 - ---- - -> ICON_ZOOM_MEDIUM = 104 - ---- - -> ICON_ZOOM_BIG = 105 - ---- - -> ICON_ZOOM_ALL = 106 - ---- - -> ICON_ZOOM_CENTER = 107 - ---- - -> ICON_BOX_DOTS_SMALL = 108 - ---- - -> ICON_BOX_DOTS_BIG = 109 - ---- - -> ICON_BOX_CONCENTRIC = 110 - ---- - -> ICON_BOX_GRID_BIG = 111 - ---- - -> ICON_OK_TICK = 112 - ---- - -> ICON_CROSS = 113 - ---- - -> ICON_ARROW_LEFT = 114 - ---- - -> ICON_ARROW_RIGHT = 115 - ---- - -> ICON_ARROW_DOWN = 116 - ---- - -> ICON_ARROW_UP = 117 - ---- - -> ICON_ARROW_LEFT_FILL = 118 - ---- - -> ICON_ARROW_RIGHT_FILL = 119 - ---- - -> ICON_ARROW_DOWN_FILL = 120 - ---- - -> ICON_ARROW_UP_FILL = 121 - ---- - -> ICON_AUDIO = 122 - ---- - -> ICON_FX = 123 - ---- - -> ICON_WAVE = 124 - ---- - -> ICON_WAVE_SINUS = 125 - ---- - -> ICON_WAVE_SQUARE = 126 - ---- - -> ICON_WAVE_TRIANGULAR = 127 - ---- - -> ICON_CROSS_SMALL = 128 - ---- - -> ICON_PLAYER_PREVIOUS = 129 - ---- - -> ICON_PLAYER_PLAY_BACK = 130 - ---- - -> ICON_PLAYER_PLAY = 131 - ---- - -> ICON_PLAYER_PAUSE = 132 - ---- - -> ICON_PLAYER_STOP = 133 - ---- - -> ICON_PLAYER_NEXT = 134 - ---- - -> ICON_PLAYER_RECORD = 135 - ---- - -> ICON_MAGNET = 136 - ---- - -> ICON_LOCK_CLOSE = 137 - ---- - -> ICON_LOCK_OPEN = 138 - ---- - -> ICON_CLOCK = 139 - ---- - -> ICON_TOOLS = 140 - ---- - -> ICON_GEAR = 141 - ---- - -> ICON_GEAR_BIG = 142 - ---- - -> ICON_BIN = 143 - ---- - -> ICON_HAND_POINTER = 144 - ---- - -> ICON_LASER = 145 - ---- - -> ICON_COIN = 146 - ---- - -> ICON_EXPLOSION = 147 - ---- - -> ICON_1UP = 148 - ---- - -> ICON_PLAYER = 149 - ---- - -> ICON_PLAYER_JUMP = 150 - ---- - -> ICON_KEY = 151 - ---- - -> ICON_DEMON = 152 - ---- - -> ICON_TEXT_POPUP = 153 - ---- - -> ICON_GEAR_EX = 154 - ---- - -> ICON_CRACK = 155 - ---- - -> ICON_CRACK_POINTS = 156 - ---- - -> ICON_STAR = 157 - ---- - -> ICON_DOOR = 158 - ---- - -> ICON_EXIT = 159 - ---- - -> ICON_MODE_2D = 160 - ---- - -> ICON_MODE_3D = 161 - ---- - -> ICON_CUBE = 162 - ---- - -> ICON_CUBE_FACE_TOP = 163 - ---- - -> ICON_CUBE_FACE_LEFT = 164 - ---- - -> ICON_CUBE_FACE_FRONT = 165 - ---- - -> ICON_CUBE_FACE_BOTTOM = 166 - ---- - -> ICON_CUBE_FACE_RIGHT = 167 - ---- - -> ICON_CUBE_FACE_BACK = 168 - ---- - -> ICON_CAMERA = 169 - ---- - -> ICON_SPECIAL = 170 - ---- - -> ICON_LINK_NET = 171 - ---- - -> ICON_LINK_BOXES = 172 - ---- - -> ICON_LINK_MULTI = 173 - ---- - -> ICON_LINK = 174 - ---- - -> ICON_LINK_BROKE = 175 - ---- - -> ICON_TEXT_NOTES = 176 - ---- - -> ICON_NOTEBOOK = 177 - ---- - -> ICON_SUITCASE = 178 - ---- - -> ICON_SUITCASE_ZIP = 179 - ---- - -> ICON_MAILBOX = 180 - ---- - -> ICON_MONITOR = 181 - ---- - -> ICON_PRINTER = 182 - ---- - -> ICON_PHOTO_CAMERA = 183 - ---- - -> ICON_PHOTO_CAMERA_FLASH = 184 - ---- - -> ICON_HOUSE = 185 - ---- - -> ICON_HEART = 186 - ---- - -> ICON_CORNER = 187 - ---- - -> ICON_VERTICAL_BARS = 188 - ---- - -> ICON_VERTICAL_BARS_FILL = 189 - ---- - -> ICON_LIFE_BARS = 190 - ---- - -> ICON_INFO = 191 - ---- - -> ICON_CROSSLINE = 192 - ---- - -> ICON_HELP = 193 - ---- - -> ICON_FILETYPE_ALPHA = 194 - ---- - -> ICON_FILETYPE_HOME = 195 - ---- - -> ICON_LAYERS_VISIBLE = 196 - ---- - -> ICON_LAYERS = 197 - ---- - -> ICON_WINDOW = 198 - ---- - -> ICON_HIDPI = 199 - ---- - -> ICON_FILETYPE_BINARY = 200 - ---- - -> ICON_HEX = 201 - ---- - -> ICON_SHIELD = 202 - ---- - -> ICON_FILE_NEW = 203 - ---- - -> ICON_FOLDER_ADD = 204 - ---- - -> ICON_ALARM = 205 - ---- - -> ICON_CPU = 206 - ---- - -> ICON_ROM = 207 - ---- - -> ICON_STEP_OVER = 208 - ---- - -> ICON_STEP_INTO = 209 - ---- - -> ICON_STEP_OUT = 210 - ---- - -> ICON_RESTART = 211 - ---- - -> ICON_BREAKPOINT_ON = 212 - ---- - -> ICON_BREAKPOINT_OFF = 213 - ---- - -> ICON_BURGER_MENU = 214 - ---- - -> ICON_CASE_SENSITIVE = 215 - ---- - -> ICON_REG_EXP = 216 - ---- - -> ICON_FOLDER = 217 - ---- - -> ICON_FILE = 218 - ---- - -> ICON_SAND_TIMER = 219 - ---- - - -## Defines - Light type -> LIGHT_DIRECTIONAL = 0 - -Directional light - ---- - -> LIGHT_POINT = 1 - -Point light - ---- - - -## Defines - RLGL Default internal render batch elements limits -> RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192 - -Default internal render batch elements limits - ---- - -> RL_DEFAULT_BATCH_BUFFERS = 1 - -Default number of batch buffers (multi-buffering) - ---- - -> RL_DEFAULT_BATCH_DRAWCALLS = 256 - -Default number of batch draw calls (by state changes: mode, texture) - ---- - -> RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 - -Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture()) - ---- - - -## Defines - RLGL Internal Matrix stack -> RL_MAX_MATRIX_STACK_SIZE = 32 - -Maximum size of internal Matrix stack - ---- - - -## Defines - RLGL Shader limits -> RL_MAX_SHADER_LOCATIONS = 32 - -Maximum number of shader locations supported - ---- - - -## Defines - RLGL Projection matrix culling -> RL_CULL_DISTANCE_NEAR = 0.01 - -Default projection matrix near cull distance - ---- - -> RL_CULL_DISTANCE_FAR = 1000 - -Default projection matrix far cull distance - ---- - - -## Defines - RLGL Texture parameters -> RL_TEXTURE_WRAP_S = 10242 - -GL_TEXTURE_WRAP_S - ---- - -> RL_TEXTURE_WRAP_T = 10243 - -GL_TEXTURE_WRAP_T - ---- - -> RL_TEXTURE_MAG_FILTER = 10240 - -GL_TEXTURE_MAG_FILTER - ---- - -> RL_TEXTURE_MIN_FILTER = 10241 - -GL_TEXTURE_MIN_FILTER - ---- - -> RL_TEXTURE_FILTER_NEAREST = 9728 - -GL_NEAREST - ---- - -> RL_TEXTURE_FILTER_LINEAR = 9729 - -GL_LINEAR - ---- - -> RL_TEXTURE_FILTER_MIP_NEAREST = 9984 - -GL_NEAREST_MIPMAP_NEAREST - ---- - -> RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 9986 - -GL_NEAREST_MIPMAP_LINEAR - ---- - -> RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 9985 - -GL_LINEAR_MIPMAP_NEAREST - ---- - -> RL_TEXTURE_FILTER_MIP_LINEAR = 9987 - -GL_LINEAR_MIPMAP_LINEAR - ---- - -> RL_TEXTURE_FILTER_ANISOTROPIC = 12288 - -Anisotropic filter (custom identifier) - ---- - -> RL_TEXTURE_MIPMAP_BIAS_RATIO = 16384 - -Texture mipmap bias, percentage ratio (custom identifier) - ---- - -> RL_TEXTURE_WRAP_REPEAT = 10497 - -GL_REPEAT - ---- - -> RL_TEXTURE_WRAP_CLAMP = 33071 - -GL_CLAMP_TO_EDGE - ---- - -> RL_TEXTURE_WRAP_MIRROR_REPEAT = 33648 - -GL_MIRRORED_REPEAT - ---- - -> RL_TEXTURE_WRAP_MIRROR_CLAMP = 34626 - -GL_MIRROR_CLAMP_EXT - ---- - - -## Defines - RLGL Matrix modes (equivalent to OpenGL) -> RL_MODELVIEW = 5888 - -GL_MODELVIEW - ---- - -> RL_PROJECTION = 5889 - -GL_PROJECTION - ---- - -> RL_TEXTURE = 5890 - -GL_TEXTURE - ---- - - -## Defines - RLGL Primitive assembly draw modes -> RL_LINES = 1 - -GL_LINES - ---- - -> RL_TRIANGLES = 4 - -GL_TRIANGLES - ---- - -> RL_QUADS = 7 - -GL_QUADS - ---- - - -## Defines - RLGL GL equivalent data types -> RL_UNSIGNED_BYTE = 5121 - -GL_UNSIGNED_BYTE - ---- - -> RL_FLOAT = 5126 - -GL_FLOAT - ---- - - -## Defines - RLGL GL buffer usage hint -> RL_STREAM_DRAW = 35040 - -GL_STREAM_DRAW - ---- - -> RL_STREAM_READ = 35041 - -GL_STREAM_READ - ---- - -> RL_STREAM_COPY = 35042 - -GL_STREAM_COPY - ---- - -> RL_STATIC_DRAW = 35044 - -GL_STATIC_DRAW - ---- - -> RL_STATIC_READ = 35045 - -GL_STATIC_READ - ---- - -> RL_STATIC_COPY = 35046 - -GL_STATIC_COPY - ---- - -> RL_DYNAMIC_DRAW = 35048 - -GL_DYNAMIC_DRAW - ---- - -> RL_DYNAMIC_READ = 35049 - -GL_DYNAMIC_READ - ---- - -> RL_DYNAMIC_COPY = 35050 - -GL_DYNAMIC_COPY - ---- - - -## Defines - RLGL Shader type -> RL_FRAGMENT_SHADER = 35632 - -GL_FRAGMENT_SHADER - ---- - -> RL_VERTEX_SHADER = 35633 - -GL_VERTEX_SHADER - ---- - -> RL_COMPUTE_SHADER = 37305 - -GL_COMPUTE_SHADER - ---- - - -## Defines - RLGL GL blending factors -> RL_ZERO = 0 - -GL_ZERO - ---- - -> RL_ONE = 1 - -GL_ONE - ---- - -> RL_SRC_COLOR = 768 - -GL_SRC_COLOR - ---- - -> RL_ONE_MINUS_SRC_COLOR = 769 - -GL_ONE_MINUS_SRC_COLOR - ---- - -> RL_SRC_ALPHA = 770 - -GL_SRC_ALPHA - ---- - -> RL_ONE_MINUS_SRC_ALPHA = 771 - -GL_ONE_MINUS_SRC_ALPHA - ---- - -> RL_DST_ALPHA = 772 - -GL_DST_ALPHA - ---- - -> RL_ONE_MINUS_DST_ALPHA = 773 - -GL_ONE_MINUS_DST_ALPHA - ---- - -> RL_DST_COLOR = 774 - -GL_DST_COLOR - ---- - -> RL_ONE_MINUS_DST_COLOR = 775 - -GL_ONE_MINUS_DST_COLOR - ---- - -> RL_SRC_ALPHA_SATURATE = 776 - -GL_SRC_ALPHA_SATURATE - ---- - -> RL_CONSTANT_COLOR = 32769 - -GL_CONSTANT_COLOR - ---- - -> RL_ONE_MINUS_CONSTANT_COLOR = 32770 - -GL_ONE_MINUS_CONSTANT_COLOR - ---- - -> RL_CONSTANT_ALPHA = 32771 - -GL_CONSTANT_ALPHA - ---- - -> RL_ONE_MINUS_CONSTANT_ALPHA = 32772 - -GL_ONE_MINUS_CONSTANT_ALPHA - ---- - - -## Defines - RLGL GL blending functions/equations -> RL_FUNC_ADD = 32774 - -GL_FUNC_ADD - ---- - -> RL_MIN = 32775 - -GL_MIN - ---- - -> RL_MAX = 32776 - -GL_MAX - ---- - -> RL_FUNC_SUBTRACT = 32778 - -GL_FUNC_SUBTRACT - ---- - -> RL_FUNC_REVERSE_SUBTRACT = 32779 - -GL_FUNC_REVERSE_SUBTRACT - ---- - -> RL_BLEND_EQUATION = 32777 - -GL_BLEND_EQUATION - ---- - -> RL_BLEND_EQUATION_RGB = 32777 - -GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION) - ---- - -> RL_BLEND_EQUATION_ALPHA = 34877 - -GL_BLEND_EQUATION_ALPHA - ---- - -> RL_BLEND_DST_RGB = 32968 - -GL_BLEND_DST_RGB - ---- - -> RL_BLEND_SRC_RGB = 32969 - -GL_BLEND_SRC_RGB - ---- - -> RL_BLEND_DST_ALPHA = 32970 - -GL_BLEND_DST_ALPHA - ---- - -> RL_BLEND_SRC_ALPHA = 32971 - -GL_BLEND_SRC_ALPHA - ---- - -> RL_BLEND_COLOR = 32773 - -GL_BLEND_COLOR - ---- - -> RL_READ_FRAMEBUFFER = 36008 - -GL_READ_FRAMEBUFFER - ---- - -> RL_DRAW_FRAMEBUFFER = 36009 - -GL_DRAW_FRAMEBUFFER - ---- - - -## Defines - RLGL Default shader vertex attribute locations -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION = 0 - ---- - -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD = 1 - ---- - -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL = 2 - ---- - -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR = 3 - ---- - -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT = 4 - ---- - -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 = 5 - ---- - -> RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES = 6 - ---- - - -RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS = nil - ---- - - -RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS = nil - ---- - - -## Defines - RLGL GlVersion -> RL_OPENGL_11 = 1 - -OpenGL 1.1 - ---- - -> RL_OPENGL_21 = 2 - -OpenGL 2.1 (GLSL 120) - ---- - -> RL_OPENGL_33 = 3 - -OpenGL 3.3 (GLSL 330) - ---- - -> RL_OPENGL_43 = 4 - -OpenGL 4.3 (using GLSL 330) - ---- - -> RL_OPENGL_ES_20 = 5 - -OpenGL ES 2.0 (GLSL 100) - ---- - - -## Defines - RLGL Framebuffer attachment type -> RL_ATTACHMENT_COLOR_CHANNEL0 = 0 - -Framebuffer attachment type: color 0 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL1 = 1 - -Framebuffer attachment type: color 1 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL2 = 2 - -Framebuffer attachment type: color 2 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL3 = 3 - -Framebuffer attachment type: color 3 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL4 = 4 - -Framebuffer attachment type: color 4 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL5 = 5 - -Framebuffer attachment type: color 5 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL6 = 6 - -Framebuffer attachment type: color 6 - ---- - -> RL_ATTACHMENT_COLOR_CHANNEL7 = 7 - -Framebuffer attachment type: color 7 - ---- - -> RL_ATTACHMENT_DEPTH = 100 - -Framebuffer attachment type: depth - ---- - -> RL_ATTACHMENT_STENCIL = 200 - -Framebuffer attachment type: stencil - ---- - - -## Defines - RLGL Framebuffer texture attachment type -> RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0 - -Framebuffer texture attachment type: cubemap, +X side - ---- - -> RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1 - -Framebuffer texture attachment type: cubemap, -X side - ---- - -> RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2 - -Framebuffer texture attachment type: cubemap, +Y side - ---- - -> RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3 - -Framebuffer texture attachment type: cubemap, -Y side - ---- - -> RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4 - -Framebuffer texture attachment type: cubemap, +Z side - ---- - -> RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5 - -Framebuffer texture attachment type: cubemap, -Z side - ---- - -> RL_ATTACHMENT_TEXTURE2D = 100 - -Framebuffer texture attachment type: texture2d - ---- - -> RL_ATTACHMENT_RENDERBUFFER = 200 - -Framebuffer texture attachment type: renderbuffer - ---- - - -## Defines - RLGL CullMode -> RL_CULL_FACE_FRONT = 0 - ---- - -> RL_CULL_FACE_BACK = 1 - ---- - - -## Defines - OpenGL Bitfield mask -> GL_COLOR_BUFFER_BIT = 16384 - ---- - -> GL_DEPTH_BUFFER_BIT = 256 - ---- - -> GL_STENCIL_BUFFER_BIT = 1024 - ---- - - -## Defines - OpenGL Texture parameter -> GL_NEAREST = 9728 - ---- - -> GL_LINEAR = 9729 - ---- - - -## Defines - OpenGL Capability -> GL_BLEND = 3042 - -If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc - ---- - -> GL_CULL_FACE = 2884 - -If enabled, cull polygons based on their winding in window coordinates. See glCullFace - ---- - -> GL_DEPTH_TEST = 2929 - -If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRangef - ---- - -> GL_DITHER = 3024 - -If enabled, dither color components or indices before they are written to the color buffer - ---- - -> GL_POLYGON_OFFSET_FILL = 32823 - -If enabled, an offset is added to depth values of a polygon's fragments produced by rasterization. See glPolygonOffset - ---- - -> GL_POLYGON_OFFSET_LINE = 10754 - ---- - -> GL_POLYGON_OFFSET_POINT = 10753 - ---- - -> GL_SAMPLE_ALPHA_TO_COVERAGE = 32926 - -If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value - ---- - -> GL_SAMPLE_COVERAGE = 32928 - -If enabled, the fragment's coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE, invert the coverage value. See glSampleCoverage - ---- - -> GL_SCISSOR_TEST = 3089 - -If enabled, discard fragments that are outside the scissor rectangle. See glScissor - ---- - -> GL_STENCIL_TEST = 2960 - -If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp - ---- - - -## Defines - OpenGL Test function -> GL_NEVER = 512 - -Always fails - ---- - -> GL_LESS = 513 - -Passes if ( ref & mask ) < ( stencil & mask ) - ---- - -> GL_LEQUAL = 515 - -Passes if ( ref & mask ) <= ( stencil & mask ) - ---- - -> GL_GREATER = 516 - -Passes if ( ref & mask ) > ( stencil & mask ) - ---- - -> GL_GEQUAL = 518 - -Passes if ( ref & mask ) >= ( stencil & mask ) - ---- - -> GL_EQUAL = 514 - -Passes if ( ref & mask ) = ( stencil & mask ) - ---- - -> GL_NOTEQUAL = 517 - -Passes if ( ref & mask ) != ( stencil & mask ) - ---- - -> GL_ALWAYS = 519 - -Always passes - ---- - - -## Defines - OpenGL Face -> GL_FRONT = 1028 - ---- - -> GL_BACK = 1029 - ---- - -> GL_FRONT_AND_BACK = 1032 - ---- - - -## Defines - OpenGL Stencil test -> GL_KEEP = 7680 - -Keeps the current value - ---- - -> GL_ZERO = 0 - -Sets the stencil buffer value to 0 - ---- - -> GL_REPLACE = 7681 - -Sets the stencil buffer value to ref, as specified by glStencilFunc - ---- - -> GL_INCR = 7682 - -Increments the current stencil buffer value. Clamps to the maximum representable unsigned value - ---- - -> GL_INCR_WRAP = 34055 - -Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value - ---- - -> GL_DECR = 7683 - -Decrements the current stencil buffer value. Clamps to 0 - ---- - -> GL_DECR_WRAP = 34056 - -Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero - ---- - -> GL_INVERT = 5386 - -Bitwise inverts the current stencil buffer value - ---- - - -## Defines - OpenGL Connection -> GL_VENDOR = 7936 - -Returns the company responsible for this GL implementation. This name does not change from release to release - ---- - -> GL_RENDERER = 7937 - -Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release - ---- - -> GL_VERSION = 7938 - -Returns a version or release number of the form OpenGLES - ---- - -> GL_SHADING_LANGUAGE_VERSION = 35724 - -Returns a version or release number for the shading language of the form OpenGLESGLSLES - ---- - -> GL_EXTENSIONS = 7939 - -Returns a space-separated list of supported extensions to GL - ---- - - -## Defines - CBuffer Data type -> BUFFER_UNSIGNED_CHAR = 0 - -C type unsigned char - ---- - -> BUFFER_UNSIGNED_SHORT = 1 - -C type unsigned short - ---- - -> BUFFER_UNSIGNED_INT = 2 - -C type unsigned int - ---- - -> BUFFER_UNSIGNED_LONG = 3 - -C type unsigned long - ---- - -> BUFFER_CHAR = 4 - -C type char - ---- - -> BUFFER_SHORT = 5 - -C type short - ---- - -> BUFFER_INT = 6 - -C type int - ---- - -> BUFFER_LONG = 7 - -C type long - ---- - -> BUFFER_FLOAT = 8 - -C type float - ---- - -> BUFFER_DOUBLE = 9 - -C type double - ---- - - -## Defines - Keyboard keys (US keyboard layout) -> GLFW_KEY_UNKNOWN = -1 - -Key: Unknown - ---- - - -## Defines - GLFW API tokens. -> GLFW_RELEASE = 0 - -The key or mouse button was released - ---- - -> GLFW_PRESS = 1 - -The key or mouse button was pressed - ---- - -> GLFW_REPEAT = 2 - -The key was held down until it repeated - ---- - -> GLFW_CONNECTED = 262145 - -Joystick connected - ---- - -> GLFW_DISCONNECTED = 262146 - -Joystick disconnected - ---- - - -## Defines - GLFW Window Events. -> GLFW_WINDOW_SIZE_EVENT = 0 - -GLFW event window size changed - ---- - -> GLFW_WINDOW_MAXIMIZE_EVENT = 1 - -GLFW event window maximize - ---- - -> GLFW_WINDOW_ICONYFY_EVENT = 2 - -GLFW event window iconify - ---- - -> GLFW_WINDOW_FOCUS_EVENT = 3 - -GLFW event window focus - ---- - -> GLFW_WINDOW_DROP_EVENT = 4 - -GLFW event window drop - ---- - - -## Defines - GLFW Input Events. -> GLFW_KEY_EVENT = 5 - -GLFW event keyboard key - ---- - -> GLFW_CHAR_EVENT = 6 - -GLFW event Unicode character - ---- - -> GLFW_MOUSE_BUTTON_EVENT = 7 - -GLFW event mouse button - ---- - -> GLFW_MOUSE_CURSOR_POS_EVENT = 8 - -GLFW event cursor position - ---- - -> GLFW_MOUSE_SCROLL_EVENT = 9 - -GLFW event mouse scroll - ---- - -> GLFW_CURSOR_ENTER_EVENT = 10 - -GLFW event cursor enter/leave - ---- - -> GLFW_JOYSTICK_EVENT = 11 - -GLFW event joystick - ---- - - -## Defines - GLFW Pen Tablet Events. NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445. - -assignGlobalInt = nil - -// GLFW event pen tablet data - ---- - - -assignGlobalInt = nil - -// GLFW event pen tablet cursor - ---- - - -assignGlobalInt = nil - -// GLFW event pen tablet proximity - ---- - - -## Core - Window-related functions - ---- - -> RL.InitWindow( Vector2 size, string title ) - -Initialize window and OpenGL context. Note! Should be called only in RL.config. -InitWindow will still be called automatically before RL.init - ---- - -> RL.CloseWindow() - -Close window and unload OpenGL context and free all resources - ---- - -> RL.WindowShouldClose() - -Check if application should close (KEY_ESCAPE pressed or windows close icon clicked). -Note! Not needed unless you want to make custom main loop - ---- - -> state = RL.IsWindowReady() - -Check if window has been initialized successfully - -- Success return bool - ---- - -> state = RL.IsWindowFullscreen() - -Check if window is currently fullscreen - -- Success return bool - ---- - -> state = RL.IsWindowHidden() - -Check if window is currently hidden (only PLATFORM_DESKTOP) - -- Success return bool - ---- - -> state = RL.IsWindowMinimized() - -Check if window is currently minimized (only PLATFORM_DESKTOP) - -- Success return bool - ---- - -> state = RL.IsWindowMaximized() - -Check if window is currently maximized (only PLATFORM_DESKTOP) - -- Success return bool - ---- - -> state = RL.IsWindowFocused() - -Check if window is currently focused (only PLATFORM_DESKTOP) - -- Success return bool - ---- - -> resized = RL.IsWindowResized() - -Check if window has been resized from last frame - -- Success return bool - ---- - -> state = RL.IsWindowState( int flag ) - -Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) - -- Success return bool - ---- - -> RL.SetWindowState( int flag ) - -Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) - ---- - -> resized = RL.ClearWindowState( int flag ) - -Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) - -- Success return bool - ---- - -> RL.ToggleFullscreen() - -Toggle window state: fullscreen/windowed, resizes monitor to match window resolution - ---- - -> RL.ToggleBorderlessWindowed() - -Toggle window state: borderless windowed, resizes window to match monitor resolution - ---- - -> RL.MaximizeWindow() - -Set window state: maximized, if resizable (only PLATFORM_DESKTOP) - ---- - -> RL.MinimizeWindow() - -Set window state: minimized, if resizable (only PLATFORM_DESKTOP) - ---- - -> RL.RestoreWindow() - -Set window state: not minimized/maximized (only PLATFORM_DESKTOP) - ---- - -> RL.SetWindowIcon( Image image ) - -Set icon for window (Only PLATFORM_DESKTOP) - ---- - -> RL.SetWindowIcons( Image{} images ) - -Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) - ---- - -> RL.SetWindowTitle( string title ) - -Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) - ---- - -> RL.SetWindowPosition( Vector2 pos ) - -Set window position on screen - ---- - -> RL.SetWindowMonitor( int monitor ) - -Set monitor for the current window - ---- - -> RL.SetWindowMinSize( Vector2 size ) - -Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) - ---- - -> RL.SetWindowMaxSize( Vector2 size ) - -Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) - ---- - -> RL.SetWindowSize( Vector2 size ) - -Set window dimensions - ---- - -> RL.SetWindowOpacity( float opacity ) - -Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) - ---- - -> RL.SetWindowFocused() - -Set window focused (only PLATFORM_DESKTOP) - ---- - -> windowHandle = RL.GetWindowHandle() - -Get native window handle. Return as lightuserdata - -- Success return lightuserdata - ---- - -> size = RL.GetScreenSize() - -Get screen size - -- Success return Vector2 - ---- - -> size = RL.GetRenderSize() - -Get render size - -- Success return Vector2 - ---- - -> count = RL.GetMonitorCount() - -Get number of connected monitors - -- Success return int - ---- - -> monitor = RL.GetCurrentMonitor() - -Get current connected monitor - -- Success return int - ---- - -> position = RL.GetMonitorPosition( int monitor ) - -Get specified monitor position - -- Success return Vector2 - ---- - -> size = RL.GetMonitorSize( int monitor ) - -Get specified monitor size - -- Success return Vector2 - ---- - -> size = RL.GetMonitorPhysicalSize( int monitor ) - -Get specified monitor physical size in millimetres - -- Success return Vector2 - ---- - -> refreshRate = RL.GetMonitorRefreshRate( int monitor ) - -Get specified monitor refresh rate - -- Success return int - ---- - -> position = RL.GetWindowPosition() - -Get window position on monitor - -- Success return Vector2 - ---- - -> dpi = RL.GetWindowScaleDPI() - -Get window scale DPI factor - -- Success return Vector2 - ---- - -> name = RL.GetMonitorName( int monitor ) - -Get the human-readable, UTF-8 encoded name of the specified monitor - -- Success return string - ---- - -> RL.SetClipboardText( string text ) - -Set clipboard text content - ---- - -> text = RL.GetClipboardText() - -Get clipboard text content - -- Success return string - ---- - -> image = RL.GetClipboardImage() - -Get clipboard image content - -- Success return Image - ---- - -> RL.EnableEventWaiting() - -Enable waiting for events on EndDrawing(), no automatic event polling - ---- - -> RL.DisableEventWaiting() - -Disable waiting for events on EndDrawing(), automatic events polling - ---- - -## Core - Cursor-related functions - ---- - -> RL.ShowCursor() - -Shows cursor - ---- - -> RL.HideCursor() - -Hides cursor - ---- - -> hidden = RL.IsCursorHidden() - -Check if cursor is not visible - -- Success return bool - ---- - -> RL.EnableCursor() - -Enables cursor (unlock cursor) - ---- - -> RL.DisableCursor() - -Disables cursor (lock cursor) - ---- - -> onSreen = RL.IsCursorOnScreen() - -Check if cursor is on the screen - -- Success return bool - ---- - -## Core - Drawing-related functions - ---- - -> RL.ClearBackground( Color color ) - -Set background color (framebuffer clear color) - ---- - -> RL.BeginDrawing() - -Setup canvas (framebuffer) to start drawing - ---- - -> RL.EndDrawing() - -End canvas drawing and swap buffers (double buffering) - ---- - -> RL.BeginMode2D( camera2D camera ) - -Begin 2D mode with custom camera (2D) - ---- - -> RL.EndMode2D() - -Ends 2D mode with custom camera - ---- - -> RL.BeginMode3D( camera3D camera ) - -Begin 3D mode with custom camera (3D) - ---- - -> RL.EndMode3D() - -Ends 3D mode and returns to default 2D orthographic mode - ---- - -> RL.BeginTextureMode( RenderTexture target ) - -Begin drawing to render texture - ---- - -> RL.EndTextureMode() - -Ends drawing to render texture - ---- - -> RL.BeginShaderMode( Shader shader ) - -Begin custom shader drawing - ---- - -> RL.EndShaderMode() - -End custom shader drawing (use default shader) - ---- - -> RL.BeginBlendMode( int mode ) - -Begin blending mode (BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED...) - ---- - -> RL.EndBlendMode() - -End blending mode (reset to default: BLEND_ALPHA) - ---- - -> RL.BeginScissorMode( Rectangle rectange ) - -Begin scissor mode (define screen area for following drawing) - ---- - -> RL.EndScissorMode() - -End scissor mode - ---- - -## Core - Shader management functions - ---- - -> shader = RL.LoadShader( string|nil vsFileName, string|nil fsFileName ) - -Load shader from files and bind default locations. -NOTE: Set nil if no shader - -- Failure return nil -- Success return Shader - ---- - -> shader = RL.LoadShaderFromMemory( string|nil vsCode, string|nil fsCode ) - -Load shader from code strings and bind default locations -NOTE: Set nil if no shader - -- Failure return nil -- Success return Shader - ---- - -> isValid = RL.IsShaderValid( Shader shader ) - -Check if a shader is valid (loaded on GPU) - -- Success return bool - ---- - -> shaderId = RL.GetShaderId( Shader shader ) - -Get shader program id - -- Success return int - ---- - -> location = RL.GetShaderLocation( Shader shader, string uniformName ) - -Get shader uniform location - -- Success return int - ---- - -> location = RL.GetShaderLocationAttrib( Shader shader, string attribName ) - -Get shader attribute location - -- Success return int - ---- - -> RL.SetShaderLocationIndex( Shader shader, int shaderLocationIndex, int location ) - -Set shader location index - ---- - -> location = RL.GetShaderLocationIndex( Shader shader, int shaderLocationIndex ) - -Get shader location index - -- Success return int - ---- - -> RL.SetShaderValueMatrix( Shader shader, int locIndex, Matrix mat ) - -Set shader uniform value (matrix 4x4) - ---- - -> RL.SetShaderValueTexture( Shader shader, int locIndex, Texture texture ) - -Set shader uniform value for texture (sampler2d) - ---- - -> RL.SetShaderValue( Shader shader, int locIndex, number{} values, int uniformType ) - -Set shader uniform value -NOTE: Even one value should be in table - ---- - -> RL.SetShaderValueV( Shader shader, int locIndex, number{} values, int uniformType, int count ) - -Set shader uniform value vector -NOTE: Even one value should be in table - ---- - -> RL.SetShaderValueWithBuffer( Shader shader, int locIndex, Buffer values, int uniformType ) - -Set shader uniform value using Buffer object - ---- - -> RL.SetShaderValueVWithBuffer( Shader shader, int locIndex, Buffer values, int uniformType, int count ) - -Set shader uniform value vector using Buffer object - ---- - -> RL.UnloadShader( Shader shader ) - -Unload shader from GPU memory (VRAM) - ---- - -## Core - Screen-space-related functions - ---- - -> ray = RL.GetScreenToWorldRay( Vector2 mousePosition, Camera3D camera ) - -Get a ray trace from screen position (i.e mouse) - -- Success return Ray - ---- - -> ray = RL.GetScreenToWorldRayEx( Vector2 mousePosition, Camera3D camera, Vector2 size ) - -Get a ray trace from screen position (i.e mouse) in a viewport - -- Success return Ray - ---- - -> position = RL.GetWorldToScreen( Vector3 position, Camera3D camera ) - -Get the screen space position for a 3d world space position - -- Success return Vector2 - ---- - -> position = RL.GetWorldToScreenEx( Vector3 position, Camera3D camera, Vector2 size ) - -Get size position for a 3d world space position - -- Success return Vector2 - ---- - -> position = RL.GetWorldToScreen2D( Vector2 position, Camera2D camera ) - -Get the screen space position for a 2d camera world space position - -- Success return Vector2 - ---- - -> position = RL.GetScreenToWorld2D( Vector2 position, Camera2D camera ) - -Get the world space position for a 2d camera screen space position - -- Success return Vector2 - ---- - -> matrix = RL.GetCameraMatrix( Camera3D camera ) - -Get camera transform matrix (view matrix) - -- Success return Matrix - ---- - -> matrix = RL.GetCameraMatrix2D( Camera2D camera ) - -Get camera 2d transform matrix - -- Success return Matrix - ---- - -## Core - Timing-related functions - ---- - -> RL.SetTargetFPS( int fps ) - -Set target FPS (maximum) - ---- - -> delta = RL.GetFrameTime() - -Get time in seconds for last frame drawn (Delta time) - -- Success return float - ---- - -> time = RL.GetTime() - -Get elapsed time in seconds since InitWindow() - -- Success return float - ---- - -> FPS = RL.GetFPS() - -Get current FPS - -- Success return int - ---- - -## Core - Custom frame control functions - ---- - -> RL.SwapScreenBuffer() - -Swap back buffer with front buffer (screen drawing) - ---- - -> RL.PollInputEvents() - -Register all input events - ---- - -> RL.WaitTime( number seconds ) - -Wait for some time (halt program execution) - ---- - -## Core - Random values generation functions - ---- - -> RL.SetRandomSeed( int seed ) - -Set the seed for the random number generator - ---- - -> time = RL.GetRandomValue( int min, int max ) - -Get a random value between min and max (both included) - -- Success return int - ---- - -> sequence = RL.LoadRandomSequence( int count, int min, int max ) - -Load random values sequence, no values repeated - -- Success return int{} - ---- - -## Core - Misc - ---- - -> RL.TakeScreenshot( string fileName ) - -Takes a screenshot of current screen (filename extension defines format) - ---- - -> RL.SetConfigFlags( int flags ) - -Setup init configuration flags (view FLAGS) - ---- - -> RL.TraceLog( int logLevel, string text ) - -Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) - ---- - -> RL.SetTraceLogLevel( int logLevel ) - -Set the current threshold (minimum) log level - ---- - -> RL.SetLogLevelInvalid( int logLevel ) - -Set the log level for bad function calls and invalid data formats. - ---- - -> logLevel = RL.GetLogLevelInvalid() - -Get the log level for bad function calls and invalid data formats. - -- Success return int - ---- - -> RL.OpenURL( string url ) - -Open URL with default system browser (if available) - ---- - -> enabled = RL.IsGCUnloadEnabled() - -Check if Lua garbage collection is set to unload object data - -- Success return bool - ---- - -> RL.SetGCUnload( bool enabled ) - -Set Lua garbage collection to unload object data - ---- - -> platform = RL.GetPlatform() - -Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten" - -- Success return string - ---- - -## Core - Files management functions - ---- - -> buffer = RL.LoadFileData( string fileName ) - -Load file data as byte array (read). Buffer type is BUFFER_UNSIGNED_CHAR - -- Success return Buffer - ---- - -> success = RL.SaveFileData( string fileName, buffer Buffer ) - -Save data to file from byte array (write), returns true on success - -- Success return bool - ---- - -> success = RL.ExportDataAsCode( Buffer buffer, string fileName ) - -Export data to code (.h), returns true on success - -- Success return bool - ---- - -> text = RL.LoadFileText( string fileName ) - -Load text data from file (read) - -- Success return string - ---- - -> success = RL.SaveFileText( string fileName, string text ) - -Save text data to file (write), returns true on success - -- Success return bool - ---- - -## Core - Files system functions - ---- - -> path = RL.GetBasePath() - -Return game directory (where main.lua is located) - -- Success return string - ---- - -> fileExists = RL.FileExists( string fileName ) - -Check if file exists - -- Success return bool - ---- - -> dirExists = RL.DirectoryExists( string dirPath ) - -Check if a directory path exists - -- Success return bool - ---- - -> hasFileExtension = RL.IsFileExtension( string fileName, string ext ) - -Check file extension (Including point: .png, .wav) - -- Success return bool - ---- - -> length = RL.GetFileLength( string fileName ) - -Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) - -- Success return int - ---- - -> extension = RL.GetFileExtension( string fileName ) - -Get pointer to extension for a filename string (Includes dot: '.png') - -- Success return string - ---- - -> fileName = RL.GetFileName( string filePath ) - -Get pointer to filename for a path string - -- Success return string - ---- - -> fileName = RL.GetFileNameWithoutExt( string filePath ) - -Get filename string without extension (Uses static string) - -- Success return string - ---- - -> filePath = RL.GetDirectoryPath( string filePath ) - -Get full path for a given fileName with path (Uses static string) - -- Success return string - ---- - -> directory = RL.GetPrevDirectoryPath( string dirPath ) - -Get previous directory path for a given path (Uses static string) - -- Success return string - ---- - -> directory = RL.GetWorkingDirectory() - -Get current working directory (Uses static string) - -- Success return string - ---- - -> directory = RL.GetApplicationDirectory() - -Get the directory of the running application (uses static string) - -- Success return string - ---- - -> success = RL.MakeDirectory( string dirPath ) - -Create directories (including full path requested), returns 0 on success - -- Success return int - ---- - -> success = RL.ChangeDirectory( string directory ) - -Change working directory, return true on success - -- Success return bool - ---- - -> isFile = RL.IsPathFile( string path ) - -Check if a given path is a file or a directory - -- Success return bool - ---- - -> isValid = RL.IsFileNameValid( string fileName ) - -Check if fileName is valid for the platform/OS - -- Success return bool - ---- - -> fileNames = RL.LoadDirectoryFiles( string dirPath ) - -Load directory filepaths - -- Success return string{} - ---- - -> fileNames = RL.LoadDirectoryFilesEx( string basePath, string|nil filter, bool scanSubdirs ) - -Load directory filepaths with extension filtering and recursive directory scan - -- Success return string{} - ---- - -> iSFileDropped = RL.IsFileDropped() - -Check if a file has been dropped into window - -- Success return bool - ---- - -> files = RL.LoadDroppedFiles() - -Load dropped filepaths - -- Success return string{} - ---- - -> time = RL.GetFileModTime( string fileName ) - -Get file modification time (Last write time) - -- Success return int - ---- - -## Core - Compression/Encoding functionality - ---- - -> compData = RL.CompressData( Buffer buffer ) - -Compress data (DEFLATE algorithm) - -- Success return Buffer - ---- - -> decompData = RL.DecompressData( Buffer compData ) - -Decompress data (DEFLATE algorithm). - -- Success Buffer - ---- - -> encodedData, outputSize = RL.EncodeDataBase64( string data ) - -Encode data to Base64 string - -- Success return string, int - ---- - -> decodedData, outputSize = RL.DecodeDataBase64( string data ) - -Decode Base64 string data - -- Success return string, int - ---- - -> code = RL.ComputeCRC32( Buffer data ) - -Compute CRC32 hash code. - -- Failure return false -- Success return int - ---- - -> code = RL.ComputeMD5( Buffer data ) - -Compute MD5 hash code, returns static int[4] (16 bytes). - -- Failure return false -- Success return int{4} - ---- - -> code = RL.ComputeSHA1( Buffer data ) - -Compute SHA1 hash code, returns static int[5] (20 bytes). - -- Failure return false -- Success return int{5} - ---- - -## Core - Automation events functionality - ---- - -> eventList = RL.LoadAutomationEventList( string|nil fileName ) - -Load automation events list from file, nil for empty list, capacity = MAX_AUTOMATION_EVENTS - -- Success return AutomationEventList - ---- - -> RL.UnloadAutomationEventList( AutomationEventList list ) - -Unload automation events list from file - ---- - -> success = RL.ExportAutomationEventList( string fileName ) - -Export automation events list as text file - -- Failure return false -- Success return true - ---- - -> RL.SetAutomationEventList( AutomationEventList list ) - -Set automation event list to record to - ---- - -> RL.SetAutomationEventBaseFrame( int frame ) - -Set automation event internal base frame to start recording - ---- - -> RL.StartAutomationEventRecording() - -Start recording automation events (AutomationEventList must be set) - ---- - -> RL.StopAutomationEventRecording() - -Stop recording automation events - ---- - -> RL.PlayAutomationEvent( AutomationEvent event ) - -Play a recorded automation event - ---- - -> capacity = RL.GetAutomationEventListCapacity( AutomationEventList list ) - -Get automation event list capacity - -- Success return int - ---- - -> count = RL.GetAutomationEventListCount( AutomationEventList list ) - -Get automation event list count - -- Success return int - ---- - -> event = RL.GetAutomationEvent( AutomationEventList list, int index ) - -Get automation event from automation event list. Return as lightuserdata - -- Failure return nil -- Success return AutomationEvent - ---- - -> frame = RL.GetAutomationEventFrame( AutomationEvent event ) - -Get automation event frame - -- Success return int - ---- - -> type = RL.GetAutomationEventType( AutomationEvent event ) - -Get automation event type - -- Success return int - ---- - -> params = RL.GetAutomationEventParams( AutomationEvent event ) - -Get automation event params - -- Success return int{} - ---- - -## Core - Input-related functions: keyboard - ---- - -> pressed = RL.IsKeyPressed( int key ) - -Detect if a key has been pressed once - -- Success return bool - ---- - -> pressed = RL.IsKeyPressedRepeat( int key ) - -Check if a key has been pressed again (Only PLATFORM_DESKTOP) - -- Success return bool - ---- - -> pressed = RL.IsKeyDown( int key ) - -Detect if a key is being pressed - -- Success return bool - ---- - -> released = RL.IsKeyReleased( int key ) - -Detect if a key has been released once - -- Success return bool - ---- - -> released = RL.IsKeyUp( int key ) - -Check if a key is NOT being pressed - -- Success return bool - ---- - -> keycode = RL.GetKeyPressed() - -Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty - -- Success return int - ---- - -> unicode = RL.GetCharPressed() - -Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty - -- Success return int - ---- - -> RL.SetExitKey( int key ) - -Set a custom key to exit program (default is ESC) - ---- - -## Core - Input-related functions: gamepads - ---- - -> available = RL.IsGamepadAvailable( int gamepad ) - -Detect if a gamepad is available - -- Success return bool - ---- - -> name = RL.GetGamepadName( int gamepad ) - -Return gamepad internal name id - -- Success return string - ---- - -> pressed = RL.IsGamepadButtonPressed( int gamepad, int button ) - -Detect if a gamepad button has been pressed once - -- Success return bool - ---- - -> pressed = RL.IsGamepadButtonDown( int gamepad, int button ) - -Detect if a gamepad button is being pressed - -- Success return bool - ---- - -> released = RL.IsGamepadButtonReleased( int gamepad, int button ) - -Detect if a gamepad button has been released once - -- Success return bool - ---- - -> notPressed = RL.IsGamepadButtonUp( int gamepad, int button ) - -Check if a gamepad button is NOT being pressed - -- Success return bool - ---- - -> button = RL.GetGamepadButtonPressed() - -Get the last gamepad button pressed - -- Success return int - ---- - -> count = RL.GetGamepadAxisCount( int gamepad ) - -Return gamepad axis count for a gamepad - -- Success return int - ---- - -> value = RL.GetGamepadAxisMovement( int gamepad, int axis ) - -Return axis movement value for a gamepad axis - -- Success return float - ---- - -> result = RL.SetGamepadMappings( string mappings ) - -Set internal gamepad mappings (SDL_GameControllerDB) - -- Success return int - ---- - -> RL.SetGamepadVibration( int gamepad, float leftMotor, float rightMotor, float duration ) - -Set gamepad vibration for both motors (duration in seconds) - ---- - -## Core - Input-related functions: mouse - ---- - -> pressed = RL.IsMouseButtonPressed( int button ) - -Detect if a mouse button has been pressed once - -- Success return bool - ---- - -> pressed = RL.IsMouseButtonDown( int button ) - -Detect if a mouse button is being pressed - -- Success return bool - ---- - -> released = RL.IsMouseButtonReleased( int button ) - -Detect if a mouse button has been released once - -- Success return bool - ---- - -> released = RL.IsMouseButtonUp( int button ) - -Check if a mouse button is NOT being pressed - -- Success return bool - ---- - -> position = RL.GetMousePosition() - -Returns mouse position - -- Success return Vector2 - ---- - -> position = RL.GetMouseDelta() - -Get mouse delta between frames - -- Success return Vector2 - ---- - -> RL.SetMousePosition( Vector2 position ) - -Set mouse position XY - ---- - -> RL.SetMouseOffset( Vector2 offset ) - -Set mouse offset - ---- - -> RL.SetMouseScale( Vector2 scale ) - -Set mouse scaling - ---- - -> offset = RL.GetMouseOffset() - -Get mouse offset - -- Success return Vector2 - ---- - -> scale = RL.GetMouseScale() - -Get mouse scale - -- Success return Vector2 - ---- - -> movement = RL.GetMouseWheelMove() - -Get mouse wheel movement for X or Y, whichever is larger - -- Success return float - ---- - -> movement = RL.GetMouseWheelMoveV() - -Get mouse wheel movement for both X and Y - -- Success return Vector2 - ---- - -> RL.SetMouseCursor( int cursor ) - -Set mouse cursor - ---- - -## Core - Input-related functions: touch - ---- - -> position = RL.GetTouchPosition( int index ) - -Get touch position XY for a touch point index (relative to screen size) - -- Success return Vector2 - ---- - -> id = RL.GetTouchPointId( int index ) - -Get touch point identifier for given index - -- Success return int - ---- - -> count = RL.GetTouchPointCount() - -Get touch point identifier for given index - -- Success return int - ---- - -## Core - Input-related functions: gestures - ---- - -> RL.SetGesturesEnabled( unsigned int flags ) - -Enable a set of gestures using flags - ---- - -> detected = RL.IsGestureDetected( int gesture ) - -Check if a gesture have been detected - -- Success return bool - ---- - -> gesture = RL.GetGestureDetected() - -Get latest detected gesture - -- Success return int - ---- - -> time = RL.GetGestureHoldDuration() - -Get gesture hold time in milliseconds - -- Success return float - ---- - -> vector = RL.GetGestureDragVector() - -Get gesture drag vector - -- Success return Vector2 - ---- - -> angle = RL.GetGestureDragAngle() - -Get gesture drag angle - -- Success return float - ---- - -> vector = RL.GetGesturePinchVector() - -Get gesture pinch delta - -- Success return Vector2 - ---- - -> angle = RL.GetGesturePinchAngle() - -Get gesture pinch angle - -- Success return float - ---- - -## Core - Camera2D System functions - ---- - -> camera2D = RL.CreateCamera2D() - -Return camera2D set to default configuration - -- Success return Camera2D - ---- - -> RL.SetCamera2DTarget( camera2D camera, Vector2 target ) - -Set camera target (rotation and zoom origin) - ---- - -> RL.SetCamera2DOffset( camera2D camera, Vector2 offset ) - -Set camera offset (displacement from target) - ---- - -> RL.SetCamera2DRotation( camera2D camera, float rotation ) - -Set camera rotation in degrees - ---- - -> RL.SetCamera2DZoom( camera2D camera, float zoom ) - -Set camera zoom (scaling), should be 1.0f by default - ---- - -> target = RL.GetCamera2DTarget( camera2D camera ) - -Get camera2D target - -- Success return Vector2 - ---- - -> offset = RL.GetCamera2DOffset( camera2D camera ) - -Get camera2D offset - -- Success return Vector2 - ---- - -> rotation = RL.GetCamera2DRotation( camera2D camera ) - -Get camera2D rotation - -- Success return float - ---- - -> zoom = RL.GetCamera2DZoom( camera2D camera ) - -Get camera2D zoom - -- Success return float - ---- - -## Core - Camera3D System functions - ---- - -> camera = RL.CreateCamera3D() - -Return camera3D id set to default configuration - -- Success return int - ---- - -> RL.SetCamera3DPosition( camera3D camera, Vector3 position ) - -Set camera position (Remember to call "RL.UpdateCamera3D()" to apply changes) - ---- - -> RL.SetCamera3DTarget( camera3D camera, Vector3 target ) - -Set camera target it looks-at - ---- - -> RL.SetCamera3DUp( camera3D camera, Vector3 up ) - -Set camera up vector (Rotation over it's axis) - ---- - -> RL.SetCamera3DFovy( camera3D camera, float fovy ) - -Set camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - ---- - -> RL.SetCamera3DProjection( camera3D camera, int projection ) - -Set camera projection mode (CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC) - ---- - -> position = RL.GetCamera3DPosition( camera3D camera ) - -Get camera position - -- Success return Vector3 - ---- - -> target = RL.GetCamera3DTarget( camera3D camera ) - -Get camera target it looks-at - -- Success return Vector3 - ---- - -> up = RL.GetCamera3DUp( camera3D camera ) - -Get camera up vector (Rotation over it's axis) - -- Success return Vector3 - ---- - -> fovy = RL.GetCamera3DFovy( camera3D camera ) - -Get camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - -- Success return float - ---- - -> projection = RL.GetCamera3DProjection( camera3D camera ) - -Get camera projection mode - -- Success return int - ---- - -> forward = RL.GetCamera3DForward( camera3D camera ) - -Returns the cameras forward vector (normalized) - -- Success return Vector3 - ---- - -> up = RL.GetCamera3DUpNormalized( camera3D camera ) - -Returns the cameras up vector (normalized) -Note: The up vector might not be perpendicular to the forward vector - -- Success return Vector3 - ---- - -> right = RL.GetCamera3DRight( camera3D camera ) - -Returns the cameras right vector (normalized) - -- Success return Vector3 - ---- - -> RL.Camera3DMoveForward( camera3D camera, float distance, bool moveInWorldPlane ) - -Moves the camera in it's forward direction - ---- - -> RL.Camera3DMoveUp( camera3D camera, float distance ) - -Moves the camera in it's up direction - ---- - -> RL.Camera3DMoveRight( camera3D camera, float distance, bool moveInWorldPlane ) - -Moves the camera target in it's current right direction - ---- - -> RL.Camera3DMoveToTarget( camera3D camera, float delta ) - -Moves the camera position closer/farther to/from the camera target - ---- - -> RL.Camera3DYaw( camera3D camera, float angle, bool rotateAroundTarget ) - -Rotates the camera around it's up vector -Yaw is "looking left and right" -If rotateAroundTarget is false, the camera rotates around it's position -Note: angle must be provided in radians - ---- - -> RL.Camera3DPitch( camera3D camera, float angle, bool lockView, bool rotateAroundTarget, bool rotateUp ) - -Rotates the camera around it's right vector, pitch is "looking up and down" -- lockView prevents camera overrotation (aka "somersaults") -- rotateAroundTarget defines if rotation is around target or around it's position -- rotateUp rotates the up direction as well (typically only usefull in CAMERA_FREE) -NOTE: angle must be provided in radians - ---- - -> RL.Camera3DRoll( camera3D camera, float angle ) - -Rotates the camera around it's forward vector -Roll is "turning your head sideways to the left or right" -Note: angle must be provided in radians - ---- - -> view = RL.GetCamera3DViewMatrix( camera3D camera ) - -Returns the camera view matrix - -- Success return Matrix - ---- - -> projection = RL.GetCamera3DProjectionMatrix( camera3D camera, float aspect ) - -Returns the camera projection matrix - -- Success return Matrix - ---- - -> RL.UpdateCamera3D( camera3D camera, int mode ) - -Update camera position for selected mode - ---- - -> RL.UpdateCamera3DPro( camera3D camera, Vector3 movement, Vector3 rotation, float zoom ) - -Update camera movement, movement/rotation values should be provided by user - ---- - -## Core - Buffer management functions - ---- - -> buffer = RL.LoadBuffer( data{} buffer, int type ) - -Load Buffer. Type should be one of the Buffer types. Empty buffer will set data to NULL. - -- Success return Buffer - ---- - -> buffer = RL.LoadBufferFormatted( int length, int type, int value ) - -Load formatted buffer with all values set to 'value' - -- Success return Buffer - ---- - -> buffer = RL.LoadBufferFromFile( string path, int type ) - -Read buffer data from binary file - -- Failure return nil -- Success return Buffer - ---- - -> buffer = RL.LoadBufferFromString( string buffer ) - -Read buffer data from string - -- Failure return nil -- Success return Buffer - ---- - -> RL.UnloadBuffer( Buffer buffer ) - -Unload buffer data - ---- - -> RL.CopyBufferData( Buffer dst, Buffer src, int posDst, int posSrc, int size ) - -Copy buffer data to another buffer. Size is in bytes - ---- - -> RL.SetBufferData( Buffer buffer, int position, any{} values ) - -Set buffer data value - ---- - -> RL.SwapBufferEndianness( Buffer buffer ) - -Swap buffer endianness from big endian to little endian and vice versa - ---- - -> data = RL.GetBufferData( Buffer buffer, int position, int length ) - -Get buffer data as table in the format it was stored - -- Success return data{} - ---- - -> string = RL.GetBufferAsString( Buffer buffer ) - -Get buffer as string - -- Success return string - ---- - -> type = RL.GetBufferType( Buffer buffer ) - -Get buffer type - -- Success return int - ---- - -> size = RL.GetBufferSize( Buffer buffer ) - -Get buffer size in bytes - -- Success return int - ---- - -> size = RL.GetBufferElementSize( Buffer buffer ) - -Get buffer element size in bytes - -- Success return int - ---- - -> length = RL.GetBufferLength( Buffer buffer ) - -Get buffer element count - -- Success return int - ---- - -> RL.ExportBuffer( Buffer buffer, string path ) - -Write buffer data to binary file - ---- - -## Shapes - Basic shapes drawing functions - ---- - -> RL.SetShapesTexture( Texture texture, Rectangle source ) - -Set texture and rectangle to be used on shapes drawing -NOTE: It can be useful when using basic shapes and one single font, -defining a font char white rectangle would allow drawing everything in a single draw call - ---- - -> texture = RL.GetShapesTexture() - -Get texture that is used for shapes drawing. Return as lightuserdata - -- Success return Texture - ---- - -> source = RL.GetShapesTextureRectangle() - -Get texture source rectangle that is used for shapes drawing - -- Success return Rectangle - ---- - -> RL.DrawPixel( Vector2 pos, Color color ) - -Draw a pixel - ---- - -> RL.DrawLine( Vector2 startPos, Vector2 endPos, float thickness, Color color ) - -Draw a line defining thickness - ---- - -> RL.DrawLineStrip( Vector2{} points, Color color ) - -Draw lines sequence - ---- - -> RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color ) - -Draw a line using cubic-bezier curves in-out - ---- - -> RL.DrawCircle( Vector2 center, float radius, Color color ) - -Draw a color-filled circle - ---- - -> RL.DrawCircleSector( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color ) - -Draw a piece of a circle - ---- - -> RL.DrawCircleSectorLines( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color ) - -Draw circle sector outline - ---- - -> RL.DrawCircleGradient( Vector2 center, float radius, Color color1, Color color2 ) - -Draw a gradient-filled circle - ---- - -> RL.DrawCircleLines( Vector2 center, float radius, Color color ) - -Draw circle outline - ---- - -> RL.DrawEllipse( Vector2 center, float radiusH, float radiusV, Color color ) - -Draw ellipse - ---- - -> RL.DrawEllipseLines( Vector2 center, float radiusH, float radiusV, Color color ) - -Draw ellipse outline - ---- - -> RL.DrawRing( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color ) - -Draw ring - ---- - -> RL.DrawRingLines( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color ) - -Draw ring outline - ---- - -> RL.DrawRectangle( Rectangle rec, Color color ) - -Draw a color-filled rectangle - ---- - -> RL.DrawRectanglePro( Rectangle rec, Vector2 origin, float rotation, Color color ) - -Draw a color-filled rectangle with pro parameters - ---- - -> RL.DrawRectangleGradientV( Rectangle rectangle, Color color1, Color color2 ) - -Draw a vertical-gradient-filled rectangle - ---- - -> RL.DrawRectangleGradientH( Rectangle rectangle, Color color1, Color color2 ) - -Draw a horizontal-gradient-filled rectangle - ---- - -> RL.DrawRectangleGradientEx( Rectangle rectangle, Color col1, Color col2, Color col3, Color col4 ) - -Draw a gradient-filled rectangle with custom vertex colors - ---- - -> RL.DrawRectangleLines( Rectangle rec, Color color ) - -Draw rectangle outline - ---- - -> RL.DrawRectangleLinesEx( Rectangle rec, int lineThick, Color color ) - -Draw rectangle outline with extended parameters - ---- - -> RL.DrawRectangleRounded( Rectangle rec, float roundness, int segments, Color color ) - -Draw rectangle with rounded edges - ---- - -> RL.DrawRectangleRoundedLines( Rectangle rec, float roundness, int segments, Color color ) - -Draw rectangle lines with rounded edges - ---- - -> RL.DrawRectangleRoundedLinesEx( Rectangle rec, float roundness, int segments, float lineThick, Color color ) - -Draw rectangle with rounded edges outline - ---- - -> RL.DrawTriangle( Vector2 v1, Vector2 v2, Vector2 v3, Color color ) - -Draw a color-filled triangle (Vertex in counter-clockwise order!) - ---- - -> RL.DrawTriangleLines( Vector2 v1, Vector2 v2, Vector2 v3, Color color ) - -Draw triangle outline (Vertex in counter-clockwise order!) - ---- - -> RL.DrawTriangleFan( Vector2{} points, Color color ) - -Draw a triangle fan defined by points (first vertex is the center) - ---- - -> RL.DrawTriangleStrip( Vector2{} points, Color color ) - -Draw a triangle strip defined by points - ---- - -> RL.DrawPoly( Vector2 center, int sides, float radius, float rotation, Color color ) - -Draw a regular polygon (Vector version) - ---- - -> RL.DrawPolyLines( Vector2 center, int sides, float radius, float rotation, Color color ) - -Draw a polygon outline of n sides - ---- - -> RL.DrawPolyLinesEx( Vector2 center, int sides, float radius, float rotation, float lineThick, Color color ) - -Draw a polygon outline of n sides with extended parameters - ---- - -## Shapes - Splines drawing functions - ---- - -> RL.DrawSplineLinear( Vector2{} points, float thick, Color color ) - -Draw spline: Linear, minimum 2 points - ---- - -> RL.DrawSplineBasis( Vector2{} points, float thick, Color color ) - -Draw spline: B-Spline, minimum 4 points - ---- - -> RL.DrawSplineCatmullRom( Vector2{} points, float thick, Color color ) - -Draw spline: Catmull-Rom, minimum 4 points - ---- - -> RL.DrawSplineBezierQuadratic( Vector2{} points, float thick, Color color ) - -Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] - ---- - -> RL.DrawSplineBezierCubic( Vector2{} points, float thick, Color color ) - -Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] - ---- - -> RL.DrawSplineSegmentLinear( Vector2 p1, Vector2 p2, float thick, Color color ) - -Draw spline segment: Linear, 2 points - ---- - -> RL.DrawSplineSegmentBasis( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color ) - -Draw spline segment: B-Spline, 4 points - ---- - -> RL.DrawSplineSegmentCatmullRom( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color ) - -Draw spline segment: Catmull-Rom, 4 points - ---- - -> RL.DrawSplineSegmentBezierQuadratic( Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color ) - -Draw spline segment: Quadratic Bezier, 2 points, 1 control point - ---- - -> RL.DrawSplineSegmentBezierCubic( Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color ) - -Draw spline segment: Cubic Bezier, 2 points, 2 control points - ---- - -## Shapes - Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] - ---- - -> point = RL.GetSplinePointLinear( Vector2 startPos, Vector2 endPos, float t ) - -Get (evaluate) spline point: Linear - -- Success return Vector2 - ---- - -> point = RL.GetSplinePointBasis( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t ) - -Get (evaluate) spline point: B-Spline - -- Success return Vector2 - ---- - -> point = RL.GetSplinePointCatmullRom( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t ) - -Get (evaluate) spline point: Catmull-Rom - -- Success return Vector2 - ---- - -> point = RL.GetSplinePointBezierQuad( Vector2 p1, Vector2 c2, Vector2 p3, float t ) - -Get (evaluate) spline point: Quadratic Bezier - -- Success return Vector2 - ---- - -> point = RL.GetSplinePointBezierCubic( Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t ) - -Get (evaluate) spline point: Cubic Bezier - -- Success return Vector2 - ---- - -## Shapes - Basic shapes collision detection functions - ---- - -> collision = RL.CheckCollisionRecs( Rectangle rec1, Rectangle rec2 ) - -Check collision between two rectangles - -- Success return bool - ---- - -> collision = RL.CheckCollisionCircles( Vector2 center1, float radius1, Vector2 center2, float radius2 ) - -Check collision between two circles - -- Success return bool - ---- - -> collision = RL.CheckCollisionCircleRec( Vector2 center, float radius, Rectangle rec ) - -Check collision between circle and rectangle - -- Success return bool - ---- - -> collision = RL.CheckCollisionCircleLine( Vector2 center, float radius, Vector2 p1, Vector2 p2 ) - -Check if circle collides with a line created betweeen two points [p1] and [p2] - -- Success return bool - ---- - -> collision = RL.CheckCollisionPointRec( Vector2 point, Rectangle rec ) - -Check if point is inside rectangle - -- Success return bool - ---- - -> collision = RL.CheckCollisionPointCircle( Vector2 point, Vector2 center, float radius ) - -Check if point is inside circle - -- Success return bool - ---- - -> collision = RL.CheckCollisionPointTriangle( Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3 ) - -Check if point is inside a triangle - -- Success return bool - ---- - -> collision = RL.CheckCollisionPointPoly( Vector2 point, Vector2{} points ) - -Check if point is within a polygon described by array of vertices - -- Success return bool - ---- - -> collision, position = RL.CheckCollisionLines( Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2 ) - -Check the collision between two lines defined by two points each, returns collision point by reference - -- Success return bool, Vector2 - ---- - -> collision = RL.CheckCollisionPointLine( Vector2 point, Vector2 p1, Vector2 p2, int threshold ) - -Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] - -- Success return bool - ---- - -> rectangle = RL.GetCollisionRec( Rectangle rec1, Rectangle rec2 ) - -Get collision rectangle for two rectangles collision - -- Success return Rectangle - ---- - -> rects{} = RL.RectPack( Rectangle{} rects, Vector2 size, int padding ) - -Useful for e.g. packing rectangular textures into an atlas. stbrp_pack_rects - -- Success return Rectangle{} - ---- - -## Textures - Image loading functions - ---- - -> image = RL.LoadImage( string fileName ) - -Load image from file into CPU memory (RAM) - -- Failure return nil -- Success return Image - ---- - -> image = RL.LoadImageRaw( string fileName, Vector2 size, int format, int headerSize ) - -Load image from RAW file data - -- Failure return nil -- Success return Image - ---- - -> image, frameCount = RL.LoadImageAnim( string fileName ) - -Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format - -- Failure return nil -- Success return Image, int - ---- - -> image, frameCount = RL.LoadImageAnimFromMemory( string fileType, Buffer fileData ) - -Load image sequence from memory buffer. All frames are returned in RGBA format - -- Success return Image, int - ---- - -> image, frameCount = RL.LoadImageFromMemory( string fileType, Buffer data ) - -Load image from memory buffer, fileType refers to extension: i.e. '.png' - -- Success return Image - ---- - -> image, frameCount = RL.LoadImageFromData( Buffer data, Vector2 size, int mipmaps, int format ) - -Load image from data - -- Success return Image - ---- - -> image = RL.LoadImageFromTexture( Texture texture ) - -Load image from GPU texture data - -- Success return Image - ---- - -> image = RL.LoadImageFromScreen() - -Load image from screen buffer and (screenshot) - -- Success return Image - ---- - -> isValid = RL.IsImageValid( Image image ) - -Check if an image is valid (data and parameters) - -- Success return bool - ---- - -> RL.UnloadImage( Image image ) - -Unload image from CPU memory (RAM) - ---- - -> success = RL.ExportImage( Image image, string fileName ) - -Export image data to file, returns true on success - -- Success return bool - ---- - -> buffer = RL.ExportImageToMemory( Image image, string fileType ) - -Export image to memory buffer - -- Success return Buffer - ---- - -> success = RL.ExportImageAsCode( Image image, string fileName ) - -Export image as code file defining an array of bytes, returns true on success - -- Success return bool - ---- - -## Textures - Image generation functions - ---- - -> image = RL.GenImageColor( Vector2 size, Color color ) - -Generate image: plain color - -- Success return Image - ---- - -> image = RL.GenImageGradientLinear( Vector2 size, int direction, Color a, Color b ) - -Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient - -- Success return Image - ---- - -> image = RL.GenImageGradientRadial( Vector2 size, float density, Color inner, Color outer ) - -Generate image: radial gradient - -- Success return Image - ---- - -> image = RL.GenImageGradientSquare( Vector2 size, float density, Color inner, Color outer ) - -Generate image: square gradient - -- Success return Image - ---- - -> image = RL.GenImageChecked( Vector2 size, Vector2 checks, Color col1, Color col2 ) - -Generate image: checked - -- Success return Image - ---- - -> image = RL.GenImageWhiteNoise( Vector2 size, float factor ) - -Generate image: white noise - -- Success return Image - ---- - -> image = RL.GenImagePerlinNoise( Vector2 size, Vector2 offset, float factor ) - -Generate image: perlin noise - -- Success return Image - ---- - -> image = RL.GenImageCellular( Vector2 size, int tileSize ) - -Generate image: cellular algorithm. Bigger tileSize means bigger cells - -- Success return Image - ---- - -> image = RL.GenImageText( Vector2 size, string text ) - -Generate image: grayscale image from text data - -- Success return Image - ---- - -## Textures - Image manipulation functions - ---- - -> image = RL.ImageCopy( Image image ) - -Create an image duplicate (useful for transformations) - -- Success return Image - ---- - -> image = RL.ImageFromImage( Image image, Rectangle rec ) - -Create an image from another image piece - -- Success return Image - ---- - -> image = RL.ImageFromChannel( Image image, int selectedChannel ) - -Create an image from a selected channel of another image (GRAYSCALE) - -- Success return Image - ---- - -> image = RL.ImageText( string text, int fontSize, Color tint ) - -Create an image from text (default font) - -- Success return Image - ---- - -> image = RL.ImageTextEx( Font font, string text, float fontSize, float spacing, Color tint ) - -Create an image from text (custom sprite font) - -- Success return Image - ---- - -> RL.ImageFormat( Image image, int newFormat ) - -Convert image data to desired format - ---- - -> RL.ImageToPOT( Image image, Color fill ) - -Convert image to POT (power-of-two) - ---- - -> RL.ImageCrop( Image image, Rectangle crop ) - -Crop an image to a defined rectangle - ---- - -> RL.ImageAlphaCrop( Image image, float threshold ) - -Crop image depending on alpha value - ---- - -> RL.ImageAlphaClear( Image image, Color color, float threshold ) - -Clear alpha channel to desired color - ---- - -> RL.ImageAlphaMask( Image image, Image alphaMask ) - -Apply alpha mask to image - ---- - -> RL.ImageAlphaPremultiply( Image image ) - -Premultiply alpha channel - ---- - -> RL.ImageBlurGaussian( Image image, int blurSize ) - -Apply Gaussian blur using a box blur approximation - ---- - -> RL.ImageKernelConvolution( Image image, float{} kernel ) - -Apply custom square convolution kernel to image - ---- - -> RL.ImageResize( Image image, Vector2 size ) - -Resize image (Bicubic scaling algorithm) - ---- - -> RL.ImageResizeNN( Image image, Vector2 size ) - -Resize image (Nearest-Neighbor scaling algorithm) - ---- - -> RL.ImageResizeCanvas( Image image, Vector2 size, Vector2 offset, Color fill ) - -Resize canvas and fill with color - ---- - -> RL.ImageMipmaps( Image image ) - -Generate all mipmap levels for a provided image - ---- - -> RL.ImageDither( Image image, Color bpp ) - -Dither image data to 16bpp or lower (Floyd-Steinberg dithering) - ---- - -> RL.ImageFlipVertical( Image image ) - -Flip image vertically - ---- - -> RL.ImageFlipHorizontal( Image image ) - -Flip image horizontally - ---- - -> RL.ImageRotate( Image image, int degrees ) - -Rotate image by input angle in degrees (-359 to 359) - ---- - -> RL.ImageRotateCW( Image image ) - -Rotate image clockwise 90deg - ---- - -> RL.ImageRotateCCW( Image image ) - -Rotate image counter-clockwise 90deg - ---- - -> RL.ImageColorTint( Image image, Color color ) - -Modify image color: tint - ---- - -> RL.ImageColorInvert( Image image ) - -Modify image color: invert - ---- - -> RL.ImageColorGrayscale( Image image ) - -Modify image color: grayscale - ---- - -> RL.ImageColorContrast( Image image, float contrast ) - -Modify image color: contrast (-100 to 100) - ---- - -> RL.ImageColorBrightness( Image image, int brightness ) - -Modify image color: brightness (-255 to 255) - ---- - -> RL.ImageColorReplace( Image image, Color color, Color replace ) - -Modify image color: replace color - ---- - -> colors = RL.LoadImageColors( Image image ) - -Load color data from image as a Color array (RGBA - 32bit) - -- Success return Color{} - ---- - -> colors = RL.LoadImagePalette( Image image, int maxPaletteSize ) - -Load colors palette from image as a Color array (RGBA - 32bit) - -- Success return Color{} - ---- - -> rectangle = RL.GetImageAlphaBorder( Image image, float threshold ) - -Get image alpha border rectangle - -- Success return Rectangle - ---- - -> color = RL.GetImageColor( Image image, Vector2 pixelPos ) - -Get image pixel color at (x, y) position - -- Success return Color - ---- - -## Textures - Image configuration functions - ---- - -> RL.SetImageData( Image image, Buffer data ) - -Set image data from Buffer - ---- - -> imageData = RL.GetImageData( Image image ) - -Get image data as Buffer - -- Success return Buffer - ---- - -> size = RL.GetImageSize( Image image ) - -Get image size - -- Success return Vector2 - ---- - -> mipmaps = RL.GetImageMipmaps( Image image ) - -Get image mipmaps. Mipmap levels, 1 by default - -- Success return int - ---- - -> format = RL.GetImageFormat( Image image ) - -Get image data format (PixelFormat type) - -- Success return int - ---- - -## Textures - Image drawing functions - ---- - -> RL.ImageClearBackground( Image dst, Color color ) - -Clear image background with given color - ---- - -> RL.ImageDrawPixel( Image dst, Vector2 position, Color color ) - -Draw pixel within an image - ---- - -> RL.ImageDrawLine( Image dst, Vector2 start, Vector2 end, Color color ) - -Draw line within an image - ---- - -> RL.ImageDrawLineEx( Image dst, Vector2 start, Vector2 end, int thick, Color color ) - -Draw a line defining thickness within an image - ---- - -> RL.ImageDrawCircle( Image dst, Vector2 center, int radius, Color color ) - -Draw circle within an image - ---- - -> RL.ImageDrawCircleLines( Image dst, Vector2 center, int radius, Color color ) - -Draw circle outline within an image - ---- - -> RL.ImageDrawRectangle( Image dst, Rectangle rec, Color color ) - -Draw rectangle within an image - ---- - -> RL.ImageDrawRectangleLines( Image dst, Rectangle rec, int thick, Color color ) - -Draw rectangle lines within an image - ---- - -> RL.ImageDrawTriangle( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color ) - -Draw triangle within an image - ---- - -> RL.ImageDrawTriangleEx( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3 ) - -Draw triangle with interpolated colors within an image - ---- - -> RL.ImageDrawTriangleLines( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color ) - -Draw triangle outline within an image - ---- - -> RL.ImageDrawTriangleFan( Image dst, Vector2{} points, Color color ) - -Draw a triangle fan defined by points within an image (first vertex is the center) - ---- - -> RL.ImageDrawTriangleStrip( Image dst, Vector2{} points, Color color ) - -Draw a triangle strip defined by points within an image - ---- - -> RL.ImageDraw( Image dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint ) - -Draw a source image within a destination image (Tint applied to source) - ---- - -> RL.ImageDrawText( Image dst, string text, Vector2 position, float fontSize, Color tint ) - -Draw text (using default font) within an image (destination) - ---- - -> RL.ImageDrawTextEx( Image dst, Font font, string text, Vector2 position, float fontSize, float spacing, Color tint ) - -Draw text (Custom sprite font) within an image (Destination) - ---- - -## Textures - Texture loading functions - ---- - -> texture = RL.GetTextureDefault() - -Get default texture. Return as lightuserdata - -- Success return Texture - ---- - -> texture = RL.LoadTexture( string fileName ) - -Load texture from file into GPU memory ( VRAM ) - -- Failure return nil -- Success return Texture - ---- - -> texture = RL.LoadTextureFromImage( Image image ) - -Load texture from image data - -- Success return Texture - ---- - -> texture = RL.LoadTextureCubemap( Image image, int layout ) - -Load cubemap from image, multiple image cubemap layouts supported - -- Success return Texture - ---- - -> texture = RL.LoadTextureFromData( Texture{} textureData ) - -Load Texture from data - -- Success return Texture - ---- - -> renderTexture = RL.LoadRenderTexture( Vector2 size ) - -Load texture for rendering (framebuffer) - -- Success return RenderTexture - ---- - -> renderTexture = RL.LoadRenderTextureFromData( Texture{} renderTextureData ) - -Load RenderTexture from data (framebuffer) - -- Success return RenderTexture - ---- - -> isValid = RL.IsTextureValid( Texture texture ) - -Check if a texture is valid (loaded in GPU) - -- Success return bool - ---- - -> RL.UnloadTexture( Texture texture ) - -Unload texture from GPU memory (VRAM) - ---- - -> isValid = RL.IsRenderTextureValid( RenderTexture target ) - -Check if a render texture is valid (loaded in GPU) - -- Success return bool - ---- - -> RL.UnloadRenderTexture( RenderTexture target ) - -Unload render texture from GPU memory (VRAM) - ---- - -> RL.UpdateTexture( Texture texture, Buffer pixels ) - -Update GPU texture with new data - ---- - -> RL.UpdateTextureRec( Texture texture, Rectangle rec, Buffer pixels ) - -Update GPU texture rectangle with new data. - ---- - -## Textures - Texture configuration functions - ---- - -> RL.GenTextureMipmaps( Texture texture ) - -Generate GPU mipmaps for a texture - ---- - -> RL.SetTextureFilter( Texture texture, int filter ) - -Set texture scaling filter mode (TEXTURE_FILTER_POINT, TEXTURE_FILTER_BILINEAR...) - ---- - -> RL.SetTextureWrap( Texture texture, int wrap ) - -Set texture wrapping mode (TEXTURE_WRAP_REPEAT, TEXTURE_WRAP_CLAMP...) - ---- - -> id = RL.GetTextureId( Texture texture ) - -Get OpenGL texture id - -- Success return int - ---- - -> size = RL.GetTextureSize( Texture texture ) - -Get texture size - -- Success return Vector2 - ---- - -> mipmaps = RL.GetTextureMipmaps( Texture texture ) - -Get texture mipmaps. Mipmap levels, 1 by default - -- Success return int - ---- - -> format = RL.GetTextureFormat( Texture texture ) - -Get texture data format (PixelFormat type) - -- Success return int - ---- - -## Textures - Texture drawing functions - ---- - -> RL.DrawTexture( Texture texture, Vector2 position, Color tint ) - -Draw a Texture2D - ---- - -> RL.DrawTextureEx( Texture texture, Vector2 position, float rotation, float scale, Color tint ) - -Draw a Texture2D with extended parameters - ---- - -> RL.DrawTextureRec( Texture texture, Rectangle source, Vector2 position, Color tint ) - -Draw a part of a texture defined by a rectangle - ---- - -> RL.DrawTexturePro( Texture texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint ) - -Draw a part of a texture defined by a rectangle with "pro" parameters - ---- - -> RL.DrawTextureNPatch( Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint ) - -Draws a texture (or part of it) that stretches or shrinks nicely - ---- - -> RL.DrawTextureNPatchRepeat( Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint ) - -Draws a texture (or part of it) that repeats nicely - ---- - -## Textures - RenderTexture configuration functions - ---- - -> id = RL.GetRenderTextureId( RenderTexture renderTexture ) - -Get OpenGL framebuffer object id - -- Success return int - ---- - -> texture = RL.GetRenderTextureTexture( RenderTexture renderTexture ) - -Get color buffer attachment texture. Returns as lightuserdata - -- Success return Texture - ---- - -> texture = RL.GetRenderTextureDepthTexture( RenderTexture renderTexture ) - -Get depth buffer attachment texture. Returns as lightuserdata - -- Success return Texture - ---- - -## Textures - Color/pixel related functions - ---- - -> isEqual = RL.ColorIsEqual( Color col1, Color col2 ) - -Check if two colors are equal - -- Success return bool - ---- - -> color = RL.Fade( Color color, float alpha ) - -Returns color with alpha applied, alpha goes from 0.0f to 1.0f - -- Success return Color - ---- - -> value = RL.ColorToInt( Color color ) - -Returns hexadecimal value for a Color - -- Success return int - ---- - -> color = RL.ColorNormalize( Color color ) - -Returns Color normalized as float [0..1] - -- Success return Vector4 - ---- - -> color = RL.ColorFromNormalized( Vector4 normalized ) - -Color from normalized values [0..1] - -- Success return Color - ---- - -> HSV = RL.ColorToHSV( Color color ) - -Returns HSV values for a Color, hue [0..360], saturation/value [0..1] - -- Success return Vector3 - ---- - -> color = RL.ColorFromHSV( float hue, float saturation, float value ) - -Returns a Color from HSV values, hue [0..360], saturation/value [0..1] - -- Success return Color - ---- - -> color = RL.ColorTint( Color color, Color tint ) - -Get color multiplied with another color - -- Success return Color - ---- - -> color = RL.ColorBrightness( Color color, float factor ) - -Get color with brightness correction, brightness factor goes from -1.0f to 1.0f - -- Success return Color - ---- - -> color = RL.ColorContrast( Color color, float contrast ) - -Get color with contrast correction, contrast values between -1.0f and 1.0f - -- Success return Color - ---- - -> color = RL.ColorAlpha( Color color, float alpha ) - -Returns color with alpha applied, alpha goes from 0.0f to 1.0f - -- Success return Color - ---- - -> color = RL.ColorAlphaBlend( Color dst, Color src, Color tint ) - -Returns src alpha-blended into dst color with tint - -- Success return Color - ---- - -> color = RL.ColorLerp( Color color1, Color color2, float factor ) - -Get color lerp interpolation between two colors, factor [0.0f..1.0f] - -- Success return Color - ---- - -> color = RL.GetColor( int hexValue ) - -Get Color structure from hexadecimal value - -- Success return Color - ---- - -> size = RL.GetPixelDataSize( Vector2 size, int format ) - -Get pixel data size in bytes for certain format - -- Success return int - ---- - -## Text - Font loading/unloading functions - ---- - -> font = RL.GetFontDefault() - -Get the default Font. Return as lightuserdata - -- Success return Font - ---- - -> font = RL.LoadFont( string fileName ) - -Load font from file into GPU memory (VRAM) - -- Failure return nil -- Success return Font - ---- - -> font = RL.LoadFontEx( string fileName, int fontSize, int{}|nil codepoints ) - -Load font from file with extended parameters, use NULL for codepoints to load the default character set - -- Failure return nil -- Success return Font - ---- - -> font = RL.LoadFontFromImage( Image image, Color key, int firstChar ) - -Load font from Image (XNA style) - -- Success return Font - ---- - -> font = RL.LoadFontFromMemory( string fileType, Buffer fileData, int fontSize, int{} codepoints ) - -Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. NOTE: fileData type should be unsigned char - -- Success return Font - ---- - -> font = RL.LoadFontFromData( Font{} fontData ) - -Load Font from data - -- Success return Font - ---- - -> font = RL.FontCopy( Font font ) - -Load font copy as new userdata - -- Success return Font - ---- - -> isValid = RL.IsFontValid( Font font ) - -Check if a font is valid (font data loaded, WARNING: GPU texture not checked) - -- Success return bool - ---- - -> glyphs = RL.LoadFontData( Buffer fileData, int fontSize, int{} codepoints, int type ) - -Load font data for further use. NOTE: fileData type should be unsigned char - -- Success return GlyphInfo{} - ---- - -> image, rectangles = RL.GenImageFontAtlas( GlyphInfo{} glyphs, int fontSize, int padding, int packMethod ) - -Generate image font atlas using chars info. NOTE: Packing method: 0-Default, 1-Skyline - -- Success Image, Rectangle{} - ---- - -> RL.UnloadFont( Font font ) - -Unload font from GPU memory (VRAM) - ---- - -> RL.ExportFontAsCode( Font font, string fileName ) - -Export font as code file, returns true on success - -- Success return bool - ---- - -## Text - Text drawing functions - ---- - -> RL.DrawFPS( Vector2 pos ) - -Draw current FPS - ---- - -> RL.DrawText( string text, Vector2 position, float fontSize, Color tint ) - -Draw text (using default font) - ---- - -> RL.DrawTextEx( Font font, string text, Vector2 position, float fontSize, float spacing, Color tint ) - -Draw text using font and additional parameters - ---- - -> RL.DrawTextPro( Font font, string text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint ) - -Draw text using Font and pro parameters (rotation) - ---- - -> RL.DrawTextCodepoint( Font font, int codepoint, Vector2 position, float fontSize, Color tint ) - -Draw one character (codepoint) - ---- - -> RL.DrawTextCodepoints( Font font, int{} codepoints, Vector2 position, float fontSize, float spacing, Color tint ) - -Draw multiple character (codepoint) - ---- - -> mouseCharId, textOffset = RL.DrawTextBoxed( Font font, string text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, bool limitHeight, Vector2|nil textOffset, int|nil tabSize ) - -Draw text inside rectangle limits. Return character id from mouse position (default 0). -textOffset can be used to set start position inside rectangle. Usefull to pass from previous -DrawTextBoxed for continuous text. -Support for tint change with "\a#FFFFFFFF" - -- Success return int, Vector2 - ---- - -## Text - Text font info functions - ---- - -> RL.SetTextLineSpacing( int spacing ) - -Set vertical line spacing when drawing with line-breaks - ---- - -> spacing = RL.GetTextLineSpacing() - -Get vertical line spacing when drawing with line-breaks - -- Success return int - ---- - -> width = RL.MeasureText( string text, int fontSize ) - -Measure string width for default font - -- Success return int - ---- - -> size = RL.MeasureTextEx( Font font, string text, float fontSize, float spacing ) - -Measure string size for Font - -- Success return Vector2 - ---- - -> size, textOffset = RL.MeasureTextBoxed( Font font, string text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, bool limitHeight, Vector2 textOffset, int|nil tabSize ) - -Measure text inside rectangle limits. - -- Success return Vector2, Vector2 - ---- - -> index = RL.GetGlyphIndex( Font font, int codepoint ) - -Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found - -- Success return int - ---- - -> glyphInfo = RL.GetGlyphInfo( Font font, int codepoint ) - -Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found. Return as lightuserdata - -- Success return GlyphInfo - ---- - -> glyphInfo = RL.GetGlyphInfoByIndex( Font font, int index ) - -Get glyph font info data by index. Return as lightuserdata - -- Failure return nil -- Success return GlyphInfo - ---- - -> rect = RL.GetGlyphAtlasRec( Font font, int codepoint ) - -Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found - -- Success return Rectangle - ---- - -> rect = RL.GetGlyphAtlasRecByIndex( Font font, int index ) - -Get glyph rectangle in font atlas by index - -- Failure return nil -- Success return Rectangle - ---- - -> baseSize = RL.GetFontBaseSize( Font font ) - -Get font base size (default chars height) - -- Success return int - ---- - -> glyphCount = RL.GetFontGlyphCount( Font font ) - -Get font number of glyph characters - -- Success return int - ---- - -> glyphPadding = RL.GetFontGlyphPadding( Font font ) - -Get font padding around the glyph characters - -- Success return int - ---- - -> texture = RL.GetFontTexture( Font font ) - -Get font texture atlas containing the glyphs. Return as lightuserdata - -- Success return Texture - ---- - -## Text - GlyphInfo management functions - ---- - -> glyphInfo = RL.LoadGlyphInfo( GlyphInfo{} glyphInfoData ) - -Load GlyphInfo from data - -- Success return GlyphInfo - ---- - -> RL.UnloadGlyphInfo( GlyphInfo glyphInfo ) - -Unload glyphInfo image from CPU memory (RAM) - ---- - -> RL.SetGlyphInfoValue( GlyphInfo glyphInfo, int value ) - -Set glyphInfo character value (Unicode) - ---- - -> RL.SetGlyphInfoOffset( GlyphInfo glyphInfo, Vector2 offset ) - -Set glyphInfo character offset when drawing - ---- - -> RL.SetGlyphInfoAdvanceX( GlyphInfo glyphInfo, int advanceX ) - -Set glyphInfo character advance position X - ---- - -> RL.SetGlyphInfoImage( GlyphInfo glyphInfo, Image image ) - -Set glyphInfo character image data - ---- - -> value = RL.GetGlyphInfoValue( GlyphInfo glyphInfo ) - -Get glyphInfo character value (Unicode) - -- Success return int - ---- - -> offset = RL.GetGlyphInfoOffset( GlyphInfo glyphInfo ) - -Get glyphInfo character offset when drawing - -- Success return Vector2 - ---- - -> advanceX = RL.GetGlyphInfoAdvanceX( GlyphInfo glyphInfo ) - -Get glyphInfo character advance position X - -- Success return int - ---- - -> image = RL.GetGlyphInfoImage( GlyphInfo glyphInfo ) - -Get glyphInfo character image data. Return as lightuserdata - -- Success return Image - ---- - -## Text - Text codepoints management functions (unicode characters) - ---- - -> string = RL.LoadUTF8( int{} codepoints ) - -Load UTF-8 text encoded from codepoints array - -- Success return string - ---- - -> codepoints = RL.LoadCodepoints( string text ) - -Load all codepoints from a UTF-8 text string - -- Success return int{} - ---- - -> count = RL.GetCodepointCount( string text ) - -Get total number of codepoints in a UTF-8 encoded string - -- Success return int - ---- - -> codepoint, codepointSize = RL.GetCodepoint( string text, int position ) - -Get codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure - -- Success return int, int - ---- - -> codepoint, codepointSize = RL.GetCodepointNext( string text, int position ) - -Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure - -- Success return int, int - ---- - -> codepoint, codepointSize = RL.GetCodepointPrevious( string text, int position ) - -Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure - -- Success return int, int - ---- - -> string = RL.CodepointToUTF8( int codepoint ) - -Encode one codepoint into UTF-8 byte array - -- Success return string - ---- - -## Text - Text strings management functions (no UTF-8 strings, only byte chars) - ---- - -> text = RL.TextSubtext( string text, int position, int length ) - -Get a piece of a text string - -- Success return string - ---- - -> text = RL.TextReplace( string text, string replace, string by ) - -Replace text string - -- Success return string - ---- - -> text = RL.TextInsert( string text, string insert, int position ) - -Insert text in a specific position, moves all text forward - -- Success return string - ---- - -> splits = RL.TextSplit( string text, char delimiter ) - -Split text into multiple strings - -- Success return string{} - ---- - -> index = RL.TextFindIndex( string text, string find ) - -Find first text occurrence within a string - -- Success return int - ---- - -> text = RL.TextToPascal( string text ) - -Get Pascal case notation version of provided string - -- Success return string - ---- - -> text = RL.TextToSnake( string text ) - -Get Snake case notation version of provided string - -- Success return string - ---- - -> text = RL.TextToCamel( string text ) - -Get Camel case notation version of provided string - -- Success return string - ---- - -## Models - Basic geometric 3D shapes drawing functions - ---- - -> RL.DrawLine3D( Vector3 startPos, Vector3 endPos, Color color ) - -Draw a line in 3D world space - ---- - -> RL.DrawPoint3D( Vector3 position, Color color ) - -Draw a point in 3D space, actually a small line - ---- - -> RL.DrawCircle3D( Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color ) - -Draw a circle in 3D world space - ---- - -> RL.DrawTriangle3D( Vector3 v1, Vector3 v2, Vector3 v3, Color color ) - -Draw a color-filled triangle (Vertex in counter-clockwise order!) - ---- - -> RL.DrawTriangleStrip3D( Vector3{} points, Color color ) - -Draw a triangle strip defined by points - ---- - -> RL.DrawCube( Vector3 position, Vector3 size, Color color ) - -Draw cube - ---- - -> RL.DrawCubeWires( Vector3 position, Vector3 size, Color color ) - -Draw cube wires - ---- - -> RL.DrawSphere( Vector3 centerPos, float radius, Color color ) - -Draw sphere - ---- - -> RL.DrawSphereEx( Vector3 centerPos, float radius, int rings, int slices, Color color ) - -Draw sphere with extended parameters - ---- - -> RL.DrawSphereWires( Vector3 centerPos, float radius, int rings, int slices, Color color ) - -Draw sphere wires - ---- - -> RL.DrawCylinder( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color ) - -Draw a cylinder/cone - ---- - -> RL.DrawCylinderEx( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color ) - -Draw a cylinder with base at startPos and top at endPos - ---- - -> RL.DrawCylinderWires( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color ) - -Draw a cylinder/cone wires - ---- - -> RL.DrawCylinderWiresEx( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color ) - -Draw a cylinder wires with base at startPos and top at endPos - ---- - -> RL.DrawCapsule( Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color ) - -Draw a capsule with the center of its sphere caps at startPos and endPos - ---- - -> RL.DrawCapsuleWires( Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color ) - -Draw capsule wireframe with the center of its sphere caps at startPos and endPos - ---- - -> RL.DrawPlane( Vector3 centerPos, Vector2 size, Color color ) - -Draw a plane XZ - ---- - -> RL.DrawQuad3DTexture( Texture texture, Vector3{} vertices, Vector2{} texCoords, Color{} colors ) - -Draw 3D textured quad. (Texture coordinates opengl style 0.0 - 1.0) - ---- - -> RL.DrawRay( Ray ray, Color color ) - -Draw a ray line - ---- - -> RL.DrawGrid( int slices, float spacing ) - -Draw a grid (Centered at ( 0, 0, 0 )) - ---- - -> RL.DrawGridEx( Vector2 slices, Vector2 spacing, Matrix transform, Color color, Vector2|nil divider, Color|nil dividerColor ) - -Draw a grid with extended parameters. Optionally you can define divider with different color for every n slices - ---- - -## Models - Model management functions - ---- - -> model = RL.LoadModel( string fileName ) - -Load model from files (Meshes and materials) - -- Failure return nil -- Success return Model - ---- - -> model = RL.LoadModelFromMesh( Mesh mesh ) - -Load model from generated mesh (Default material) - -- Success return Model - ---- - -> isValid = RL.IsModelValid( Model model ) - -Check if a model is valid (loaded in GPU, VAO/VBOs) - -- Success return bool - ---- - -> RL.UnloadModel( Model model ) - -Unload model (meshes/materials) from memory (RAM and/or VRAM) - ---- - -> boundingBox = RL.GetModelBoundingBox( Model model ) - -Compute model bounding box limits (considers all meshes) - -- Success return BoundingBox - ---- - -> RL.SetModelTransform( Model model, Matrix transform ) - -Set model transform matrix - ---- - -> success = RL.SetModelMesh( Model model, int meshId, Mesh mesh ) - -Set model mesh. - -- Failure return false -- Success return true - ---- - -> success = RL.SetModelMaterial( Model model, int materialId, Material material ) - -Set material to model material - -- Failure return false -- Success return true - ---- - -> RL.SetModelMeshMaterial( Model model, int meshId, int materialId ) - -Set material for a mesh (Mesh and material on this model) - ---- - -> success = RL.SetModelBone( Model model, int boneId, BoneInfo bone ) - -Set model bone information (skeleton) - -- Failure return false -- Success return true - ---- - -> success = RL.SetModelBindPose( Model model, int boneId, Transform pose ) - -Set model bones base transformation (pose) - -- Failure return false -- Success return true - ---- - -> transform = RL.GetModelTransform( Model model ) - -Get model transform matrix - -- Success return Matrix - ---- - -> meshCount = RL.GetModelMeshCount( Model model ) - -Get model number of meshes - -- Success return int - ---- - -> meshCount = RL.GetModelMaterialCount( Model model ) - -Get model number of materials - -- Success return int - ---- - -> mesh = RL.GetModelMesh( Model model, int meshId ) - -Get model mesh. Return as lightuserdata - -- Failure return nil -- Success return Mesh - ---- - -> material = RL.GetModelMaterial( Model model, int materialId ) - -Get model material. Return as lightuserdata - -- Failure return nil -- Success return Material - ---- - -> boneCount = RL.GetModelBoneCount( Model model ) - -Get model number of bones - -- Success return int - ---- - -> bone = RL.GetModelBone( Model model, int boneId ) - -Get model bones information (skeleton) - -- Failure return nil -- Success return BoneInfo - ---- - -> pose = RL.GetModelBindPose( Model model, int boneId ) - -Get models bones base transformation (pose) - -- Failure return nil -- Success return Transform - ---- - -## Models - Model drawing functions - ---- - -> RL.DrawModel( Model model, Vector3 position, float scale, Color tint ) - -Draw a model (With texture if set) - ---- - -> RL.DrawModelEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) - -Draw a model with extended parameters - ---- - -> RL.DrawModelWires( Model model, Vector3 position, float scale, Color tint ) - -Draw a model wires (with texture if set) - ---- - -> RL.DrawModelWiresEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) - -Draw a model wires (with texture if set) with extended parameters - ---- - -> RL.DrawModelPoints( Model model, Vector3 position, float scale, Color tint ) - -Draw a model as points - ---- - -> RL.DrawModelPointsEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) - -Draw a model as points with extended parameters - ---- - -> RL.DrawBoundingBox( BoundingBox box, Color color ) - -Draw bounding box (wires) - ---- - -> RL.DrawBillboard( Camera3D camera, Texture texture, Vector3 position, float size, Color tint ) - -Draw a billboard texture - ---- - -> RL.DrawBillboardRec( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector2 size, Color tint ) - -Draw a billboard texture defined by source - ---- - -> RL.DrawBillboardPro( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint ) - -Draw a billboard texture defined by source and rotation - ---- - -## Models - Mesh management functions - ---- - -> RL.UpdateMesh( Mesh mesh, Mesh{} meshData ) - -Update mesh vertex data in GPU. -NOTE: Mainly intented to be used with custom meshes. - ---- - -> RL.UnloadMesh( Mesh mesh ) - -Unload mesh data from CPU and GPU - ---- - -> RL.DrawMesh( Mesh mesh, Material material, Matrix transform ) - -Draw a 3d mesh with material and transform - ---- - -> RL.DrawMeshInstanced( Mesh mesh, Material material, Buffer transforms, int instances ) - -Draw multiple mesh instances with material and different transforms - ---- - -> success = RL.SetMeshColor( Mesh mesh, Color color ) - -Updades mesh color vertex attribute buffer -NOTE: Currently only works on custom mesh - -- Failure return false -- Success return true - ---- - -> success = RL.ExportMesh( Mesh mesh, string fileName ) - -Export mesh data to file, returns true on success - -- Success return bool - ---- - -> success = RL.ExportMeshAsCode( Mesh mesh, string fileName ) - -Export mesh as code file (.h) defining multiple arrays of vertex attributes - -- Success return bool - ---- - -> boundingBox = RL.GetMeshBoundingBox( Mesh mesh ) - -Compute mesh bounding box limits - -- Success return BoundingBox - ---- - -> RL.GenMeshTangents( Mesh mesh ) - -Compute mesh tangents - ---- - -> meshData = RL.GetMeshData( Mesh mesh ) - -Get mesh vertex attributes data as table. - -- Success return Mesh{} - ---- - -## Models - Mesh generation functions - ---- - -> mesh = RL.GenMeshPoly( int sides, float radius ) - -Generate polygonal mesh - -- Success return Mesh - ---- - -> mesh = RL.GenMeshPlane( float width, float length, int resX, int resZ ) - -Generate plane mesh (With subdivisions) - -- Success return Mesh - ---- - -> mesh = RL.GenMeshCube( Vector3 size ) - -Generate cuboid mesh - -- Success return Mesh - ---- - -> mesh = RL.GenMeshSphere( float radius, int rings, int slices ) - -Generate sphere mesh (Standard sphere) - -- Success return Mesh - ---- - -> mesh = RL.GenMeshHemiSphere( float radius, int rings, int slices ) - -Generate half-sphere mesh (no bottom cap) - -- Success return Mesh - ---- - -> mesh = RL.GenMeshCylinder( float radius, float height, int slices ) - -Generate cylinder mesh - -- Success return Mesh - ---- - -> mesh = RL.GenMeshCone( float radius, float height, int slices ) - -Generate cone/pyramid mesh - -- Success return Mesh - ---- - -> mesh = RL.GenMeshTorus( float radius, float size, int radSeg, int sides ) - -Generate torus mesh - -- Success return Mesh - ---- - -> mesh = RL.GenMeshKnot( float radius, float size, int radSeg, int sides ) - -Generate torus mesh - -- Success return Mesh - ---- - -> mesh = RL.GenMeshHeightmap( Image heightmap, Vector3 size ) - -Generate heightmap mesh from image data - -- Success return Mesh - ---- - -> mesh = RL.GenMeshCubicmap( Image cubicmap, Vector3 cubeSize ) - -Generate cubes-based map mesh from image data - -- Success return Mesh - ---- - -> mesh = RL.GenMeshCustom( Mesh{} meshData, bool dynamic ) - -Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO - -- Success return Mesh - ---- - -## Models - Material management functions - ---- - -> materials = RL.LoadMaterials( string fileName ) - -Load materials from model file - -- Success return Material{} - ---- - -> material = RL.GetMaterialDefault() - -Default material for reference. Return as lightuserdata - -- Success return Material - ---- - -> material = RL.LoadMaterialDefault() - -Load default material as new object - -- Success return Material - ---- - -> material = RL.CreateMaterial( Material{} materialData ) - -Load material from table. See material table definition - -- Success return Material - ---- - -> isValid = RL.IsMaterialValid( Material material ) - -Check if a material is valid (shader assigned, map textures loaded in GPU) - -- Success return bool - ---- - -> RL.UnloadMaterial( Material material, bool freeAll ) - -Unload material from GPU memory (VRAM). Note! Use freeAll to unload shaders and textures - ---- - -> RL.SetMaterialTexture( Material material, int mapType, Texture texture ) - -Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...) - ---- - -> RL.SetMaterialColor( Material material, int mapType, Color color ) - -Set color for a material map type - ---- - -> RL.SetMaterialValue( Material material, int mapType, float value ) - -Set value for a material map type - ---- - -> RL.SetMaterialShader( Material material, Shader shader ) - -Set shader for material - ---- - -> RL.SetMaterialParams( Material material, float{} params ) - -Set material generic parameters (if required) - ---- - -> texture = RL.GetMaterialTexture( Material material, int mapType ) - -Get texture from material map type. Return as lightuserdata - -- Success return Texture - ---- - -> color = RL.GetMaterialColor( Material material, int mapType ) - -Get color from material map type - -- Success return Color - ---- - -> value = RL.GetMaterialValue( Material material, int mapType ) - -Get color from material map type - -- Success return float - ---- - -> shader = RL.GetMaterialShader( Material material ) - -Get material shader. Return as lightuserdata - -- Success return Shader - ---- - -> params = RL.GetMaterialParams( Material material ) - -Get material parameters - -- Success return float{} - ---- - -## Model - Model animations management functions - ---- - -> animations = RL.LoadModelAnimations( string fileName ) - -Load model animations from file - -- Failure return nil -- Success return ModelAnimations{} - ---- - -> RL.UpdateModelAnimation( Model model, ModelAnimation animation, int frame ) - -Update model animation pose - ---- - -> RL.UpdateModelAnimationBones( Model model, ModelAnimation animation, int frame ) - -Update model animation mesh bone matrices (GPU skinning) - ---- - -> RL.UnloadModelAnimation( ModelAnimation animation ) - -Unload animation data - ---- - -> RL.UnloadModelAnimations( ModelAnimation{} animations ) - -Unload animation table data - ---- - -> valid = RL.IsModelAnimationValid( Model model, ModelAnimation animation ) - -Check model animation skeleton match - -- Success return bool - ---- - -> success = RL.SetModelAnimationBone( ModelAnimation animation, int boneId, BoneInfo bone ) - -Set modelAnimation bones information (skeleton) - -- Failure return false -- Success return true - ---- - -> success = RL.SetModelAnimationFramePose( ModelAnimation animation, int frame, int boneId, Transform pose ) - -Set modelAnimation bones base transformation (pose) - -- Failure return false -- Success return true - ---- - -> RL.SetModelAnimationName( ModelAnimation animation, string name ) - -Set modelAnimation name - ---- - -> boneCount = RL.GetModelAnimationBoneCount( ModelAnimation animation ) - -Return modelAnimation bone count - -- Success return int - ---- - -> frameCount = RL.GetModelAnimationFrameCount( ModelAnimation animation ) - -Return modelAnimation frame count - -- Success return int - ---- - -> bone = RL.GetModelAnimationBone( ModelAnimation animation, int boneId ) - -Get modelAnimation bones information (skeleton) - -- Failure return nil -- Success return BoneInfo - ---- - -> pose = RL.GetModelAnimationFramePose( ModelAnimation animation, int frame, int boneId ) - -Get modelAnimation bones base transformation (pose) - -- Failure return nil -- Success return Transform - ---- - -> name = RL.GetModelAnimationName( ModelAnimation animation ) - -Get modelAnimation name - -- Success return string - ---- - -## Model - Collision detection functions - ---- - -> collision = RL.CheckCollisionSpheres( Vector3 center1, float radius1, Vector3 center2, float radius2 ) - -Check collision between two spheres - -- Success return bool - ---- - -> collision = RL.CheckCollisionBoxes( BoundingBox box1, BoundingBox box2 ) - -Check collision between two bounding boxes - -- Success return bool - ---- - -> collision = RL.CheckCollisionBoxSphere( BoundingBox box, Vector3 center, float radius ) - -Check collision between box and sphere - -- Success return bool - ---- - -> rayCollision = RL.GetRayCollisionSphere( Ray ray, Vector3 center, float radius ) - -Get collision info between ray and sphere. ( RayCollision is Lua table of { hit, distance, point, normal } ) - -- Success return RayCollision - ---- - -> rayCollision = RL.GetRayCollisionBox( Ray ray, BoundingBox box ) - -Get collision info between ray and box - -- Success return RayCollision - ---- - -> rayCollision = RL.GetRayCollisionMesh( Ray ray, Mesh mesh, Matrix transform ) - -Get collision info between ray and mesh - -- Success return RayCollision - ---- - -> rayCollision = RL.GetRayCollisionTriangle( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3 ) - -Get collision info between ray and triangle - -- Success return RayCollision - ---- - -> rayCollision = RL.GetRayCollisionQuad( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4 ) - -Get collision info between ray and quad. NOTE: The points are expected to be in counter-clockwise winding - -- Success return RayCollision - ---- - -> cells, exitPoint = RL.GetRayBoxCells( Ray ray, BoundingBox box, Vector3 cellSize ) - -Get cell positions inside box that intersect with the ray. Also returns ray exit point. Returns empty table if ray misses the box - -- Success return Vector3{}, RayCollision|nil - ---- - -## Audio - Audio device management functions - ---- - -> RL.InitAudioDevice() - -Initialize audio device and context - ---- - -> RL.CloseAudioDevice() - -Close the audio device and context - ---- - -> isReady = RL.IsAudioDeviceReady() - -Check if audio device has been initialized successfully - -- Success return bool - ---- - -> RL.SetMasterVolume( float volume ) - -Set master volume (listener) - ---- - -> volume = RL.GetMasterVolume() - -Get master volume (listener) - -- Success return float - ---- - -## Audio - Wave/Sound loading/unloading functions - ---- - -> sound = RL.LoadSound( string fileName ) - -Load sound from file - -- Failure return nil -- Success return Sound - ---- - -> wave = RL.LoadWave( string fileName ) - -Load wave data from file - -- Failure return nil -- Success return Wave - ---- - -> wave = RL.LoadWaveFromMemory( string fileType, Buffer data ) - -Load wave from memory buffer, fileType refers to extension: i.e. '.wav' - -- Success return Wave - ---- - -> isValid = RL.IsWaveValid( Wave wave ) - -Checks if wave data is valid (data loaded and parameters) - -- Success return bool - ---- - -> sound = RL.LoadSoundFromWave( Wave wave ) - -Load sound from wave data - -- Success return Sound - ---- - -> sound = RL.LoadSoundAlias( Sound source ) - -Create a new sound that shares the same sample data as the source sound, does not own the sound data - -- Success return Sound - ---- - -> isValid = RL.IsSoundValid( Sound sound ) - -Checks if a sound is valid (data loaded and buffers initialized) - -- Success return bool - ---- - -> RL.UpdateSound( Sound sound, Buffer data, int sampleCount ) - -Update sound buffer with new data - ---- - -> RL.UnloadWave( Wave wave ) - -Unload wave data - ---- - -> RL.UnloadSound( Sound sound ) - -Unload sound - ---- - -> RL.UnloadSoundAlias( Sound alias ) - -Unload a sound alias (does not deallocate sample data) - ---- - -> success = RL.ExportWave( Wave wave, string fileName ) - -Export wave data to file, returns true on success - -- Success return bool - ---- - -> success = RL.ExportWaveAsCode( Wave wave, string fileName ) - -Export wave sample data to code (.h), returns true on success - -- Success return true - ---- - -## Audio - Wave/Sound management functions - ---- - -> RL.PlaySound( Sound sound ) - -Play a sound - ---- - -> RL.StopSound( Sound sound ) - -Stop playing a sound - ---- - -> RL.PauseSound( Sound sound ) - -Pause a sound - ---- - -> RL.ResumeSound( Sound sound ) - -Resume a paused sound - ---- - -> playing = RL.IsSoundPlaying( Sound sound ) - -Check if a sound is currently playing - -- Success return bool - ---- - -> RL.SetSoundVolume( Sound sound, float volume ) - -Set volume for a sound (1.0 is max level) - ---- - -> RL.SetSoundPitch( Sound sound, float pitch ) - -Set pitch for a sound (1.0 is base level) - ---- - -> RL.SetSoundPan( Sound sound, float pan ) - -Set pan for a sound (0.5 is center) - ---- - -> stream = RL.GetSoundStream( Sound sound ) - -Get sound audio stream. Return as lightuserdata - -- Success return AudioStream - ---- - -> RL.WaveFormat( Wave wave, int sampleRate, int sampleSize, int channels ) - -Convert wave data to desired format - ---- - -> samples = RL.LoadWaveSamples( Wave wave ) - -Load samples data from wave as a 32bit float data array - -- Success return float{} - ---- - -> wave = RL.WaveCopy( Wave wave ) - -Copy a wave to a new wave - -- Success return Wave - ---- - -> RL.WaveCrop( Wave wave, int initSample, int finalSample ) - -Crop a wave to defined samples range - ---- - -## Audio - Music management functions - ---- - -> music = RL.LoadMusicStream( string fileName ) - -Load music stream from file - -- Success return Music - ---- - -> music = RL.LoadMusicStreamFromMemory( string fileType, Buffer data ) - -Load music stream from data - -- Success return Music - ---- - -> isValid = RL.IsMusicValid( Music music ) - -Checks if a music stream is valid (context and buffers initialized) - -- Success return bool - ---- - -> RL.UnloadMusicStream( Music music ) - -Unload music stream - ---- - -> RL.PlayMusicStream( Music music ) - -Start music playing - ---- - -> playing = RL.IsMusicStreamPlaying( Music music ) - -Check if music is playing - -- Success return bool - ---- - -> RL.UpdateMusicStream( Music music ) - -Updates buffers for music streaming - ---- - -> RL.StopMusicStream( Music music ) - -Stop music playing - ---- - -> RL.PauseMusicStream( Music music ) - -Pause music playing - ---- - -> RL.ResumeMusicStream( Music music ) - -Resume playing paused music - ---- - -> RL.SeekMusicStream( Music music, float position ) - -Seek music to a position (in seconds) - ---- - -> RL.SetMusicVolume( Music music, float volume ) - -Set volume for music (1.0 is max level) - ---- - -> RL.SetMusicPitch( Music music, float pitch ) - -Set pitch for a music (1.0 is base level) - ---- - -> RL.SetMusicPan( Music music, float pan ) - -Set pan for a music (0.5 is center) - ---- - -> RL.SetMusicLooping( Music music, bool looping ) - -Set looping for a music - ---- - -> looping = RL.GetMusicLooping( Music music ) - -Get looping of a music - -- Success return bool - ---- - -> length = RL.GetMusicTimeLength( Music music ) - -Get music time length (in seconds) - -- Success return float - ---- - -> timePlayed = RL.GetMusicTimePlayed( Music music ) - -Get current music time played (in seconds) - -- Success return float - ---- - -> stream = RL.GetMusicStream( Music music ) - -Get music audio stream. Return as lightuserdata - -- Success return AudioStream - ---- - -## Audio - AudioStream management functions - ---- - -> audioStream = RL.LoadAudioStream( int sampleRate, int sampleSize, int channels ) - -Load audio stream (to stream raw audio pcm data) - -- Success return AudioStream - ---- - -> isValid = RL.IsAudioStreamValid( AudioStream stream ) - -Checks if an audio stream is valid (buffers initialized) - -- Success return bool - ---- - -> RL.UnloadAudioStream( AudioStream stream ) - -Unload audio stream and free memory - ---- - -> RL.UpdateAudioStream( AudioStream stream, Buffer data, int frameCount ) - -Update audio stream buffers with data - ---- - -> isProcessed = RL.IsAudioStreamProcessed( AudioStream stream ) - -Check if any audio stream buffers requires refill - -- Success return bool - ---- - -> RL.PlayAudioStream( AudioStream stream ) - -Play audio stream - ---- - -> RL.PauseAudioStream( AudioStream stream ) - -Pause audio stream - ---- - -> RL.ResumeAudioStream( AudioStream stream ) - -Resume audio stream - ---- - -> isPlaying = RL.IsAudioStreamPlaying( AudioStream stream ) - -Check if audio stream is playing - -- Success return bool - ---- - -> RL.StopAudioStream( AudioStream stream ) - -Stop audio stream - ---- - -> RL.SetAudioStreamVolume( AudioStream stream, float volume ) - -Set volume for audio stream (1.0 is max level) - ---- - -> RL.SetAudioStreamPitch( AudioStream stream, float pitch ) - -Set pitch for audio stream (1.0 is base level) - ---- - -> RL.SetAudioStreamPan( AudioStream stream, float pan ) - -Set pan for audio stream (0.5 is centered) - ---- - -> RL.SetAudioStreamBufferSizeDefault( int size ) - -Default size for new audio streams - ---- - -> RL.SetAudioStreamCallback( AudioStream stream, AudioCallback callback ) - -Audio thread callback to request new data. -AudioCallback should be lightuserdata function pointer - ---- - -> RL.AttachAudioStreamProcessor( AudioStream stream, AudioCallback processor ) - -Attach audio stream processor to stream, receives the samples as 'float'. -AudioCallback should be lightuserdata function pointer - ---- - -> RL.DetachAudioStreamProcessor( AudioStream stream, AudioCallback processor ) - -Detach audio stream processor from stream. -AudioCallback should be lightuserdata function pointer - ---- - -> RL.AttachAudioMixedProcessor( AudioCallback processor ) - -Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'. -AudioCallback should be lightuserdata function pointer - ---- - -> RL.DetachAudioMixedProcessor( AudioCallback processor ) - -Detach audio stream processor from the entire audio pipeline. -AudioCallback should be lightuserdata function pointer - ---- - -## Math - Utils - ---- - -> result = RL.Round( float value ) - -Round float value - -- Success return int - ---- - -> result = RL.Sign( float value ) - -Sign of value - -- Success return int - ---- - -> result = RL.Clamp( float value, float min, float max ) - -Clamp float value - -- Success return float - ---- - -> result = RL.Lerp( float a, float b, float amount ) - -Calculate linear interpolation between two floats - -- Success return float - ---- - -> result = RL.Normalize( float value, float a, float b ) - -Normalize input value within input range - -- Success return float - ---- - -> result = RL.Remap( float value, float inputStart, float inputEnd, float outputStart, float outputEnd ) - -Remap input value within input range to output range - -- Success return float - ---- - -> result = RL.Wrap( float value, float min, float max ) - -Wrap input value from min to max - -- Success return float - ---- - -> result = RL.FloatEquals( float x, float y ) - -Check whether two given floats are almost equal - -- Success return bool - ---- - -## Math - Vector2 - ---- - -> result = RL.Vector2Zero() - -Vector with components value 0.0f - -- Success return Vector2 - ---- - -> result = RL.Vector2One() - -Vector with components value 1.0f - -- Success return Vector2 - ---- - -> result = RL.Vector2Add( Vector2 v1, Vector2 v2 ) - -Add two vectors (v1 + v2) - -- Success return Vector2 - ---- - -> result = RL.Vector2AddValue( Vector2 v, float add ) - -Add vector and float value - -- Success return Vector2 - ---- - -> result = RL.Vector2Subtract( Vector2 v1, Vector2 v2 ) - -Subtract two vectors (v1 - v2) - -- Success return Vector2 - ---- - -> result = RL.Vector2SubtractValue( Vector2 v, float sub ) - -Subtract vector by float value - -- Success return Vector2 - ---- - -> result = RL.Vector2Length( vector2 v ) - -Calculate vector length - -- Success return float - ---- - -> result = RL.Vector2LengthSqr( vector2 v ) - -Calculate vector square length - -- Success return float - ---- - -> result = RL.Vector2DotProduct( Vector2 v1, Vector2 v2 ) - -Calculate two vectors dot product - -- Success return float - ---- - -> result = RL.Vector2Distance( Vector2 v1, Vector2 v2 ) - -Calculate distance between two vectors - -- Success return float - ---- - -> result = RL.Vector2DistanceSqr( Vector2 v1, Vector2 v2 ) - -Calculate square distance between two vectors - -- Success return float - ---- - -> result = RL.Vector2Angle( Vector2 v1, Vector2 v2 ) - -Calculate angle between two vectors -NOTE: Angle is calculated from origin point (0, 0) - -- Success return float - ---- - -> result = RL.Vector2LineAngle( Vector2 a, Vector2 b ) - -Calculate angle defined by a two vectors line -NOTE: Parameters need to be normalized -Current implementation should be aligned with glm::angle - -- Success return float - ---- - -> result = RL.Vector2Scale( Vector2 v, float scale ) - -Scale vector (multiply by value) - -- Success return Vector2 - ---- - -> result = RL.Vector2Multiply( Vector2 v1, Vector2 v2 ) - -Multiply vector by vector - -- Success return Vector2 - ---- - -> result = RL.Vector2Negate( Vector2 v ) - -Negate vector - -- Success return Vector2 - ---- - -> result = RL.Vector2Divide( Vector2 v1, Vector2 v2 ) - -Divide vector by vector - -- Success return Vector2 - ---- - -> result = RL.Vector2Normalize( Vector2 v ) - -Normalize provided vector - -- Success return Vector2 - ---- - -> result = RL.Vector2Transform( Vector2 v, Matrix mat ) - -Transforms a Vector2 by a given Matrix - -- Success return Vector2 - ---- - -> result = RL.Vector2Lerp( Vector2 v1, Vector2 v2, float amount ) - -Calculate linear interpolation between two vectors - -- Success return Vector2 - ---- - -> result = RL.Vector2Reflect( Vector2 v, Vector2 normal ) - -Calculate reflected vector to normal - -- Success return Vector2 - ---- - -> result = RL.Vector2Min( Vector2 v1, Vector2 v2 ) - -Get min value for each pair of components - -- Success return Vector2 - ---- - -> result = RL.Vector2Max( Vector2 v1, Vector2 v2 ) - -Get max value for each pair of components - -- Success return Vector2 - ---- - -> result = RL.Vector2Rotate( Vector2 v, float angle ) - -Rotate vector by angle - -- Success return Vector2 - ---- - -> result = RL.Vector2MoveTowards( Vector2 v, Vector2 target, float maxDistance ) - -Move Vector towards target - -- Success return Vector2 - ---- - -> result = RL.Vector2Invert( Vector2 v ) - -Invert the given vector - -- Success return Vector2 - ---- - -> result = RL.Vector2Clamp( Vector2 v, Vector2 min, Vector2 max ) - -Clamp the components of the vector between -min and max values specified by the given vectors - -- Success return Vector2 - ---- - -> result = RL.Vector2ClampValue( Vector2 v, float min, float max ) - -Clamp the magnitude of the vector between two min and max values - -- Success return Vector2 - ---- - -> result = RL.Vector2Equals( Vector2 v1, Vector2 v2 ) - -Check whether two given vectors are almost equal - -- Success return bool - ---- - -> result = RL.Vector2Refract( Vector2 v, Vector2 n, float r ) - -Compute the direction of a refracted ray -v: normalized direction of the incoming ray -n: normalized normal vector of the interface of two optical media -r: ratio of the refractive index of the medium from where the ray comes - to the refractive index of the medium on the other side of the surface - -- Success return Vector2 - ---- - -## Math - Vector 3 - ---- - -> result = RL.Vector3Zero() - -Vector with components value 0.0f - -- Success return Vector3 - ---- - -> result = RL.Vector3One() - -Vector with components value 1.0f - -- Success return Vector3 - ---- - -> result = RL.Vector3Add( Vector3 v1, Vector3 v2 ) - -Add two vectors - -- Success return Vector3 - ---- - -> result = RL.Vector3AddValue( Vector3 v, float add ) - -Add vector and float value - -- Success return Vector3 - ---- - -> result = RL.Vector3Subtract( Vector3 v1, Vector3 v2 ) - -Subtract two vectors - -- Success return Vector3 - ---- - -> result = RL.Vector3SubtractValue( Vector3 v, float sub ) - -Subtract vector by float value - -- Success return Vector3 - ---- - -> result = RL.Vector3Scale( Vector3 v, float scalar ) - -Multiply vector by scalar - -- Success return Vector3 - ---- - -> result = RL.Vector3Multiply( Vector3 v1, Vector3 v2 ) - -Multiply vector by vector - -- Success return Vector3 - ---- - -> result = RL.Vector3CrossProduct( Vector3 v1, Vector3 v2 ) - -Calculate two vectors cross product - -- Success return Vector3 - ---- - -> result = RL.Vector3Perpendicular( Vector3 v ) - -Calculate one vector perpendicular vector - -- Success return Vector3 - ---- - -> result = RL.Vector3Length( Vector3 v ) - -Calculate vector length - -- Success return float - ---- - -> result = RL.Vector3LengthSqr( Vector3 v ) - -Calculate vector square length - -- Success return float - ---- - -> result = RL.Vector3DotProduct( Vector3 v1, Vector3 v2 ) - -Calculate two vectors dot product - -- Success return float - ---- - -> result = RL.Vector3Distance( Vector3 v1, Vector3 v2 ) - -Calculate distance between two vectors - -- Success return float - ---- - -> result = RL.Vector3DistanceSqr( Vector3 v1, Vector3 v2 ) - -Calculate square distance between two vectors - -- Success return float - ---- - -> result = RL.Vector3Angle( Vector3 v1, Vector3 v2 ) - -Calculate angle between two vectors - -- Success return float - ---- - -> result = RL.Vector3Negate( Vector3 v ) - -Negate provided vector (invert direction) - -- Success return Vector3 - ---- - -> result = RL.Vector3Divide( Vector3 v1, Vector3 v2 ) - -Divide vector by vector - -- Success return Vector3 - ---- - -> result = RL.Vector3Normalize( Vector3 v ) - -Normalize provided vector - -- Success return Vector3 - ---- - -> result = RL.Vector3Project( Vector3 v1, Vector3 v2 ) - -Calculate the projection of the vector v1 on to v2 - -- Success return Vector3 - ---- - -> result = RL.Vector3Reject( Vector3 v1, Vector3 v2 ) - -Calculate the rejection of the vector v1 on to v2 - -- Success return Vector3 - ---- - -> v1, v2 = RL.Vector3OrthoNormalize( Vector3 v1, Vector3 v2 ) - -Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other. -Gram-Schmidt function implementation - -- Success return Vector3, Vector3 - ---- - -> result = RL.Vector3Transform( Vector3 v, Matrix mat ) - -Transforms a Vector3 by a given Matrix - -- Success return Vector3 - ---- - -> result = RL.Vector3RotateByQuaternion( Vector3 v, Quaternion q ) - -Transform a vector by quaternion rotation - -- Success return Vector3 - ---- - -> result = RL.Vector3RotateByAxisAngle( Vector3 v, Vector3 axis, float angle ) - -Rotates a vector around an axis - -- Success return Vector3 - ---- - -> result = RL.Vector3MoveTowards( Vector3 v, Vector3 target, float maxDistance ) - -Move Vector towards target - -- Success return Vector3 - ---- - -> result = RL.Vector3Lerp( Vector3 v1, Vector3 v2, float amount ) - -Calculate linear interpolation between two vectors - -- Success return Vector3 - ---- - -> result = RL.Vector3CubicHermite( Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount ) - -Calculate cubic hermite interpolation between two vectors and their tangents -as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic - -- Success return Vector3 - ---- - -> result = RL.Vector3Reflect( Vector3 v, Vector3 normal ) - -Calculate reflected vector to normal - -- Success return Vector3 - ---- - -> result = RL.Vector3Min( Vector3 v1, Vector3 v2 ) - -Get min value for each pair of components - -- Success return Vector3 - ---- - -> result = RL.Vector3Max( Vector3 v1, Vector3 v2 ) - -Get max value for each pair of components - -- Success return Vector3 - ---- - -> result = RL.Vector3Barycenter( Vector3 p, Vector3 a, Vector3 b, Vector3 c ) - -Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) -NOTE: Assumes P is on the plane of the triangle - -- Success return Vector3 - ---- - -> result = RL.Vector3Unproject( Vector3 source, Matrix projection, Matrix view ) - -Projects a Vector3 from screen space into object space -NOTE: We are avoiding calling other raymath functions despite available - -- Success return Vector3 - ---- - -> result = RL.Vector3Invert( Vector3 v ) - -Invert the given vector - -- Success return Vector3 - ---- - -> result = RL.Vector3Clamp( Vector3 v, Vector3 min, Vector3 max ) - -Clamp the components of the vector between -min and max values specified by the given vectors - -- Success return Vector3 - ---- - -> result = RL.Vector3ClampValue( Vector3 v, float min, float max ) - -Clamp the magnitude of the vector between two values - -- Success return Vector3 - ---- - -> result = RL.Vector3Equals( Vector3 v1, Vector3 v2 ) - -Check whether two given vectors are almost equal - -- Success return bool - ---- - -> result = RL.Vector3Refract( Vector3 v, Vector3 n, float r ) - -Compute the direction of a refracted ray where v specifies the -normalized direction of the incoming ray, n specifies the -normalized normal vector of the interface of two optical media, -and r specifies the ratio of the refractive index of the medium -from where the ray comes to the refractive index of the medium -on the other side of the surface - -- Success return Vector3 - ---- - -## Math - Vector4 - ---- - -> result = RL.Vector4Zero() - -Vector with components value 0.0f - -- Success return Vector4 - ---- - -> result = RL.Vector4One() - -Vector with components value 1.0f - -- Success return Vector4 - ---- - -> result = RL.Vector4Add( Vector4 v1, Vector4 v2 ) - -Add two vectors - -- Success return Vector4 - ---- - -> result = RL.Vector4AddValue( Vector4 v, float add ) - -Add vector and float value - -- Success return Vector4 - ---- - -> result = RL.Vector4Subtract( Vector4 v1, Vector4 v2 ) - -Subtract two vectors - -- Success return Vector4 - ---- - -> result = RL.Vector4SubtractValue( Vector4 v, float sub ) - -Subtract vector by float value - -- Success return Vector4 - ---- - -> result = RL.Vector4Length( Vector4 v ) - -Calculate vector length - -- Success return float - ---- - -> result = RL.Vector4LengthSqr( Vector4 v ) - -Calculate vector square length - -- Success return float - ---- - -> result = RL.Vector4DotProduct( Vector4 v1, Vector4 v2 ) - -Calculate two vectors dot product - -- Success return float - ---- - -> result = RL.Vector4Distance( Vector4 v1, Vector4 v2 ) - -Calculate distance between two vectors - -- Success return float - ---- - -> result = RL.Vector4DistanceSqr( Vector4 v1, Vector4 v2 ) - -Calculate square distance between two vectors - -- Success return float - ---- - -> result = RL.Vector4Scale( Vector4 v, float scalar ) - -Multiply vector by scalar - -- Success return Vector4 - ---- - -> result = RL.Vector4Multiply( Vector4 v1, Vector4 v2 ) - -Multiply vector by vector - -- Success return Vector4 - ---- - -> result = RL.Vector4Negate( Vector4 v ) - -Negate provided vector (invert direction) - -- Success return Vector4 - ---- - -> result = RL.Vector4Divide( Vector4 v1, Vector4 v2 ) - -Divide vector by vector - -- Success return Vector4 - ---- - -> result = RL.Vector4Normalize( Vector4 v ) - -Normalize provided vector - -- Success return Vector4 - ---- - -> result = RL.Vector4Min( Vector4 v1, Vector4 v2 ) - -Get min value for each pair of components - -- Success return Vector4 - ---- - -> result = RL.Vector4Max( Vector4 v1, Vector4 v2 ) - -Get max value for each pair of components - -- Success return Vector4 - ---- - -> result = RL.Vector4Lerp( Vector4 v1, Vector4 v2, float amount ) - -Calculate linear interpolation between two vectors - -- Success return Vector4 - ---- - -> result = RL.Vector4MoveTowards( Vector4 v, Vector4 target, float maxDistance ) - -Move Vector towards target - -- Success return Vector4 - ---- - -> result = RL.Vector4Invert( Vector4 v ) - -Invert the given vector - -- Success return Vector4 - ---- - -> result = RL.Vector4Equals( Vector4 v1, Vector4 v2 ) - -Check whether two given vectors are almost equal - -- Success return bool - ---- - -## Math - Matrix - ---- - -> result = RL.MatrixDeterminant( Matrix mat ) - -Compute matrix determinant - -- Success return float - ---- - -> result = RL.MatrixTrace( Matrix mat ) - -Get the trace of the matrix (sum of the values along the diagonal) - -- Success return float - ---- - -> result = RL.MatrixTranspose( Matrix mat ) - -Transposes provided matrix - -- Success return Matrix - ---- - -> result = RL.MatrixInvert( Matrix mat ) - -Invert provided matrix - -- Success return Matrix - ---- - -> result = RL.MatrixIdentity() - -Get identity matrix - -- Success return Matrix - ---- - -> result = RL.MatrixAdd( Matrix left, Matrix right ) - -Add two matrices - -- Success return Matrix - ---- - -> result = RL.MatrixSubtract( Matrix left, Matrix right ) - -Subtract two matrices (left - right) - -- Success return Matrix - ---- - -> result = RL.MatrixMultiply( Matrix left, Matrix right ) - -Get two matrix multiplication - -- Success return Matrix - ---- - -> result = RL.MatrixTranslate( Vector3 translate ) - -Get translation matrix - -- Success return Matrix - ---- - -> result = RL.MatrixRotate( Vector3 axis, float angle ) - -Create rotation matrix from axis and angle. NOTE: Angle should be provided in radians - -- Success return Matrix - ---- - -> result = RL.MatrixRotateX( float angle ) - -Get x-rotation matrix (angle in radians) - -- Success return Matrix - ---- - -> result = RL.MatrixRotateY( float angle ) - -Get y-rotation matrix (angle in radians) - -- Success return Matrix - ---- - -> result = RL.MatrixRotateZ( float angle ) - -Get z-rotation matrix (angle in radians) - -- Success return Matrix - ---- - -> result = RL.MatrixRotateXYZ( Vector3 angles ) - -Get xyz-rotation matrix (angles in radians) - -- Success return Matrix - ---- - -> result = RL.MatrixRotateZYX( Vector3 angles ) - -Get zyx-rotation matrix (angles in radians) - -- Success return Matrix - ---- - -> result = RL.MatrixScale( Vector3 scale ) - -Get scaling matrix - -- Success return Matrix - ---- - -> result = RL.MatrixFrustum( double left, double right, double bottom, double top, double near, double far ) - -Get perspective projection matrix - -- Success return Matrix - ---- - -> result = RL.MatrixPerspective( double fovy, double aspect, double near, double far ) - -Get perspective projection matrix - -- Success return Matrix - ---- - -> result = RL.MatrixOrtho( double left, double right, double bottom, double top, double near, double far ) - -Get orthographic projection matrix - -- Success return Matrix - ---- - -> result = RL.MatrixLookAt( Vector3 eye, Vector3 target, Vector3 up ) - -Get camera look-at matrix (View matrix) - -- Success return Matrix - ---- - -> translation, rotation, scale = RL.MatrixDecompose( Matrix mat ) - -Decompose a transformation matrix into its rotational, translational and scaling components - -- Success return Vector3, Quaternion, Vector3 - ---- - -## Math - Quaternion - ---- - -> result = RL.QuaternionAdd( Quaternion q1, Quaternion q2 ) - -Add two quaternions - -- Success return Quaternion - ---- - -> result = RL.QuaternionAddValue( Quaternion q, float add ) - -Add quaternion and float value - -- Success return Quaternion - ---- - -> result = RL.QuaternionSubtract( Quaternion q1, Quaternion q2 ) - -Subtract two quaternions - -- Success return Quaternion - ---- - -> result = RL.QuaternionSubtractValue( Quaternion q, float sub ) - -Subtract quaternion and float value - -- Success return Quaternion - ---- - -> result = RL.QuaternionIdentity() - -Get identity quaternion - -- Success return Quaternion - ---- - -> result = RL.QuaternionLength( Quaternion q ) - -Computes the length of a quaternion - -- Success return float - ---- - -> result = RL.QuaternionNormalize( Quaternion q ) - -Normalize provided quaternion - -- Success return Quaternion - ---- - -> result = RL.QuaternionInvert( Quaternion q ) - -Invert provided quaternion - -- Success return Quaternion - ---- - -> result = RL.QuaternionMultiply( Quaternion q1, Quaternion q2 ) - -Calculate two quaternion multiplication - -- Success return Quaternion - ---- - -> result = RL.QuaternionScale( Quaternion q, float mul ) - -Scale quaternion by float value - -- Success return Quaternion - ---- - -> result = RL.QuaternionDivide( Quaternion q1, Quaternion q2 ) - -Divide two quaternions - -- Success return Quaternion - ---- - -> result = RL.QuaternionLerp( Quaternion q1, Quaternion q2, float amount ) - -Calculate linear interpolation between two quaternions - -- Success return Quaternion - ---- - -> result = RL.QuaternionNlerp( Quaternion q1, Quaternion q2, float amount ) - -Calculate slerp-optimized interpolation between two quaternions - -- Success return Quaternion - ---- - -> result = RL.QuaternionSlerp( Quaternion q1, Quaternion q2, float amount ) - -Calculates spherical linear interpolation between two quaternions - -- Success return Quaternion - ---- - -> result = RL.QuaternionCubicHermiteSpline( Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t ) - -Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm -as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic - -- Success return Quaternion - ---- - -> result = RL.QuaternionFromVector3ToVector3( Vector3 from, Vector3 to ) - -Calculate quaternion based on the rotation from one vector to another - -- Success return Quaternion - ---- - -> result = RL.QuaternionFromMatrix( Matrix mat ) - -Get a quaternion for a given rotation matrix - -- Success return Quaternion - ---- - -> result = RL.QuaternionToMatrix( Quaternion q ) - -Get a matrix for a given quaternion - -- Success return Matrix - ---- - -> result = RL.QuaternionFromAxisAngle( Vector3 axis, float angle ) - -Get rotation quaternion for an angle and axis -NOTE: angle must be provided in radians - -- Success return Quaternion - ---- - -> axis, angle = RL.QuaternionToAxisAngle( Quaternion q ) - -Get the rotation angle and axis for a given quaternion - -- Success return Vector3, float - ---- - -> result = RL.QuaternionFromEuler( float pitch, float yaw, float roll ) - -Get the quaternion equivalent to Euler angles -NOTE: Rotation order is ZYX - -- Success return Quaternion - ---- - -> result = RL.QuaternionToEuler( Quaternion q ) - -Get the Euler angles equivalent to quaternion (roll, pitch, yaw) -NOTE: Angles are returned in a Vector3 struct in radians - -- Success return Vector3 - ---- - -> result = RL.QuaternionTransform( Quaternion q, Matrix mat ) - -Transform a quaternion given a transformation matrix - -- Success return Quaternion - ---- - -> result = RL.QuaternionEquals( Quaternion q1, Quaternion q2 ) - -Check whether two given quaternions are almost equal - -- Success return bool - ---- - -## Math - Frustum - ---- - -> frustum = RL.ExtractFrustum( Matrix projection, Matrix modelview ) - -Extract frustum from projection and modelView matrices. - -- Success return Vector4{} - ---- - -> inFrustum = RL.PointInFrustum( Vector4{} frustum, Vector3 position ) - -Check if point inside frustum - -- Success return bool - ---- - -> inFrustum = RL.SphereInFrustum( Vector4{} frustum, Vector3 position ) - -Check if sphere inside frustum - -- Success return bool - ---- - -> inFrustum = RL.AABBInFrustum( Vector4{} frustum, Vector3 min, Vector3 max ) - -Check if AABB inside frustum - -- Success return bool - ---- - -## Gui - Global gui state control functions - ---- - -> RL.GuiEnable() - -Enable gui controls (global state) - ---- - -> RL.GuiDisable() - -Disable gui controls (global state) - ---- - -> RL.GuiLock() - -Lock gui controls (global state) - ---- - -> RL.GuiUnlock() - -Unlock gui controls (global state) - ---- - -> locked = RL.GuiIsLocked() - -Check if gui is locked (global state) - -- Success return bool - ---- - -> RL.GuiSetAlpha( float alpha ) - -Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f - ---- - -> RL.GuiSetState( int state ) - -Set gui state (global state) - ---- - -> state = RL.GuiGetState() - -Get gui state (global state) - -- Success return int - ---- - -> RL.GuiSetSliderDragging( bool dragging ) - -Set guiSliderDragging - ---- - -> isSliderDragging = RL.GuiGetSliderDragging() - -Get guiSliderDragging - -- Success return bool - ---- - -> RL.GuiSetSliderActive( Rectange rect ) - -Set guiSliderActive - ---- - -> isSliderDragging = RL.GuiGetSliderActive() - -Get guiSliderActive - -- Success return Rectangle - ---- - -## Gui - Font set/get functions - ---- - -> RL.GuiSetFont( Font font ) - -Set gui custom font (global state) - ---- - -> font = RL.GuiGetFont() - -Get gui font (global state). Return as lightuserdata - -- Success return Font - ---- - -## Gui - Style set/get functions - ---- - -> RL.GuiSetStyle( int control, int property, int value ) - -Set one style property - ---- - -> value = RL.GuiGetStyle( int control, int property ) - -Get one style property - -- Success return int - ---- - -## Gui - Styles loading functions - ---- - -> success = RL.GuiLoadStyle( string fileName ) - -Load style file over global style variable (.rgs) - -- Failure return nil -- Success return true - ---- - -> RL.GuiLoadStyleDefault() - -Load style default over global style - ---- - -## Gui - Tooltips management functions - ---- - -> RL.GuiEnableTooltip() - -Enable gui tooltips (global state) - ---- - -> RL.GuiDisableTooltip() - -Disable gui tooltips (global state) - ---- - -> RL.GuiSetTooltip( string tooltip ) - -Set tooltip string - ---- - -## Gui - Icons functionality - ---- - -> text = RL.GuiIconText( int iconId, string|nil text ) - -Get text with icon id prepended (if supported) - -- Success return string - ---- - -> RL.GuiSetIconScale( int scale ) - -Set icon scale (1 by default) - ---- - -> iconsBuffer = RL.GuiGetIcons() - -Get raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB - -- Success return Buffer - ---- - -> success = RL.GuiSetIcons( Buffer iconBuffer ) - -Set raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB - -- Failure return false -- Success return true - ---- - -> iconNames = RL.GuiLoadIcons( string fileName, bool loadIconsName ) - -Load raygui icons file (.rgi) into internal icons data - -- Failure return nil -- Success return strings{} - ---- - -> RL.GuiDrawIcon( int iconId, Vector2 pos, int pixelSize, Color color ) - -Draw icon - ---- - -## Gui - Container/separator controls, useful for controls organization - ---- - -> result = RL.GuiWindowBox( Rectangle bounds, string|nil title ) - -Window Box control, shows a window that can be closed - -- Success return int - ---- - -> result = RL.GuiGroupBox( Rectangle bounds, string|nil text ) - -Group Box control with text name - -- Success return int - ---- - -> result = RL.GuiLine( Rectangle bounds, string|nil text ) - -Line separator control, could contain text - -- Success return int - ---- - -> result = RL.GuiPanel( Rectangle bounds, string|nil text ) - -Panel control, useful to group controls - -- Success return int - ---- - -> result, active = RL.GuiTabBar( Rectangle bounds, string text, int active ) - -Tab Bar control, returns TAB to be closed or -1 - -- Success return int, int - ---- - -> result, scroll, view = RL.GuiScrollPanel( Rectangle bounds, string|nil text, Rectangle content, Vector2 scroll, Rectangle view ) - -Scroll Panel control - -- Success return int, Vector2, Rectangle - ---- - -## Gui - Basic controls set - ---- - -> result = RL.GuiLabel( Rectangle bounds, string|nil text ) - -Label control, shows text - -- Success return int - ---- - -> result = RL.GuiButton( Rectangle bounds, string|nil text ) - -Button control, returns true when clicked - -- Success return int - ---- - -> result = RL.GuiLabelButton( Rectangle bounds, string|nil text ) - -Label button control, show true when clicked - -- Success return int - ---- - -> result, active = RL.GuiToggle( Rectangle bounds, string|nil text, bool active ) - -Toggle Button control, returns true when active - -- Success return int, bool - ---- - -> result, active = RL.GuiToggleGroup( Rectangle bounds, string|nil text, int active ) - -Toggle Group control, returns active toggle index - -- Success return int, int - ---- - -> result, active = RL.GuiToggleSlider( Rectangle bounds, string|nil text, int active ) - -Toggle Slider control, returns true when clicked - -- Success return int, int - ---- - -> result, checked, textBounds = RL.GuiCheckBox( Rectangle bounds, string|nil text, bool checked ) - -Check Box control, returns true when active - -- Success return bool, Rectangle - ---- - -> result, active = RL.GuiComboBox( Rectangle bounds, string|nil text, int active ) - -Combo Box control, returns selected item index - -- Success return int, int - ---- - -> result, active = RL.GuiDropdownBox( Rectangle bounds, string text, int active, bool editMode ) - -Dropdown Box control, returns selected item - -- Success return int, int - ---- - -> result, value, textBounds = RL.GuiSpinner( Rectangle bounds, string|nil text, int value, int minValue, int maxValue, bool editMode ) - -Spinner control, returns selected value - -- Success return int, int, Rectangle - ---- - -> result, value, textBounds = RL.GuiValueBox( Rectangle bounds, string|nil text, int value, int minValue, int maxValue, bool editMode ) - -Value Box control, updates input text with numbers - -- Success return int, int, Rectangle - ---- - -> result, text = RL.GuiTextBox( Rectangle bounds, string text, int bufferSize, bool editMode ) - -Text Box control, updates input text - -- Success return int, string - ---- - -> result, value, textLeftBounds, textRightBounds = RL.GuiSlider( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue ) - -Slider control, returns selected value - -- Success return int, float, Rectangle, Rectangle - ---- - -> result, value, textLeftBounds, textRightBounds = RL.GuiSliderBar( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue ) - -Slider Bar control, returns selected value - -- Success return int, float, Rectangle, Rectangle - ---- - -> result, value, textLeftBounds, textRightBounds = RL.GuiProgressBar( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue ) - -Progress Bar control, shows current progress value - -- Success return int, float, Rectangle, Rectangle - ---- - -> result = RL.GuiStatusBar( Rectangle bounds, string|nil text ) - -Status Bar control, shows info text - -- Success return int - ---- - -> result = RL.GuiDummyRec( Rectangle bounds, string|nil text ) - -Dummy control for placeholders - -- Success return int - ---- - -> result, mouseCell = RL.GuiGrid( Rectangle bounds, string|nil text, float spacing, int subdivs, Vector2 mouseCell ) - -Grid control, returns mouse cell position - -- Success return int, Vector2 - ---- - -> value = RL.GuiScrollBar( Rectangle bounds, int value, int minValue, int maxValue ) - -Scroll bar control - -- Success return int - ---- - -## Gui - Advance controls set - ---- - -> result, scrollIndex, active = RL.GuiListView( Rectangle bounds, string|nil text, int scrollIndex, int active ) - -List View control, returns selected list item index - -- Success return int, int, int - ---- - -> result, scrollIndex, active, focus = RL.GuiListViewEx( Rectangle bounds, string text, int scrollIndex, int active, int focus ) - -List View with extended parameters - -- Success return int, int, int, int - ---- - -> result = RL.GuiMessageBox( Rectangle bounds, string|nil title, string message, string buttons ) - -Message Box control, displays a message - -- Success return int - ---- - -> result, text, secretViewActive = RL.GuiTextInputBox( Rectangle bounds, string title, string message, string buttons, string text, int textMaxSize, bool secretViewActive ) - -Text Input Box control, ask for text, supports secret - -- Success return int, string, bool - ---- - -> result, color = RL.GuiColorPicker( Rectangle bounds, string|nil text, Color color ) - -Color Picker control (multiple color controls) - -- Success return int, Color - ---- - -> result, color = RL.GuiColorPanel( Rectangle bounds, string|nil text, Color color ) - -Color Panel control - -- Success return int, Color - ---- - -> result, alpha = RL.GuiColorBarAlpha( Rectangle bounds, string|nil text, float alpha ) - -Color Bar Alpha control - -- Success return int, float - ---- - -> result, value = RL.GuiColorBarHue( Rectangle bounds, string|nil text, float value ) - -Color Bar Hue control - -- Success return int, float - ---- - -> result, colorHsv = RL.GuiColorPickerHSV( Rectangle bounds, string|nil text, Vector3 colorHsv ) - -Color Picker control that avoids conversion to RGB on each call (multiple color controls) - -- Success return int, Vector3 - ---- - -> result, colorHsv = RL.GuiColorPanelHSV( Rectangle bounds, string|nil text, Vector3 colorHsv ) - -Color Panel control that returns HSV color value, used by GuiColorPickerHSV() - -- Success return int, Vector3 - ---- - -## Lights - Light management functions - ---- - -> light = RL.CreateLight( int type, Vector3 position, Vector3 target, Color color, Shader shader ) - -Create a light and get shader locations - -- Success return Light - ---- - -> RL.UpdateLightValues( Shader shader, Light light ) - -Send light properties to shader - ---- - -> RL.SetLightType( Light light, int type ) - -Set light type - ---- - -> RL.SetLightPosition( Light light, Vector3 position ) - -Set light position - ---- - -> RL.SetLightTarget( Light light, Vector3 target ) - -Set light target - ---- - -> RL.SetLightColor( Light light, Color color ) - -Set light color - ---- - -> RL.SetLightEnabled( Light light, bool enabled ) - -Set light enabled - ---- - -> type = RL.GetLightType( Light light ) - -Get light type - -- Success return int - ---- - -> position = RL.GetLightPosition( Light light ) - -Get light position - -- Success return Vector3 - ---- - -> target = RL.GetLightTarget( Light light ) - -Get light target - -- Success return Vector3 - ---- - -> color = RL.GetLightColor( Light light ) - -Get light color - -- Success return Color - ---- - -> enabled = RL.IsLightEnabled( Light light ) - -Get light enabled - -- Success return bool - ---- - -## RLGL - Matrix operations - ---- - -> RL.rlMatrixMode( int mode ) - -Choose the current matrix to be transformed - ---- - -> RL.rlPushMatrix() - -Push the current matrix to stack - ---- - -> RL.rlPopMatrix() - -Pop latest inserted matrix from stack - ---- - -> RL.rlLoadIdentity() - -Reset current matrix to identity matrix - ---- - -> RL.rlTranslatef( Vector3 translation ) - -Multiply the current matrix by a translation matrix - ---- - -> RL.rlRotatef( float angle, Vector3 rotation ) - -Multiply the current matrix by a rotation matrix - ---- - -> RL.rlScalef( Vector3 scale ) - -Multiply the current matrix by a scaling matrix - ---- - -> RL.rlMultMatrixf( Matrix matrix ) - -Multiply the current matrix by another matrix - ---- - -> RL.rlFrustum( float left, float right, float bottom, float top, float znear, float zfar ) - -Multiply the current matrix by a perspective matrix generated by parameters - ---- - -> RL.rlOrtho( float left, float right, float bottom, float top, float znear, float zfar ) - -Multiply the current matrix by an orthographic matrix generated by parameters - ---- - -> RL.rlViewport( Rectangle viewport ) - -Set the viewport area (transformation from normalized device coordinates to window coordinates) -NOTE: We store current viewport dimensions - ---- - -> RL.rlSetClipPlanes( float nearPlane, float farPlane ) - -Set clip planes distances - ---- - -> distance = RL.rlGetCullDistanceNear() - -Get cull plane distance near - -- Success return float - ---- - -> distance = RL.rlGetCullDistanceFar() - -Get cull plane distance far - -- Success return float - ---- - -## RLGL - Vertex level operations - ---- - -> RL.rlBegin( int mode ) - -Initialize drawing mode (how to organize vertex) - ---- - -> RL.rlEnd() - -Finish vertex providing - ---- - -> RL.rlVertex2f( Vector2 position ) - -Define one vertex (position) - ---- - -> RL.rlVertex3f( Vector3 position ) - -Define one vertex (position) - ---- - -> RL.rlTexCoord2f( Vector2 texCoord ) - -Define one vertex (texture coordinate) - 2 float - ---- - -> RL.rlNormal3f( Vector3 normal ) - -Define one vertex (normal) - 3 float - ---- - -> RL.rlColor4ub( Color color ) - -Define one vertex (color) - 4 byte - ---- - -> RL.rlColor3f( Vector3 color ) - -Define one vertex (color) - 3 float - ---- - -> RL.rlColor4f( Vector4 color ) - -Define one vertex (color) - 4 float - ---- - -## RLGL - Vertex buffers state - ---- - -> supported = RL.rlEnableVertexArray( int vaoId ) - -Enable vertex array (VAO, if supported) - -- Success return bool - ---- - -> RL.rlDisableVertexArray() - -Disable vertex array (VAO, if supported) - ---- - -> RL.rlEnableVertexBuffer( int id ) - -Enable vertex buffer (VBO) - -- Failure return false -- Success return true - ---- - -> RL.rlDisableVertexBuffer() - -Disable vertex buffer (VBO) - ---- - -> RL.rlEnableVertexBufferElement( int id ) - -Enable vertex buffer element (VBO element) - ---- - -> RL.rlDisableVertexBufferElement() - -Disable vertex buffer element (VBO element) - ---- - -> RL.rlEnableVertexAttribute( int index ) - -Enable vertex attribute index - ---- - -> RL.rlDisableVertexAttribute( int index ) - -Disable vertex attribute index - ---- - -> RL.rlEnableStatePointer( int vertexAttribType, Buffer buffer ) - -Enable attribute state pointer - ---- - -> RL.rlDisableStatePointer( int vertexAttribType ) - -Disable attribute state pointer - ---- - -## RLGL - Textures state - ---- - -> RL.rlActiveTextureSlot( int slot ) - -Select and active a texture slot - ---- - -> RL.rlEnableTexture( int id ) - -Enable texture - ---- - -> RL.rlDisableTexture() - -Disable texture - ---- - -> RL.rlEnableTextureCubemap( int id ) - -Enable texture cubemap - ---- - -> RL.rlDisableTextureCubemap() - -Disable texture cubemap - ---- - -> RL.rlTextureParameters( int id, int param, int value ) - -Set texture parameters (filter, wrap) - ---- - -> RL.rlCubemapParameters( int id, int param, int value ) - -Set cubemap parameters (filter, wrap) - ---- - -## RLGL - Shader state - ---- - -> RL.rlEnableShader( int id ) - -Enable shader program - ---- - -> RL.rlDisableShader() - -Disable shader program - ---- - -## RLGL - Framebuffer state - ---- - -> RL.rlEnableFramebuffer( int id ) - -Enable render texture (fbo) - ---- - -> RL.rlDisableFramebuffer() - -Disable render texture (fbo), return to default framebuffer - ---- - -> framebuffer = RL.rlGetActiveFramebuffer() - -Get the currently active render texture (fbo), 0 for default framebuffer - -- Success return int - ---- - -> RL.rlActiveDrawBuffers( int count ) - -Activate multiple draw color buffers - ---- - -> RL.rlBlitFramebuffer( Rectangle srcRect, Rectangle dstRect, int bufferMask ) - -Blit active framebuffer to main framebuffer - ---- - -> RL.rlBindFramebuffer( int target, int framebuffer ) - -Bind framebuffer (FBO) - ---- - -## RLGL - General render state - ---- - -> RL.rlEnableColorBlend() - -Enable color blending - ---- - -> RL.rlDisableColorBlend() - -Disable color blending - ---- - -> RL.rlEnableDepthTest() - -Enable depth test - ---- - -> RL.rlDisableDepthTest() - -Disable depth test - ---- - -> RL.rlEnableDepthMask() - -Enable depth write - ---- - -> RL.rlDisableDepthMask() - -Disable depth write - ---- - -> RL.rlEnableBackfaceCulling() - -Enable backface culling - ---- - -> RL.rlDisableBackfaceCulling() - -Disable backface culling - ---- - -> RL.rlColorMask( bool r, bool g, bool b, bool a ) - -Color mask control - ---- - -> RL.rlSetCullFace( int mode ) - -Set face culling mode - ---- - -> RL.rlEnableScissorTest() - -Enable scissor test - ---- - -> RL.rlDisableScissorTest() - -Disable scissor test - ---- - -> RL.rlScissor( Rectangle area ) - -Scissor test - ---- - -> RL.rlEnableWireMode() - -Enable wire mode - ---- - -> RL.rlEnablePointMode() - -Enable point mode - ---- - -> RL.rlDisableWireMode() - -Disable wire mode - ---- - -> RL.rlSetLineWidth( float width ) - -Set the line drawing width - ---- - -> width = RL.rlGetLineWidth() - -Get the line drawing width - -- Success return float - ---- - -> RL.rlEnableSmoothLines() - -Enable line aliasing - ---- - -> RL.rlDisableSmoothLines() - -Disable line aliasing - ---- - -> RL.rlEnableStereoRender() - -Enable stereo rendering - ---- - -> RL.rlDisableStereoRender() - -Enable stereo rendering - ---- - -> enabled = RL.rlIsStereoRenderEnabled() - -Check if stereo render is enabled - -- Success return bool - ---- - -> RL.rlClearColor( Color color ) - -Clear color buffer with color - ---- - -> RL.rlClearScreenBuffers() - -Clear used screen buffers (color and depth) - ---- - -> RL.rlCheckErrors() - -Check and log OpenGL error codes - ---- - -> RL.rlSetBlendMode( int mode ) - -Set blending mode - ---- - -> RL.rlSetBlendFactors( int glSrcFactor, int glDstFactor, int glEquation ) - -Set blending mode factor and equation (using OpenGL factors) - ---- - -> RL.rlSetBlendFactorsSeparate( int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha ) - -Set blending mode factors and equations separately (using OpenGL factors) - ---- - -## RLGL - Initialization functions - ---- - -> version = RL.rlGetVersion() - -Get current OpenGL version - -- Success return int - ---- - -> version = RL.rlSetFramebufferWidth( int width ) - -Set current framebuffer width - ---- - -> width = RL.rlGetFramebufferWidth() - -Get default framebuffer width - -- Success return int - ---- - -> version = RL.rlSetFramebufferHeight( int height ) - -Set current framebuffer height - ---- - -> height = RL.rlGetFramebufferHeight() - -Get default framebuffer height - -- Success return int - ---- - -> id = RL.rlGetTextureIdDefault() - -Get default texture id - -- Success return int - ---- - -> id = RL.rlGetShaderIdDefault() - -Get default shader id - -- Success return int - ---- - -> locations = RL.rlGetShaderLocsDefault() - -Get default shader locations - -- Success return int{} - ---- - -## RLGL - Render batch management - ---- - -> renderBatch = RL.rlLoadRenderBatch( int numBuffers, int bufferElements ) - -Load a render batch system - -- Success return rlRenderBatch - ---- - -> RL.rlUnloadRenderBatch( rlRenderBatch renderBatch ) - -Unload render batch system - ---- - -> RL.rlDrawRenderBatch( rlRenderBatch renderBatch ) - -Draw render batch data (Update->Draw->Reset) - ---- - -> RL.rlSetRenderBatchActive( rlRenderBatch renderBatch ) - -Set the active render batch for rlgl (nil for default internal) - ---- - -> RL.rlDrawRenderBatchActive() - -Update and draw internal render batch - ---- - -> overflow = RL.rlCheckRenderBatchLimit( int vCount ) - -Check internal buffer overflow for a given number of vertex and force a rlRenderBatch draw call if required - -- Success return bool - ---- - -> RL.rlSetTexture( int id ) - -Set current texture for render batch and check buffers limits - ---- - -## RLGL - Vertex buffers management - ---- - -> vaoId = RL.rlLoadVertexArray() - -Load vertex array (vao) if supported - -- Success return int - ---- - -> vboId = RL.rlLoadVertexBuffer( Buffer buffer, bool dynamic ) - -Load a vertex buffer attribute - -- Success return int - ---- - -> vboId = RL.rlLoadVertexBufferElement( Buffer buffer, bool dynamic ) - -Load a new attributes element buffer - -- Success return int - ---- - -> RL.rlUpdateVertexBuffer( int bufferId, Buffer buffer, int offset ) - -Update GPU buffer with new data - ---- - -> RL.rlUpdateVertexBufferElements( int id, Buffer buffer, int offset ) - -Update vertex buffer elements with new data - ---- - -> RL.rlUnloadVertexArray( int vaoId ) - -Unload vertex array object (VAO) - ---- - -> RL.rlUnloadVertexBuffer( int vboId ) - -Unload vertex buffer (VBO) - ---- - -> RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, int offset ) - -Set vertex attribute data configuration - ---- - -> RL.rlSetVertexAttributeDivisor( int index, int divisor ) - -Set vertex attribute divisor - ---- - -> RL.rlSetVertexAttributeDefault( int locIndex, float{} value, int attribType ) - -Set vertex attribute default value - ---- - -> RL.rlDrawVertexArray( int offset, int count ) - -Draw vertex array - ---- - -> RL.rlDrawVertexArrayElements( int offset, int count, Buffer buffer ) - -Draw vertex array elements - ---- - -> RL.rlDrawVertexArrayInstanced( int offset, int count, int instances ) - -Draw vertex array instanced - ---- - -> RL.rlDrawVertexArrayElementsInstanced( int offset, int count, Buffer buffer, int instances ) - -Draw vertex array elements instanced - ---- - -## RLGL - Textures management - ---- - -> id = RL.rlLoadTexture( Buffer data, Vector2 size, int format, int mipmapCount ) - -Load texture in GPU - -- Success return int - ---- - -> id = RL.rlLoadTextureDepth( Vector2 size, bool useRenderBuffer ) - -Load depth texture/renderbuffer (to be attached to fbo) - -- Success return int - ---- - -> id = RL.rlLoadTextureCubemap( Buffer data, int size, int format, int mipmapCount ) - -Load texture cubemap data - -- Success return int - ---- - -> RL.rlUpdateTexture( int id, Vector2 offset, Vector2 size, int format, Buffer data ) - -Update GPU texture with new data - ---- - -> glInternalFormat, glFormat, glType = RL.rlGetGlTextureFormats( int format ) - -Get OpenGL internal formats - -- Success return int, int, int - ---- - -> name = RL.rlGetPixelFormatName( int format ) - -Get name string for pixel format - -- Success return string - ---- - -> RL.rlUnloadTexture( int id ) - -Unload texture from GPU memory - ---- - -> mipmapCount = RL.rlGenTextureMipmaps( int id, Vector2 size, int format ) - -Generate mipmap data for selected texture - -- Success return int - ---- - -> data = RL.rlReadTexturePixels( int id, Vector2 size, int format ) - -Read texture pixel data - -- Success return Buffer - ---- - -> data = RL.rlReadScreenPixels( Vector2 size ) - -Read screen pixel data (color buffer) - -- Success return Buffer - ---- - -## RLGL - Framebuffer management (fbo) - ---- - -> fboId = RL.rlLoadFramebuffer() - -Load an empty framebuffer - -- Success return int - ---- - -> RL.rlFramebufferAttach( int fboId, int texId, int attachType, int texType, int mipLevel ) - -Attach texture/renderbuffer to a framebuffer - ---- - -> isComplete = RL.rlFramebufferComplete( int id ) - -Verify framebuffer is complete - -- Success return bool - ---- - -> RL.rlUnloadFramebuffer( int id ) - -Delete framebuffer from GPU - ---- - -## RLGL - Shaders management - ---- - -> shaderId = RL.rlLoadShaderCode( string vsCode, string fsCode ) - -Load shader from code strings - -- Success return int - ---- - -> shaderId = RL.rlCompileShader( string shaderCode, int type ) - -Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER) - -- Success return int - ---- - -> shaderProgramId = RL.rlLoadShaderProgram( int vShaderId, int fShaderId ) - -Load custom shader program - -- Success return int - ---- - -> RL.rlUnloadShaderProgram( int id ) - -Unload shader program - ---- - -> location = RL.rlGetLocationUniform( int shaderId, string uniformName ) - -Get shader location uniform - -- Success return int - ---- - -> location = RL.rlGetLocationAttrib( int shaderId, string attribName ) - -Get shader location attribute - -- Success return int - ---- - -> RL.rlSetUniform( int locIndex, Buffer value, int uniformType, int count ) - -Set shader value uniform - ---- - -> RL.rlSetUniformMatrix( int locIndex, Matrix mat ) - -Set shader value matrix - ---- - -> RL.rlSetUniformMatrices( int locIndex, Matrix{} mat ) - -Set shader value matrices - ---- - -> RL.rlSetUniformSampler( int locIndex, int textureId ) - -Set shader value sampler - ---- - -> RL.rlSetShader( int id, int{} locs ) - -Set shader currently active (id and locations) - ---- - -## RLGL - Compute shader management - ---- - -> programId = RL.rlLoadComputeShaderProgram( int shaderId ) - -Load compute shader program - -- Success return int - ---- - -> RL.rlComputeShaderDispatch( int groupX, int groupY, int groupZ ) - -Dispatch compute shader (equivalent to *draw* for graphics pipeline) - ---- - -## RLGL - Shader buffer storage object management (ssbo) - ---- - -> buffer = RL.rlLoadShaderBuffer( int size, Buffer data, int usageHint ) - -Load shader storage buffer object (SSBO) - -- Success return int - ---- - -> RL.rlUnloadShaderBuffer( int ssboId ) - -Unload shader storage buffer object (SSBO) - ---- - -> RL.rlUpdateShaderBuffer( int id, Buffer data, int offset ) - -Update SSBO buffer data - ---- - -> RL.rlBindShaderBuffer( int id, int index ) - -Bind SSBO buffer - ---- - -> data = RL.rlReadShaderBuffer( int id, int count, int offset ) - -Read SSBO buffer data (GPU->CPU) - -- Success return Buffer - ---- - -> RL.rlCopyShaderBuffer( int destId, int srcId, int destOffset, int srcOffset, int count ) - -Copy SSBO data between buffers - ---- - -> size = RL.rlGetShaderBufferSize( int id ) - -Get SSBO buffer size - -- Success return int - ---- - -## RLGL - Buffer management - ---- - -> RL.rlBindImageTexture( int id, int index, int format, bool readonly ) - -Bind image texture - ---- - -## RLGL - Matrix state management - ---- - -> modelview = RL.rlGetMatrixModelview() - -Get internal modelview matrix - -- Success return Matrix - ---- - -> projection = RL.rlGetMatrixProjection() - -Get internal projection matrix - -- Success return Matrix - ---- - -> transform = RL.rlGetMatrixTransform() - -Get internal accumulated transform matrix - -- Success return Matrix - ---- - -> projection = RL.rlGetMatrixProjectionStereo( int eye ) - -Get internal projection matrix for stereo render (selected eye) - -- Success return Matrix - ---- - -> viewOffset = RL.rlGetMatrixViewOffsetStereo( int eye ) - -Get internal view offset matrix for stereo render (selected eye) - -- Success return Matrix - ---- - -> RL.rlSetMatrixProjection( Matrix proj ) - -Set a custom projection matrix (replaces internal projection matrix) - ---- - -> RL.rlSetMatrixModelview( Matrix view ) - -Set a custom modelview matrix (replaces internal modelview matrix) - ---- - -> RL.rlSetMatrixProjectionStereo( Matrix right, Matrix left ) - -Set eyes projection matrices for stereo rendering - ---- - -> RL.rlSetMatrixViewOffsetStereo( Matrix right, Matrix left ) - -Set eyes view offsets matrices for stereo rendering - ---- - -## OpenGL - Rendering - ---- - -> RL.glClear( int mask ) - -Clear buffers to preset values - ---- - -## OpenGL - Frame Buffers - ---- - -> RL.glBlitFramebuffer( RenderTexture srcTex, RenderTexture dstTex, Rectangle srcRect, Rectangle dstRect, int mask, int filter ) - -Copy a block of pixels from one framebuffer object to another. -Use nil RenderTexture for window framebuffer - ---- - -## OpenGL - State Management - ---- - -> RL.glDepthRange( float nearVal, float farVal ) - -Specify mapping of depth values from normalized device coordinates to window coordinates - ---- - -> RL.glEnable( int cap ) - -Enable server-side GL capabilities - ---- - -> RL.glDisable( int cap ) - -Disable server-side GL capabilities - ---- - -> RL.glPolygonOffset( float factor, float units ) - -Set the scale and units used to calculate depth values - ---- - -> RL.glStencilFunc( int func, int ref, int mask ) - -Set front and back function and reference value for stencil testing - ---- - -> RL.glStencilFuncSeparate( int face, int func, int ref, int mask ) - -Set front and/or back function and reference value for stencil testing - ---- - -> RL.glStencilMask( int mask ) - -Control the front and back writing of individual bits in the stencil planes - ---- - -> RL.glStencilMaskSeparate( int face, int mask ) - -Control the front and/or back writing of individual bits in the stencil planes - ---- - -> RL.glStencilOp( int sfail, int dpfail, int dppass ) - -Set front and back stencil test actions - ---- - -> RL.glStencilOpSeparate( int face, int sfail, int dpfail, int dppass ) - -Set front and back stencil test actions - ---- - -## OpenGL - Utility - ---- - -> connection = RL.glGetString( int name, int|nil index ) - -Return a string describing the current GL connection. GL_EXTENSIONS returns the extension string supported by the implementation at index - -- Success return string - ---- - -## Easings - Linear Easing functions - ---- - -> value = RL.EaseLinear( float t, float b, float c, float d ) - -Ease linear - -- Success return float - ---- - -## Easings - Sine Easing functions - ---- - -> value = RL.EaseSineIn( float t, float b, float c, float d ) - -Ease sine in - -- Success return float - ---- - -> value = RL.EaseSineOut( float t, float b, float c, float d ) - -Ease sine out - -- Success return float - ---- - -> value = RL.EaseSineInOut( float t, float b, float c, float d ) - -Ease sine in out - -- Success return float - ---- - -## Easings - Circular Easing functions - ---- - -> value = RL.EaseCircIn( float t, float b, float c, float d ) - -Ease circle in - -- Success return float - ---- - -> value = RL.EaseCircOut( float t, float b, float c, float d ) - -Ease circle out - -- Success return float - ---- - -> value = RL.EaseCircInOut( float t, float b, float c, float d ) - -Ease circle in out - -- Success return float - ---- - -## Easings - Cubic Easing functions - ---- - -> value = RL.EaseCubicIn( float t, float b, float c, float d ) - -Ease cubic in - -- Success return float - ---- - -> value = RL.EaseCubicOut( float t, float b, float c, float d ) - -Ease cubic out - -- Success return float - ---- - -> value = RL.EaseCubicInOut( float t, float b, float c, float d ) - -Ease cubic in out - -- Success return float - ---- - -## Easings - Quadratic Easing functions - ---- - -> value = RL.EaseQuadIn( float t, float b, float c, float d ) - -Ease quadratic in - -- Success return float - ---- - -> value = RL.EaseQuadOut( float t, float b, float c, float d ) - -Ease quadratic out - -- Success return float - ---- - -> value = RL.EaseQuadInOut( float t, float b, float c, float d ) - -Ease quadratic in out - -- Success return float - ---- - -## Easings - Exponential Easing functions - ---- - -> value = RL.EaseExpoIn( float t, float b, float c, float d ) - -Ease exponential in - -- Success return float - ---- - -> value = RL.EaseExpoOut( float t, float b, float c, float d ) - -Ease exponential out - -- Success return float - ---- - -> value = RL.EaseExpoInOut( float t, float b, float c, float d ) - -Ease exponential in out - -- Success return float - ---- - -## Easings - Back Easing functions - ---- - -> value = RL.EaseBackIn( float t, float b, float c, float d ) - -Ease back in - -- Success return float - ---- - -> value = RL.EaseBackOut( float t, float b, float c, float d ) - -Ease back out - -- Success return float - ---- - -> value = RL.EaseBackInOut( float t, float b, float c, float d ) - -Ease back in out - -- Success return float - ---- - -## Easings - Bounce Easing functions - ---- - -> value = RL.EaseBounceIn( float t, float b, float c, float d ) - -Ease bounce in - -- Success return float - ---- - -> value = RL.EaseBounceOut( float t, float b, float c, float d ) - -Ease bounce out - -- Success return float - ---- - -> value = RL.EaseBounceInOut( float t, float b, float c, float d ) - -Ease bounce in out - -- Success return float - ---- - -## Easings - Elastic Easing functions - ---- - -> value = RL.EaseElasticIn( float t, float b, float c, float d ) - -Ease elastic in - -- Success return float - ---- - -> value = RL.EaseElasticOut( float t, float b, float c, float d ) - -Ease elastic out - -- Success return float - ---- - -> value = RL.EaseElasticInOut( float t, float b, float c, float d ) - -Ease elastic in out - -- Success return float - ---- - -## Bitwise Operations - Arithmetic - ---- - -> result = RL.BitAnd( int a, int b ) - -Equivalent to a & b in C - -- Success return int - ---- - -> result = RL.BitOr( int a, int b ) - -Equivalent to a | b in C - -- Success return int - ---- - -> result = RL.BitXor( int a, int b ) - -Equivalent to a ^ b in C - -- Success return int - ---- - -> result = RL.BitNot( int v ) - -Equivalent to ~v in C - -- Success return int - ---- - -> result = RL.BitShiftLeft( int v, int n ) - -Equivalent to v << n in C - -- Success return int - ---- - -> result = RL.BitShiftRight( int v, int n ) - -Equivalent to v >> n in C - -- Success return int - ---- - -> result = RL.BitSet( int v, int i, bool b ) - -Set bit in index i to state b in value v - -- Success return int - ---- - -> bit = RL.BitGet( int v, int i ) - -Get bit in index i from value v - -- Success return bool - ---- - -> result = RL.BitToggle( int v, int i ) - -Toggle bit in index i in value v - -- Success return int - ---- - -## GLFW Core - Input-related functions: keyboard - ---- - -> keyName = RL.GetKeyName( int key, int scancode ) - -This function returns the name of the specified printable key, encoded as UTF-8. -If the key is KEY_UNKNOWN, the scancode is used to identify the key, -otherwise the scancode is ignored. If you specify a non-printable key, -or KEY_UNKNOWN and a scancode that maps to a non-printable key, -this function returns nil but does not emit an error. - -- Success return string or nil - ---- - -> scancode = RL.GetKeyScancode( int key ) - -This function returns the platform-specific scancode of the specified key. -If the key is KEY_UNKNOWN or does not exist on the keyboard this method will return -1. - -- Success return int - ---- - -## Window events - ---- - -> GLFWwindowsizeEvent = { int type, int width, int height } - -Called when the window is resized. Type GLFW_WINDOW_SIZE_EVENT - ---- - -> GLFWwindowmaximizeEvent = { int type, int maximized } - -Called when the window is maximized or restored. Type GLFW_WINDOW_MAXIMIZE_EVENT - ---- - -> GLFWwindowiconifyEvent = { int type, int iconified } - -Called when the window is iconified or restored. Type GLFW_WINDOW_ICONYFY_EVENT - ---- - -> GLFWwindowfocusEvent = { int type, int focused } - -Called when the window gains or loses input focus. Type GLFW_WINDOW_FOCUS_EVENT - ---- - -> GLFWdropEvent = { int type, int count, string{} paths } - -Called when files are dropped to the window. Type GLFW_WINDOW_DROP_EVENT - ---- - -## Input events - ---- - -> GLFWkeyEvent = { int type, int key, int scancode, int action, int mods } - -Called when a physical key is pressed or released or when it repeats. Type GLFW_KEY_EVENT - ---- - -> GLFWcharEvent = { int type, int key } - -Unicode code points for key events that would have led to regular text input and generally behaves as a standard text field on that platform. Type GLFW_CHAR_EVENT - ---- - -> GLFWmousebuttonEvent = { int type, int button, int action, int mods } - -Called when a mouse button is pressed or released. Type GLFW_MOUSE_BUTTON_EVENT - ---- - -> GLFWcursorposEvent = { int type, float x, float y } - -Called when the cursor moves over the window. Type GLFW_MOUSE_CURSOR_POS_EVENT - ---- - -> GLFWscrollEvent = { int type, float xoffset, float yoffset } - -Called when the user scrolls, whether with a mouse wheel or touchpad gesture. Type GLFW_MOUSE_SCROLL_EVENT - ---- - -> GLFWcursorenterEvent = { int type, int enter } - -Called when the cursor enters or leaves the content area of a window. Type GLFW_CURSOR_ENTER_EVENT - ---- - -> GLFWjoystickEvent = { int type, int jid, int event } - -Called when a joystick is connected or disconnected. Type GLFW_JOYSTICK_EVENT - ---- - -> GLFWpentabletdataEvent = { int type, float x, float y, float z, float pressure, float pitch, float yaw, float roll } - -Called when the pen tablet data is updated. Type GLFW_PEN_TABLET_DATA_EVENT -NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 - ---- - -> GLFWpentabletcursorEvent = { int type, int identifier } - -Called when the pen tablet cursor has changed. Type GLFW_PEN_TABLET_CURSOR_EVENT -NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 - ---- - -> GLFWpentabletproximityEvent = { int type, int proxState } - -Called when the pen tablet proximity has changed. Type GLFW_PEN_TABLET_PROXIMITY_EVENT -NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 - ---- diff --git a/ASSET_LOADING.md b/ASSET_LOADING.md deleted file mode 100644 index a38a264..0000000 --- a/ASSET_LOADING.md +++ /dev/null @@ -1,285 +0,0 @@ -# Asset Loading System - -ReiLua includes a built-in asset loading system with a nice loading screen UI that automatically shows progress while assets are being loaded. - -## 🎨 Features - -- **Automatic Progress Tracking** - Tracks how many assets have been loaded -- **Beautiful Loading UI** - Modern, minimal loading screen with: - - Animated "Loading..." text with dots - - Smooth progress bar with shimmer effect - - Progress percentage (e.g., "3 / 10") - - Current asset name being loaded - - Dark, clean color scheme -- **Easy to Use** - Just 3 functions to show loading progress -- **Works Everywhere** - Development and release builds - -## 📝 API Functions - -### RL.BeginAssetLoading(totalAssets) - -Initialize asset loading progress tracking and show the loading screen. - -**Parameters:** -- `totalAssets` (integer) - Total number of assets to load - -**Example:** -```lua -RL.BeginAssetLoading(10) -- We're loading 10 assets -``` - ---- - -### RL.UpdateAssetLoading(assetName) - -Update the loading progress and display current asset being loaded. - -**Parameters:** -- `assetName` (string) - Name of the asset currently being loaded - -**Example:** -```lua -RL.UpdateAssetLoading("player.png") -``` - -Call this **after** each asset is loaded to update the progress bar. - ---- - -### RL.EndAssetLoading() - -Finish asset loading and hide the loading screen. - -**Example:** -```lua -RL.EndAssetLoading() -``` - -## 🚀 Quick Example - -```lua -function RL.init() - -- List of assets to load - local assetsToLoad = { - "assets/player.png", - "assets/enemy.png", - "assets/background.png", - "assets/music.wav", - } - - -- Begin loading - RL.BeginAssetLoading(#assetsToLoad) - - -- Load each asset - for i, path in ipairs(assetsToLoad) do - RL.UpdateAssetLoading(path) -- Update progress - - -- Load the actual asset - if path:match("%.png$") or path:match("%.jpg$") then - textures[i] = RL.LoadTexture(path) - elseif path:match("%.wav$") or path:match("%.ogg$") then - sounds[i] = RL.LoadSound(path) - end - end - - -- Done! - RL.EndAssetLoading() -end -``` - -## 💡 Complete Example - -```lua -local assets = {} - -local assetsToLoad = { - {type="texture", name="player", path="assets/player.png"}, - {type="texture", name="enemy", path="assets/enemy.png"}, - {type="texture", name="background", path="assets/background.png"}, - {type="sound", name="music", path="assets/music.wav"}, - {type="sound", name="shoot", path="assets/shoot.wav"}, - {type="font", name="title", path="assets/title.ttf"}, -} - -function RL.init() - RL.SetWindowTitle("My Game") - - -- Start loading with progress - RL.BeginAssetLoading(#assetsToLoad) - - -- Load all assets - for i, asset in ipairs(assetsToLoad) do - -- Show current asset name on loading screen - RL.UpdateAssetLoading(asset.name) - - -- Load based on type - if asset.type == "texture" then - assets[asset.name] = RL.LoadTexture(asset.path) - elseif asset.type == "sound" then - assets[asset.name] = RL.LoadSound(asset.path) - elseif asset.type == "font" then - assets[asset.name] = RL.LoadFont(asset.path) - end - end - - -- Loading complete! - RL.EndAssetLoading() - - print("Game ready!") -end - -function RL.update(delta) - -- Your game logic -end - -function RL.draw() - RL.ClearBackground(RL.RAYWHITE) - - -- Use loaded assets - if assets.background then - RL.DrawTexture(assets.background, {0, 0}, RL.WHITE) - end - - if assets.player then - RL.DrawTexture(assets.player, {100, 100}, RL.WHITE) - end -end -``` - -## 🎨 Loading Screen Appearance - -The loading screen features a clean 1-bit pixel art style: - -**Design:** -- Pure black and white aesthetic -- Retro pixel art styling -- Minimal and clean design - -**Elements:** -- **Title**: "LOADING" in bold white pixel text -- **Animated Dots**: White pixelated dots (4x4 squares) that cycle -- **Progress Bar**: - - 200px wide, 16px tall - - Thick 2px white border (pixel art style) - - White fill with black dithering pattern - - Retro/Classic terminal aesthetic -- **Progress Text**: "3/10" in white pixel font style -- **Asset Name**: Current loading asset in small white text -- **Corner Decorations**: White pixel art L-shaped corners in all 4 corners - -**Background:** -- Pure black background (#000000) -- High contrast for maximum clarity - -**Color Palette:** -- White text and UI (#FFFFFF) -- Black background (#000000) -- Pure 1-bit aesthetic (inverted terminal style) - -**Visual Layout:** -``` -[Black Background] - -┌─┐ ┌─┐ -│ │ LOADING □ □ │ │ -│ │ │ │ -│ │ ┌──────────────────┐ │ │ -│ │ │████████░░░░░░░░░░│ 3/10 │ │ -│ │ └──────────────────┘ │ │ -│ │ │ │ -│ │ player.png │ │ -│ │ │ │ -└─┘ └─┘ - -[All text and UI elements in WHITE] -``` - -**Style Inspiration:** -- Classic terminal / console aesthetic -- MS-DOS loading screens -- 1-bit dithering patterns -- Chunky pixel borders -- Retro computing / CRT monitor style - -## 🔧 Customization - -If you want to customize the loading screen appearance, you can modify the colors and sizes in `src/lua_core.c` in the `drawLoadingScreen()` function. - -## ⚡ Performance Tips - -1. **Call UpdateAssetLoading AFTER loading** - This ensures the progress updates at the right time -2. **Load assets in order of importance** - Load critical assets first -3. **Group similar assets** - Load all textures, then sounds, etc. -4. **Use descriptive names** - Shows better feedback to users - -## 📋 Example Asset Loading Patterns - -### Pattern 1: Simple List -```lua -local files = {"player.png", "enemy.png", "music.wav"} -RL.BeginAssetLoading(#files) -for i, file in ipairs(files) do - RL.UpdateAssetLoading(file) - -- load file -end -RL.EndAssetLoading() -``` - -### Pattern 2: With Types -```lua -local assets = { - textures = {"player.png", "enemy.png"}, - sounds = {"music.wav", "shoot.wav"}, -} -local total = #assets.textures + #assets.sounds - -RL.BeginAssetLoading(total) -for _, file in ipairs(assets.textures) do - RL.UpdateAssetLoading(file) - -- load texture -end -for _, file in ipairs(assets.sounds) do - RL.UpdateAssetLoading(file) - -- load sound -end -RL.EndAssetLoading() -``` - -### Pattern 3: Error Handling -```lua -RL.BeginAssetLoading(#files) -for i, file in ipairs(files) do - RL.UpdateAssetLoading(file) - - if RL.FileExists(file) then - -- load file - else - print("Warning: " .. file .. " not found") - end -end -RL.EndAssetLoading() -``` - -## 🎮 When to Use - -**Use the loading system when:** -- You have more than 5-10 assets to load -- Assets are large (images, sounds, fonts) -- Loading might take more than 1 second -- You want polished loading feedback - -**You can skip it when:** -- You have very few, small assets -- Loading is nearly instant -- You prefer immediate game start - -## ✨ Benefits - -- ✅ Polished user experience -- ✅ User knows the game is loading, not frozen -- ✅ Shows progress for large asset sets -- ✅ Works with embedded assets -- ✅ Minimal code required -- ✅ Beautiful default UI - -The loading system makes your game feel polished with just a few lines of code! diff --git a/BUILD_SCRIPTS.md b/BUILD_SCRIPTS.md deleted file mode 100644 index 013f5a5..0000000 --- a/BUILD_SCRIPTS.md +++ /dev/null @@ -1,213 +0,0 @@ -# Build Scripts Documentation - -ReiLua includes automated build scripts for easy development and release builds. - -## Available Scripts - -### Development Build Scripts -- **Windows**: `build_dev.bat` -- **Linux/Unix**: `build_dev.sh` - -### Release Build Scripts -- **Windows**: `build_release.bat` -- **Linux/Unix**: `build_release.sh` - -## Development Build - -### Purpose -Fast iteration during game development with external Lua files and assets. - -### Usage - -**Windows:** -```cmd -build_dev.bat -``` - -**Linux/Unix:** -```bash -chmod +x build_dev.sh -./build_dev.sh -``` - -### Features -- ✅ No embedding - loads Lua and assets from file system -- ✅ Fast build times -- ✅ Edit code and assets without rebuilding -- ✅ Automatic cleanup of embedded files -- ✅ Warns if Lua files or assets are in build directory -- ✅ Optional clean build: `build_dev.bat clean` or `./build_dev.sh clean` - -### Output -- Development executable: `build/ReiLua.exe` -- Run your game: `cd your_game && path/to/build/ReiLua.exe` -- Debug mode: `path/to/build/ReiLua.exe --log` - -## Release Build - -### Purpose -Create a single-file executable for distribution with all code and assets embedded. - -### Preparation - -Before running the release build, prepare your files: - -```bash -cd build - -# Copy all Lua files -copy ..\your_game\*.lua . -# Or: cp ../your_game/*.lua . - -# Copy assets -mkdir assets -copy ..\your_game\assets\* assets\ -# Or: cp -r ../your_game/assets/* assets/ -``` - -### Usage - -**Windows:** -```cmd -build_release.bat -``` - -**Linux/Unix:** -```bash -chmod +x build_release.sh -./build_release.sh -``` - -### Features -- ✅ Embeds all Lua files from `build/` directory -- ✅ Embeds all assets from `build/assets/` folder -- ✅ Creates single-file executable -- ✅ Release optimization enabled -- ✅ Verifies Lua files and assets before building -- ✅ Shows summary of embedded files after build -- ✅ Interactive confirmation before building - -### Output -- Release executable: `build/ReiLua.exe` -- Ready for distribution - no external dependencies -- Can be renamed to your game name - -### Build Configuration - -The release build automatically configures: -- `EMBED_MAIN=ON` - Embeds all Lua files -- `EMBED_ASSETS=ON` - Embeds all assets (if assets folder exists) -- `CMAKE_BUILD_TYPE=Release` - Optimized build - -## Customizing Your Executable - -### Adding Custom Icon - -1. Replace `icon.ico` with your own icon file -2. Keep the same filename or update `resources.rc` -3. Rebuild - -### Changing Executable Properties - -Edit `resources.rc` to customize: - -```rc -VALUE "CompanyName", "Your Studio Name" -VALUE "FileDescription", "Your Game Description" -VALUE "ProductName", "Your Game Name" -VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" -``` - -### Renaming the Executable - -Edit `CMakeLists.txt`: -```cmake -project( YourGameName ) # Line 6 -``` - -After building, the executable will be named `YourGameName.exe`. - -## Workflow Examples - -### Development Workflow - -```bash -# Initial setup -build_dev.bat - -# Edit your Lua files in your game directory -# ... make changes ... - -# Just run - no rebuild needed! -cd your_game -path\to\build\ReiLua.exe - -# If you modify C code, rebuild -build_dev.bat -``` - -### Release Workflow - -```bash -# 1. Prepare files -cd build -copy ..\your_game\*.lua . -mkdir assets -copy ..\your_game\assets\* assets\ - -# 2. Build release -cd .. -build_release.bat - -# 3. Test -cd build -ReiLua.exe --log - -# 4. Distribute -# Copy build\ReiLua.exe to your distribution folder -``` - -## Troubleshooting - -### "CMake configuration failed" -- Ensure CMake is installed and in PATH -- Ensure MinGW is installed and in PATH -- Check `CMakeLists.txt` exists in parent directory - -### "No Lua files found" -- Copy your Lua files to `build/` directory before release build -- Ensure `main.lua` exists (required entry point) - -### "Build failed" -- Check compiler errors in output -- Ensure all dependencies are installed -- Try clean build: `build_dev.bat clean` - -### Development build embedding warning -- The dev build script warns if it finds Lua files or assets in build/ -- These should be removed for development builds -- The script offers to remove them automatically - -## Script Features - -### Safety Features -- Checks for correct directory before running -- Validates required files exist -- Warns about potential issues -- Interactive confirmations for release builds -- Automatic cleanup of old embedded files - -### User Friendly -- Clear progress messages -- Colored output (where supported) -- Helpful error messages -- Pause at end to review results -- Quick reference commands shown after build - -## Notes - -- Development builds are **much faster** than release builds -- Release builds may take longer due to embedding and optimization -- Always test your release build before distribution -- The scripts work on both Windows (CMD/PowerShell) and Unix shells -- On Unix, make scripts executable: `chmod +x build_*.sh` diff --git a/CMakeLists.txt b/CMakeLists.txt index 61d96d9..ad67d96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ set( LOGO_FILES add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/embedded_logo.h - COMMAND python ${CMAKE_SOURCE_DIR}/embed_logo.py + COMMAND python ${CMAKE_SOURCE_DIR}/scripts/embed_logo.py ${CMAKE_CURRENT_BINARY_DIR}/embedded_logo.h ${CMAKE_SOURCE_DIR}/logo/raylib_logo.png ${CMAKE_SOURCE_DIR}/logo/reilua_logo.png @@ -50,7 +50,7 @@ set( FONT_FILE "${CMAKE_SOURCE_DIR}/fonts/Oleaguid.ttf" ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/embedded_font.h - COMMAND python ${CMAKE_SOURCE_DIR}/embed_font.py + COMMAND python ${CMAKE_SOURCE_DIR}/scripts/embed_font.py ${CMAKE_CURRENT_BINARY_DIR}/embedded_font.h ${CMAKE_SOURCE_DIR}/fonts/Oleaguid.ttf DEPENDS ${FONT_FILE} @@ -73,7 +73,7 @@ if( EMBED_MAIN ) if( LUA_FILES ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/embedded_main.h - COMMAND python ${CMAKE_SOURCE_DIR}/embed_lua.py ${CMAKE_CURRENT_BINARY_DIR}/embedded_main.h ${LUA_FILES} + COMMAND python ${CMAKE_SOURCE_DIR}/scripts/embed_lua.py ${CMAKE_CURRENT_BINARY_DIR}/embedded_main.h ${LUA_FILES} DEPENDS ${LUA_FILES} COMMENT "Embedding Lua files into executable..." ) @@ -90,7 +90,7 @@ if( EMBED_ASSETS ) if( ASSET_FILES ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.h - COMMAND python ${CMAKE_SOURCE_DIR}/embed_assets.py ${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.h ${ASSET_FILES} + COMMAND python ${CMAKE_SOURCE_DIR}/scripts/embed_assets.py ${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.h ${ASSET_FILES} DEPENDS ${ASSET_FILES} COMMENT "Embedding asset files into executable..." ) diff --git a/CUSTOMIZATION.md b/CUSTOMIZATION.md deleted file mode 100644 index ab74a33..0000000 --- a/CUSTOMIZATION.md +++ /dev/null @@ -1,401 +0,0 @@ -# Customizing Your ReiLua Executable - -This guide explains how to customize the ReiLua executable with your own branding. - -## Overview - -You can customize: -- Executable name -- Window icon -- File properties (company name, version, description, etc.) -- Splash screen text and logos -- Loading screen appearance - -## Quick Customization Checklist - -- [ ] Change executable name in CMakeLists.txt -- [ ] Replace icon.ico with your game icon -- [ ] Edit resources.rc with your game information -- [ ] Customize splash screens in src/splash.c -- [ ] Replace logo images in logo/ folder -- [ ] Rebuild the project - -## 1. Changing the Executable Name - -The easiest customization - change "ReiLua.exe" to "YourGame.exe". - -### Steps - -1. Open `CMakeLists.txt` -2. Find line 6 (near the top): - ```cmake - project( ReiLua ) - ``` -3. Change to your game name: - ```cmake - project( MyAwesomeGame ) - ``` -4. Rebuild: - ```bash - cd build - cmake .. - cmake --build . --config Release - ``` - -Result: Executable is now named `MyAwesomeGame.exe` - -## 2. Adding a Custom Icon - -Replace the default icon with your game's icon. - -### Requirements - -- **Format**: .ico file (Windows icon format) -- **Recommended sizes**: 16x16, 32x32, 48x48, 256x256 -- **Tools**: Use online converters or tools like IcoFX, GIMP, or Photoshop - -### Steps - -1. Create or convert your image to .ico format -2. Replace `icon.ico` in the ReiLua root folder with your icon -3. Keep the same filename (`icon.ico`) or update `resources.rc`: - ```rc - IDI_ICON1 ICON "your_icon.ico" - ``` -4. Rebuild the project - -**Tip**: Many online tools can convert PNG to ICO: -- https://convertio.co/png-ico/ -- https://www.icoconverter.com/ - -## 3. Customizing Executable Properties - -When users right-click your .exe and select "Properties", they see file information. Customize this to show your game details. - -### Steps - -1. Open `resources.rc` -2. Find the `VERSIONINFO` section -3. Modify these values: - -```rc -1 VERSIONINFO -FILEVERSION 1,0,0,0 // Change version numbers -PRODUCTVERSION 1,0,0,0 // Change product version -FILEFLAGSMASK 0x3fL -FILEFLAGS 0x0L -FILEOS VOS_NT_WINDOWS32 -FILETYPE VFT_APP -FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Your Studio Name" // Your company/studio - VALUE "FileDescription", "Your Game - An awesome game" // Game description - VALUE "FileVersion", "1.0.0.0" // File version string - VALUE "InternalName", "YourGame" // Internal name - VALUE "LegalCopyright", "Copyright (C) 2025 Your Name" // Copyright notice - VALUE "OriginalFilename", "YourGame.exe" // Original filename - VALUE "ProductName", "Your Game" // Product name - VALUE "ProductVersion", "1.0.0.0" // Product version string - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END -``` - -### Common Values - -**FileVersion / ProductVersion Format**: Major, Minor, Patch, Build -- Example: `1,0,0,0` for version 1.0.0.0 -- Example: `2,3,1,5` for version 2.3.1.5 - -**CompanyName Examples**: -- "Your Studio Name" -- "Independent Developer" -- "Your Name Games" - -**FileDescription**: -- Short description users see in file properties -- Example: "Space Adventure Game" -- Example: "Puzzle Game with Physics" - -**LegalCopyright**: -- Standard format: "Copyright (C) Year Your Name" -- Example: "Copyright (C) 2025 Indie Studios" - -4. Rebuild the project - -## 4. Customizing Splash Screens - -Change the text and logos that appear when your game starts. - -### Changing Splash Screen Text - -1. Open `src/splash.c` -2. Find the splash drawing function (around line 150) -3. Change this line: - ```c - const char* text = "YOUR STUDIO NAME"; - ``` - -**Style Tips**: -- Use ALL CAPS for bold impact -- Keep it short (under 30 characters) -- Examples: "INDIE STUDIO GAMES", "MADE BY YOUR NAME", "GAME JAM 2025" - -### Changing Splash Screen Logos - -1. Create or find your logos: - - **Recommended size**: 256x256 pixels or smaller - - **Format**: PNG with transparency - - **Style**: Simple, recognizable logos work best - -2. Replace these files: - ``` - logo/raylib_logo.png → Your game logo - logo/reilua_logo.png → Your studio logo (or keep ReiLua logo as credit) - ``` - -3. Logo sizing: - - Logos are automatically scaled to max 200px - - They display side-by-side on second splash screen - - Maintain aspect ratio - -4. Rebuild the project - logos are automatically embedded - -### Changing Splash Screen Timing - -1. Open `src/splash.c` -2. Modify these constants at the top: - ```c - #define FADE_IN_TIME 0.8f // Seconds to fade in (default: 0.8) - #define DISPLAY_TIME 2.5f // Seconds fully visible (default: 2.5) - #define FADE_OUT_TIME 0.8f // Seconds to fade out (default: 0.8) - ``` - -**Recommendations**: -- Keep fade times between 0.5 - 1.5 seconds -- Display time between 1.5 - 3.5 seconds -- Total splash time ideally under 10 seconds - -### Changing Splash Screen Colors - -1. Open `src/splash.c` -2. Find color definitions: - ```c - // First splash screen background (Raylib red) - Color bgColor = (Color){ 230, 41, 55, 255 }; // Change these RGB values - - // Second splash screen background (Black) - Color bg = BLACK; // Change to any color - ``` - -**Color Examples**: -- White: `(Color){ 255, 255, 255, 255 }` -- Blue: `(Color){ 0, 120, 215, 255 }` -- Dark Gray: `(Color){ 32, 32, 32, 255 }` -- Your brand color: `(Color){ R, G, B, 255 }` - -## 5. Customizing the Loading Screen - -Change the appearance of the asset loading screen. - -### Steps - -1. Open `src/lua_core.c` -2. Find the `drawLoadingScreen()` function -3. Modify colors and style: - -```c -// Background color -Color bgColor = BLACK; // Change background - -// Text color -Color textColor = WHITE; // Change text color - -// Progress bar fill color -Color fillColor = WHITE; // Change bar fill - -// Border color -Color borderColor = WHITE; // Change borders -``` - -### Customizing Loading Text - -```c -// In drawLoadingScreen() function -const char* loadingText = "LOADING"; // Change to "LOADING GAME", etc. -``` - -### Changing Progress Bar Size - -```c -int barWidth = 200; // Default 200px, change as needed -int barHeight = 16; // Default 16px, change as needed -int borderThick = 2; // Border thickness -``` - -## 6. Complete Rebranding Example - -Here's a complete example of rebranding ReiLua as "Space Quest": - -### 1. CMakeLists.txt -```cmake -project( SpaceQuest ) -``` - -### 2. resources.rc -```rc -VALUE "CompanyName", "Cosmic Games Studio" -VALUE "FileDescription", "Space Quest - Explore the Galaxy" -VALUE "FileVersion", "1.0.0.0" -VALUE "InternalName", "SpaceQuest" -VALUE "LegalCopyright", "Copyright (C) 2025 Cosmic Games" -VALUE "OriginalFilename", "SpaceQuest.exe" -VALUE "ProductName", "Space Quest" -VALUE "ProductVersion", "1.0.0.0" -``` - -### 3. icon.ico -Replace with your space-themed icon - -### 4. src/splash.c -```c -const char* text = "COSMIC GAMES STUDIO"; -``` - -### 5. logo/ folder -``` -logo/raylib_logo.png → Your game logo (space ship, planet, etc.) -logo/reilua_logo.png → Studio logo (keep ReiLua logo for credit) -``` - -### 6. Build -```bash -cd build -cmake .. -cmake --build . --config Release -``` - -Result: `SpaceQuest.exe` with all your custom branding! - -## 7. Advanced: Removing ReiLua Branding - -If you want to completely remove ReiLua references: - -### Remove "Made with ReiLua" Logo - -1. Open `src/splash.c` -2. Find `drawMadeWithSplash()` function -3. Comment out or modify the function to only show your logo - -### Remove Second Splash Screen - -1. Open `src/main.c` -2. Find the splash screen loop -3. Modify to only call your custom splash - -**Note**: Please keep attribution to Raylib and ReiLua in your game's credits or about screen as a courtesy! - -## 8. Build and Test - -After making any customizations: - -```bash -# Clean build (recommended after customizations) -cd build -rm -rf * # Or: rmdir /s /q * on Windows -cmake .. -cmake --build . --config Release - -# Test with console -YourGame.exe --log - -# Test production mode -YourGame.exe -``` - -Verify: -- ✅ Executable has correct name -- ✅ Icon appears in file explorer -- ✅ Right-click → Properties shows correct info -- ✅ Splash screens display correctly -- ✅ Loading screen appears as expected - -## Checklist: Release-Ready Customization - -Before releasing your game: - -- [ ] Executable name matches your game -- [ ] Custom icon is recognizable at small sizes -- [ ] File properties are complete and accurate -- [ ] Splash screens show correct studio name -- [ ] Logos are high quality and appropriate size -- [ ] Loading screen matches your game's aesthetic -- [ ] Copyright and legal information is correct -- [ ] Version numbers are accurate -- [ ] Tested on target platforms -- [ ] Credits mention Raylib and ReiLua - -## Tips for Polish - -1. **Consistent Branding**: Use the same colors, fonts, and style across splash screens, loading screen, and in-game UI - -2. **Icon Quality**: Invest time in a good icon - it's the first thing users see - -3. **Version Management**: Update version numbers for each release - -4. **Legal Info**: Always include proper copyright and attribution - -5. **Test Everything**: Test your branded executable on a clean system - -6. **Keep Credits**: Mention Raylib and ReiLua in your game's credits screen - -## Troubleshooting - -**Icon doesn't change:** -- Ensure .ico file is valid -- Rebuild completely (clean build) -- Clear icon cache (Windows): Delete `IconCache.db` - -**Properties don't update:** -- Verify `resources.rc` syntax is correct -- Rebuild completely -- Check that resource compiler ran (check build output) - -**Splash screens don't show changes:** -- Rebuild with clean build -- Check `embed_logo.py` ran successfully -- Verify logo files exist in `logo/` folder - -**Executable name unchanged:** -- Check `CMakeLists.txt` project name -- Do a clean rebuild -- Verify cmake configuration step succeeded - -## Additional Resources - -### Icon Creation Tools -- **IcoFX**: Icon editor (paid) -- **GIMP**: Free, supports ICO export -- **Online**: convertio.co, icoconverter.com - -### Image Editing -- **GIMP**: Free, powerful image editor -- **Paint.NET**: Simple, free Windows editor -- **Photoshop**: Industry standard (paid) - -### Color Picking -- **ColorPicker**: Use system color picker -- **HTML Color Codes**: htmlcolorcodes.com -- **Adobe Color**: color.adobe.com - ---- - -Now your ReiLua executable is fully branded and ready to represent your game! diff --git a/DOCUMENTATION_INDEX.md b/DOCUMENTATION_INDEX.md deleted file mode 100644 index b927a29..0000000 --- a/DOCUMENTATION_INDEX.md +++ /dev/null @@ -1,213 +0,0 @@ -# Documentation Overview - -This document provides a quick reference to all available documentation for ReiLua Enhanced Edition. - -## Core Documentation - -### 📘 [README.md](README.md) - **START HERE** -The main documentation covering: -- What is ReiLua Enhanced Edition -- Complete attributions (Raylib, ReiLua, enhancements) -- Quick start guide -- All enhanced features overview -- Command line options -- Building from source (Windows, Linux, Mac, Raspberry Pi, Web) -- Complete release workflow -- Troubleshooting - -**Read this first!** - ---- - -## Feature-Specific Guides - -### 🎨 [SPLASH_SCREENS.md](SPLASH_SCREENS.md) -Everything about splash screens: -- How the dual splash screen system works -- Custom text splash screen details -- "Made using Raylib + ReiLua" screen details -- Skipping splashes with `--no-logo` flag -- Customizing text, logos, timing, and colors -- Technical implementation details -- Troubleshooting splash screen issues - -### 📦 [EMBEDDING.md](EMBEDDING.md) -Complete guide to embedding: -- Development vs release workflows -- Embedding Lua files (`EMBED_MAIN=ON`) -- Embedding assets (`EMBED_ASSETS=ON`) -- Console control with `--log` flag -- Complete release build workflow -- Asset path consistency -- Troubleshooting embedding issues - -### 📊 [ASSET_LOADING.md](ASSET_LOADING.md) -Asset loading system documentation: -- API functions (`BeginAssetLoading`, `UpdateAssetLoading`, `EndAssetLoading`) -- Beautiful 1-bit pixel art loading screen -- Complete examples -- Loading patterns -- Progress tracking -- When to use the loading system -- Customization options - -### 🔧 [BUILD_SCRIPTS.md](BUILD_SCRIPTS.md) -Build automation documentation: -- `build_dev.bat` / `build_dev.sh` - Development builds -- `build_release.bat` / `build_release.sh` - Release builds -- Features of each build type -- Workflow examples -- Customizing executable name, icon, and properties -- Troubleshooting build issues - -### 🎨 [CUSTOMIZATION.md](CUSTOMIZATION.md) -Complete rebranding guide: -- Changing executable name -- Adding custom icon -- Customizing file properties (company name, version, etc.) -- Customizing splash screens -- Customizing loading screen -- Complete rebranding example -- Removing ReiLua branding (with attribution notes) - -### 💻 [ZED_EDITOR_SETUP.md](ZED_EDITOR_SETUP.md) -Complete Zed editor setup: -- Why Zed for ReiLua development -- Installation guide -- Lua Language Server configuration -- Project setup with `.zed/settings.json` -- Task configuration for quick testing -- Essential keyboard shortcuts -- Multi-cursor editing, split views, Vim mode -- Troubleshooting LSP issues -- Workflow tips and best practices - ---- - -## Technical Documentation - -### 📚 [API.md](API.md) -Complete API reference: -- 1000+ functions -- All ReiLua/Raylib bindings -- Function signatures -- Raygui, Raymath, Lights, Easings, RLGL modules - -### 📝 [ReiLua_API.lua](ReiLua_API.lua) -Lua annotations file: -- Provides autocomplete in LSP-enabled editors -- Function documentation -- Copy to your project for IDE support - -### 🔄 [UPGRADE_SUMMARY.md](UPGRADE_SUMMARY.md) -Technical implementation details: -- Features added in this enhanced version -- Files modified and added -- Build options explained -- Testing checklist -- Known changes from original ReiLua - ---- - -## Quick Reference by Task - -### "I want to start making a game" -1. Read [README.md](README.md) - Quick Start section -2. Look at examples in `examples/` folder -3. Use `ReiLua.exe --log --no-logo` for development - -### "I want to embed my game into a single .exe" -1. Read [EMBEDDING.md](EMBEDDING.md) -2. Use `build_release.bat` / `build_release.sh` -3. Follow the complete release workflow in [README.md](README.md) - -### "I want to add a loading screen" -1. Read [ASSET_LOADING.md](ASSET_LOADING.md) -2. Use `RL.BeginAssetLoading()`, `RL.UpdateAssetLoading()`, `RL.EndAssetLoading()` -3. See complete examples in the guide - -### "I want to customize splash screens" -1. Read [SPLASH_SCREENS.md](SPLASH_SCREENS.md) -2. Edit `src/splash.c` for text changes -3. Replace logo files in `logo/` folder -4. Rebuild project - -### "I want to rebrand the executable" -1. Read [CUSTOMIZATION.md](CUSTOMIZATION.md) -2. Change project name in `CMakeLists.txt` -3. Replace `icon.ico` -4. Edit `resources.rc` -5. Customize splash screens -6. Rebuild - -### "I want to setup my code editor" -1. Read [ZED_EDITOR_SETUP.md](ZED_EDITOR_SETUP.md) -2. Install Zed and Lua Language Server -3. Copy `ReiLua_API.lua` to your project -4. Create `.zed/settings.json` configuration -5. Set up tasks for quick testing - -### "I want to build ReiLua from source" -1. Read [README.md](README.md) - Building from Source section -2. Install prerequisites (CMake, compiler, Raylib, Lua) -3. Use `build_dev.bat` for development -4. Use `build_release.bat` for release - -### "I need API reference" -1. Open [API.md](API.md) -2. Search for function name -3. See function signature and description -4. Or copy [ReiLua_API.lua](ReiLua_API.lua) for autocomplete - ---- - -## Documentation File Sizes - -| File | Size | Purpose | -|------|------|---------| -| README.md | 21 KB | Main documentation (START HERE) | -| ZED_EDITOR_SETUP.md | 13 KB | Editor setup guide | -| CUSTOMIZATION.md | 11 KB | Rebranding guide | -| ASSET_LOADING.md | 8 KB | Loading system guide | -| EMBEDDING.md | 7 KB | Embedding guide | -| SPLASH_SCREENS.md | 7 KB | Splash screen guide | -| UPGRADE_SUMMARY.md | 6 KB | Technical details | -| BUILD_SCRIPTS.md | 5 KB | Build automation guide | -| API.md | 207 KB | Complete API reference | - ---- - -## Contribution - -When adding new features, please: -1. Update relevant documentation -2. Add examples where appropriate -3. Update this overview if adding new docs -4. Test documentation accuracy - ---- - -## Documentation Standards - -All documentation follows these standards: -- ✅ Clear headings and structure -- ✅ Code examples for all features -- ✅ Troubleshooting sections -- ✅ Cross-references to related docs -- ✅ Platform-specific notes where needed -- ✅ Emoji icons for visual scanning -- ✅ Complete but concise - ---- - -## Quick Links - -- **Original ReiLua**: https://github.com/Gamerfiend/ReiLua -- **Raylib**: https://github.com/raysan5/raylib -- **Lua**: https://www.lua.org/ -- **Zed Editor**: https://zed.dev/ - ---- - -**Last Updated**: 2025-01-03 -**Documentation Version**: 1.0 (Enhanced Edition) diff --git a/EMBEDDING.md b/EMBEDDING.md deleted file mode 100644 index 13f3752..0000000 --- a/EMBEDDING.md +++ /dev/null @@ -1,289 +0,0 @@ -# Embedding main.lua into Executable - -When you're ready to ship your game, you can embed all Lua files and asset files directly into the executable. - -## Development vs Release Workflow - -### 🔧 Development Build (Fast Iteration) - -During development, use external files for quick iteration: - -**Setup:** -``` -GameFolder/ -├── ReiLua.exe -├── main.lua -├── player.lua -└── assets/ - ├── player.png - └── music.wav -``` - -**Build:** -```bash -cd build -cmake .. -cmake --build . -``` - -**Benefits:** -- ✅ Edit Lua files and re-run immediately -- ✅ Edit assets and reload -- ✅ Fast development cycle -- ✅ Debug with `--log` flag - -### 📦 Release Build (Single Executable) - -For distribution, embed everything into one file: - -**Setup:** -```bash -cd build - -# Copy Lua files to build directory -copy ..\main.lua . -copy ..\player.lua . - -# Create assets folder and copy files -mkdir assets -copy ..\player.png assets\ -copy ..\music.wav assets\ -``` - -**Build:** -```bash -# Configure with embedding -cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON - -# Build release -cmake --build . --config Release -``` - -**Result:** -``` -Distribution/ -└── YourGame.exe (Everything embedded!) -``` - -**Benefits:** -- ✅ Single executable file -- ✅ No external dependencies -- ✅ Users can't modify game files -- ✅ Smaller download (no separate files) - -## Quick Start - -### Embedding Lua Files - -1. **Copy your Lua files to the build directory**: - ```bash - copy main.lua build\main.lua - copy player.lua build\player.lua - ``` - -2. **Build with EMBED_MAIN option**: - ```bash - cd build - cmake .. -DEMBED_MAIN=ON - cmake --build . --config Release - ``` - -## Command Line Options - -ReiLua supports several command-line options: - -```bash -ReiLua [Options] [Directory to main.lua or main] - -Options: - -h, --help Show help message - -v, --version Show ReiLua version - -i, --interpret Interpret mode [File name] - --log Show console window for logging (Windows only) -``` - -### Console/Logging - -By default, ReiLua runs **without a console window** for a clean user experience. To enable console output for debugging: - -```bash -# Run with console for debugging -ReiLua.exe --log - -# You can also combine with other options -ReiLua.exe --log path/to/game - -# Or with interpret mode -ReiLua.exe --log -i script.lua -``` - -This is useful during development to see: -- TraceLog output -- Print statements -- Lua errors -- Debug information - -## Complete Release Workflow - -Here's a complete step-by-step guide to prepare your game for release: - -### Step 1: Organize Your Project - -Ensure your project has this structure: -``` -MyGame/ -├── main.lua -├── player.lua -├── enemy.lua -├── player.png -├── enemy.png -├── music.wav -└── icon.ico (optional) -``` - -### Step 2: Customize Branding (Optional) - -**Change executable icon:** -```bash -# Replace ReiLua's icon with yours -copy MyGame\icon.ico ReiLua\icon.ico -``` - -**Edit executable properties:** -Open `ReiLua\resources.rc` and modify: -```rc -VALUE "CompanyName", "Your Studio Name" -VALUE "FileDescription", "Your Game Description" -VALUE "ProductName", "Your Game Name" -VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" -``` - -**Change executable name:** -Edit `ReiLua\CMakeLists.txt`: -```cmake -project( YourGameName ) # Change from "ReiLua" -``` - -See [CUSTOMIZATION.md](CUSTOMIZATION.md) for full details. - -### Important: Asset Paths - -**Keep your paths consistent!** The embedding system now preserves the `assets/` prefix, so use the same paths in both development and release: - -```lua --- ✅ Correct - works in both dev and release -playerImage = RL.LoadTexture("assets/player.png") -backgroundImg = RL.LoadTexture("assets/background.png") -musicSound = RL.LoadSound("assets/music.wav") -``` - -Your Lua code doesn't need to change between development and release builds! - -### Step 3: Prepare Build Directory - -```bash -cd ReiLua\build - -# Copy all Lua files -copy ..\MyGame\*.lua . - -# Create assets folder -mkdir assets - -# Copy all asset files (images, sounds, etc.) -copy ..\MyGame\*.png assets\ -copy ..\MyGame\*.wav assets\ -copy ..\MyGame\*.ogg assets\ -# Or copy entire folders -xcopy /E /I ..\MyGame\images assets\images -xcopy /E /I ..\MyGame\sounds assets\sounds -``` - -### Step 4: Build Release - -```bash -# Configure with embedding enabled -cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON - -# Build in release mode -cmake --build . --config Release -``` - -### Step 5: Test Release Build - -```bash -# Test with console to verify everything loaded -YourGameName.exe --log - -# Test production mode (no console) -YourGameName.exe -``` - -Check console output for: -- ✅ "ReiLua x.x.x" version info -- ✅ No file loading errors -- ✅ Game runs correctly - -### Step 6: Package for Distribution - -```bash -# Create distribution folder -mkdir ..\Distribution -copy YourGameName.exe ..\Distribution\ - -# Optional: Add README, LICENSE, etc. -copy ..\README.txt ..\Distribution\ -``` - -Your game is now ready to distribute as a single executable! - -### Workflow Summary - -| Stage | Build Command | Files Needed | Result | -|-------|--------------|--------------|--------| -| **Development** | `cmake .. && cmake --build .` | Lua + assets external | Fast iteration | -| **Testing** | `cmake .. -DEMBED_MAIN=ON && cmake --build .` | Lua in build/ | Test embedding | -| **Release** | `cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON && cmake --build . --config Release` | Lua + assets in build/ | Single .exe | - -### Troubleshooting - -**Problem: "No .lua files found in build directory"** -```bash -# Solution: Copy Lua files to build directory -copy ..\*.lua . -``` - -**Problem: "No files found in assets folder"** -```bash -# Solution: Create assets folder and copy files -mkdir assets -copy ..\*.png assets\ -``` - -**Problem: Game crashes on startup** -```bash -# Solution: Run with --log to see error messages -YourGameName.exe --log -``` - -**Problem: Assets not loading** -- Verify assets are in `build/assets/` before building -- Check asset filenames match in your Lua code -- Use `--log` to see loading errors - -### Notes - -- `.lua` files in the **build directory root** are embedded when using `EMBED_MAIN=ON` -- Asset files in **build/assets/** folder (and subfolders) are embedded when using `EMBED_ASSETS=ON` -- `main.lua` must exist and is always the entry point -- Asset embedding works with subdirectories: `assets/images/player.png` → Load with `LoadImage("player.png")` -- Both Lua and asset embedding can be used independently or together -- The system falls back to file system if embedded file is not found -- No code changes needed - all raylib functions work automatically with embedded assets - -## Customizing Your Executable - -Want to add your own icon and version info to the executable? See [CUSTOMIZATION.md](CUSTOMIZATION.md) for details on: -- Adding a custom icon -- Setting exe properties (company name, version, description) -- Renaming the executable diff --git a/README.md b/README.md index e0abe52..e9ca0f8 100644 --- a/README.md +++ b/README.md @@ -297,11 +297,11 @@ One-command builds for development and release: **Development Build (Fast Iteration):** ```bash # Windows -build_dev.bat +scripts\build_dev.bat # Linux/Unix -chmod +x build_dev.sh -./build_dev.sh +chmod +x scripts/build_dev.sh +scripts/build_dev.sh ``` - No embedding - Fast build times @@ -319,10 +319,10 @@ copy ..\your_game\assets\* assets\ cd .. # Windows -build_release.bat +scripts\build_release.bat # Linux/Unix -./build_release.sh +scripts/build_release.sh ``` - Embeds all Lua files - Embeds all assets @@ -389,10 +389,10 @@ The given file will be called with `dofile`. Generate API.md and ReiLua_API.lua from the build folder: ```bash -ReiLua -i ../docgen.lua +ReiLua -i ../tools/docgen.lua ``` -**Tip:** Use ReiLua_API.lua in your project folder to provide annotations when using "Lua Language Server". +**Tip:** Use tools/ReiLua_API.lua in your project folder to provide annotations when using "Lua Language Server". ## Building from Source @@ -456,7 +456,7 @@ copy liblua.a path\to\ReiLua\lib\ **Quick Method (Recommended):** ```bash cd ReiLua -build_dev.bat +scripts\build_dev.bat ``` **Manual Method:** @@ -494,8 +494,8 @@ Move both `.a` files to the `ReiLua/lib` folder. **Quick Method (Recommended):** ```bash cd ReiLua -chmod +x build_dev.sh -./build_dev.sh +chmod +x scripts/build_dev.sh +scripts/build_dev.sh ``` **Manual Method:** @@ -639,8 +639,8 @@ copy ..\MyGame\assets\* assets\ ```bash cd .. -build_release.bat -# Or: ./build_release.sh on Linux +scripts\build_release.bat +# Or: scripts/build_release.sh on Linux ``` ### Step 4: Test @@ -750,10 +750,10 @@ Create `.zed/settings.json` in your project root: ### Copy ReiLua API Definitions -Copy `ReiLua_API.lua` to your project folder. This provides autocomplete and documentation for all ReiLua functions. +Copy `tools/ReiLua_API.lua` to your project folder. This provides autocomplete and documentation for all ReiLua functions. ```bash -copy path\to\ReiLua\ReiLua_API.lua your_game\ +copy path\to\ReiLua\tools\ReiLua_API.lua your_game\ ``` ### Keyboard Shortcuts @@ -832,8 +832,8 @@ path\to\ReiLua.exe --log --no-logo ### Quick References -- **API.md** - All ReiLua/Raylib functions -- **ReiLua_API.lua** - Lua annotations for IDE autocomplete +- **docs/API.md** - All ReiLua/Raylib functions +- **tools/ReiLua_API.lua** - Lua annotations for IDE autocomplete - **examples/** - Example games and demos ## Troubleshooting @@ -868,7 +868,7 @@ path\to\ReiLua.exe --log --no-logo **Build fails:** - Check CMake and compiler are installed and in PATH - Verify `libraylib.a` and `liblua.a` are in `lib/` folder -- Try clean build: `build_dev.bat clean` +- Try clean build: `scripts\build_dev.bat clean` ### Getting Help diff --git a/ReiLua_API.lua b/ReiLua_API.lua deleted file mode 100644 index 1ba8b71..0000000 --- a/ReiLua_API.lua +++ /dev/null @@ -1,9054 +0,0 @@ --- Put this file into your project folder to provide annotations when using Lua language server. - -RL={} - --- Functions. - ----This function will be called after window has been initialized. Should be used as the main init point. -function RL.init() end ----This function will be called every frame during execution. It will get time duration from last frame on argument 'delta' ----@param delta number -function RL.update( delta ) end ----This function will be called every frame after update and it should have all rendering related functions. Note: Engine will call Raylib functions 'BeginDrawing()' before this function call and 'EndDrawing()' after it. You can still use RL.BeginDrawing() and RL.EndDrawing() manually from anywhere. -function RL.draw() end ----This function will be called on events input. Content of event table is determined by event type. ----@param event table -function RL.event( event ) end ----This function can be used for custom log message handling. ----@param logLevel integer ----@param message string -function RL.log( logLevel, message ) end ----This function will be called on program close. Cleanup could be done here. -function RL.exit() end ----This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point. -function RL.config() end - --- Defines - System/Window config flags - ----Set to try enabling V-Sync on GPU -RL.FLAG_VSYNC_HINT=64 ----Set to run program in fullscreen -RL.FLAG_FULLSCREEN_MODE=2 ----Set to allow resizable window -RL.FLAG_WINDOW_RESIZABLE=4 ----Set to disable window decoration (frame and buttons) -RL.FLAG_WINDOW_UNDECORATED=8 ----Set to hide window -RL.FLAG_WINDOW_HIDDEN=128 ----Set to minimize window (iconify) -RL.FLAG_WINDOW_MINIMIZED=512 ----Set to maximize window (expanded to monitor) -RL.FLAG_WINDOW_MAXIMIZED=1024 ----Set to window non focused -RL.FLAG_WINDOW_UNFOCUSED=2048 ----Set to window always on top -RL.FLAG_WINDOW_TOPMOST=4096 ----Set to allow windows running while minimized -RL.FLAG_WINDOW_ALWAYS_RUN=256 ----Set to allow transparent framebuffer -RL.FLAG_WINDOW_TRANSPARENT=16 ----Set to support HighDPI -RL.FLAG_WINDOW_HIGHDPI=8192 ----Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED -RL.FLAG_WINDOW_MOUSE_PASSTHROUGH=16384 ----Set to try enabling MSAA 4X -RL.FLAG_MSAA_4X_HINT=32 ----Set to try enabling interlaced video format (for V3D) -RL.FLAG_INTERLACED_HINT=65536 - --- Defines - Trace log level - ----Display all logs -RL.LOG_ALL=0 ----Trace logging, intended for internal use only -RL.LOG_TRACE=1 ----Debug logging, used for internal debugging, it should be disabled on release builds -RL.LOG_DEBUG=2 ----Info logging, used for program execution info -RL.LOG_INFO=3 ----Warning logging, used on recoverable failures -RL.LOG_WARNING=4 ----Error logging, used on unrecoverable failures -RL.LOG_ERROR=5 ----Fatal logging, used to abort program: exit(EXIT_FAILURE) -RL.LOG_FATAL=6 ----Disable logging -RL.LOG_NONE=7 - --- Defines - Keyboard keys (US keyboard layout) - ----Key: NULL, used for no key pressed -RL.KEY_NULL=0 ----Key: ' -RL.KEY_APOSTROPHE=39 ----Key: , -RL.KEY_COMMA=44 ----Key: - -RL.KEY_MINUS=45 ----Key: . -RL.KEY_PERIOD=46 ----Key: / -RL.KEY_SLASH=47 ----Key: 0 -RL.KEY_ZERO=48 ----Key: 1 -RL.KEY_ONE=49 ----Key: 2 -RL.KEY_TWO=50 ----Key: 3 -RL.KEY_THREE=51 ----Key: 4 -RL.KEY_FOUR=52 ----Key: 5 -RL.KEY_FIVE=53 ----Key: 6 -RL.KEY_SIX=54 ----Key: 7 -RL.KEY_SEVEN=55 ----Key: 8 -RL.KEY_EIGHT=56 ----Key: 9 -RL.KEY_NINE=57 ----Key: ; -RL.KEY_SEMICOLON=59 ----Key: = -RL.KEY_EQUAL=61 ----Key: A | a -RL.KEY_A=65 ----Key: B | b -RL.KEY_B=66 ----Key: C | c -RL.KEY_C=67 ----Key: D | d -RL.KEY_D=68 ----Key: E | e -RL.KEY_E=69 ----Key: F | f -RL.KEY_F=70 ----Key: G | g -RL.KEY_G=71 ----Key: H | h -RL.KEY_H=72 ----Key: I | i -RL.KEY_I=73 ----Key: J | j -RL.KEY_J=74 ----Key: K | k -RL.KEY_K=75 ----Key: L | l -RL.KEY_L=76 ----Key: M | m -RL.KEY_M=77 ----Key: N | n -RL.KEY_N=78 ----Key: O | o -RL.KEY_O=79 ----Key: P | p -RL.KEY_P=80 ----Key: Q | q -RL.KEY_Q=81 ----Key: R | r -RL.KEY_R=82 ----Key: S | s -RL.KEY_S=83 ----Key: T | t -RL.KEY_T=84 ----Key: U | u -RL.KEY_U=85 ----Key: V | v -RL.KEY_V=86 ----Key: W | w -RL.KEY_W=87 ----Key: X | x -RL.KEY_X=88 ----Key: Y | y -RL.KEY_Y=89 ----Key: Z | z -RL.KEY_Z=90 ----Key: [ -RL.KEY_LEFT_BRACKET=91 ----Key: '\' -RL.KEY_BACKSLASH=92 ----Key: ] -RL.KEY_RIGHT_BRACKET=93 ----Key: ` -RL.KEY_GRAVE=96 ----Key: Space -RL.KEY_SPACE=32 ----Key: Esc -RL.KEY_ESCAPE=256 ----Key: Enter -RL.KEY_ENTER=257 ----Key: Tab -RL.KEY_TAB=258 ----Key: Backspace -RL.KEY_BACKSPACE=259 ----Key: Ins -RL.KEY_INSERT=260 ----Key: Del -RL.KEY_DELETE=261 ----Key: Cursor right -RL.KEY_RIGHT=262 ----Key: Cursor left -RL.KEY_LEFT=263 ----Key: Cursor down -RL.KEY_DOWN=264 ----Key: Cursor up -RL.KEY_UP=265 ----Key: Page up -RL.KEY_PAGE_UP=266 ----Key: Page down -RL.KEY_PAGE_DOWN=267 ----Key: Home -RL.KEY_HOME=268 ----Key: End -RL.KEY_END=269 ----Key: Caps lock -RL.KEY_CAPS_LOCK=280 ----Key: Scroll down -RL.KEY_SCROLL_LOCK=281 ----Key: Num lock -RL.KEY_NUM_LOCK=282 ----Key: Print screen -RL.KEY_PRINT_SCREEN=283 ----Key: Pause -RL.KEY_PAUSE=284 ----Key: F1 -RL.KEY_F1=290 ----Key: F2 -RL.KEY_F2=291 ----Key: F3 -RL.KEY_F3=292 ----Key: F4 -RL.KEY_F4=293 ----Key: F5 -RL.KEY_F5=294 ----Key: F6 -RL.KEY_F6=295 ----Key: F7 -RL.KEY_F7=296 ----Key: F8 -RL.KEY_F8=297 ----Key: F9 -RL.KEY_F9=298 ----Key: F10 -RL.KEY_F10=299 ----Key: F11 -RL.KEY_F11=300 ----Key: F12 -RL.KEY_F12=301 ----Key: Shift left -RL.KEY_LEFT_SHIFT=340 ----Key: Control left -RL.KEY_LEFT_CONTROL=341 ----Key: Alt left -RL.KEY_LEFT_ALT=342 ----Key: Super left -RL.KEY_LEFT_SUPER=343 ----Key: Shift right -RL.KEY_RIGHT_SHIFT=344 ----Key: Control right -RL.KEY_RIGHT_CONTROL=345 ----Key: Alt right -RL.KEY_RIGHT_ALT=346 ----Key: Super right -RL.KEY_RIGHT_SUPER=347 ----Key: KB menu -RL.KEY_KB_MENU=348 ----Key: Keypad 0 -RL.KEY_KP_0=320 ----Key: Keypad 1 -RL.KEY_KP_1=321 ----Key: Keypad 2 -RL.KEY_KP_2=322 ----Key: Keypad 3 -RL.KEY_KP_3=323 ----Key: Keypad 4 -RL.KEY_KP_4=324 ----Key: Keypad 5 -RL.KEY_KP_5=325 ----Key: Keypad 6 -RL.KEY_KP_6=326 ----Key: Keypad 7 -RL.KEY_KP_7=327 ----Key: Keypad 8 -RL.KEY_KP_8=328 ----Key: Keypad 9 -RL.KEY_KP_9=329 ----Key: Keypad . -RL.KEY_KP_DECIMAL=330 ----Key: Keypad / -RL.KEY_KP_DIVIDE=331 ----Key: Keypad * -RL.KEY_KP_MULTIPLY=332 ----Key: Keypad - -RL.KEY_KP_SUBTRACT=333 ----Key: Keypad + -RL.KEY_KP_ADD=334 ----Key: Keypad Enter -RL.KEY_KP_ENTER=335 ----Key: Keypad = -RL.KEY_KP_EQUAL=336 ----Key: Android back button -RL.KEY_BACK=4 ----Key: Android menu button -RL.KEY_MENU=5 ----Key: Android volume up button -RL.KEY_VOLUME_UP=24 ----Key: Android volume down button -RL.KEY_VOLUME_DOWN=25 - --- Defines - Mouse buttons - ----Mouse button left -RL.MOUSE_BUTTON_LEFT=0 ----Mouse button right -RL.MOUSE_BUTTON_RIGHT=1 ----Mouse button middle (pressed wheel) -RL.MOUSE_BUTTON_MIDDLE=2 ----Mouse button side (advanced mouse device) -RL.MOUSE_BUTTON_SIDE=3 ----Mouse button extra (advanced mouse device) -RL.MOUSE_BUTTON_EXTRA=4 ----Mouse button forward (advanced mouse device) -RL.MOUSE_BUTTON_FORWARD=5 ----Mouse button back (advanced mouse device) -RL.MOUSE_BUTTON_BACK=6 - --- Defines - Mouse cursor - ----Default pointer shape -RL.MOUSE_CURSOR_DEFAULT=0 ----Arrow shape -RL.MOUSE_CURSOR_ARROW=1 ----Text writing cursor shape -RL.MOUSE_CURSOR_IBEAM=2 ----Cross shape -RL.MOUSE_CURSOR_CROSSHAIR=3 ----Pointing hand cursor -RL.MOUSE_CURSOR_POINTING_HAND=4 ----Horizontal resize/move arrow shape -RL.MOUSE_CURSOR_RESIZE_EW=5 ----Vertical resize/move arrow shape -RL.MOUSE_CURSOR_RESIZE_NS=6 ----Top-left to bottom-right diagonal resize/move arrow shape -RL.MOUSE_CURSOR_RESIZE_NWSE=7 ----The top-right to bottom-left diagonal resize/move arrow shape -RL.MOUSE_CURSOR_RESIZE_NESW=8 ----The omnidirectional resize/move cursor shape -RL.MOUSE_CURSOR_RESIZE_ALL=9 ----The operation-not-allowed shape -RL.MOUSE_CURSOR_NOT_ALLOWED=10 - --- Defines - Gamepad buttons - ----Unknown button, just for error checking -RL.GAMEPAD_BUTTON_UNKNOWN=0 ----Gamepad left DPAD up button -RL.GAMEPAD_BUTTON_LEFT_FACE_UP=1 ----Gamepad left DPAD right button -RL.GAMEPAD_BUTTON_LEFT_FACE_RIGHT=2 ----Gamepad left DPAD down button -RL.GAMEPAD_BUTTON_LEFT_FACE_DOWN=3 ----Gamepad left DPAD left button -RL.GAMEPAD_BUTTON_LEFT_FACE_LEFT=4 ----Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) -RL.GAMEPAD_BUTTON_RIGHT_FACE_UP=5 ----Gamepad right button right (i.e. PS3: Square, Xbox: X) -RL.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT=6 ----Gamepad right button down (i.e. PS3: Cross, Xbox: A) -RL.GAMEPAD_BUTTON_RIGHT_FACE_DOWN=7 ----Gamepad right button left (i.e. PS3: Circle, Xbox: B) -RL.GAMEPAD_BUTTON_RIGHT_FACE_LEFT=8 ----Gamepad top/back trigger left (first), it could be a trailing button -RL.GAMEPAD_BUTTON_LEFT_TRIGGER_1=9 ----Gamepad top/back trigger left (second), it could be a trailing button -RL.GAMEPAD_BUTTON_LEFT_TRIGGER_2=10 ----Gamepad top/back trigger right (one), it could be a trailing button -RL.GAMEPAD_BUTTON_RIGHT_TRIGGER_1=11 ----Gamepad top/back trigger right (second), it could be a trailing button -RL.GAMEPAD_BUTTON_RIGHT_TRIGGER_2=12 ----Gamepad center buttons, left one (i.e. PS3: Select) -RL.GAMEPAD_BUTTON_MIDDLE_LEFT=13 ----Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) -RL.GAMEPAD_BUTTON_MIDDLE=14 ----Gamepad center buttons, right one (i.e. PS3: Start) -RL.GAMEPAD_BUTTON_MIDDLE_RIGHT=15 ----Gamepad joystick pressed button left -RL.GAMEPAD_BUTTON_LEFT_THUMB=16 ----Gamepad joystick pressed button right -RL.GAMEPAD_BUTTON_RIGHT_THUMB=17 - --- Defines - Gamepad axis - ----Gamepad left stick X axis -RL.GAMEPAD_AXIS_LEFT_X=0 ----Gamepad left stick Y axis -RL.GAMEPAD_AXIS_LEFT_Y=1 ----Gamepad right stick X axis -RL.GAMEPAD_AXIS_RIGHT_X=2 ----Gamepad right stick Y axis -RL.GAMEPAD_AXIS_RIGHT_Y=3 ----Gamepad back trigger left, pressure level: [1..-1] -RL.GAMEPAD_AXIS_LEFT_TRIGGER=4 ----Gamepad back trigger right, pressure level: [1..-1] -RL.GAMEPAD_AXIS_RIGHT_TRIGGER=5 - --- Defines - Material map index - ----Albedo material (same as: MATERIAL_MAP_DIFFUSE) -RL.MATERIAL_MAP_ALBEDO=0 ----Metalness material (same as: MATERIAL_MAP_SPECULAR) -RL.MATERIAL_MAP_METALNESS=1 ----Normal material -RL.MATERIAL_MAP_NORMAL=2 ----Roughness material -RL.MATERIAL_MAP_ROUGHNESS=3 ----Ambient occlusion material -RL.MATERIAL_MAP_OCCLUSION=4 ----Emission material -RL.MATERIAL_MAP_EMISSION=5 ----Heightmap material -RL.MATERIAL_MAP_HEIGHT=6 ----Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) -RL.MATERIAL_MAP_CUBEMAP=7 ----Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) -RL.MATERIAL_MAP_IRRADIANCE=8 ----Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) -RL.MATERIAL_MAP_PREFILTER=9 ----Brdf material -RL.MATERIAL_MAP_BRDF=10 ----Diffuce material (same as: MATERIAL_MAP_ALBEDO) -RL.MATERIAL_MAP_DIFFUSE=0 ----Specular material (same as: MATERIAL_MAP_METALNESS) -RL.MATERIAL_MAP_SPECULAR=1 - --- Defines - Shader location index - ----Shader location: vertex attribute: position -RL.SHADER_LOC_VERTEX_POSITION=0 ----Shader location: vertex attribute: texcoord01 -RL.SHADER_LOC_VERTEX_TEXCOORD01=1 ----Shader location: vertex attribute: texcoord02 -RL.SHADER_LOC_VERTEX_TEXCOORD02=2 ----Shader location: vertex attribute: normal -RL.SHADER_LOC_VERTEX_NORMAL=3 ----Shader location: vertex attribute: tangent -RL.SHADER_LOC_VERTEX_TANGENT=4 ----Shader location: vertex attribute: color -RL.SHADER_LOC_VERTEX_COLOR=5 ----Shader location: matrix uniform: model-view-projection -RL.SHADER_LOC_MATRIX_MVP=6 ----Shader location: matrix uniform: view (camera transform) -RL.SHADER_LOC_MATRIX_VIEW=7 ----Shader location: matrix uniform: projection -RL.SHADER_LOC_MATRIX_PROJECTION=8 ----Shader location: matrix uniform: model (transform) -RL.SHADER_LOC_MATRIX_MODEL=9 ----Shader location: matrix uniform: normal -RL.SHADER_LOC_MATRIX_NORMAL=10 ----Shader location: vector uniform: view -RL.SHADER_LOC_VECTOR_VIEW=11 ----Shader location: vector uniform: diffuse color -RL.SHADER_LOC_COLOR_DIFFUSE=12 ----Shader location: vector uniform: specular color -RL.SHADER_LOC_COLOR_SPECULAR=13 ----Shader location: vector uniform: ambient color -RL.SHADER_LOC_COLOR_AMBIENT=14 ----Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) -RL.SHADER_LOC_MAP_ALBEDO=15 ----Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) -RL.SHADER_LOC_MAP_METALNESS=16 ----Shader location: sampler2d texture: normal -RL.SHADER_LOC_MAP_NORMAL=17 ----Shader location: sampler2d texture: roughness -RL.SHADER_LOC_MAP_ROUGHNESS=18 ----Shader location: sampler2d texture: occlusion -RL.SHADER_LOC_MAP_OCCLUSION=19 ----Shader location: sampler2d texture: emission -RL.SHADER_LOC_MAP_EMISSION=20 ----Shader location: sampler2d texture: height -RL.SHADER_LOC_MAP_HEIGHT=21 ----Shader location: samplerCube texture: cubemap -RL.SHADER_LOC_MAP_CUBEMAP=22 ----Shader location: samplerCube texture: irradiance -RL.SHADER_LOC_MAP_IRRADIANCE=23 ----Shader location: samplerCube texture: prefilter -RL.SHADER_LOC_MAP_PREFILTER=24 ----Shader location: sampler2d texture: brdf -RL.SHADER_LOC_MAP_BRDF=25 ----Shader location: vertex attribute: boneIds -RL.SHADER_LOC_VERTEX_BONEIDS=26 ----Shader location: vertex attribute: boneWeights -RL.SHADER_LOC_VERTEX_BONEWEIGHTS=27 ----Shader location: array of matrices uniform: boneMatrices -RL.SHADER_LOC_BONE_MATRICES=28 ----Shader location: sampler2d texture: diffuce (same as: SHADER_LOC_MAP_ALBEDO) -RL.SHADER_LOC_MAP_DIFFUSE=15 ----Shader location: sampler2d texture: specular (same as: SHADER_LOC_MAP_METALNESS) -RL.SHADER_LOC_MAP_SPECULAR=16 - --- Defines - Shader uniform data type - ----Shader uniform type: float -RL.SHADER_UNIFORM_FLOAT=0 ----Shader uniform type: vec2 (2 float) -RL.SHADER_UNIFORM_VEC2=1 ----Shader uniform type: vec3 (3 float) -RL.SHADER_UNIFORM_VEC3=2 ----Shader uniform type: vec4 (4 float) -RL.SHADER_UNIFORM_VEC4=3 ----Shader uniform type: int -RL.SHADER_UNIFORM_INT=4 ----Shader uniform type: ivec2 (2 int) -RL.SHADER_UNIFORM_IVEC2=5 ----Shader uniform type: ivec3 (3 int) -RL.SHADER_UNIFORM_IVEC3=6 ----Shader uniform type: ivec4 (4 int) -RL.SHADER_UNIFORM_IVEC4=7 ----Shader uniform type: sampler2d -RL.SHADER_UNIFORM_SAMPLER2D=8 - --- Defines - Shader attribute data types - ----Shader attribute type: float -RL.SHADER_ATTRIB_FLOAT=0 ----Shader attribute type: vec2 (2 float) -RL.SHADER_ATTRIB_VEC2=1 ----Shader attribute type: vec3 (3 float) -RL.SHADER_ATTRIB_VEC3=2 ----Shader attribute type: vec4 (4 float) -RL.SHADER_ATTRIB_VEC4=3 - --- Defines - Pixel formats - ----8 bit per pixel (no alpha) -RL.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE=1 ----8*2 bpp (2 channels) -RL.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA=2 ----16 bpp -RL.PIXELFORMAT_UNCOMPRESSED_R5G6B5=3 ----24 bpp -RL.PIXELFORMAT_UNCOMPRESSED_R8G8B8=4 ----16 bpp (1 bit alpha) -RL.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1=5 ----16 bpp (4 bit alpha) -RL.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4=6 ----32 bpp -RL.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8=7 ----32 bpp (1 channel - float) -RL.PIXELFORMAT_UNCOMPRESSED_R32=8 ----32*3 bpp (3 channels - float) -RL.PIXELFORMAT_UNCOMPRESSED_R32G32B32=9 ----32*4 bpp (4 channels - float) -RL.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32=10 ----4 bpp (no alpha) -RL.PIXELFORMAT_COMPRESSED_DXT1_RGB=14 ----4 bpp (1 bit alpha) -RL.PIXELFORMAT_COMPRESSED_DXT1_RGBA=15 ----8 bpp -RL.PIXELFORMAT_COMPRESSED_DXT3_RGBA=16 ----8 bpp -RL.PIXELFORMAT_COMPRESSED_DXT5_RGBA=17 ----4 bpp -RL.PIXELFORMAT_COMPRESSED_ETC1_RGB=18 ----4 bpp -RL.PIXELFORMAT_COMPRESSED_ETC2_RGB=19 ----8 bpp -RL.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA=20 ----4 bpp -RL.PIXELFORMAT_COMPRESSED_PVRT_RGB=21 ----4 bpp -RL.PIXELFORMAT_COMPRESSED_PVRT_RGBA=22 ----8 bpp -RL.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA=23 ----2 bpp -RL.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA=24 - --- Defines - Texture parameters: filter mode - ----No filter, just pixel approximation -RL.TEXTURE_FILTER_POINT=0 ----Linear filtering -RL.TEXTURE_FILTER_BILINEAR=1 ----Trilinear filtering (linear with mipmaps) -RL.TEXTURE_FILTER_TRILINEAR=2 ----Anisotropic filtering 4x -RL.TEXTURE_FILTER_ANISOTROPIC_4X=3 ----Anisotropic filtering 8x -RL.TEXTURE_FILTER_ANISOTROPIC_8X=4 ----Anisotropic filtering 16x -RL.TEXTURE_FILTER_ANISOTROPIC_16X=5 - --- Defines - Texture parameters: wrap mode - ----Repeats texture in tiled mode -RL.TEXTURE_WRAP_REPEAT=0 ----Clamps texture to edge pixel in tiled mode -RL.TEXTURE_WRAP_CLAMP=1 ----Mirrors and repeats the texture in tiled mode -RL.TEXTURE_WRAP_MIRROR_REPEAT=2 ----Mirrors and clamps to border the texture in tiled mode -RL.TEXTURE_WRAP_MIRROR_CLAMP=3 - --- Defines - Cubemap layouts - ----Automatically detect layout type -RL.CUBEMAP_LAYOUT_AUTO_DETECT=0 ----Layout is defined by a vertical line with faces -RL.CUBEMAP_LAYOUT_LINE_VERTICAL=1 ----Layout is defined by a horizontal line with faces -RL.CUBEMAP_LAYOUT_LINE_HORIZONTAL=2 ----Layout is defined by a 3x4 cross with cubemap faces -RL.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR=3 ----Layout is defined by a 4x3 cross with cubemap faces -RL.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE=4 - --- Defines - Font type, defines generation method - ----Default font generation, anti-aliased -RL.FONT_DEFAULT=0 ----Bitmap font generation, no anti-aliasing -RL.FONT_BITMAP=1 ----SDF font generation, requires external shader -RL.FONT_SDF=2 - --- Defines - Color blending modes (pre-defined) - ----Blend textures considering alpha (default) -RL.BLEND_ALPHA=0 ----Blend textures adding colors -RL.BLEND_ADDITIVE=1 ----Blend textures multiplying colors -RL.BLEND_MULTIPLIED=2 ----Blend textures adding colors (alternative) -RL.BLEND_ADD_COLORS=3 ----Blend textures subtracting colors (alternative) -RL.BLEND_SUBTRACT_COLORS=4 ----Blend premultiplied textures considering alpha -RL.BLEND_ALPHA_PREMULTIPLY=5 ----Blend textures using custom src/dst factors (use rlSetBlendFactors()) -RL.BLEND_CUSTOM=6 ----Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) -RL.BLEND_CUSTOM_SEPARATE=7 - --- Defines - Gesture - ----No gesture -RL.GESTURE_NONE=0 ----Tap gesture -RL.GESTURE_TAP=1 ----Double tap gesture -RL.GESTURE_DOUBLETAP=2 ----Hold gesture -RL.GESTURE_HOLD=4 ----Drag gesture -RL.GESTURE_DRAG=8 ----Swipe right gesture -RL.GESTURE_SWIPE_RIGHT=16 ----Swipe left gesture -RL.GESTURE_SWIPE_LEFT=32 ----Swipe up gesture -RL.GESTURE_SWIPE_UP=64 ----Swipe down gesture -RL.GESTURE_SWIPE_DOWN=128 ----Pinch in gesture -RL.GESTURE_PINCH_IN=256 ----Pinch out gesture -RL.GESTURE_PINCH_OUT=512 - --- Defines - Camera system modes - ----Custom camera -RL.CAMERA_CUSTOM=0 ----Free camera -RL.CAMERA_FREE=1 ----Orbital camera -RL.CAMERA_ORBITAL=2 ----First person camera -RL.CAMERA_FIRST_PERSON=3 ----Third person camera -RL.CAMERA_THIRD_PERSON=4 - --- Defines - Camera projection - ----Perspective projection -RL.CAMERA_PERSPECTIVE=0 ----Orthographic projection -RL.CAMERA_ORTHOGRAPHIC=1 - --- Defines - N-patch layout - ----Npatch layout: 3x3 tiles -RL.NPATCH_NINE_PATCH=0 ----Npatch layout: 1x3 tiles -RL.NPATCH_THREE_PATCH_VERTICAL=1 ----Npatch layout: 3x1 tiles -RL.NPATCH_THREE_PATCH_HORIZONTAL=2 - --- Defines - Colors - ----Light Gray -RL.LIGHTGRAY={200,200,200,255} ----Gray -RL.GRAY={130,130,130,255} ----Dark Gray -RL.DARKGRAY={80,80,80,255} ----Yellow -RL.YELLOW={253,249,0,255} ----Gold -RL.GOLD={255,203,0,255} ----Orange -RL.ORANGE={255,161,0,255} ----Pink -RL.PINK={255,109,194,255} ----Red -RL.RED={230,41,55,255} ----Maroon -RL.MAROON={190,33,55,255} ----Green -RL.GREEN={0,228,48,255} ----Lime -RL.LIME={0,158,47,255} ----Dark Green -RL.DARKGREEN={0,117,44,255} ----Sky Blue -RL.SKYBLUE={102,191,255,255} ----Blue -RL.BLUE={0,121,241,255} ----Dark Blue -RL.DARKBLUE={0,82,172,255} ----Purple -RL.PURPLE={200,122,255,255} ----Violet -RL.VIOLET={135,60,190,255} ----Dark Purple -RL.DARKPURPLE={112,31,126,255} ----Beige -RL.BEIGE={211,176,131,255} ----Brown -RL.BROWN={127,106,79,255} ----Dark Brown -RL.DARKBROWN={76,63,47,255} ----White -RL.WHITE={255,255,255,255} ----Black -RL.BLACK={0,0,0,255} ----Blank (Transparent) -RL.BLANK={0,0,0,0} ----Magenta -RL.MAGENTA={255,0,255,255} ----My own White (raylib logo) -RL.RAYWHITE={245,245,245,255} - --- Defines - Math - ----Pi -RL.PI=3.1415927410126 ----Epsilon -RL.EPSILON=9.9999999747524e-07 ----Degrees to radians -RL.DEG2RAD=0.017453292384744 ----Radians to degrees -RL.RAD2DEG=57.295776367188 - --- Defines - Gui control state - -RL.STATE_NORMAL=0 -RL.STATE_FOCUSED=1 -RL.STATE_PRESSED=2 -RL.STATE_DISABLED=3 - --- Defines - Gui control text alignment - -RL.TEXT_ALIGN_LEFT=0 -RL.TEXT_ALIGN_CENTER=1 -RL.TEXT_ALIGN_RIGHT=2 - --- Defines - Gui control text alignment vertical - -RL.TEXT_ALIGN_TOP=0 -RL.TEXT_ALIGN_MIDDLE=1 -RL.TEXT_ALIGN_BOTTOM=2 - --- Defines - Gui control text wrap mode - -RL.TEXT_WRAP_NONE=0 -RL.TEXT_WRAP_CHAR=1 -RL.TEXT_WRAP_WORD=2 - --- Defines - Gui controls - -RL.DEFAULT=0 ----Used also for: LABELBUTTON -RL.LABEL=1 -RL.BUTTON=2 ----Used also for: TOGGLEGROUP -RL.TOGGLE=3 ----Used also for: SLIDERBAR -RL.SLIDER=4 -RL.PROGRESSBAR=5 -RL.CHECKBOX=6 -RL.COMBOBOX=7 -RL.DROPDOWNBOX=8 ----Used also for: TEXTBOXMULTI -RL.TEXTBOX=9 -RL.VALUEBOX=10 ----Uses: BUTTON, VALUEBOX -RL.SPINNER=11 -RL.LISTVIEW=12 -RL.COLORPICKER=13 -RL.SCROLLBAR=14 -RL.STATUSBAR=15 - --- Defines - Gui base properties for every control - -RL.BORDER_COLOR_NORMAL=0 -RL.BASE_COLOR_NORMAL=1 -RL.TEXT_COLOR_NORMAL=2 -RL.BORDER_COLOR_FOCUSED=3 -RL.BASE_COLOR_FOCUSED=4 -RL.TEXT_COLOR_FOCUSED=5 -RL.BORDER_COLOR_PRESSED=6 -RL.BASE_COLOR_PRESSED=7 -RL.TEXT_COLOR_PRESSED=8 -RL.BORDER_COLOR_DISABLED=9 -RL.BASE_COLOR_DISABLED=10 -RL.TEXT_COLOR_DISABLED=11 -RL.BORDER_WIDTH=12 -RL.TEXT_PADDING=13 -RL.TEXT_ALIGNMENT=14 - --- Defines - Gui extended properties depend on control - ----Text size (glyphs max height) -RL.TEXT_SIZE=16 ----Text spacing between glyphs -RL.TEXT_SPACING=17 ----Line control color -RL.LINE_COLOR=18 ----Background color -RL.BACKGROUND_COLOR=19 ----Text spacing between lines -RL.TEXT_LINE_SPACING=20 ----Text vertical alignment inside text bounds (after border and padding) -RL.TEXT_ALIGNMENT_VERTICAL=21 ----Text wrap-mode inside text bounds -RL.TEXT_WRAP_MODE=22 - --- Defines - Gui Toggle/ToggleGroup - ----ToggleGroup separation between toggles -RL.GROUP_PADDING=16 - --- Defines - Gui Slider/SliderBar - ----Slider size of internal bar -RL.SLIDER_WIDTH=16 ----Slider/SliderBar internal bar padding -RL.SLIDER_PADDING=17 - --- Defines - Gui ProgressBar - ----ProgressBar internal padding -RL.PROGRESS_PADDING=16 - --- Defines - Gui ScrollBar - -RL.ARROWS_SIZE=16 -RL.ARROWS_VISIBLE=17 ----(SLIDERBAR, SLIDER_PADDING) -RL.SCROLL_SLIDER_PADDING=18 -RL.SCROLL_SLIDER_SIZE=19 -RL.SCROLL_PADDING=20 -RL.SCROLL_SPEED=21 - --- Defines - Gui CheckBox - ----CheckBox internal check padding -RL.CHECK_PADDING=16 - --- Defines - Gui ComboBox - ----ComboBox right button width -RL.COMBO_BUTTON_WIDTH=16 ----ComboBox button separation -RL.COMBO_BUTTON_SPACING=17 - --- Defines - Gui DropdownBox - ----DropdownBox arrow separation from border and items -RL.ARROW_PADDING=16 ----DropdownBox items separation -RL.DROPDOWN_ITEMS_SPACING=17 - --- Defines - Gui TextBox/TextBoxMulti/ValueBox/Spinner - ----TextBox in read-only mode: 0-text editable, 1-text no-editable -RL.TEXT_READONLY=16 - --- Defines - Gui Spinner - ----Spinner left/right buttons width -RL.SPIN_BUTTON_WIDTH=16 ----Spinner buttons separation -RL.SPIN_BUTTON_SPACING=17 - --- Defines - Gui ListView - ----ListView items height -RL.LIST_ITEMS_HEIGHT=16 ----ListView items separation -RL.LIST_ITEMS_SPACING=17 ----ListView scrollbar size (usually width) -RL.SCROLLBAR_WIDTH=18 ----ListView scrollbar side (0-left, 1-right) -RL.SCROLLBAR_SIDE=19 - --- Defines - Gui ColorPicker - -RL.COLOR_SELECTOR_SIZE=16 ----ColorPicker right hue bar width -RL.HUEBAR_WIDTH=17 ----ColorPicker right hue bar separation from panel -RL.HUEBAR_PADDING=18 ----ColorPicker right hue bar selector height -RL.HUEBAR_SELECTOR_HEIGHT=19 ----ColorPicker right hue bar selector overflow -RL.HUEBAR_SELECTOR_OVERFLOW=20 - --- Defines - Gui Icons enumeration - -RL.ICON_NONE=0 -RL.ICON_FOLDER_FILE_OPEN=1 -RL.ICON_FILE_SAVE_CLASSIC=2 -RL.ICON_FOLDER_OPEN=3 -RL.ICON_FOLDER_SAVE=4 -RL.ICON_FILE_OPEN=5 -RL.ICON_FILE_SAVE=6 -RL.ICON_FILE_EXPORT=7 -RL.ICON_FILE_ADD=8 -RL.ICON_FILE_DELETE=9 -RL.ICON_FILETYPE_TEXT=10 -RL.ICON_FILETYPE_AUDIO=11 -RL.ICON_FILETYPE_IMAGE=12 -RL.ICON_FILETYPE_PLAY=13 -RL.ICON_FILETYPE_VIDEO=14 -RL.ICON_FILETYPE_INFO=15 -RL.ICON_FILE_COPY=16 -RL.ICON_FILE_CUT=17 -RL.ICON_FILE_PASTE=18 -RL.ICON_CURSOR_HAND=19 -RL.ICON_CURSOR_POINTER=20 -RL.ICON_CURSOR_CLASSIC=21 -RL.ICON_PENCIL=22 -RL.ICON_PENCIL_BIG=23 -RL.ICON_BRUSH_CLASSIC=24 -RL.ICON_BRUSH_PAINTER=25 -RL.ICON_WATER_DROP=26 -RL.ICON_COLOR_PICKER=27 -RL.ICON_RUBBER=28 -RL.ICON_COLOR_BUCKET=29 -RL.ICON_TEXT_T=30 -RL.ICON_TEXT_A=31 -RL.ICON_SCALE=32 -RL.ICON_RESIZE=33 -RL.ICON_FILTER_POINT=34 -RL.ICON_FILTER_BILINEAR=35 -RL.ICON_CROP=36 -RL.ICON_CROP_ALPHA=37 -RL.ICON_SQUARE_TOGGLE=38 -RL.ICON_SYMMETRY=39 -RL.ICON_SYMMETRY_HORIZONTAL=40 -RL.ICON_SYMMETRY_VERTICAL=41 -RL.ICON_LENS=42 -RL.ICON_LENS_BIG=43 -RL.ICON_EYE_ON=44 -RL.ICON_EYE_OFF=45 -RL.ICON_FILTER_TOP=46 -RL.ICON_FILTER=47 -RL.ICON_TARGET_POINT=48 -RL.ICON_TARGET_SMALL=49 -RL.ICON_TARGET_BIG=50 -RL.ICON_TARGET_MOVE=51 -RL.ICON_CURSOR_MOVE=52 -RL.ICON_CURSOR_SCALE=53 -RL.ICON_CURSOR_SCALE_RIGHT=54 -RL.ICON_CURSOR_SCALE_LEFT=55 -RL.ICON_UNDO=56 -RL.ICON_REDO=57 -RL.ICON_REREDO=58 -RL.ICON_MUTATE=59 -RL.ICON_ROTATE=60 -RL.ICON_REPEAT=61 -RL.ICON_SHUFFLE=62 -RL.ICON_EMPTYBOX=63 -RL.ICON_TARGET=64 -RL.ICON_TARGET_SMALL_FILL=65 -RL.ICON_TARGET_BIG_FILL=66 -RL.ICON_TARGET_MOVE_FILL=67 -RL.ICON_CURSOR_MOVE_FILL=68 -RL.ICON_CURSOR_SCALE_FILL=69 -RL.ICON_CURSOR_SCALE_RIGHT_FILL=70 -RL.ICON_CURSOR_SCALE_LEFT_FILL=71 -RL.ICON_UNDO_FILL=72 -RL.ICON_REDO_FILL=73 -RL.ICON_REREDO_FILL=74 -RL.ICON_MUTATE_FILL=75 -RL.ICON_ROTATE_FILL=76 -RL.ICON_REPEAT_FILL=77 -RL.ICON_SHUFFLE_FILL=78 -RL.ICON_EMPTYBOX_SMALL=79 -RL.ICON_BOX=80 -RL.ICON_BOX_TOP=81 -RL.ICON_BOX_TOP_RIGHT=82 -RL.ICON_BOX_RIGHT=83 -RL.ICON_BOX_BOTTOM_RIGHT=84 -RL.ICON_BOX_BOTTOM=85 -RL.ICON_BOX_BOTTOM_LEFT=86 -RL.ICON_BOX_LEFT=87 -RL.ICON_BOX_TOP_LEFT=88 -RL.ICON_BOX_CENTER=89 -RL.ICON_BOX_CIRCLE_MASK=90 -RL.ICON_POT=91 -RL.ICON_ALPHA_MULTIPLY=92 -RL.ICON_ALPHA_CLEAR=93 -RL.ICON_DITHERING=94 -RL.ICON_MIPMAPS=95 -RL.ICON_BOX_GRID=96 -RL.ICON_GRID=97 -RL.ICON_BOX_CORNERS_SMALL=98 -RL.ICON_BOX_CORNERS_BIG=99 -RL.ICON_FOUR_BOXES=100 -RL.ICON_GRID_FILL=101 -RL.ICON_BOX_MULTISIZE=102 -RL.ICON_ZOOM_SMALL=103 -RL.ICON_ZOOM_MEDIUM=104 -RL.ICON_ZOOM_BIG=105 -RL.ICON_ZOOM_ALL=106 -RL.ICON_ZOOM_CENTER=107 -RL.ICON_BOX_DOTS_SMALL=108 -RL.ICON_BOX_DOTS_BIG=109 -RL.ICON_BOX_CONCENTRIC=110 -RL.ICON_BOX_GRID_BIG=111 -RL.ICON_OK_TICK=112 -RL.ICON_CROSS=113 -RL.ICON_ARROW_LEFT=114 -RL.ICON_ARROW_RIGHT=115 -RL.ICON_ARROW_DOWN=116 -RL.ICON_ARROW_UP=117 -RL.ICON_ARROW_LEFT_FILL=118 -RL.ICON_ARROW_RIGHT_FILL=119 -RL.ICON_ARROW_DOWN_FILL=120 -RL.ICON_ARROW_UP_FILL=121 -RL.ICON_AUDIO=122 -RL.ICON_FX=123 -RL.ICON_WAVE=124 -RL.ICON_WAVE_SINUS=125 -RL.ICON_WAVE_SQUARE=126 -RL.ICON_WAVE_TRIANGULAR=127 -RL.ICON_CROSS_SMALL=128 -RL.ICON_PLAYER_PREVIOUS=129 -RL.ICON_PLAYER_PLAY_BACK=130 -RL.ICON_PLAYER_PLAY=131 -RL.ICON_PLAYER_PAUSE=132 -RL.ICON_PLAYER_STOP=133 -RL.ICON_PLAYER_NEXT=134 -RL.ICON_PLAYER_RECORD=135 -RL.ICON_MAGNET=136 -RL.ICON_LOCK_CLOSE=137 -RL.ICON_LOCK_OPEN=138 -RL.ICON_CLOCK=139 -RL.ICON_TOOLS=140 -RL.ICON_GEAR=141 -RL.ICON_GEAR_BIG=142 -RL.ICON_BIN=143 -RL.ICON_HAND_POINTER=144 -RL.ICON_LASER=145 -RL.ICON_COIN=146 -RL.ICON_EXPLOSION=147 -RL.ICON_1UP=148 -RL.ICON_PLAYER=149 -RL.ICON_PLAYER_JUMP=150 -RL.ICON_KEY=151 -RL.ICON_DEMON=152 -RL.ICON_TEXT_POPUP=153 -RL.ICON_GEAR_EX=154 -RL.ICON_CRACK=155 -RL.ICON_CRACK_POINTS=156 -RL.ICON_STAR=157 -RL.ICON_DOOR=158 -RL.ICON_EXIT=159 -RL.ICON_MODE_2D=160 -RL.ICON_MODE_3D=161 -RL.ICON_CUBE=162 -RL.ICON_CUBE_FACE_TOP=163 -RL.ICON_CUBE_FACE_LEFT=164 -RL.ICON_CUBE_FACE_FRONT=165 -RL.ICON_CUBE_FACE_BOTTOM=166 -RL.ICON_CUBE_FACE_RIGHT=167 -RL.ICON_CUBE_FACE_BACK=168 -RL.ICON_CAMERA=169 -RL.ICON_SPECIAL=170 -RL.ICON_LINK_NET=171 -RL.ICON_LINK_BOXES=172 -RL.ICON_LINK_MULTI=173 -RL.ICON_LINK=174 -RL.ICON_LINK_BROKE=175 -RL.ICON_TEXT_NOTES=176 -RL.ICON_NOTEBOOK=177 -RL.ICON_SUITCASE=178 -RL.ICON_SUITCASE_ZIP=179 -RL.ICON_MAILBOX=180 -RL.ICON_MONITOR=181 -RL.ICON_PRINTER=182 -RL.ICON_PHOTO_CAMERA=183 -RL.ICON_PHOTO_CAMERA_FLASH=184 -RL.ICON_HOUSE=185 -RL.ICON_HEART=186 -RL.ICON_CORNER=187 -RL.ICON_VERTICAL_BARS=188 -RL.ICON_VERTICAL_BARS_FILL=189 -RL.ICON_LIFE_BARS=190 -RL.ICON_INFO=191 -RL.ICON_CROSSLINE=192 -RL.ICON_HELP=193 -RL.ICON_FILETYPE_ALPHA=194 -RL.ICON_FILETYPE_HOME=195 -RL.ICON_LAYERS_VISIBLE=196 -RL.ICON_LAYERS=197 -RL.ICON_WINDOW=198 -RL.ICON_HIDPI=199 -RL.ICON_FILETYPE_BINARY=200 -RL.ICON_HEX=201 -RL.ICON_SHIELD=202 -RL.ICON_FILE_NEW=203 -RL.ICON_FOLDER_ADD=204 -RL.ICON_ALARM=205 -RL.ICON_CPU=206 -RL.ICON_ROM=207 -RL.ICON_STEP_OVER=208 -RL.ICON_STEP_INTO=209 -RL.ICON_STEP_OUT=210 -RL.ICON_RESTART=211 -RL.ICON_BREAKPOINT_ON=212 -RL.ICON_BREAKPOINT_OFF=213 -RL.ICON_BURGER_MENU=214 -RL.ICON_CASE_SENSITIVE=215 -RL.ICON_REG_EXP=216 -RL.ICON_FOLDER=217 -RL.ICON_FILE=218 -RL.ICON_SAND_TIMER=219 - --- Defines - Light type - ----Directional light -RL.LIGHT_DIRECTIONAL=0 ----Point light -RL.LIGHT_POINT=1 - --- Defines - RLGL Default internal render batch elements limits - ----Default internal render batch elements limits -RL.RL_DEFAULT_BATCH_BUFFER_ELEMENTS=8192 ----Default number of batch buffers (multi-buffering) -RL.RL_DEFAULT_BATCH_BUFFERS=1 ----Default number of batch draw calls (by state changes: mode, texture) -RL.RL_DEFAULT_BATCH_DRAWCALLS=256 ----Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture()) -RL.RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS=4 - --- Defines - RLGL Internal Matrix stack - ----Maximum size of internal Matrix stack -RL.RL_MAX_MATRIX_STACK_SIZE=32 - --- Defines - RLGL Shader limits - ----Maximum number of shader locations supported -RL.RL_MAX_SHADER_LOCATIONS=32 - --- Defines - RLGL Projection matrix culling - ----Default projection matrix near cull distance -RL.RL_CULL_DISTANCE_NEAR=0.01 ----Default projection matrix far cull distance -RL.RL_CULL_DISTANCE_FAR=1000 - --- Defines - RLGL Texture parameters - ----GL_TEXTURE_WRAP_S -RL.RL_TEXTURE_WRAP_S=10242 ----GL_TEXTURE_WRAP_T -RL.RL_TEXTURE_WRAP_T=10243 ----GL_TEXTURE_MAG_FILTER -RL.RL_TEXTURE_MAG_FILTER=10240 ----GL_TEXTURE_MIN_FILTER -RL.RL_TEXTURE_MIN_FILTER=10241 ----GL_NEAREST -RL.RL_TEXTURE_FILTER_NEAREST=9728 ----GL_LINEAR -RL.RL_TEXTURE_FILTER_LINEAR=9729 ----GL_NEAREST_MIPMAP_NEAREST -RL.RL_TEXTURE_FILTER_MIP_NEAREST=9984 ----GL_NEAREST_MIPMAP_LINEAR -RL.RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR=9986 ----GL_LINEAR_MIPMAP_NEAREST -RL.RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST=9985 ----GL_LINEAR_MIPMAP_LINEAR -RL.RL_TEXTURE_FILTER_MIP_LINEAR=9987 ----Anisotropic filter (custom identifier) -RL.RL_TEXTURE_FILTER_ANISOTROPIC=12288 ----Texture mipmap bias, percentage ratio (custom identifier) -RL.RL_TEXTURE_MIPMAP_BIAS_RATIO=16384 ----GL_REPEAT -RL.RL_TEXTURE_WRAP_REPEAT=10497 ----GL_CLAMP_TO_EDGE -RL.RL_TEXTURE_WRAP_CLAMP=33071 ----GL_MIRRORED_REPEAT -RL.RL_TEXTURE_WRAP_MIRROR_REPEAT=33648 ----GL_MIRROR_CLAMP_EXT -RL.RL_TEXTURE_WRAP_MIRROR_CLAMP=34626 - --- Defines - RLGL Matrix modes (equivalent to OpenGL) - ----GL_MODELVIEW -RL.RL_MODELVIEW=5888 ----GL_PROJECTION -RL.RL_PROJECTION=5889 ----GL_TEXTURE -RL.RL_TEXTURE=5890 - --- Defines - RLGL Primitive assembly draw modes - ----GL_LINES -RL.RL_LINES=1 ----GL_TRIANGLES -RL.RL_TRIANGLES=4 ----GL_QUADS -RL.RL_QUADS=7 - --- Defines - RLGL GL equivalent data types - ----GL_UNSIGNED_BYTE -RL.RL_UNSIGNED_BYTE=5121 ----GL_FLOAT -RL.RL_FLOAT=5126 - --- Defines - RLGL GL buffer usage hint - ----GL_STREAM_DRAW -RL.RL_STREAM_DRAW=35040 ----GL_STREAM_READ -RL.RL_STREAM_READ=35041 ----GL_STREAM_COPY -RL.RL_STREAM_COPY=35042 ----GL_STATIC_DRAW -RL.RL_STATIC_DRAW=35044 ----GL_STATIC_READ -RL.RL_STATIC_READ=35045 ----GL_STATIC_COPY -RL.RL_STATIC_COPY=35046 ----GL_DYNAMIC_DRAW -RL.RL_DYNAMIC_DRAW=35048 ----GL_DYNAMIC_READ -RL.RL_DYNAMIC_READ=35049 ----GL_DYNAMIC_COPY -RL.RL_DYNAMIC_COPY=35050 - --- Defines - RLGL Shader type - ----GL_FRAGMENT_SHADER -RL.RL_FRAGMENT_SHADER=35632 ----GL_VERTEX_SHADER -RL.RL_VERTEX_SHADER=35633 ----GL_COMPUTE_SHADER -RL.RL_COMPUTE_SHADER=37305 - --- Defines - RLGL GL blending factors - ----GL_ZERO -RL.RL_ZERO=0 ----GL_ONE -RL.RL_ONE=1 ----GL_SRC_COLOR -RL.RL_SRC_COLOR=768 ----GL_ONE_MINUS_SRC_COLOR -RL.RL_ONE_MINUS_SRC_COLOR=769 ----GL_SRC_ALPHA -RL.RL_SRC_ALPHA=770 ----GL_ONE_MINUS_SRC_ALPHA -RL.RL_ONE_MINUS_SRC_ALPHA=771 ----GL_DST_ALPHA -RL.RL_DST_ALPHA=772 ----GL_ONE_MINUS_DST_ALPHA -RL.RL_ONE_MINUS_DST_ALPHA=773 ----GL_DST_COLOR -RL.RL_DST_COLOR=774 ----GL_ONE_MINUS_DST_COLOR -RL.RL_ONE_MINUS_DST_COLOR=775 ----GL_SRC_ALPHA_SATURATE -RL.RL_SRC_ALPHA_SATURATE=776 ----GL_CONSTANT_COLOR -RL.RL_CONSTANT_COLOR=32769 ----GL_ONE_MINUS_CONSTANT_COLOR -RL.RL_ONE_MINUS_CONSTANT_COLOR=32770 ----GL_CONSTANT_ALPHA -RL.RL_CONSTANT_ALPHA=32771 ----GL_ONE_MINUS_CONSTANT_ALPHA -RL.RL_ONE_MINUS_CONSTANT_ALPHA=32772 - --- Defines - RLGL GL blending functions/equations - ----GL_FUNC_ADD -RL.RL_FUNC_ADD=32774 ----GL_MIN -RL.RL_MIN=32775 ----GL_MAX -RL.RL_MAX=32776 ----GL_FUNC_SUBTRACT -RL.RL_FUNC_SUBTRACT=32778 ----GL_FUNC_REVERSE_SUBTRACT -RL.RL_FUNC_REVERSE_SUBTRACT=32779 ----GL_BLEND_EQUATION -RL.RL_BLEND_EQUATION=32777 ----GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION) -RL.RL_BLEND_EQUATION_RGB=32777 ----GL_BLEND_EQUATION_ALPHA -RL.RL_BLEND_EQUATION_ALPHA=34877 ----GL_BLEND_DST_RGB -RL.RL_BLEND_DST_RGB=32968 ----GL_BLEND_SRC_RGB -RL.RL_BLEND_SRC_RGB=32969 ----GL_BLEND_DST_ALPHA -RL.RL_BLEND_DST_ALPHA=32970 ----GL_BLEND_SRC_ALPHA -RL.RL_BLEND_SRC_ALPHA=32971 ----GL_BLEND_COLOR -RL.RL_BLEND_COLOR=32773 ----GL_READ_FRAMEBUFFER -RL.RL_READ_FRAMEBUFFER=36008 ----GL_DRAW_FRAMEBUFFER -RL.RL_DRAW_FRAMEBUFFER=36009 - --- Defines - RLGL Default shader vertex attribute locations - -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION=0 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD=1 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL=2 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR=3 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT=4 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2=5 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES=6 -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS=nil -RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS=nil - --- Defines - RLGL GlVersion - ----OpenGL 1.1 -RL.RL_OPENGL_11=1 ----OpenGL 2.1 (GLSL 120) -RL.RL_OPENGL_21=2 ----OpenGL 3.3 (GLSL 330) -RL.RL_OPENGL_33=3 ----OpenGL 4.3 (using GLSL 330) -RL.RL_OPENGL_43=4 ----OpenGL ES 2.0 (GLSL 100) -RL.RL_OPENGL_ES_20=5 - --- Defines - RLGL Framebuffer attachment type - ----Framebuffer attachment type: color 0 -RL.RL_ATTACHMENT_COLOR_CHANNEL0=0 ----Framebuffer attachment type: color 1 -RL.RL_ATTACHMENT_COLOR_CHANNEL1=1 ----Framebuffer attachment type: color 2 -RL.RL_ATTACHMENT_COLOR_CHANNEL2=2 ----Framebuffer attachment type: color 3 -RL.RL_ATTACHMENT_COLOR_CHANNEL3=3 ----Framebuffer attachment type: color 4 -RL.RL_ATTACHMENT_COLOR_CHANNEL4=4 ----Framebuffer attachment type: color 5 -RL.RL_ATTACHMENT_COLOR_CHANNEL5=5 ----Framebuffer attachment type: color 6 -RL.RL_ATTACHMENT_COLOR_CHANNEL6=6 ----Framebuffer attachment type: color 7 -RL.RL_ATTACHMENT_COLOR_CHANNEL7=7 ----Framebuffer attachment type: depth -RL.RL_ATTACHMENT_DEPTH=100 ----Framebuffer attachment type: stencil -RL.RL_ATTACHMENT_STENCIL=200 - --- Defines - RLGL Framebuffer texture attachment type - ----Framebuffer texture attachment type: cubemap, +X side -RL.RL_ATTACHMENT_CUBEMAP_POSITIVE_X=0 ----Framebuffer texture attachment type: cubemap, -X side -RL.RL_ATTACHMENT_CUBEMAP_NEGATIVE_X=1 ----Framebuffer texture attachment type: cubemap, +Y side -RL.RL_ATTACHMENT_CUBEMAP_POSITIVE_Y=2 ----Framebuffer texture attachment type: cubemap, -Y side -RL.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y=3 ----Framebuffer texture attachment type: cubemap, +Z side -RL.RL_ATTACHMENT_CUBEMAP_POSITIVE_Z=4 ----Framebuffer texture attachment type: cubemap, -Z side -RL.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z=5 ----Framebuffer texture attachment type: texture2d -RL.RL_ATTACHMENT_TEXTURE2D=100 ----Framebuffer texture attachment type: renderbuffer -RL.RL_ATTACHMENT_RENDERBUFFER=200 - --- Defines - RLGL CullMode - -RL.RL_CULL_FACE_FRONT=0 -RL.RL_CULL_FACE_BACK=1 - --- Defines - OpenGL Bitfield mask - -RL.GL_COLOR_BUFFER_BIT=16384 -RL.GL_DEPTH_BUFFER_BIT=256 -RL.GL_STENCIL_BUFFER_BIT=1024 - --- Defines - OpenGL Texture parameter - -RL.GL_NEAREST=9728 -RL.GL_LINEAR=9729 - --- Defines - OpenGL Capability - ----If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc -RL.GL_BLEND=3042 ----If enabled, cull polygons based on their winding in window coordinates. See glCullFace -RL.GL_CULL_FACE=2884 ----If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRangef -RL.GL_DEPTH_TEST=2929 ----If enabled, dither color components or indices before they are written to the color buffer -RL.GL_DITHER=3024 ----If enabled, an offset is added to depth values of a polygon's fragments produced by rasterization. See glPolygonOffset -RL.GL_POLYGON_OFFSET_FILL=32823 -RL.GL_POLYGON_OFFSET_LINE=10754 -RL.GL_POLYGON_OFFSET_POINT=10753 ----If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value -RL.GL_SAMPLE_ALPHA_TO_COVERAGE=32926 ----If enabled, the fragment's coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE, invert the coverage value. See glSampleCoverage -RL.GL_SAMPLE_COVERAGE=32928 ----If enabled, discard fragments that are outside the scissor rectangle. See glScissor -RL.GL_SCISSOR_TEST=3089 ----If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp -RL.GL_STENCIL_TEST=2960 - --- Defines - OpenGL Test function - ----Always fails -RL.GL_NEVER=512 ----Passes if ( ref & mask ) < ( stencil & mask ) -RL.GL_LESS=513 ----Passes if ( ref & mask ) <= ( stencil & mask ) -RL.GL_LEQUAL=515 ----Passes if ( ref & mask ) > ( stencil & mask ) -RL.GL_GREATER=516 ----Passes if ( ref & mask ) >= ( stencil & mask ) -RL.GL_GEQUAL=518 ----Passes if ( ref & mask ) = ( stencil & mask ) -RL.GL_EQUAL=514 ----Passes if ( ref & mask ) != ( stencil & mask ) -RL.GL_NOTEQUAL=517 ----Always passes -RL.GL_ALWAYS=519 - --- Defines - OpenGL Face - -RL.GL_FRONT=1028 -RL.GL_BACK=1029 -RL.GL_FRONT_AND_BACK=1032 - --- Defines - OpenGL Stencil test - ----Keeps the current value -RL.GL_KEEP=7680 ----Sets the stencil buffer value to 0 -RL.GL_ZERO=0 ----Sets the stencil buffer value to ref, as specified by glStencilFunc -RL.GL_REPLACE=7681 ----Increments the current stencil buffer value. Clamps to the maximum representable unsigned value -RL.GL_INCR=7682 ----Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value -RL.GL_INCR_WRAP=34055 ----Decrements the current stencil buffer value. Clamps to 0 -RL.GL_DECR=7683 ----Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero -RL.GL_DECR_WRAP=34056 ----Bitwise inverts the current stencil buffer value -RL.GL_INVERT=5386 - --- Defines - OpenGL Connection - ----Returns the company responsible for this GL implementation. This name does not change from release to release -RL.GL_VENDOR=7936 ----Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release -RL.GL_RENDERER=7937 ----Returns a version or release number of the form OpenGLES -RL.GL_VERSION=7938 ----Returns a version or release number for the shading language of the form OpenGLESGLSLES -RL.GL_SHADING_LANGUAGE_VERSION=35724 ----Returns a space-separated list of supported extensions to GL -RL.GL_EXTENSIONS=7939 - --- Defines - CBuffer Data type - ----C type unsigned char -RL.BUFFER_UNSIGNED_CHAR=0 ----C type unsigned short -RL.BUFFER_UNSIGNED_SHORT=1 ----C type unsigned int -RL.BUFFER_UNSIGNED_INT=2 ----C type unsigned long -RL.BUFFER_UNSIGNED_LONG=3 ----C type char -RL.BUFFER_CHAR=4 ----C type short -RL.BUFFER_SHORT=5 ----C type int -RL.BUFFER_INT=6 ----C type long -RL.BUFFER_LONG=7 ----C type float -RL.BUFFER_FLOAT=8 ----C type double -RL.BUFFER_DOUBLE=9 - --- Defines - Keyboard keys (US keyboard layout) - ----Key: Unknown -RL.GLFW_KEY_UNKNOWN=-1 - --- Defines - GLFW API tokens. - ----The key or mouse button was released -RL.GLFW_RELEASE=0 ----The key or mouse button was pressed -RL.GLFW_PRESS=1 ----The key was held down until it repeated -RL.GLFW_REPEAT=2 ----Joystick connected -RL.GLFW_CONNECTED=262145 ----Joystick disconnected -RL.GLFW_DISCONNECTED=262146 - --- Defines - GLFW Window Events. - ----GLFW event window size changed -RL.GLFW_WINDOW_SIZE_EVENT=0 ----GLFW event window maximize -RL.GLFW_WINDOW_MAXIMIZE_EVENT=1 ----GLFW event window iconify -RL.GLFW_WINDOW_ICONYFY_EVENT=2 ----GLFW event window focus -RL.GLFW_WINDOW_FOCUS_EVENT=3 ----GLFW event window drop -RL.GLFW_WINDOW_DROP_EVENT=4 - --- Defines - GLFW Input Events. - ----GLFW event keyboard key -RL.GLFW_KEY_EVENT=5 ----GLFW event Unicode character -RL.GLFW_CHAR_EVENT=6 ----GLFW event mouse button -RL.GLFW_MOUSE_BUTTON_EVENT=7 ----GLFW event cursor position -RL.GLFW_MOUSE_CURSOR_POS_EVENT=8 ----GLFW event mouse scroll -RL.GLFW_MOUSE_SCROLL_EVENT=9 ----GLFW event cursor enter/leave -RL.GLFW_CURSOR_ENTER_EVENT=10 ----GLFW event joystick -RL.GLFW_JOYSTICK_EVENT=11 - --- Defines - GLFW Pen Tablet Events. NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445. - ----// GLFW event pen tablet data -RL.assignGlobalInt=nil ----// GLFW event pen tablet cursor -RL.assignGlobalInt=nil ----// GLFW event pen tablet proximity -RL.assignGlobalInt=nil --- Core - Window-related functions - ----Initialize window and OpenGL context. Note! Should be called only in RL.config. ----InitWindow will still be called automatically before RL.init ----@param size table ----@param title string ----@return any RL.InitWindow -function RL.InitWindow( size, title ) end - ----Close window and unload OpenGL context and free all resources ----@return any RL.CloseWindow -function RL.CloseWindow() end - ----Check if application should close (KEY_ESCAPE pressed or windows close icon clicked). ----Note! Not needed unless you want to make custom main loop ----@return any RL.WindowShouldClose -function RL.WindowShouldClose() end - ----Check if window has been initialized successfully ----- Success return bool ----@return any state -function RL.IsWindowReady() end - ----Check if window is currently fullscreen ----- Success return bool ----@return any state -function RL.IsWindowFullscreen() end - ----Check if window is currently hidden (only PLATFORM_DESKTOP) ----- Success return bool ----@return any state -function RL.IsWindowHidden() end - ----Check if window is currently minimized (only PLATFORM_DESKTOP) ----- Success return bool ----@return any state -function RL.IsWindowMinimized() end - ----Check if window is currently maximized (only PLATFORM_DESKTOP) ----- Success return bool ----@return any state -function RL.IsWindowMaximized() end - ----Check if window is currently focused (only PLATFORM_DESKTOP) ----- Success return bool ----@return any state -function RL.IsWindowFocused() end - ----Check if window has been resized from last frame ----- Success return bool ----@return any resized -function RL.IsWindowResized() end - ----Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) ----- Success return bool ----@param flag integer ----@return any state -function RL.IsWindowState( flag ) end - ----Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) ----@param flag integer ----@return any RL.SetWindowState -function RL.SetWindowState( flag ) end - ----Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) ----- Success return bool ----@param flag integer ----@return any resized -function RL.ClearWindowState( flag ) end - ----Toggle window state: fullscreen/windowed, resizes monitor to match window resolution ----@return any RL.ToggleFullscreen -function RL.ToggleFullscreen() end - ----Toggle window state: borderless windowed, resizes window to match monitor resolution ----@return any RL.ToggleBorderlessWindowed -function RL.ToggleBorderlessWindowed() end - ----Set window state: maximized, if resizable (only PLATFORM_DESKTOP) ----@return any RL.MaximizeWindow -function RL.MaximizeWindow() end - ----Set window state: minimized, if resizable (only PLATFORM_DESKTOP) ----@return any RL.MinimizeWindow -function RL.MinimizeWindow() end - ----Set window state: not minimized/maximized (only PLATFORM_DESKTOP) ----@return any RL.RestoreWindow -function RL.RestoreWindow() end - ----Set icon for window (Only PLATFORM_DESKTOP) ----@param image any ----@return any RL.SetWindowIcon -function RL.SetWindowIcon( image ) end - ----Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) ----@param images table ----@return any RL.SetWindowIcons -function RL.SetWindowIcons( images ) end - ----Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) ----@param title string ----@return any RL.SetWindowTitle -function RL.SetWindowTitle( title ) end - ----Set window position on screen ----@param pos table ----@return any RL.SetWindowPosition -function RL.SetWindowPosition( pos ) end - ----Set monitor for the current window ----@param monitor integer ----@return any RL.SetWindowMonitor -function RL.SetWindowMonitor( monitor ) end - ----Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) ----@param size table ----@return any RL.SetWindowMinSize -function RL.SetWindowMinSize( size ) end - ----Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) ----@param size table ----@return any RL.SetWindowMaxSize -function RL.SetWindowMaxSize( size ) end - ----Set window dimensions ----@param size table ----@return any RL.SetWindowSize -function RL.SetWindowSize( size ) end - ----Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) ----@param opacity number ----@return any RL.SetWindowOpacity -function RL.SetWindowOpacity( opacity ) end - ----Set window focused (only PLATFORM_DESKTOP) ----@return any RL.SetWindowFocused -function RL.SetWindowFocused() end - ----Get native window handle. Return as lightuserdata ----- Success return lightuserdata ----@return any windowHandle -function RL.GetWindowHandle() end - ----Get screen size ----- Success return Vector2 ----@return any size -function RL.GetScreenSize() end - ----Get render size ----- Success return Vector2 ----@return any size -function RL.GetRenderSize() end - ----Get number of connected monitors ----- Success return int ----@return any count -function RL.GetMonitorCount() end - ----Get current connected monitor ----- Success return int ----@return any monitor -function RL.GetCurrentMonitor() end - ----Get specified monitor position ----- Success return Vector2 ----@param monitor integer ----@return any position -function RL.GetMonitorPosition( monitor ) end - ----Get specified monitor size ----- Success return Vector2 ----@param monitor integer ----@return any size -function RL.GetMonitorSize( monitor ) end - ----Get specified monitor physical size in millimetres ----- Success return Vector2 ----@param monitor integer ----@return any size -function RL.GetMonitorPhysicalSize( monitor ) end - ----Get specified monitor refresh rate ----- Success return int ----@param monitor integer ----@return any refreshRate -function RL.GetMonitorRefreshRate( monitor ) end - ----Get window position on monitor ----- Success return Vector2 ----@return any position -function RL.GetWindowPosition() end - ----Get window scale DPI factor ----- Success return Vector2 ----@return any dpi -function RL.GetWindowScaleDPI() end - ----Get the human-readable, UTF-8 encoded name of the specified monitor ----- Success return string ----@param monitor integer ----@return any name -function RL.GetMonitorName( monitor ) end - ----Set clipboard text content ----@param text string ----@return any RL.SetClipboardText -function RL.SetClipboardText( text ) end - ----Get clipboard text content ----- Success return string ----@return any text -function RL.GetClipboardText() end - ----Get clipboard image content ----- Success return Image ----@return any image -function RL.GetClipboardImage() end - ----Enable waiting for events on EndDrawing(), no automatic event polling ----@return any RL.EnableEventWaiting -function RL.EnableEventWaiting() end - ----Disable waiting for events on EndDrawing(), automatic events polling ----@return any RL.DisableEventWaiting -function RL.DisableEventWaiting() end - --- Core - Cursor-related functions - ----Shows cursor ----@return any RL.ShowCursor -function RL.ShowCursor() end - ----Hides cursor ----@return any RL.HideCursor -function RL.HideCursor() end - ----Check if cursor is not visible ----- Success return bool ----@return any hidden -function RL.IsCursorHidden() end - ----Enables cursor (unlock cursor) ----@return any RL.EnableCursor -function RL.EnableCursor() end - ----Disables cursor (lock cursor) ----@return any RL.DisableCursor -function RL.DisableCursor() end - ----Check if cursor is on the screen ----- Success return bool ----@return any onSreen -function RL.IsCursorOnScreen() end - --- Core - Drawing-related functions - ----Set background color (framebuffer clear color) ----@param color table ----@return any RL.ClearBackground -function RL.ClearBackground( color ) end - ----Setup canvas (framebuffer) to start drawing ----@return any RL.BeginDrawing -function RL.BeginDrawing() end - ----End canvas drawing and swap buffers (double buffering) ----@return any RL.EndDrawing -function RL.EndDrawing() end - ----Begin 2D mode with custom camera (2D) ----@param camera any ----@return any RL.BeginMode2D -function RL.BeginMode2D( camera ) end - ----Ends 2D mode with custom camera ----@return any RL.EndMode2D -function RL.EndMode2D() end - ----Begin 3D mode with custom camera (3D) ----@param camera any ----@return any RL.BeginMode3D -function RL.BeginMode3D( camera ) end - ----Ends 3D mode and returns to default 2D orthographic mode ----@return any RL.EndMode3D -function RL.EndMode3D() end - ----Begin drawing to render texture ----@param target any ----@return any RL.BeginTextureMode -function RL.BeginTextureMode( target ) end - ----Ends drawing to render texture ----@return any RL.EndTextureMode -function RL.EndTextureMode() end - ----Begin custom shader drawing ----@param shader any ----@return any RL.BeginShaderMode -function RL.BeginShaderMode( shader ) end - ----End custom shader drawing (use default shader) ----@return any RL.EndShaderMode -function RL.EndShaderMode() end - ----Begin blending mode (BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED...) ----@param mode integer ----@return any RL.BeginBlendMode -function RL.BeginBlendMode( mode ) end - ----End blending mode (reset to default: BLEND_ALPHA) ----@return any RL.EndBlendMode -function RL.EndBlendMode() end - ----Begin scissor mode (define screen area for following drawing) ----@param rectange table ----@return any RL.BeginScissorMode -function RL.BeginScissorMode( rectange ) end - ----End scissor mode ----@return any RL.EndScissorMode -function RL.EndScissorMode() end - --- Core - Shader management functions - ----Load shader from files and bind default locations. ----NOTE: Set nil if no shader ----- Failure return nil ----- Success return Shader ----@param vsFileName string|nil ----@param fsFileName string|nil ----@return any shader -function RL.LoadShader( vsFileName, fsFileName ) end - ----Load shader from code strings and bind default locations ----NOTE: Set nil if no shader ----- Failure return nil ----- Success return Shader ----@param vsCode string|nil ----@param fsCode string|nil ----@return any shader -function RL.LoadShaderFromMemory( vsCode, fsCode ) end - ----Check if a shader is valid (loaded on GPU) ----- Success return bool ----@param shader any ----@return any isValid -function RL.IsShaderValid( shader ) end - ----Get shader program id ----- Success return int ----@param shader any ----@return any shaderId -function RL.GetShaderId( shader ) end - ----Get shader uniform location ----- Success return int ----@param shader any ----@param uniformName string ----@return any location -function RL.GetShaderLocation( shader, uniformName ) end - ----Get shader attribute location ----- Success return int ----@param shader any ----@param attribName string ----@return any location -function RL.GetShaderLocationAttrib( shader, attribName ) end - ----Set shader location index ----@param shader any ----@param shaderLocationIndex integer ----@param location integer ----@return any RL.SetShaderLocationIndex -function RL.SetShaderLocationIndex( shader, shaderLocationIndex, location ) end - ----Get shader location index ----- Success return int ----@param shader any ----@param shaderLocationIndex integer ----@return any location -function RL.GetShaderLocationIndex( shader, shaderLocationIndex ) end - ----Set shader uniform value (matrix 4x4) ----@param shader any ----@param locIndex integer ----@param mat table ----@return any RL.SetShaderValueMatrix -function RL.SetShaderValueMatrix( shader, locIndex, mat ) end - ----Set shader uniform value for texture (sampler2d) ----@param shader any ----@param locIndex integer ----@param texture any ----@return any RL.SetShaderValueTexture -function RL.SetShaderValueTexture( shader, locIndex, texture ) end - ----Set shader uniform value ----NOTE: Even one value should be in table ----@param shader any ----@param locIndex integer ----@param values table ----@param uniformType integer ----@return any RL.SetShaderValue -function RL.SetShaderValue( shader, locIndex, values, uniformType ) end - ----Set shader uniform value vector ----NOTE: Even one value should be in table ----@param shader any ----@param locIndex integer ----@param values table ----@param uniformType integer ----@param count integer ----@return any RL.SetShaderValueV -function RL.SetShaderValueV( shader, locIndex, values, uniformType, count ) end - ----Set shader uniform value using Buffer object ----@param shader any ----@param locIndex integer ----@param values any ----@param uniformType integer ----@return any RL.SetShaderValueWithBuffer -function RL.SetShaderValueWithBuffer( shader, locIndex, values, uniformType ) end - ----Set shader uniform value vector using Buffer object ----@param shader any ----@param locIndex integer ----@param values any ----@param uniformType integer ----@param count integer ----@return any RL.SetShaderValueVWithBuffer -function RL.SetShaderValueVWithBuffer( shader, locIndex, values, uniformType, count ) end - ----Unload shader from GPU memory (VRAM) ----@param shader any ----@return any RL.UnloadShader -function RL.UnloadShader( shader ) end - --- Core - Screen-space-related functions - ----Get a ray trace from screen position (i.e mouse) ----- Success return Ray ----@param mousePosition table ----@param camera any ----@return any ray -function RL.GetScreenToWorldRay( mousePosition, camera ) end - ----Get a ray trace from screen position (i.e mouse) in a viewport ----- Success return Ray ----@param mousePosition table ----@param camera any ----@param size table ----@return any ray -function RL.GetScreenToWorldRayEx( mousePosition, camera, size ) end - ----Get the screen space position for a 3d world space position ----- Success return Vector2 ----@param position table ----@param camera any ----@return any position -function RL.GetWorldToScreen( position, camera ) end - ----Get size position for a 3d world space position ----- Success return Vector2 ----@param position table ----@param camera any ----@param size table ----@return any position -function RL.GetWorldToScreenEx( position, camera, size ) end - ----Get the screen space position for a 2d camera world space position ----- Success return Vector2 ----@param position table ----@param camera any ----@return any position -function RL.GetWorldToScreen2D( position, camera ) end - ----Get the world space position for a 2d camera screen space position ----- Success return Vector2 ----@param position table ----@param camera any ----@return any position -function RL.GetScreenToWorld2D( position, camera ) end - ----Get camera transform matrix (view matrix) ----- Success return Matrix ----@param camera any ----@return any matrix -function RL.GetCameraMatrix( camera ) end - ----Get camera 2d transform matrix ----- Success return Matrix ----@param camera any ----@return any matrix -function RL.GetCameraMatrix2D( camera ) end - --- Core - Timing-related functions - ----Set target FPS (maximum) ----@param fps integer ----@return any RL.SetTargetFPS -function RL.SetTargetFPS( fps ) end - ----Get time in seconds for last frame drawn (Delta time) ----- Success return float ----@return any delta -function RL.GetFrameTime() end - ----Get elapsed time in seconds since InitWindow() ----- Success return float ----@return any time -function RL.GetTime() end - ----Get current FPS ----- Success return int ----@return any FPS -function RL.GetFPS() end - --- Core - Custom frame control functions - ----Swap back buffer with front buffer (screen drawing) ----@return any RL.SwapScreenBuffer -function RL.SwapScreenBuffer() end - ----Register all input events ----@return any RL.PollInputEvents -function RL.PollInputEvents() end - ----Wait for some time (halt program execution) ----@param seconds any ----@return any RL.WaitTime -function RL.WaitTime( seconds ) end - --- Core - Random values generation functions - ----Set the seed for the random number generator ----@param seed integer ----@return any RL.SetRandomSeed -function RL.SetRandomSeed( seed ) end - ----Get a random value between min and max (both included) ----- Success return int ----@param min integer ----@param max integer ----@return any time -function RL.GetRandomValue( min, max ) end - ----Load random values sequence, no values repeated ----- Success return int{} ----@param count integer ----@param min integer ----@param max integer ----@return any sequence -function RL.LoadRandomSequence( count, min, max ) end - --- Core - Misc - ----Takes a screenshot of current screen (filename extension defines format) ----@param fileName string ----@return any RL.TakeScreenshot -function RL.TakeScreenshot( fileName ) end - ----Setup init configuration flags (view FLAGS) ----@param flags integer ----@return any RL.SetConfigFlags -function RL.SetConfigFlags( flags ) end - ----Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) ----@param logLevel integer ----@param text string ----@return any RL.TraceLog -function RL.TraceLog( logLevel, text ) end - ----Set the current threshold (minimum) log level ----@param logLevel integer ----@return any RL.SetTraceLogLevel -function RL.SetTraceLogLevel( logLevel ) end - ----Set the log level for bad function calls and invalid data formats. ----@param logLevel integer ----@return any RL.SetLogLevelInvalid -function RL.SetLogLevelInvalid( logLevel ) end - ----Get the log level for bad function calls and invalid data formats. ----- Success return int ----@return any logLevel -function RL.GetLogLevelInvalid() end - ----Open URL with default system browser (if available) ----@param url string ----@return any RL.OpenURL -function RL.OpenURL( url ) end - ----Check if Lua garbage collection is set to unload object data ----- Success return bool ----@return any enabled -function RL.IsGCUnloadEnabled() end - ----Set Lua garbage collection to unload object data ----@param enabled boolean ----@return any RL.SetGCUnload -function RL.SetGCUnload( enabled ) end - ----Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten" ----- Success return string ----@return any platform -function RL.GetPlatform() end - --- Core - Files management functions - ----Load file data as byte array (read). Buffer type is BUFFER_UNSIGNED_CHAR ----- Success return Buffer ----@param fileName string ----@return any buffer -function RL.LoadFileData( fileName ) end - ----Save data to file from byte array (write), returns true on success ----- Success return bool ----@param fileName string ----@param Buffer any ----@return any success -function RL.SaveFileData( fileName, Buffer ) end - ----Export data to code (.h), returns true on success ----- Success return bool ----@param buffer any ----@param fileName string ----@return any success -function RL.ExportDataAsCode( buffer, fileName ) end - ----Load text data from file (read) ----- Success return string ----@param fileName string ----@return any text -function RL.LoadFileText( fileName ) end - ----Save text data to file (write), returns true on success ----- Success return bool ----@param fileName string ----@param text string ----@return any success -function RL.SaveFileText( fileName, text ) end - --- Core - Files system functions - ----Return game directory (where main.lua is located) ----- Success return string ----@return any path -function RL.GetBasePath() end - ----Check if file exists ----- Success return bool ----@param fileName string ----@return any fileExists -function RL.FileExists( fileName ) end - ----Check if a directory path exists ----- Success return bool ----@param dirPath string ----@return any dirExists -function RL.DirectoryExists( dirPath ) end - ----Check file extension (Including point: .png, .wav) ----- Success return bool ----@param fileName string ----@param ext string ----@return any hasFileExtension -function RL.IsFileExtension( fileName, ext ) end - ----Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) ----- Success return int ----@param fileName string ----@return any length -function RL.GetFileLength( fileName ) end - ----Get pointer to extension for a filename string (Includes dot: '.png') ----- Success return string ----@param fileName string ----@return any extension -function RL.GetFileExtension( fileName ) end - ----Get pointer to filename for a path string ----- Success return string ----@param filePath string ----@return any fileName -function RL.GetFileName( filePath ) end - ----Get filename string without extension (Uses static string) ----- Success return string ----@param filePath string ----@return any fileName -function RL.GetFileNameWithoutExt( filePath ) end - ----Get full path for a given fileName with path (Uses static string) ----- Success return string ----@param filePath string ----@return any filePath -function RL.GetDirectoryPath( filePath ) end - ----Get previous directory path for a given path (Uses static string) ----- Success return string ----@param dirPath string ----@return any directory -function RL.GetPrevDirectoryPath( dirPath ) end - ----Get current working directory (Uses static string) ----- Success return string ----@return any directory -function RL.GetWorkingDirectory() end - ----Get the directory of the running application (uses static string) ----- Success return string ----@return any directory -function RL.GetApplicationDirectory() end - ----Create directories (including full path requested), returns 0 on success ----- Success return int ----@param dirPath string ----@return any success -function RL.MakeDirectory( dirPath ) end - ----Change working directory, return true on success ----- Success return bool ----@param directory string ----@return any success -function RL.ChangeDirectory( directory ) end - ----Check if a given path is a file or a directory ----- Success return bool ----@param path string ----@return any isFile -function RL.IsPathFile( path ) end - ----Check if fileName is valid for the platform/OS ----- Success return bool ----@param fileName string ----@return any isValid -function RL.IsFileNameValid( fileName ) end - ----Load directory filepaths ----- Success return string{} ----@param dirPath string ----@return any fileNames -function RL.LoadDirectoryFiles( dirPath ) end - ----Load directory filepaths with extension filtering and recursive directory scan ----- Success return string{} ----@param basePath string ----@param filter string|nil ----@param scanSubdirs boolean ----@return any fileNames -function RL.LoadDirectoryFilesEx( basePath, filter, scanSubdirs ) end - ----Check if a file has been dropped into window ----- Success return bool ----@return any iSFileDropped -function RL.IsFileDropped() end - ----Load dropped filepaths ----- Success return string{} ----@return any files -function RL.LoadDroppedFiles() end - ----Get file modification time (Last write time) ----- Success return int ----@param fileName string ----@return any time -function RL.GetFileModTime( fileName ) end - --- Core - Compression/Encoding functionality - ----Compress data (DEFLATE algorithm) ----- Success return Buffer ----@param buffer any ----@return any compData -function RL.CompressData( buffer ) end - ----Decompress data (DEFLATE algorithm). ----- Success Buffer ----@param compData any ----@return any decompData -function RL.DecompressData( compData ) end - ----Encode data to Base64 string ----- Success return string, int ----@param data string ----@return any encodedData ----@return any outputSize -function RL.EncodeDataBase64( data ) end - ----Decode Base64 string data ----- Success return string, int ----@param data string ----@return any decodedData ----@return any outputSize -function RL.DecodeDataBase64( data ) end - ----Compute CRC32 hash code. ----- Failure return false ----- Success return int ----@param data any ----@return any code -function RL.ComputeCRC32( data ) end - ----Compute MD5 hash code, returns static int[4] (16 bytes). ----- Failure return false ----- Success return int{4} ----@param data any ----@return any code -function RL.ComputeMD5( data ) end - ----Compute SHA1 hash code, returns static int[5] (20 bytes). ----- Failure return false ----- Success return int{5} ----@param data any ----@return any code -function RL.ComputeSHA1( data ) end - --- Core - Automation events functionality - ----Load automation events list from file, nil for empty list, capacity = MAX_AUTOMATION_EVENTS ----- Success return AutomationEventList ----@param fileName string|nil ----@return any eventList -function RL.LoadAutomationEventList( fileName ) end - ----Unload automation events list from file ----@param list any ----@return any RL.UnloadAutomationEventList -function RL.UnloadAutomationEventList( list ) end - ----Export automation events list as text file ----- Failure return false ----- Success return true ----@param fileName string ----@return any success -function RL.ExportAutomationEventList( fileName ) end - ----Set automation event list to record to ----@param list any ----@return any RL.SetAutomationEventList -function RL.SetAutomationEventList( list ) end - ----Set automation event internal base frame to start recording ----@param frame integer ----@return any RL.SetAutomationEventBaseFrame -function RL.SetAutomationEventBaseFrame( frame ) end - ----Start recording automation events (AutomationEventList must be set) ----@return any RL.StartAutomationEventRecording -function RL.StartAutomationEventRecording() end - ----Stop recording automation events ----@return any RL.StopAutomationEventRecording -function RL.StopAutomationEventRecording() end - ----Play a recorded automation event ----@param event any ----@return any RL.PlayAutomationEvent -function RL.PlayAutomationEvent( event ) end - ----Get automation event list capacity ----- Success return int ----@param list any ----@return any capacity -function RL.GetAutomationEventListCapacity( list ) end - ----Get automation event list count ----- Success return int ----@param list any ----@return any count -function RL.GetAutomationEventListCount( list ) end - ----Get automation event from automation event list. Return as lightuserdata ----- Failure return nil ----- Success return AutomationEvent ----@param list any ----@param index integer ----@return any event -function RL.GetAutomationEvent( list, index ) end - ----Get automation event frame ----- Success return int ----@param event any ----@return any frame -function RL.GetAutomationEventFrame( event ) end - ----Get automation event type ----- Success return int ----@param event any ----@return any type -function RL.GetAutomationEventType( event ) end - ----Get automation event params ----- Success return int{} ----@param event any ----@return any params -function RL.GetAutomationEventParams( event ) end - --- Core - Input-related functions: keyboard - ----Detect if a key has been pressed once ----- Success return bool ----@param key integer ----@return any pressed -function RL.IsKeyPressed( key ) end - ----Check if a key has been pressed again (Only PLATFORM_DESKTOP) ----- Success return bool ----@param key integer ----@return any pressed -function RL.IsKeyPressedRepeat( key ) end - ----Detect if a key is being pressed ----- Success return bool ----@param key integer ----@return any pressed -function RL.IsKeyDown( key ) end - ----Detect if a key has been released once ----- Success return bool ----@param key integer ----@return any released -function RL.IsKeyReleased( key ) end - ----Check if a key is NOT being pressed ----- Success return bool ----@param key integer ----@return any released -function RL.IsKeyUp( key ) end - ----Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty ----- Success return int ----@return any keycode -function RL.GetKeyPressed() end - ----Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty ----- Success return int ----@return any unicode -function RL.GetCharPressed() end - ----Set a custom key to exit program (default is ESC) ----@param key integer ----@return any RL.SetExitKey -function RL.SetExitKey( key ) end - --- Core - Input-related functions: gamepads - ----Detect if a gamepad is available ----- Success return bool ----@param gamepad integer ----@return any available -function RL.IsGamepadAvailable( gamepad ) end - ----Return gamepad internal name id ----- Success return string ----@param gamepad integer ----@return any name -function RL.GetGamepadName( gamepad ) end - ----Detect if a gamepad button has been pressed once ----- Success return bool ----@param gamepad integer ----@param button integer ----@return any pressed -function RL.IsGamepadButtonPressed( gamepad, button ) end - ----Detect if a gamepad button is being pressed ----- Success return bool ----@param gamepad integer ----@param button integer ----@return any pressed -function RL.IsGamepadButtonDown( gamepad, button ) end - ----Detect if a gamepad button has been released once ----- Success return bool ----@param gamepad integer ----@param button integer ----@return any released -function RL.IsGamepadButtonReleased( gamepad, button ) end - ----Check if a gamepad button is NOT being pressed ----- Success return bool ----@param gamepad integer ----@param button integer ----@return any notPressed -function RL.IsGamepadButtonUp( gamepad, button ) end - ----Get the last gamepad button pressed ----- Success return int ----@return any button -function RL.GetGamepadButtonPressed() end - ----Return gamepad axis count for a gamepad ----- Success return int ----@param gamepad integer ----@return any count -function RL.GetGamepadAxisCount( gamepad ) end - ----Return axis movement value for a gamepad axis ----- Success return float ----@param gamepad integer ----@param axis integer ----@return any value -function RL.GetGamepadAxisMovement( gamepad, axis ) end - ----Set internal gamepad mappings (SDL_GameControllerDB) ----- Success return int ----@param mappings string ----@return any result -function RL.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 any RL.SetGamepadVibration -function RL.SetGamepadVibration( gamepad, leftMotor, rightMotor, duration ) end - --- Core - Input-related functions: mouse - ----Detect if a mouse button has been pressed once ----- Success return bool ----@param button integer ----@return any pressed -function RL.IsMouseButtonPressed( button ) end - ----Detect if a mouse button is being pressed ----- Success return bool ----@param button integer ----@return any pressed -function RL.IsMouseButtonDown( button ) end - ----Detect if a mouse button has been released once ----- Success return bool ----@param button integer ----@return any released -function RL.IsMouseButtonReleased( button ) end - ----Check if a mouse button is NOT being pressed ----- Success return bool ----@param button integer ----@return any released -function RL.IsMouseButtonUp( button ) end - ----Returns mouse position ----- Success return Vector2 ----@return any position -function RL.GetMousePosition() end - ----Get mouse delta between frames ----- Success return Vector2 ----@return any position -function RL.GetMouseDelta() end - ----Set mouse position XY ----@param position table ----@return any RL.SetMousePosition -function RL.SetMousePosition( position ) end - ----Set mouse offset ----@param offset table ----@return any RL.SetMouseOffset -function RL.SetMouseOffset( offset ) end - ----Set mouse scaling ----@param scale table ----@return any RL.SetMouseScale -function RL.SetMouseScale( scale ) end - ----Get mouse offset ----- Success return Vector2 ----@return any offset -function RL.GetMouseOffset() end - ----Get mouse scale ----- Success return Vector2 ----@return any scale -function RL.GetMouseScale() end - ----Get mouse wheel movement for X or Y, whichever is larger ----- Success return float ----@return any movement -function RL.GetMouseWheelMove() end - ----Get mouse wheel movement for both X and Y ----- Success return Vector2 ----@return any movement -function RL.GetMouseWheelMoveV() end - ----Set mouse cursor ----@param cursor integer ----@return any RL.SetMouseCursor -function RL.SetMouseCursor( cursor ) end - --- Core - Input-related functions: touch - ----Get touch position XY for a touch point index (relative to screen size) ----- Success return Vector2 ----@param index integer ----@return any position -function RL.GetTouchPosition( index ) end - ----Get touch point identifier for given index ----- Success return int ----@param index integer ----@return any id -function RL.GetTouchPointId( index ) end - ----Get touch point identifier for given index ----- Success return int ----@return any count -function RL.GetTouchPointCount() end - --- Core - Input-related functions: gestures - ----Enable a set of gestures using flags ----@param int any ----@return any RL.SetGesturesEnabled -function RL.SetGesturesEnabled( int ) end - ----Check if a gesture have been detected ----- Success return bool ----@param gesture integer ----@return any detected -function RL.IsGestureDetected( gesture ) end - ----Get latest detected gesture ----- Success return int ----@return any gesture -function RL.GetGestureDetected() end - ----Get gesture hold time in milliseconds ----- Success return float ----@return any time -function RL.GetGestureHoldDuration() end - ----Get gesture drag vector ----- Success return Vector2 ----@return any vector -function RL.GetGestureDragVector() end - ----Get gesture drag angle ----- Success return float ----@return any angle -function RL.GetGestureDragAngle() end - ----Get gesture pinch delta ----- Success return Vector2 ----@return any vector -function RL.GetGesturePinchVector() end - ----Get gesture pinch angle ----- Success return float ----@return any angle -function RL.GetGesturePinchAngle() end - --- Core - Camera2D System functions - ----Return camera2D set to default configuration ----- Success return Camera2D ----@return any camera2D -function RL.CreateCamera2D() end - ----Set camera target (rotation and zoom origin) ----@param camera any ----@param target table ----@return any RL.SetCamera2DTarget -function RL.SetCamera2DTarget( camera, target ) end - ----Set camera offset (displacement from target) ----@param camera any ----@param offset table ----@return any RL.SetCamera2DOffset -function RL.SetCamera2DOffset( camera, offset ) end - ----Set camera rotation in degrees ----@param camera any ----@param rotation number ----@return any RL.SetCamera2DRotation -function RL.SetCamera2DRotation( camera, rotation ) end - ----Set camera zoom (scaling), should be 1.0f by default ----@param camera any ----@param zoom number ----@return any RL.SetCamera2DZoom -function RL.SetCamera2DZoom( camera, zoom ) end - ----Get camera2D target ----- Success return Vector2 ----@param camera any ----@return any target -function RL.GetCamera2DTarget( camera ) end - ----Get camera2D offset ----- Success return Vector2 ----@param camera any ----@return any offset -function RL.GetCamera2DOffset( camera ) end - ----Get camera2D rotation ----- Success return float ----@param camera any ----@return any rotation -function RL.GetCamera2DRotation( camera ) end - ----Get camera2D zoom ----- Success return float ----@param camera any ----@return any zoom -function RL.GetCamera2DZoom( camera ) end - --- Core - Camera3D System functions - ----Return camera3D id set to default configuration ----- Success return int ----@return any camera -function RL.CreateCamera3D() end - ----Set camera position (Remember to call "RL.UpdateCamera3D()" to apply changes) ----@param camera any ----@param position table ----@return any RL.SetCamera3DPosition -function RL.SetCamera3DPosition( camera, position ) end - ----Set camera target it looks-at ----@param camera any ----@param target table ----@return any RL.SetCamera3DTarget -function RL.SetCamera3DTarget( camera, target ) end - ----Set camera up vector (Rotation over it's axis) ----@param camera any ----@param up table ----@return any RL.SetCamera3DUp -function RL.SetCamera3DUp( camera, up ) end - ----Set camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic ----@param camera any ----@param fovy number ----@return any RL.SetCamera3DFovy -function RL.SetCamera3DFovy( camera, fovy ) end - ----Set camera projection mode (CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC) ----@param camera any ----@param projection integer ----@return any RL.SetCamera3DProjection -function RL.SetCamera3DProjection( camera, projection ) end - ----Get camera position ----- Success return Vector3 ----@param camera any ----@return any position -function RL.GetCamera3DPosition( camera ) end - ----Get camera target it looks-at ----- Success return Vector3 ----@param camera any ----@return any target -function RL.GetCamera3DTarget( camera ) end - ----Get camera up vector (Rotation over it's axis) ----- Success return Vector3 ----@param camera any ----@return any up -function RL.GetCamera3DUp( camera ) end - ----Get camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic ----- Success return float ----@param camera any ----@return any fovy -function RL.GetCamera3DFovy( camera ) end - ----Get camera projection mode ----- Success return int ----@param camera any ----@return any projection -function RL.GetCamera3DProjection( camera ) end - ----Returns the cameras forward vector (normalized) ----- Success return Vector3 ----@param camera any ----@return any forward -function RL.GetCamera3DForward( camera ) end - ----Returns the cameras up vector (normalized) ----Note: The up vector might not be perpendicular to the forward vector ----- Success return Vector3 ----@param camera any ----@return any up -function RL.GetCamera3DUpNormalized( camera ) end - ----Returns the cameras right vector (normalized) ----- Success return Vector3 ----@param camera any ----@return any right -function RL.GetCamera3DRight( camera ) end - ----Moves the camera in it's forward direction ----@param camera any ----@param distance number ----@param moveInWorldPlane boolean ----@return any RL.Camera3DMoveForward -function RL.Camera3DMoveForward( camera, distance, moveInWorldPlane ) end - ----Moves the camera in it's up direction ----@param camera any ----@param distance number ----@return any RL.Camera3DMoveUp -function RL.Camera3DMoveUp( camera, distance ) end - ----Moves the camera target in it's current right direction ----@param camera any ----@param distance number ----@param moveInWorldPlane boolean ----@return any RL.Camera3DMoveRight -function RL.Camera3DMoveRight( camera, distance, moveInWorldPlane ) end - ----Moves the camera position closer/farther to/from the camera target ----@param camera any ----@param delta number ----@return any RL.Camera3DMoveToTarget -function RL.Camera3DMoveToTarget( camera, delta ) end - ----Rotates the camera around it's up vector ----Yaw is "looking left and right" ----If rotateAroundTarget is false, the camera rotates around it's position ----Note: angle must be provided in radians ----@param camera any ----@param angle number ----@param rotateAroundTarget boolean ----@return any RL.Camera3DYaw -function RL.Camera3DYaw( camera, angle, rotateAroundTarget ) end - ----Rotates the camera around it's right vector, pitch is "looking up and down" ----- lockView prevents camera overrotation (aka "somersaults") ----- rotateAroundTarget defines if rotation is around target or around it's position ----- rotateUp rotates the up direction as well (typically only usefull in CAMERA_FREE) ----NOTE: angle must be provided in radians ----@param camera any ----@param angle number ----@param lockView boolean ----@param rotateAroundTarget boolean ----@param rotateUp boolean ----@return any RL.Camera3DPitch -function RL.Camera3DPitch( camera, angle, lockView, rotateAroundTarget, rotateUp ) end - ----Rotates the camera around it's forward vector ----Roll is "turning your head sideways to the left or right" ----Note: angle must be provided in radians ----@param camera any ----@param angle number ----@return any RL.Camera3DRoll -function RL.Camera3DRoll( camera, angle ) end - ----Returns the camera view matrix ----- Success return Matrix ----@param camera any ----@return any view -function RL.GetCamera3DViewMatrix( camera ) end - ----Returns the camera projection matrix ----- Success return Matrix ----@param camera any ----@param aspect number ----@return any projection -function RL.GetCamera3DProjectionMatrix( camera, aspect ) end - ----Update camera position for selected mode ----@param camera any ----@param mode integer ----@return any RL.UpdateCamera3D -function RL.UpdateCamera3D( camera, mode ) end - ----Update camera movement, movement/rotation values should be provided by user ----@param camera any ----@param movement table ----@param rotation table ----@param zoom number ----@return any RL.UpdateCamera3DPro -function RL.UpdateCamera3DPro( camera, movement, rotation, zoom ) end - --- Core - Buffer management functions - ----Load Buffer. Type should be one of the Buffer types. Empty buffer will set data to NULL. ----- Success return Buffer ----@param buffer table ----@param type integer ----@return any buffer -function RL.LoadBuffer( buffer, type ) end - ----Load formatted buffer with all values set to 'value' ----- Success return Buffer ----@param length integer ----@param type integer ----@param value integer ----@return any buffer -function RL.LoadBufferFormatted( length, type, value ) end - ----Read buffer data from binary file ----- Failure return nil ----- Success return Buffer ----@param path string ----@param type integer ----@return any buffer -function RL.LoadBufferFromFile( path, type ) end - ----Read buffer data from string ----- Failure return nil ----- Success return Buffer ----@param buffer string ----@return any buffer -function RL.LoadBufferFromString( buffer ) end - ----Unload buffer data ----@param buffer any ----@return any RL.UnloadBuffer -function RL.UnloadBuffer( buffer ) end - ----Copy buffer data to another buffer. Size is in bytes ----@param dst any ----@param src any ----@param posDst integer ----@param posSrc integer ----@param size integer ----@return any RL.CopyBufferData -function RL.CopyBufferData( dst, src, posDst, posSrc, size ) end - ----Set buffer data value ----@param buffer any ----@param position integer ----@param values table ----@return any RL.SetBufferData -function RL.SetBufferData( buffer, position, values ) end - ----Swap buffer endianness from big endian to little endian and vice versa ----@param buffer any ----@return any RL.SwapBufferEndianness -function RL.SwapBufferEndianness( buffer ) end - ----Get buffer data as table in the format it was stored ----- Success return data{} ----@param buffer any ----@param position integer ----@param length integer ----@return any data -function RL.GetBufferData( buffer, position, length ) end - ----Get buffer as string ----- Success return string ----@param buffer any ----@return any string -function RL.GetBufferAsString( buffer ) end - ----Get buffer type ----- Success return int ----@param buffer any ----@return any type -function RL.GetBufferType( buffer ) end - ----Get buffer size in bytes ----- Success return int ----@param buffer any ----@return any size -function RL.GetBufferSize( buffer ) end - ----Get buffer element size in bytes ----- Success return int ----@param buffer any ----@return any size -function RL.GetBufferElementSize( buffer ) end - ----Get buffer element count ----- Success return int ----@param buffer any ----@return any length -function RL.GetBufferLength( buffer ) end - ----Write buffer data to binary file ----@param buffer any ----@param path string ----@return any RL.ExportBuffer -function RL.ExportBuffer( buffer, path ) end - --- Shapes - Basic shapes drawing functions - ----Set texture and rectangle to be used on shapes drawing ----NOTE: It can be useful when using basic shapes and one single font, ----defining a font char white rectangle would allow drawing everything in a single draw call ----@param texture any ----@param source table ----@return any RL.SetShapesTexture -function RL.SetShapesTexture( texture, source ) end - ----Get texture that is used for shapes drawing. Return as lightuserdata ----- Success return Texture ----@return any texture -function RL.GetShapesTexture() end - ----Get texture source rectangle that is used for shapes drawing ----- Success return Rectangle ----@return any source -function RL.GetShapesTextureRectangle() end - ----Draw a pixel ----@param pos table ----@param color table ----@return any RL.DrawPixel -function RL.DrawPixel( pos, color ) end - ----Draw a line defining thickness ----@param startPos table ----@param endPos table ----@param thickness number ----@param color table ----@return any RL.DrawLine -function RL.DrawLine( startPos, endPos, thickness, color ) end - ----Draw lines sequence ----@param points table ----@param color table ----@return any RL.DrawLineStrip -function RL.DrawLineStrip( points, color ) end - ----Draw a line using cubic-bezier curves in-out ----@param startPos table ----@param endPos table ----@param thickness number ----@param color table ----@return any RL.DrawLineBezier -function RL.DrawLineBezier( startPos, endPos, thickness, color ) end - ----Draw a color-filled circle ----@param center table ----@param radius number ----@param color table ----@return any RL.DrawCircle -function RL.DrawCircle( center, radius, color ) end - ----Draw a piece of a circle ----@param center table ----@param radius number ----@param startAngle number ----@param endAngle number ----@param segments integer ----@param color table ----@return any RL.DrawCircleSector -function RL.DrawCircleSector( center, radius, startAngle, endAngle, segments, color ) end - ----Draw circle sector outline ----@param center table ----@param radius number ----@param startAngle number ----@param endAngle number ----@param segments integer ----@param color table ----@return any RL.DrawCircleSectorLines -function RL.DrawCircleSectorLines( center, radius, startAngle, endAngle, segments, color ) end - ----Draw a gradient-filled circle ----@param center table ----@param radius number ----@param color1 table ----@param color2 table ----@return any RL.DrawCircleGradient -function RL.DrawCircleGradient( center, radius, color1, color2 ) end - ----Draw circle outline ----@param center table ----@param radius number ----@param color table ----@return any RL.DrawCircleLines -function RL.DrawCircleLines( center, radius, color ) end - ----Draw ellipse ----@param center table ----@param radiusH number ----@param radiusV number ----@param color table ----@return any RL.DrawEllipse -function RL.DrawEllipse( center, radiusH, radiusV, color ) end - ----Draw ellipse outline ----@param center table ----@param radiusH number ----@param radiusV number ----@param color table ----@return any RL.DrawEllipseLines -function RL.DrawEllipseLines( center, radiusH, radiusV, color ) end - ----Draw ring ----@param center table ----@param innerRadius number ----@param outerRadius number ----@param startAngle number ----@param endAngle number ----@param segments integer ----@param color table ----@return any RL.DrawRing -function RL.DrawRing( center, innerRadius, outerRadius, startAngle, endAngle, segments, color ) end - ----Draw ring outline ----@param center table ----@param innerRadius number ----@param outerRadius number ----@param startAngle number ----@param endAngle number ----@param segments integer ----@param color table ----@return any RL.DrawRingLines -function RL.DrawRingLines( center, innerRadius, outerRadius, startAngle, endAngle, segments, color ) end - ----Draw a color-filled rectangle ----@param rec table ----@param color table ----@return any RL.DrawRectangle -function RL.DrawRectangle( rec, color ) end - ----Draw a color-filled rectangle with pro parameters ----@param rec table ----@param origin table ----@param rotation number ----@param color table ----@return any RL.DrawRectanglePro -function RL.DrawRectanglePro( rec, origin, rotation, color ) end - ----Draw a vertical-gradient-filled rectangle ----@param rectangle table ----@param color1 table ----@param color2 table ----@return any RL.DrawRectangleGradientV -function RL.DrawRectangleGradientV( rectangle, color1, color2 ) end - ----Draw a horizontal-gradient-filled rectangle ----@param rectangle table ----@param color1 table ----@param color2 table ----@return any RL.DrawRectangleGradientH -function RL.DrawRectangleGradientH( rectangle, color1, color2 ) end - ----Draw a gradient-filled rectangle with custom vertex colors ----@param rectangle table ----@param col1 table ----@param col2 table ----@param col3 table ----@param col4 table ----@return any RL.DrawRectangleGradientEx -function RL.DrawRectangleGradientEx( rectangle, col1, col2, col3, col4 ) end - ----Draw rectangle outline ----@param rec table ----@param color table ----@return any RL.DrawRectangleLines -function RL.DrawRectangleLines( rec, color ) end - ----Draw rectangle outline with extended parameters ----@param rec table ----@param lineThick integer ----@param color table ----@return any RL.DrawRectangleLinesEx -function RL.DrawRectangleLinesEx( rec, lineThick, color ) end - ----Draw rectangle with rounded edges ----@param rec table ----@param roundness number ----@param segments integer ----@param color table ----@return any RL.DrawRectangleRounded -function RL.DrawRectangleRounded( rec, roundness, segments, color ) end - ----Draw rectangle lines with rounded edges ----@param rec table ----@param roundness number ----@param segments integer ----@param color table ----@return any RL.DrawRectangleRoundedLines -function RL.DrawRectangleRoundedLines( rec, roundness, segments, color ) end - ----Draw rectangle with rounded edges outline ----@param rec table ----@param roundness number ----@param segments integer ----@param lineThick number ----@param color table ----@return any RL.DrawRectangleRoundedLinesEx -function RL.DrawRectangleRoundedLinesEx( rec, roundness, segments, lineThick, color ) end - ----Draw a color-filled triangle (Vertex in counter-clockwise order!) ----@param v1 table ----@param v2 table ----@param v3 table ----@param color table ----@return any RL.DrawTriangle -function RL.DrawTriangle( v1, v2, v3, color ) end - ----Draw triangle outline (Vertex in counter-clockwise order!) ----@param v1 table ----@param v2 table ----@param v3 table ----@param color table ----@return any RL.DrawTriangleLines -function RL.DrawTriangleLines( v1, v2, v3, color ) end - ----Draw a triangle fan defined by points (first vertex is the center) ----@param points table ----@param color table ----@return any RL.DrawTriangleFan -function RL.DrawTriangleFan( points, color ) end - ----Draw a triangle strip defined by points ----@param points table ----@param color table ----@return any RL.DrawTriangleStrip -function RL.DrawTriangleStrip( points, color ) end - ----Draw a regular polygon (Vector version) ----@param center table ----@param sides integer ----@param radius number ----@param rotation number ----@param color table ----@return any RL.DrawPoly -function RL.DrawPoly( center, sides, radius, rotation, color ) end - ----Draw a polygon outline of n sides ----@param center table ----@param sides integer ----@param radius number ----@param rotation number ----@param color table ----@return any RL.DrawPolyLines -function RL.DrawPolyLines( center, sides, radius, rotation, color ) end - ----Draw a polygon outline of n sides with extended parameters ----@param center table ----@param sides integer ----@param radius number ----@param rotation number ----@param lineThick number ----@param color table ----@return any RL.DrawPolyLinesEx -function RL.DrawPolyLinesEx( center, sides, radius, rotation, lineThick, color ) end - --- Shapes - Splines drawing functions - ----Draw spline: Linear, minimum 2 points ----@param points table ----@param thick number ----@param color table ----@return any RL.DrawSplineLinear -function RL.DrawSplineLinear( points, thick, color ) end - ----Draw spline: B-Spline, minimum 4 points ----@param points table ----@param thick number ----@param color table ----@return any RL.DrawSplineBasis -function RL.DrawSplineBasis( points, thick, color ) end - ----Draw spline: Catmull-Rom, minimum 4 points ----@param points table ----@param thick number ----@param color table ----@return any RL.DrawSplineCatmullRom -function RL.DrawSplineCatmullRom( points, thick, color ) end - ----Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] ----@param points table ----@param thick number ----@param color table ----@return any RL.DrawSplineBezierQuadratic -function RL.DrawSplineBezierQuadratic( points, thick, color ) end - ----Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] ----@param points table ----@param thick number ----@param color table ----@return any RL.DrawSplineBezierCubic -function RL.DrawSplineBezierCubic( points, thick, color ) end - ----Draw spline segment: Linear, 2 points ----@param p1 table ----@param p2 table ----@param thick number ----@param color table ----@return any RL.DrawSplineSegmentLinear -function RL.DrawSplineSegmentLinear( p1, p2, thick, color ) end - ----Draw spline segment: B-Spline, 4 points ----@param p1 table ----@param p2 table ----@param p3 table ----@param p4 table ----@param thick number ----@param color table ----@return any RL.DrawSplineSegmentBasis -function RL.DrawSplineSegmentBasis( p1, p2, p3, p4, thick, color ) end - ----Draw spline segment: Catmull-Rom, 4 points ----@param p1 table ----@param p2 table ----@param p3 table ----@param p4 table ----@param thick number ----@param color table ----@return any RL.DrawSplineSegmentCatmullRom -function RL.DrawSplineSegmentCatmullRom( p1, p2, p3, p4, thick, color ) end - ----Draw spline segment: Quadratic Bezier, 2 points, 1 control point ----@param p1 table ----@param c2 table ----@param p3 table ----@param thick number ----@param color table ----@return any RL.DrawSplineSegmentBezierQuadratic -function RL.DrawSplineSegmentBezierQuadratic( p1, c2, p3, thick, color ) end - ----Draw spline segment: Cubic Bezier, 2 points, 2 control points ----@param p1 table ----@param c2 table ----@param c3 table ----@param p4 table ----@param thick number ----@param color table ----@return any RL.DrawSplineSegmentBezierCubic -function RL.DrawSplineSegmentBezierCubic( p1, c2, c3, p4, thick, color ) end - --- Shapes - Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] - ----Get (evaluate) spline point: Linear ----- Success return Vector2 ----@param startPos table ----@param endPos table ----@param t number ----@return any point -function RL.GetSplinePointLinear( startPos, endPos, t ) end - ----Get (evaluate) spline point: B-Spline ----- Success return Vector2 ----@param p1 table ----@param p2 table ----@param p3 table ----@param p4 table ----@param t number ----@return any point -function RL.GetSplinePointBasis( p1, p2, p3, p4, t ) end - ----Get (evaluate) spline point: Catmull-Rom ----- Success return Vector2 ----@param p1 table ----@param p2 table ----@param p3 table ----@param p4 table ----@param t number ----@return any point -function RL.GetSplinePointCatmullRom( p1, p2, p3, p4, t ) end - ----Get (evaluate) spline point: Quadratic Bezier ----- Success return Vector2 ----@param p1 table ----@param c2 table ----@param p3 table ----@param t number ----@return any point -function RL.GetSplinePointBezierQuad( p1, c2, p3, t ) end - ----Get (evaluate) spline point: Cubic Bezier ----- Success return Vector2 ----@param p1 table ----@param c2 table ----@param c3 table ----@param p4 table ----@param t number ----@return any point -function RL.GetSplinePointBezierCubic( p1, c2, c3, p4, t ) end - --- Shapes - Basic shapes collision detection functions - ----Check collision between two rectangles ----- Success return bool ----@param rec1 table ----@param rec2 table ----@return any collision -function RL.CheckCollisionRecs( rec1, rec2 ) end - ----Check collision between two circles ----- Success return bool ----@param center1 table ----@param radius1 number ----@param center2 table ----@param radius2 number ----@return any collision -function RL.CheckCollisionCircles( center1, radius1, center2, radius2 ) end - ----Check collision between circle and rectangle ----- Success return bool ----@param center table ----@param radius number ----@param rec table ----@return any collision -function RL.CheckCollisionCircleRec( center, radius, rec ) end - ----Check if circle collides with a line created betweeen two points [p1] and [p2] ----- Success return bool ----@param center table ----@param radius number ----@param p1 table ----@param p2 table ----@return any collision -function RL.CheckCollisionCircleLine( center, radius, p1, p2 ) end - ----Check if point is inside rectangle ----- Success return bool ----@param point table ----@param rec table ----@return any collision -function RL.CheckCollisionPointRec( point, rec ) end - ----Check if point is inside circle ----- Success return bool ----@param point table ----@param center table ----@param radius number ----@return any collision -function RL.CheckCollisionPointCircle( point, center, radius ) end - ----Check if point is inside a triangle ----- Success return bool ----@param point table ----@param p1 table ----@param p2 table ----@param p3 table ----@return any collision -function RL.CheckCollisionPointTriangle( point, p1, p2, p3 ) end - ----Check if point is within a polygon described by array of vertices ----- Success return bool ----@param point table ----@param points table ----@return any collision -function RL.CheckCollisionPointPoly( point, points ) end - ----Check the collision between two lines defined by two points each, returns collision point by reference ----- Success return bool, Vector2 ----@param startPos1 table ----@param endPos1 table ----@param startPos2 table ----@param endPos2 table ----@return any collision ----@return any position -function RL.CheckCollisionLines( startPos1, endPos1, startPos2, endPos2 ) end - ----Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] ----- Success return bool ----@param point table ----@param p1 table ----@param p2 table ----@param threshold integer ----@return any collision -function RL.CheckCollisionPointLine( point, p1, p2, threshold ) end - ----Get collision rectangle for two rectangles collision ----- Success return Rectangle ----@param rec1 table ----@param rec2 table ----@return any rectangle -function RL.GetCollisionRec( rec1, rec2 ) end - ----Useful for e.g. packing rectangular textures into an atlas. stbrp_pack_rects ----- Success return Rectangle{} ----@param rects table ----@param size table ----@param padding integer ----@return any rects{} -function RL.RectPack( rects, size, padding ) end - --- Textures - Image loading functions - ----Load image from file into CPU memory (RAM) ----- Failure return nil ----- Success return Image ----@param fileName string ----@return any image -function RL.LoadImage( fileName ) end - ----Load image from RAW file data ----- Failure return nil ----- Success return Image ----@param fileName string ----@param size table ----@param format integer ----@param headerSize integer ----@return any image -function RL.LoadImageRaw( fileName, size, format, headerSize ) end - ----Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format ----- Failure return nil ----- Success return Image, int ----@param fileName string ----@return any image ----@return any frameCount -function RL.LoadImageAnim( fileName ) end - ----Load image sequence from memory buffer. All frames are returned in RGBA format ----- Success return Image, int ----@param fileType string ----@param fileData any ----@return any image ----@return any frameCount -function RL.LoadImageAnimFromMemory( fileType, fileData ) end - ----Load image from memory buffer, fileType refers to extension: i.e. '.png' ----- Success return Image ----@param fileType string ----@param data any ----@return any image ----@return any frameCount -function RL.LoadImageFromMemory( fileType, data ) end - ----Load image from data ----- Success return Image ----@param data any ----@param size table ----@param mipmaps integer ----@param format integer ----@return any image ----@return any frameCount -function RL.LoadImageFromData( data, size, mipmaps, format ) end - ----Load image from GPU texture data ----- Success return Image ----@param texture any ----@return any image -function RL.LoadImageFromTexture( texture ) end - ----Load image from screen buffer and (screenshot) ----- Success return Image ----@return any image -function RL.LoadImageFromScreen() end - ----Check if an image is valid (data and parameters) ----- Success return bool ----@param image any ----@return any isValid -function RL.IsImageValid( image ) end - ----Unload image from CPU memory (RAM) ----@param image any ----@return any RL.UnloadImage -function RL.UnloadImage( image ) end - ----Export image data to file, returns true on success ----- Success return bool ----@param image any ----@param fileName string ----@return any success -function RL.ExportImage( image, fileName ) end - ----Export image to memory buffer ----- Success return Buffer ----@param image any ----@param fileType string ----@return any buffer -function RL.ExportImageToMemory( image, fileType ) end - ----Export image as code file defining an array of bytes, returns true on success ----- Success return bool ----@param image any ----@param fileName string ----@return any success -function RL.ExportImageAsCode( image, fileName ) end - --- Textures - Image generation functions - ----Generate image: plain color ----- Success return Image ----@param size table ----@param color table ----@return any image -function RL.GenImageColor( size, color ) end - ----Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient ----- Success return Image ----@param size table ----@param direction integer ----@param a table ----@param b table ----@return any image -function RL.GenImageGradientLinear( size, direction, a, b ) end - ----Generate image: radial gradient ----- Success return Image ----@param size table ----@param density number ----@param inner table ----@param outer table ----@return any image -function RL.GenImageGradientRadial( size, density, inner, outer ) end - ----Generate image: square gradient ----- Success return Image ----@param size table ----@param density number ----@param inner table ----@param outer table ----@return any image -function RL.GenImageGradientSquare( size, density, inner, outer ) end - ----Generate image: checked ----- Success return Image ----@param size table ----@param checks table ----@param col1 table ----@param col2 table ----@return any image -function RL.GenImageChecked( size, checks, col1, col2 ) end - ----Generate image: white noise ----- Success return Image ----@param size table ----@param factor number ----@return any image -function RL.GenImageWhiteNoise( size, factor ) end - ----Generate image: perlin noise ----- Success return Image ----@param size table ----@param offset table ----@param factor number ----@return any image -function RL.GenImagePerlinNoise( size, offset, factor ) end - ----Generate image: cellular algorithm. Bigger tileSize means bigger cells ----- Success return Image ----@param size table ----@param tileSize integer ----@return any image -function RL.GenImageCellular( size, tileSize ) end - ----Generate image: grayscale image from text data ----- Success return Image ----@param size table ----@param text string ----@return any image -function RL.GenImageText( size, text ) end - --- Textures - Image manipulation functions - ----Create an image duplicate (useful for transformations) ----- Success return Image ----@param image any ----@return any image -function RL.ImageCopy( image ) end - ----Create an image from another image piece ----- Success return Image ----@param image any ----@param rec table ----@return any image -function RL.ImageFromImage( image, rec ) end - ----Create an image from a selected channel of another image (GRAYSCALE) ----- Success return Image ----@param image any ----@param selectedChannel integer ----@return any image -function RL.ImageFromChannel( image, selectedChannel ) end - ----Create an image from text (default font) ----- Success return Image ----@param text string ----@param fontSize integer ----@param tint table ----@return any image -function RL.ImageText( text, fontSize, tint ) end - ----Create an image from text (custom sprite font) ----- Success return Image ----@param font any ----@param text string ----@param fontSize number ----@param spacing number ----@param tint table ----@return any image -function RL.ImageTextEx( font, text, fontSize, spacing, tint ) end - ----Convert image data to desired format ----@param image any ----@param newFormat integer ----@return any RL.ImageFormat -function RL.ImageFormat( image, newFormat ) end - ----Convert image to POT (power-of-two) ----@param image any ----@param fill table ----@return any RL.ImageToPOT -function RL.ImageToPOT( image, fill ) end - ----Crop an image to a defined rectangle ----@param image any ----@param crop table ----@return any RL.ImageCrop -function RL.ImageCrop( image, crop ) end - ----Crop image depending on alpha value ----@param image any ----@param threshold number ----@return any RL.ImageAlphaCrop -function RL.ImageAlphaCrop( image, threshold ) end - ----Clear alpha channel to desired color ----@param image any ----@param color table ----@param threshold number ----@return any RL.ImageAlphaClear -function RL.ImageAlphaClear( image, color, threshold ) end - ----Apply alpha mask to image ----@param image any ----@param alphaMask any ----@return any RL.ImageAlphaMask -function RL.ImageAlphaMask( image, alphaMask ) end - ----Premultiply alpha channel ----@param image any ----@return any RL.ImageAlphaPremultiply -function RL.ImageAlphaPremultiply( image ) end - ----Apply Gaussian blur using a box blur approximation ----@param image any ----@param blurSize integer ----@return any RL.ImageBlurGaussian -function RL.ImageBlurGaussian( image, blurSize ) end - ----Apply custom square convolution kernel to image ----@param image any ----@param kernel table ----@return any RL.ImageKernelConvolution -function RL.ImageKernelConvolution( image, kernel ) end - ----Resize image (Bicubic scaling algorithm) ----@param image any ----@param size table ----@return any RL.ImageResize -function RL.ImageResize( image, size ) end - ----Resize image (Nearest-Neighbor scaling algorithm) ----@param image any ----@param size table ----@return any RL.ImageResizeNN -function RL.ImageResizeNN( image, size ) end - ----Resize canvas and fill with color ----@param image any ----@param size table ----@param offset table ----@param fill table ----@return any RL.ImageResizeCanvas -function RL.ImageResizeCanvas( image, size, offset, fill ) end - ----Generate all mipmap levels for a provided image ----@param image any ----@return any RL.ImageMipmaps -function RL.ImageMipmaps( image ) end - ----Dither image data to 16bpp or lower (Floyd-Steinberg dithering) ----@param image any ----@param bpp table ----@return any RL.ImageDither -function RL.ImageDither( image, bpp ) end - ----Flip image vertically ----@param image any ----@return any RL.ImageFlipVertical -function RL.ImageFlipVertical( image ) end - ----Flip image horizontally ----@param image any ----@return any RL.ImageFlipHorizontal -function RL.ImageFlipHorizontal( image ) end - ----Rotate image by input angle in degrees (-359 to 359) ----@param image any ----@param degrees integer ----@return any RL.ImageRotate -function RL.ImageRotate( image, degrees ) end - ----Rotate image clockwise 90deg ----@param image any ----@return any RL.ImageRotateCW -function RL.ImageRotateCW( image ) end - ----Rotate image counter-clockwise 90deg ----@param image any ----@return any RL.ImageRotateCCW -function RL.ImageRotateCCW( image ) end - ----Modify image color: tint ----@param image any ----@param color table ----@return any RL.ImageColorTint -function RL.ImageColorTint( image, color ) end - ----Modify image color: invert ----@param image any ----@return any RL.ImageColorInvert -function RL.ImageColorInvert( image ) end - ----Modify image color: grayscale ----@param image any ----@return any RL.ImageColorGrayscale -function RL.ImageColorGrayscale( image ) end - ----Modify image color: contrast (-100 to 100) ----@param image any ----@param contrast number ----@return any RL.ImageColorContrast -function RL.ImageColorContrast( image, contrast ) end - ----Modify image color: brightness (-255 to 255) ----@param image any ----@param brightness integer ----@return any RL.ImageColorBrightness -function RL.ImageColorBrightness( image, brightness ) end - ----Modify image color: replace color ----@param image any ----@param color table ----@param replace table ----@return any RL.ImageColorReplace -function RL.ImageColorReplace( image, color, replace ) end - ----Load color data from image as a Color array (RGBA - 32bit) ----- Success return Color{} ----@param image any ----@return any colors -function RL.LoadImageColors( image ) end - ----Load colors palette from image as a Color array (RGBA - 32bit) ----- Success return Color{} ----@param image any ----@param maxPaletteSize integer ----@return any colors -function RL.LoadImagePalette( image, maxPaletteSize ) end - ----Get image alpha border rectangle ----- Success return Rectangle ----@param image any ----@param threshold number ----@return any rectangle -function RL.GetImageAlphaBorder( image, threshold ) end - ----Get image pixel color at (x, y) position ----- Success return Color ----@param image any ----@param pixelPos table ----@return any color -function RL.GetImageColor( image, pixelPos ) end - --- Textures - Image configuration functions - ----Set image data from Buffer ----@param image any ----@param data any ----@return any RL.SetImageData -function RL.SetImageData( image, data ) end - ----Get image data as Buffer ----- Success return Buffer ----@param image any ----@return any imageData -function RL.GetImageData( image ) end - ----Get image size ----- Success return Vector2 ----@param image any ----@return any size -function RL.GetImageSize( image ) end - ----Get image mipmaps. Mipmap levels, 1 by default ----- Success return int ----@param image any ----@return any mipmaps -function RL.GetImageMipmaps( image ) end - ----Get image data format (PixelFormat type) ----- Success return int ----@param image any ----@return any format -function RL.GetImageFormat( image ) end - --- Textures - Image drawing functions - ----Clear image background with given color ----@param dst any ----@param color table ----@return any RL.ImageClearBackground -function RL.ImageClearBackground( dst, color ) end - ----Draw pixel within an image ----@param dst any ----@param position table ----@param color table ----@return any RL.ImageDrawPixel -function RL.ImageDrawPixel( dst, position, color ) end - ----Draw line within an image ----@param dst any ----@param start table ----@param end table ----@param color table ----@return any RL.ImageDrawLine -function RL.ImageDrawLine( dst, start, end, color ) end - ----Draw a line defining thickness within an image ----@param dst any ----@param start table ----@param end table ----@param thick integer ----@param color table ----@return any RL.ImageDrawLineEx -function RL.ImageDrawLineEx( dst, start, end, thick, color ) end - ----Draw circle within an image ----@param dst any ----@param center table ----@param radius integer ----@param color table ----@return any RL.ImageDrawCircle -function RL.ImageDrawCircle( dst, center, radius, color ) end - ----Draw circle outline within an image ----@param dst any ----@param center table ----@param radius integer ----@param color table ----@return any RL.ImageDrawCircleLines -function RL.ImageDrawCircleLines( dst, center, radius, color ) end - ----Draw rectangle within an image ----@param dst any ----@param rec table ----@param color table ----@return any RL.ImageDrawRectangle -function RL.ImageDrawRectangle( dst, rec, color ) end - ----Draw rectangle lines within an image ----@param dst any ----@param rec table ----@param thick integer ----@param color table ----@return any RL.ImageDrawRectangleLines -function RL.ImageDrawRectangleLines( dst, rec, thick, color ) end - ----Draw triangle within an image ----@param dst any ----@param v1 table ----@param v2 table ----@param v3 table ----@param color table ----@return any RL.ImageDrawTriangle -function RL.ImageDrawTriangle( dst, v1, v2, v3, color ) end - ----Draw triangle with interpolated colors within an image ----@param dst any ----@param v1 table ----@param v2 table ----@param v3 table ----@param c1 table ----@param c2 table ----@param c3 table ----@return any RL.ImageDrawTriangleEx -function RL.ImageDrawTriangleEx( dst, v1, v2, v3, c1, c2, c3 ) end - ----Draw triangle outline within an image ----@param dst any ----@param v1 table ----@param v2 table ----@param v3 table ----@param color table ----@return any RL.ImageDrawTriangleLines -function RL.ImageDrawTriangleLines( dst, v1, v2, v3, color ) end - ----Draw a triangle fan defined by points within an image (first vertex is the center) ----@param dst any ----@param points table ----@param color table ----@return any RL.ImageDrawTriangleFan -function RL.ImageDrawTriangleFan( dst, points, color ) end - ----Draw a triangle strip defined by points within an image ----@param dst any ----@param points table ----@param color table ----@return any RL.ImageDrawTriangleStrip -function RL.ImageDrawTriangleStrip( dst, points, color ) end - ----Draw a source image within a destination image (Tint applied to source) ----@param dst any ----@param src any ----@param srcRec table ----@param dstRec table ----@param tint table ----@return any RL.ImageDraw -function RL.ImageDraw( dst, src, srcRec, dstRec, tint ) end - ----Draw text (using default font) within an image (destination) ----@param dst any ----@param text string ----@param position table ----@param fontSize number ----@param tint table ----@return any RL.ImageDrawText -function RL.ImageDrawText( dst, text, position, fontSize, tint ) end - ----Draw text (Custom sprite font) within an image (Destination) ----@param dst any ----@param font any ----@param text string ----@param position table ----@param fontSize number ----@param spacing number ----@param tint table ----@return any RL.ImageDrawTextEx -function RL.ImageDrawTextEx( dst, font, text, position, fontSize, spacing, tint ) end - --- Textures - Texture loading functions - ----Get default texture. Return as lightuserdata ----- Success return Texture ----@return any texture -function RL.GetTextureDefault() end - ----Load texture from file into GPU memory ( VRAM ) ----- Failure return nil ----- Success return Texture ----@param fileName string ----@return any texture -function RL.LoadTexture( fileName ) end - ----Load texture from image data ----- Success return Texture ----@param image any ----@return any texture -function RL.LoadTextureFromImage( image ) end - ----Load cubemap from image, multiple image cubemap layouts supported ----- Success return Texture ----@param image any ----@param layout integer ----@return any texture -function RL.LoadTextureCubemap( image, layout ) end - ----Load Texture from data ----- Success return Texture ----@param textureData table ----@return any texture -function RL.LoadTextureFromData( textureData ) end - ----Load texture for rendering (framebuffer) ----- Success return RenderTexture ----@param size table ----@return any renderTexture -function RL.LoadRenderTexture( size ) end - ----Load RenderTexture from data (framebuffer) ----- Success return RenderTexture ----@param renderTextureData table ----@return any renderTexture -function RL.LoadRenderTextureFromData( renderTextureData ) end - ----Check if a texture is valid (loaded in GPU) ----- Success return bool ----@param texture any ----@return any isValid -function RL.IsTextureValid( texture ) end - ----Unload texture from GPU memory (VRAM) ----@param texture any ----@return any RL.UnloadTexture -function RL.UnloadTexture( texture ) end - ----Check if a render texture is valid (loaded in GPU) ----- Success return bool ----@param target any ----@return any isValid -function RL.IsRenderTextureValid( target ) end - ----Unload render texture from GPU memory (VRAM) ----@param target any ----@return any RL.UnloadRenderTexture -function RL.UnloadRenderTexture( target ) end - ----Update GPU texture with new data ----@param texture any ----@param pixels any ----@return any RL.UpdateTexture -function RL.UpdateTexture( texture, pixels ) end - ----Update GPU texture rectangle with new data. ----@param texture any ----@param rec table ----@param pixels any ----@return any RL.UpdateTextureRec -function RL.UpdateTextureRec( texture, rec, pixels ) end - --- Textures - Texture configuration functions - ----Generate GPU mipmaps for a texture ----@param texture any ----@return any RL.GenTextureMipmaps -function RL.GenTextureMipmaps( texture ) end - ----Set texture scaling filter mode (TEXTURE_FILTER_POINT, TEXTURE_FILTER_BILINEAR...) ----@param texture any ----@param filter integer ----@return any RL.SetTextureFilter -function RL.SetTextureFilter( texture, filter ) end - ----Set texture wrapping mode (TEXTURE_WRAP_REPEAT, TEXTURE_WRAP_CLAMP...) ----@param texture any ----@param wrap integer ----@return any RL.SetTextureWrap -function RL.SetTextureWrap( texture, wrap ) end - ----Get OpenGL texture id ----- Success return int ----@param texture any ----@return any id -function RL.GetTextureId( texture ) end - ----Get texture size ----- Success return Vector2 ----@param texture any ----@return any size -function RL.GetTextureSize( texture ) end - ----Get texture mipmaps. Mipmap levels, 1 by default ----- Success return int ----@param texture any ----@return any mipmaps -function RL.GetTextureMipmaps( texture ) end - ----Get texture data format (PixelFormat type) ----- Success return int ----@param texture any ----@return any format -function RL.GetTextureFormat( texture ) end - --- Textures - Texture drawing functions - ----Draw a Texture2D ----@param texture any ----@param position table ----@param tint table ----@return any RL.DrawTexture -function RL.DrawTexture( texture, position, tint ) end - ----Draw a Texture2D with extended parameters ----@param texture any ----@param position table ----@param rotation number ----@param scale number ----@param tint table ----@return any RL.DrawTextureEx -function RL.DrawTextureEx( texture, position, rotation, scale, tint ) end - ----Draw a part of a texture defined by a rectangle ----@param texture any ----@param source table ----@param position table ----@param tint table ----@return any RL.DrawTextureRec -function RL.DrawTextureRec( texture, source, position, tint ) end - ----Draw a part of a texture defined by a rectangle with "pro" parameters ----@param texture any ----@param source table ----@param dest table ----@param origin table ----@param rotation number ----@param tint table ----@return any RL.DrawTexturePro -function RL.DrawTexturePro( texture, source, dest, origin, rotation, tint ) end - ----Draws a texture (or part of it) that stretches or shrinks nicely ----@param texture any ----@param nPatchInfo any ----@param dest table ----@param origin table ----@param rotation number ----@param tint table ----@return any RL.DrawTextureNPatch -function RL.DrawTextureNPatch( texture, nPatchInfo, dest, origin, rotation, tint ) end - ----Draws a texture (or part of it) that repeats nicely ----@param texture any ----@param nPatchInfo any ----@param dest table ----@param origin table ----@param rotation number ----@param tint table ----@return any RL.DrawTextureNPatchRepeat -function RL.DrawTextureNPatchRepeat( texture, nPatchInfo, dest, origin, rotation, tint ) end - --- Textures - RenderTexture configuration functions - ----Get OpenGL framebuffer object id ----- Success return int ----@param renderTexture any ----@return any id -function RL.GetRenderTextureId( renderTexture ) end - ----Get color buffer attachment texture. Returns as lightuserdata ----- Success return Texture ----@param renderTexture any ----@return any texture -function RL.GetRenderTextureTexture( renderTexture ) end - ----Get depth buffer attachment texture. Returns as lightuserdata ----- Success return Texture ----@param renderTexture any ----@return any texture -function RL.GetRenderTextureDepthTexture( renderTexture ) end - --- Textures - Color/pixel related functions - ----Check if two colors are equal ----- Success return bool ----@param col1 table ----@param col2 table ----@return any isEqual -function RL.ColorIsEqual( col1, col2 ) end - ----Returns color with alpha applied, alpha goes from 0.0f to 1.0f ----- Success return Color ----@param color table ----@param alpha number ----@return any color -function RL.Fade( color, alpha ) end - ----Returns hexadecimal value for a Color ----- Success return int ----@param color table ----@return any value -function RL.ColorToInt( color ) end - ----Returns Color normalized as float [0..1] ----- Success return Vector4 ----@param color table ----@return any color -function RL.ColorNormalize( color ) end - ----Color from normalized values [0..1] ----- Success return Color ----@param normalized table ----@return any color -function RL.ColorFromNormalized( normalized ) end - ----Returns HSV values for a Color, hue [0..360], saturation/value [0..1] ----- Success return Vector3 ----@param color table ----@return any HSV -function RL.ColorToHSV( color ) end - ----Returns a Color from HSV values, hue [0..360], saturation/value [0..1] ----- Success return Color ----@param hue number ----@param saturation number ----@param value number ----@return any color -function RL.ColorFromHSV( hue, saturation, value ) end - ----Get color multiplied with another color ----- Success return Color ----@param color table ----@param tint table ----@return any color -function RL.ColorTint( color, tint ) end - ----Get color with brightness correction, brightness factor goes from -1.0f to 1.0f ----- Success return Color ----@param color table ----@param factor number ----@return any color -function RL.ColorBrightness( color, factor ) end - ----Get color with contrast correction, contrast values between -1.0f and 1.0f ----- Success return Color ----@param color table ----@param contrast number ----@return any color -function RL.ColorContrast( color, contrast ) end - ----Returns color with alpha applied, alpha goes from 0.0f to 1.0f ----- Success return Color ----@param color table ----@param alpha number ----@return any color -function RL.ColorAlpha( color, alpha ) end - ----Returns src alpha-blended into dst color with tint ----- Success return Color ----@param dst table ----@param src table ----@param tint table ----@return any color -function RL.ColorAlphaBlend( dst, src, tint ) end - ----Get color lerp interpolation between two colors, factor [0.0f..1.0f] ----- Success return Color ----@param color1 table ----@param color2 table ----@param factor number ----@return any color -function RL.ColorLerp( color1, color2, factor ) end - ----Get Color structure from hexadecimal value ----- Success return Color ----@param hexValue integer ----@return any color -function RL.GetColor( hexValue ) end - ----Get pixel data size in bytes for certain format ----- Success return int ----@param size table ----@param format integer ----@return any size -function RL.GetPixelDataSize( size, format ) end - --- Text - Font loading/unloading functions - ----Get the default Font. Return as lightuserdata ----- Success return Font ----@return any font -function RL.GetFontDefault() end - ----Load font from file into GPU memory (VRAM) ----- Failure return nil ----- Success return Font ----@param fileName string ----@return any font -function RL.LoadFont( fileName ) end - ----Load font from file with extended parameters, use NULL for codepoints to load the default character set ----- Failure return nil ----- Success return Font ----@param fileName string ----@param fontSize integer ----@param codepoints table|nil ----@return any font -function RL.LoadFontEx( fileName, fontSize, codepoints ) end - ----Load font from Image (XNA style) ----- Success return Font ----@param image any ----@param key table ----@param firstChar integer ----@return any font -function RL.LoadFontFromImage( image, key, firstChar ) end - ----Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. NOTE: fileData type should be unsigned char ----- Success return Font ----@param fileType string ----@param fileData any ----@param fontSize integer ----@param codepoints table ----@return any font -function RL.LoadFontFromMemory( fileType, fileData, fontSize, codepoints ) end - ----Load Font from data ----- Success return Font ----@param fontData table ----@return any font -function RL.LoadFontFromData( fontData ) end - ----Load font copy as new userdata ----- Success return Font ----@param font any ----@return any font -function RL.FontCopy( font ) end - ----Check if a font is valid (font data loaded, WARNING: GPU texture not checked) ----- Success return bool ----@param font any ----@return any isValid -function RL.IsFontValid( font ) end - ----Load font data for further use. NOTE: fileData type should be unsigned char ----- Success return GlyphInfo{} ----@param fileData any ----@param fontSize integer ----@param codepoints table ----@param type integer ----@return any glyphs -function RL.LoadFontData( fileData, fontSize, codepoints, type ) end - ----Generate image font atlas using chars info. NOTE: Packing method: 0-Default, 1-Skyline ----- Success Image, Rectangle{} ----@param glyphs table ----@param fontSize integer ----@param padding integer ----@param packMethod integer ----@return any image ----@return any rectangles -function RL.GenImageFontAtlas( glyphs, fontSize, padding, packMethod ) end - ----Unload font from GPU memory (VRAM) ----@param font any ----@return any RL.UnloadFont -function RL.UnloadFont( font ) end - ----Export font as code file, returns true on success ----- Success return bool ----@param font any ----@param fileName string ----@return any RL.ExportFontAsCode -function RL.ExportFontAsCode( font, fileName ) end - --- Text - Text drawing functions - ----Draw current FPS ----@param pos table ----@return any RL.DrawFPS -function RL.DrawFPS( pos ) end - ----Draw text (using default font) ----@param text string ----@param position table ----@param fontSize number ----@param tint table ----@return any RL.DrawText -function RL.DrawText( text, position, fontSize, tint ) end - ----Draw text using font and additional parameters ----@param font any ----@param text string ----@param position table ----@param fontSize number ----@param spacing number ----@param tint table ----@return any RL.DrawTextEx -function RL.DrawTextEx( font, text, position, fontSize, spacing, tint ) end - ----Draw text using Font and pro parameters (rotation) ----@param font any ----@param text string ----@param position table ----@param origin table ----@param rotation number ----@param fontSize number ----@param spacing number ----@param tint table ----@return any RL.DrawTextPro -function RL.DrawTextPro( font, text, position, origin, rotation, fontSize, spacing, tint ) end - ----Draw one character (codepoint) ----@param font any ----@param codepoint integer ----@param position table ----@param fontSize number ----@param tint table ----@return any RL.DrawTextCodepoint -function RL.DrawTextCodepoint( font, codepoint, position, fontSize, tint ) end - ----Draw multiple character (codepoint) ----@param font any ----@param codepoints table ----@param position table ----@param fontSize number ----@param spacing number ----@param tint table ----@return any RL.DrawTextCodepoints -function RL.DrawTextCodepoints( font, codepoints, position, fontSize, spacing, tint ) end - ----Draw text inside rectangle limits. Return character id from mouse position (default 0). ----textOffset can be used to set start position inside rectangle. Usefull to pass from previous ----DrawTextBoxed for continuous text. ----Support for tint change with "\a#FFFFFFFF" ----- Success return int, Vector2 ----@param font any ----@param text string ----@param rec table ----@param fontSize number ----@param spacing number ----@param wordWrap boolean ----@param tint table ----@param limitHeight boolean ----@param textOffset table|nil ----@param tabSize integer|nil ----@return any mouseCharId ----@return any textOffset -function RL.DrawTextBoxed( font, text, rec, fontSize, spacing, wordWrap, tint, limitHeight, textOffset, tabSize ) end - --- Text - Text font info functions - ----Set vertical line spacing when drawing with line-breaks ----@param spacing integer ----@return any RL.SetTextLineSpacing -function RL.SetTextLineSpacing( spacing ) end - ----Get vertical line spacing when drawing with line-breaks ----- Success return int ----@return any spacing -function RL.GetTextLineSpacing() end - ----Measure string width for default font ----- Success return int ----@param text string ----@param fontSize integer ----@return any width -function RL.MeasureText( text, fontSize ) end - ----Measure string size for Font ----- Success return Vector2 ----@param font any ----@param text string ----@param fontSize number ----@param spacing number ----@return any size -function RL.MeasureTextEx( font, text, fontSize, spacing ) end - ----Measure text inside rectangle limits. ----- Success return Vector2, Vector2 ----@param font any ----@param text string ----@param rec table ----@param fontSize number ----@param spacing number ----@param wordWrap boolean ----@param tint table ----@param limitHeight boolean ----@param textOffset table ----@param tabSize integer|nil ----@return any size ----@return any textOffset -function RL.MeasureTextBoxed( font, text, rec, fontSize, spacing, wordWrap, tint, limitHeight, textOffset, tabSize ) end - ----Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found ----- Success return int ----@param font any ----@param codepoint integer ----@return any index -function RL.GetGlyphIndex( font, codepoint ) end - ----Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found. Return as lightuserdata ----- Success return GlyphInfo ----@param font any ----@param codepoint integer ----@return any glyphInfo -function RL.GetGlyphInfo( font, codepoint ) end - ----Get glyph font info data by index. Return as lightuserdata ----- Failure return nil ----- Success return GlyphInfo ----@param font any ----@param index integer ----@return any glyphInfo -function RL.GetGlyphInfoByIndex( font, index ) end - ----Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found ----- Success return Rectangle ----@param font any ----@param codepoint integer ----@return any rect -function RL.GetGlyphAtlasRec( font, codepoint ) end - ----Get glyph rectangle in font atlas by index ----- Failure return nil ----- Success return Rectangle ----@param font any ----@param index integer ----@return any rect -function RL.GetGlyphAtlasRecByIndex( font, index ) end - ----Get font base size (default chars height) ----- Success return int ----@param font any ----@return any baseSize -function RL.GetFontBaseSize( font ) end - ----Get font number of glyph characters ----- Success return int ----@param font any ----@return any glyphCount -function RL.GetFontGlyphCount( font ) end - ----Get font padding around the glyph characters ----- Success return int ----@param font any ----@return any glyphPadding -function RL.GetFontGlyphPadding( font ) end - ----Get font texture atlas containing the glyphs. Return as lightuserdata ----- Success return Texture ----@param font any ----@return any texture -function RL.GetFontTexture( font ) end - --- Text - GlyphInfo management functions - ----Load GlyphInfo from data ----- Success return GlyphInfo ----@param glyphInfoData table ----@return any glyphInfo -function RL.LoadGlyphInfo( glyphInfoData ) end - ----Unload glyphInfo image from CPU memory (RAM) ----@param glyphInfo any ----@return any RL.UnloadGlyphInfo -function RL.UnloadGlyphInfo( glyphInfo ) end - ----Set glyphInfo character value (Unicode) ----@param glyphInfo any ----@param value integer ----@return any RL.SetGlyphInfoValue -function RL.SetGlyphInfoValue( glyphInfo, value ) end - ----Set glyphInfo character offset when drawing ----@param glyphInfo any ----@param offset table ----@return any RL.SetGlyphInfoOffset -function RL.SetGlyphInfoOffset( glyphInfo, offset ) end - ----Set glyphInfo character advance position X ----@param glyphInfo any ----@param advanceX integer ----@return any RL.SetGlyphInfoAdvanceX -function RL.SetGlyphInfoAdvanceX( glyphInfo, advanceX ) end - ----Set glyphInfo character image data ----@param glyphInfo any ----@param image any ----@return any RL.SetGlyphInfoImage -function RL.SetGlyphInfoImage( glyphInfo, image ) end - ----Get glyphInfo character value (Unicode) ----- Success return int ----@param glyphInfo any ----@return any value -function RL.GetGlyphInfoValue( glyphInfo ) end - ----Get glyphInfo character offset when drawing ----- Success return Vector2 ----@param glyphInfo any ----@return any offset -function RL.GetGlyphInfoOffset( glyphInfo ) end - ----Get glyphInfo character advance position X ----- Success return int ----@param glyphInfo any ----@return any advanceX -function RL.GetGlyphInfoAdvanceX( glyphInfo ) end - ----Get glyphInfo character image data. Return as lightuserdata ----- Success return Image ----@param glyphInfo any ----@return any image -function RL.GetGlyphInfoImage( glyphInfo ) end - --- Text - Text codepoints management functions (unicode characters) - ----Load UTF-8 text encoded from codepoints array ----- Success return string ----@param codepoints table ----@return any string -function RL.LoadUTF8( codepoints ) end - ----Load all codepoints from a UTF-8 text string ----- Success return int{} ----@param text string ----@return any codepoints -function RL.LoadCodepoints( text ) end - ----Get total number of codepoints in a UTF-8 encoded string ----- Success return int ----@param text string ----@return any count -function RL.GetCodepointCount( text ) end - ----Get codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure ----- Success return int, int ----@param text string ----@param position integer ----@return any codepoint ----@return any codepointSize -function RL.GetCodepoint( text, position ) end - ----Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure ----- Success return int, int ----@param text string ----@param position integer ----@return any codepoint ----@return any codepointSize -function RL.GetCodepointNext( text, position ) end - ----Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure ----- Success return int, int ----@param text string ----@param position integer ----@return any codepoint ----@return any codepointSize -function RL.GetCodepointPrevious( text, position ) end - ----Encode one codepoint into UTF-8 byte array ----- Success return string ----@param codepoint integer ----@return any string -function RL.CodepointToUTF8( codepoint ) end - --- Text - Text strings management functions (no UTF-8 strings, only byte chars) - ----Get a piece of a text string ----- Success return string ----@param text string ----@param position integer ----@param length integer ----@return any text -function RL.TextSubtext( text, position, length ) end - ----Replace text string ----- Success return string ----@param text string ----@param replace string ----@param by string ----@return any text -function RL.TextReplace( text, replace, by ) end - ----Insert text in a specific position, moves all text forward ----- Success return string ----@param text string ----@param insert string ----@param position integer ----@return any text -function RL.TextInsert( text, insert, position ) end - ----Split text into multiple strings ----- Success return string{} ----@param text string ----@param delimiter any ----@return any splits -function RL.TextSplit( text, delimiter ) end - ----Find first text occurrence within a string ----- Success return int ----@param text string ----@param find string ----@return any index -function RL.TextFindIndex( text, find ) end - ----Get Pascal case notation version of provided string ----- Success return string ----@param text string ----@return any text -function RL.TextToPascal( text ) end - ----Get Snake case notation version of provided string ----- Success return string ----@param text string ----@return any text -function RL.TextToSnake( text ) end - ----Get Camel case notation version of provided string ----- Success return string ----@param text string ----@return any text -function RL.TextToCamel( text ) end - --- Models - Basic geometric 3D shapes drawing functions - ----Draw a line in 3D world space ----@param startPos table ----@param endPos table ----@param color table ----@return any RL.DrawLine3D -function RL.DrawLine3D( startPos, endPos, color ) end - ----Draw a point in 3D space, actually a small line ----@param position table ----@param color table ----@return any RL.DrawPoint3D -function RL.DrawPoint3D( position, color ) end - ----Draw a circle in 3D world space ----@param center table ----@param radius number ----@param rotationAxis table ----@param rotationAngle number ----@param color table ----@return any RL.DrawCircle3D -function RL.DrawCircle3D( center, radius, rotationAxis, rotationAngle, color ) end - ----Draw a color-filled triangle (Vertex in counter-clockwise order!) ----@param v1 table ----@param v2 table ----@param v3 table ----@param color table ----@return any RL.DrawTriangle3D -function RL.DrawTriangle3D( v1, v2, v3, color ) end - ----Draw a triangle strip defined by points ----@param points table ----@param color table ----@return any RL.DrawTriangleStrip3D -function RL.DrawTriangleStrip3D( points, color ) end - ----Draw cube ----@param position table ----@param size table ----@param color table ----@return any RL.DrawCube -function RL.DrawCube( position, size, color ) end - ----Draw cube wires ----@param position table ----@param size table ----@param color table ----@return any RL.DrawCubeWires -function RL.DrawCubeWires( position, size, color ) end - ----Draw sphere ----@param centerPos table ----@param radius number ----@param color table ----@return any RL.DrawSphere -function RL.DrawSphere( centerPos, radius, color ) end - ----Draw sphere with extended parameters ----@param centerPos table ----@param radius number ----@param rings integer ----@param slices integer ----@param color table ----@return any RL.DrawSphereEx -function RL.DrawSphereEx( centerPos, radius, rings, slices, color ) end - ----Draw sphere wires ----@param centerPos table ----@param radius number ----@param rings integer ----@param slices integer ----@param color table ----@return any RL.DrawSphereWires -function RL.DrawSphereWires( centerPos, radius, rings, slices, color ) end - ----Draw a cylinder/cone ----@param position table ----@param radiusTop number ----@param radiusBottom number ----@param height number ----@param slices integer ----@param color table ----@return any RL.DrawCylinder -function RL.DrawCylinder( position, radiusTop, radiusBottom, height, slices, color ) end - ----Draw a cylinder with base at startPos and top at endPos ----@param startPos table ----@param endPos table ----@param startRadius number ----@param endRadius number ----@param sides integer ----@param color table ----@return any RL.DrawCylinderEx -function RL.DrawCylinderEx( startPos, endPos, startRadius, endRadius, sides, color ) end - ----Draw a cylinder/cone wires ----@param position table ----@param radiusTop number ----@param radiusBottom number ----@param height number ----@param slices integer ----@param color table ----@return any RL.DrawCylinderWires -function RL.DrawCylinderWires( position, radiusTop, radiusBottom, height, slices, color ) end - ----Draw a cylinder wires with base at startPos and top at endPos ----@param startPos table ----@param endPos table ----@param startRadius number ----@param endRadius number ----@param sides integer ----@param color table ----@return any RL.DrawCylinderWiresEx -function RL.DrawCylinderWiresEx( startPos, endPos, startRadius, endRadius, sides, color ) end - ----Draw a capsule with the center of its sphere caps at startPos and endPos ----@param startPos table ----@param endPos table ----@param radius number ----@param slices integer ----@param rings integer ----@param color table ----@return any RL.DrawCapsule -function RL.DrawCapsule( startPos, endPos, radius, slices, rings, color ) end - ----Draw capsule wireframe with the center of its sphere caps at startPos and endPos ----@param startPos table ----@param endPos table ----@param radius number ----@param slices integer ----@param rings integer ----@param color table ----@return any RL.DrawCapsuleWires -function RL.DrawCapsuleWires( startPos, endPos, radius, slices, rings, color ) end - ----Draw a plane XZ ----@param centerPos table ----@param size table ----@param color table ----@return any RL.DrawPlane -function RL.DrawPlane( centerPos, size, color ) end - ----Draw 3D textured quad. (Texture coordinates opengl style 0.0 - 1.0) ----@param texture any ----@param vertices table ----@param texCoords table ----@param colors table ----@return any RL.DrawQuad3DTexture -function RL.DrawQuad3DTexture( texture, vertices, texCoords, colors ) end - ----Draw a ray line ----@param ray any ----@param color table ----@return any RL.DrawRay -function RL.DrawRay( ray, color ) end - ----Draw a grid (Centered at ( 0, 0, 0 )) ----@param slices integer ----@param spacing number ----@return any RL.DrawGrid -function RL.DrawGrid( slices, spacing ) end - ----Draw a grid with extended parameters. Optionally you can define divider with different color for every n slices ----@param slices table ----@param spacing table ----@param transform table ----@param color table ----@param divider table|nil ----@param dividerColor table|nil ----@return any RL.DrawGridEx -function RL.DrawGridEx( slices, spacing, transform, color, divider, dividerColor ) end - --- Models - Model management functions - ----Load model from files (Meshes and materials) ----- Failure return nil ----- Success return Model ----@param fileName string ----@return any model -function RL.LoadModel( fileName ) end - ----Load model from generated mesh (Default material) ----- Success return Model ----@param mesh any ----@return any model -function RL.LoadModelFromMesh( mesh ) end - ----Check if a model is valid (loaded in GPU, VAO/VBOs) ----- Success return bool ----@param model any ----@return any isValid -function RL.IsModelValid( model ) end - ----Unload model (meshes/materials) from memory (RAM and/or VRAM) ----@param model any ----@return any RL.UnloadModel -function RL.UnloadModel( model ) end - ----Compute model bounding box limits (considers all meshes) ----- Success return BoundingBox ----@param model any ----@return any boundingBox -function RL.GetModelBoundingBox( model ) end - ----Set model transform matrix ----@param model any ----@param transform table ----@return any RL.SetModelTransform -function RL.SetModelTransform( model, transform ) end - ----Set model mesh. ----- Failure return false ----- Success return true ----@param model any ----@param meshId integer ----@param mesh any ----@return any success -function RL.SetModelMesh( model, meshId, mesh ) end - ----Set material to model material ----- Failure return false ----- Success return true ----@param model any ----@param materialId integer ----@param material any ----@return any success -function RL.SetModelMaterial( model, materialId, material ) end - ----Set material for a mesh (Mesh and material on this model) ----@param model any ----@param meshId integer ----@param materialId integer ----@return any RL.SetModelMeshMaterial -function RL.SetModelMeshMaterial( model, meshId, materialId ) end - ----Set model bone information (skeleton) ----- Failure return false ----- Success return true ----@param model any ----@param boneId integer ----@param bone any ----@return any success -function RL.SetModelBone( model, boneId, bone ) end - ----Set model bones base transformation (pose) ----- Failure return false ----- Success return true ----@param model any ----@param boneId integer ----@param pose any ----@return any success -function RL.SetModelBindPose( model, boneId, pose ) end - ----Get model transform matrix ----- Success return Matrix ----@param model any ----@return any transform -function RL.GetModelTransform( model ) end - ----Get model number of meshes ----- Success return int ----@param model any ----@return any meshCount -function RL.GetModelMeshCount( model ) end - ----Get model number of materials ----- Success return int ----@param model any ----@return any meshCount -function RL.GetModelMaterialCount( model ) end - ----Get model mesh. Return as lightuserdata ----- Failure return nil ----- Success return Mesh ----@param model any ----@param meshId integer ----@return any mesh -function RL.GetModelMesh( model, meshId ) end - ----Get model material. Return as lightuserdata ----- Failure return nil ----- Success return Material ----@param model any ----@param materialId integer ----@return any material -function RL.GetModelMaterial( model, materialId ) end - ----Get model number of bones ----- Success return int ----@param model any ----@return any boneCount -function RL.GetModelBoneCount( model ) end - ----Get model bones information (skeleton) ----- Failure return nil ----- Success return BoneInfo ----@param model any ----@param boneId integer ----@return any bone -function RL.GetModelBone( model, boneId ) end - ----Get models bones base transformation (pose) ----- Failure return nil ----- Success return Transform ----@param model any ----@param boneId integer ----@return any pose -function RL.GetModelBindPose( model, boneId ) end - --- Models - Model drawing functions - ----Draw a model (With texture if set) ----@param model any ----@param position table ----@param scale number ----@param tint table ----@return any RL.DrawModel -function RL.DrawModel( model, position, scale, tint ) end - ----Draw a model with extended parameters ----@param model any ----@param position table ----@param rotationAxis table ----@param rotationAngle number ----@param scale table ----@param tint table ----@return any RL.DrawModelEx -function RL.DrawModelEx( model, position, rotationAxis, rotationAngle, scale, tint ) end - ----Draw a model wires (with texture if set) ----@param model any ----@param position table ----@param scale number ----@param tint table ----@return any RL.DrawModelWires -function RL.DrawModelWires( model, position, scale, tint ) end - ----Draw a model wires (with texture if set) with extended parameters ----@param model any ----@param position table ----@param rotationAxis table ----@param rotationAngle number ----@param scale table ----@param tint table ----@return any RL.DrawModelWiresEx -function RL.DrawModelWiresEx( model, position, rotationAxis, rotationAngle, scale, tint ) end - ----Draw a model as points ----@param model any ----@param position table ----@param scale number ----@param tint table ----@return any RL.DrawModelPoints -function RL.DrawModelPoints( model, position, scale, tint ) end - ----Draw a model as points with extended parameters ----@param model any ----@param position table ----@param rotationAxis table ----@param rotationAngle number ----@param scale table ----@param tint table ----@return any RL.DrawModelPointsEx -function RL.DrawModelPointsEx( model, position, rotationAxis, rotationAngle, scale, tint ) end - ----Draw bounding box (wires) ----@param box any ----@param color table ----@return any RL.DrawBoundingBox -function RL.DrawBoundingBox( box, color ) end - ----Draw a billboard texture ----@param camera any ----@param texture any ----@param position table ----@param size number ----@param tint table ----@return any RL.DrawBillboard -function RL.DrawBillboard( camera, texture, position, size, tint ) end - ----Draw a billboard texture defined by source ----@param camera any ----@param texture any ----@param source table ----@param position table ----@param size table ----@param tint table ----@return any RL.DrawBillboardRec -function RL.DrawBillboardRec( camera, texture, source, position, size, tint ) end - ----Draw a billboard texture defined by source and rotation ----@param camera any ----@param texture any ----@param source table ----@param position table ----@param up table ----@param size table ----@param origin table ----@param rotation number ----@param tint table ----@return any RL.DrawBillboardPro -function RL.DrawBillboardPro( camera, texture, source, position, up, size, origin, rotation, tint ) end - --- Models - Mesh management functions - ----Update mesh vertex data in GPU. ----NOTE: Mainly intented to be used with custom meshes. ----@param mesh any ----@param meshData table ----@return any RL.UpdateMesh -function RL.UpdateMesh( mesh, meshData ) end - ----Unload mesh data from CPU and GPU ----@param mesh any ----@return any RL.UnloadMesh -function RL.UnloadMesh( mesh ) end - ----Draw a 3d mesh with material and transform ----@param mesh any ----@param material any ----@param transform table ----@return any RL.DrawMesh -function RL.DrawMesh( mesh, material, transform ) end - ----Draw multiple mesh instances with material and different transforms ----@param mesh any ----@param material any ----@param transforms any ----@param instances integer ----@return any RL.DrawMeshInstanced -function RL.DrawMeshInstanced( mesh, material, transforms, instances ) end - ----Updades mesh color vertex attribute buffer ----NOTE: Currently only works on custom mesh ----- Failure return false ----- Success return true ----@param mesh any ----@param color table ----@return any success -function RL.SetMeshColor( mesh, color ) end - ----Export mesh data to file, returns true on success ----- Success return bool ----@param mesh any ----@param fileName string ----@return any success -function RL.ExportMesh( mesh, fileName ) end - ----Export mesh as code file (.h) defining multiple arrays of vertex attributes ----- Success return bool ----@param mesh any ----@param fileName string ----@return any success -function RL.ExportMeshAsCode( mesh, fileName ) end - ----Compute mesh bounding box limits ----- Success return BoundingBox ----@param mesh any ----@return any boundingBox -function RL.GetMeshBoundingBox( mesh ) end - ----Compute mesh tangents ----@param mesh any ----@return any RL.GenMeshTangents -function RL.GenMeshTangents( mesh ) end - ----Get mesh vertex attributes data as table. ----- Success return Mesh{} ----@param mesh any ----@return any meshData -function RL.GetMeshData( mesh ) end - --- Models - Mesh generation functions - ----Generate polygonal mesh ----- Success return Mesh ----@param sides integer ----@param radius number ----@return any mesh -function RL.GenMeshPoly( sides, radius ) end - ----Generate plane mesh (With subdivisions) ----- Success return Mesh ----@param width number ----@param length number ----@param resX integer ----@param resZ integer ----@return any mesh -function RL.GenMeshPlane( width, length, resX, resZ ) end - ----Generate cuboid mesh ----- Success return Mesh ----@param size table ----@return any mesh -function RL.GenMeshCube( size ) end - ----Generate sphere mesh (Standard sphere) ----- Success return Mesh ----@param radius number ----@param rings integer ----@param slices integer ----@return any mesh -function RL.GenMeshSphere( radius, rings, slices ) end - ----Generate half-sphere mesh (no bottom cap) ----- Success return Mesh ----@param radius number ----@param rings integer ----@param slices integer ----@return any mesh -function RL.GenMeshHemiSphere( radius, rings, slices ) end - ----Generate cylinder mesh ----- Success return Mesh ----@param radius number ----@param height number ----@param slices integer ----@return any mesh -function RL.GenMeshCylinder( radius, height, slices ) end - ----Generate cone/pyramid mesh ----- Success return Mesh ----@param radius number ----@param height number ----@param slices integer ----@return any mesh -function RL.GenMeshCone( radius, height, slices ) end - ----Generate torus mesh ----- Success return Mesh ----@param radius number ----@param size number ----@param radSeg integer ----@param sides integer ----@return any mesh -function RL.GenMeshTorus( radius, size, radSeg, sides ) end - ----Generate torus mesh ----- Success return Mesh ----@param radius number ----@param size number ----@param radSeg integer ----@param sides integer ----@return any mesh -function RL.GenMeshKnot( radius, size, radSeg, sides ) end - ----Generate heightmap mesh from image data ----- Success return Mesh ----@param heightmap any ----@param size table ----@return any mesh -function RL.GenMeshHeightmap( heightmap, size ) end - ----Generate cubes-based map mesh from image data ----- Success return Mesh ----@param cubicmap any ----@param cubeSize table ----@return any mesh -function RL.GenMeshCubicmap( cubicmap, cubeSize ) end - ----Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO ----- Success return Mesh ----@param meshData table ----@param dynamic boolean ----@return any mesh -function RL.GenMeshCustom( meshData, dynamic ) end - --- Models - Material management functions - ----Load materials from model file ----- Success return Material{} ----@param fileName string ----@return any materials -function RL.LoadMaterials( fileName ) end - ----Default material for reference. Return as lightuserdata ----- Success return Material ----@return any material -function RL.GetMaterialDefault() end - ----Load default material as new object ----- Success return Material ----@return any material -function RL.LoadMaterialDefault() end - ----Load material from table. See material table definition ----- Success return Material ----@param materialData table ----@return any material -function RL.CreateMaterial( materialData ) end - ----Check if a material is valid (shader assigned, map textures loaded in GPU) ----- Success return bool ----@param material any ----@return any isValid -function RL.IsMaterialValid( material ) end - ----Unload material from GPU memory (VRAM). Note! Use freeAll to unload shaders and textures ----@param material any ----@param freeAll boolean ----@return any RL.UnloadMaterial -function RL.UnloadMaterial( material, freeAll ) end - ----Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...) ----@param material any ----@param mapType integer ----@param texture any ----@return any RL.SetMaterialTexture -function RL.SetMaterialTexture( material, mapType, texture ) end - ----Set color for a material map type ----@param material any ----@param mapType integer ----@param color table ----@return any RL.SetMaterialColor -function RL.SetMaterialColor( material, mapType, color ) end - ----Set value for a material map type ----@param material any ----@param mapType integer ----@param value number ----@return any RL.SetMaterialValue -function RL.SetMaterialValue( material, mapType, value ) end - ----Set shader for material ----@param material any ----@param shader any ----@return any RL.SetMaterialShader -function RL.SetMaterialShader( material, shader ) end - ----Set material generic parameters (if required) ----@param material any ----@param params table ----@return any RL.SetMaterialParams -function RL.SetMaterialParams( material, params ) end - ----Get texture from material map type. Return as lightuserdata ----- Success return Texture ----@param material any ----@param mapType integer ----@return any texture -function RL.GetMaterialTexture( material, mapType ) end - ----Get color from material map type ----- Success return Color ----@param material any ----@param mapType integer ----@return any color -function RL.GetMaterialColor( material, mapType ) end - ----Get color from material map type ----- Success return float ----@param material any ----@param mapType integer ----@return any value -function RL.GetMaterialValue( material, mapType ) end - ----Get material shader. Return as lightuserdata ----- Success return Shader ----@param material any ----@return any shader -function RL.GetMaterialShader( material ) end - ----Get material parameters ----- Success return float{} ----@param material any ----@return any params -function RL.GetMaterialParams( material ) end - --- Model - Model animations management functions - ----Load model animations from file ----- Failure return nil ----- Success return ModelAnimations{} ----@param fileName string ----@return any animations -function RL.LoadModelAnimations( fileName ) end - ----Update model animation pose ----@param model any ----@param animation any ----@param frame integer ----@return any RL.UpdateModelAnimation -function RL.UpdateModelAnimation( model, animation, frame ) end - ----Update model animation mesh bone matrices (GPU skinning) ----@param model any ----@param animation any ----@param frame integer ----@return any RL.UpdateModelAnimationBones -function RL.UpdateModelAnimationBones( model, animation, frame ) end - ----Unload animation data ----@param animation any ----@return any RL.UnloadModelAnimation -function RL.UnloadModelAnimation( animation ) end - ----Unload animation table data ----@param animations table ----@return any RL.UnloadModelAnimations -function RL.UnloadModelAnimations( animations ) end - ----Check model animation skeleton match ----- Success return bool ----@param model any ----@param animation any ----@return any valid -function RL.IsModelAnimationValid( model, animation ) end - ----Set modelAnimation bones information (skeleton) ----- Failure return false ----- Success return true ----@param animation any ----@param boneId integer ----@param bone any ----@return any success -function RL.SetModelAnimationBone( animation, boneId, bone ) end - ----Set modelAnimation bones base transformation (pose) ----- Failure return false ----- Success return true ----@param animation any ----@param frame integer ----@param boneId integer ----@param pose any ----@return any success -function RL.SetModelAnimationFramePose( animation, frame, boneId, pose ) end - ----Set modelAnimation name ----@param animation any ----@param name string ----@return any RL.SetModelAnimationName -function RL.SetModelAnimationName( animation, name ) end - ----Return modelAnimation bone count ----- Success return int ----@param animation any ----@return any boneCount -function RL.GetModelAnimationBoneCount( animation ) end - ----Return modelAnimation frame count ----- Success return int ----@param animation any ----@return any frameCount -function RL.GetModelAnimationFrameCount( animation ) end - ----Get modelAnimation bones information (skeleton) ----- Failure return nil ----- Success return BoneInfo ----@param animation any ----@param boneId integer ----@return any bone -function RL.GetModelAnimationBone( animation, boneId ) end - ----Get modelAnimation bones base transformation (pose) ----- Failure return nil ----- Success return Transform ----@param animation any ----@param frame integer ----@param boneId integer ----@return any pose -function RL.GetModelAnimationFramePose( animation, frame, boneId ) end - ----Get modelAnimation name ----- Success return string ----@param animation any ----@return any name -function RL.GetModelAnimationName( animation ) end - --- Model - Collision detection functions - ----Check collision between two spheres ----- Success return bool ----@param center1 table ----@param radius1 number ----@param center2 table ----@param radius2 number ----@return any collision -function RL.CheckCollisionSpheres( center1, radius1, center2, radius2 ) end - ----Check collision between two bounding boxes ----- Success return bool ----@param box1 any ----@param box2 any ----@return any collision -function RL.CheckCollisionBoxes( box1, box2 ) end - ----Check collision between box and sphere ----- Success return bool ----@param box any ----@param center table ----@param radius number ----@return any collision -function RL.CheckCollisionBoxSphere( box, center, radius ) end - ----Get collision info between ray and sphere. ( RayCollision is Lua table of { hit, distance, point, normal } ) ----- Success return RayCollision ----@param ray any ----@param center table ----@param radius number ----@return any rayCollision -function RL.GetRayCollisionSphere( ray, center, radius ) end - ----Get collision info between ray and box ----- Success return RayCollision ----@param ray any ----@param box any ----@return any rayCollision -function RL.GetRayCollisionBox( ray, box ) end - ----Get collision info between ray and mesh ----- Success return RayCollision ----@param ray any ----@param mesh any ----@param transform table ----@return any rayCollision -function RL.GetRayCollisionMesh( ray, mesh, transform ) end - ----Get collision info between ray and triangle ----- Success return RayCollision ----@param ray any ----@param p1 table ----@param p2 table ----@param p3 table ----@return any rayCollision -function RL.GetRayCollisionTriangle( ray, p1, p2, p3 ) end - ----Get collision info between ray and quad. NOTE: The points are expected to be in counter-clockwise winding ----- Success return RayCollision ----@param ray any ----@param p1 table ----@param p2 table ----@param p3 table ----@param p4 table ----@return any rayCollision -function RL.GetRayCollisionQuad( ray, p1, p2, p3, p4 ) end - ----Get cell positions inside box that intersect with the ray. Also returns ray exit point. Returns empty table if ray misses the box ----- Success return Vector3{}, RayCollision|nil ----@param ray any ----@param box any ----@param cellSize table ----@return any cells ----@return any exitPoint -function RL.GetRayBoxCells( ray, box, cellSize ) end - --- Audio - Audio device management functions - ----Initialize audio device and context ----@return any RL.InitAudioDevice -function RL.InitAudioDevice() end - ----Close the audio device and context ----@return any RL.CloseAudioDevice -function RL.CloseAudioDevice() end - ----Check if audio device has been initialized successfully ----- Success return bool ----@return any isReady -function RL.IsAudioDeviceReady() end - ----Set master volume (listener) ----@param volume number ----@return any RL.SetMasterVolume -function RL.SetMasterVolume( volume ) end - ----Get master volume (listener) ----- Success return float ----@return any volume -function RL.GetMasterVolume() end - --- Audio - Wave/Sound loading/unloading functions - ----Load sound from file ----- Failure return nil ----- Success return Sound ----@param fileName string ----@return any sound -function RL.LoadSound( fileName ) end - ----Load wave data from file ----- Failure return nil ----- Success return Wave ----@param fileName string ----@return any wave -function RL.LoadWave( fileName ) end - ----Load wave from memory buffer, fileType refers to extension: i.e. '.wav' ----- Success return Wave ----@param fileType string ----@param data any ----@return any wave -function RL.LoadWaveFromMemory( fileType, data ) end - ----Checks if wave data is valid (data loaded and parameters) ----- Success return bool ----@param wave any ----@return any isValid -function RL.IsWaveValid( wave ) end - ----Load sound from wave data ----- Success return Sound ----@param wave any ----@return any sound -function RL.LoadSoundFromWave( wave ) end - ----Create a new sound that shares the same sample data as the source sound, does not own the sound data ----- Success return Sound ----@param source any ----@return any sound -function RL.LoadSoundAlias( source ) end - ----Checks if a sound is valid (data loaded and buffers initialized) ----- Success return bool ----@param sound any ----@return any isValid -function RL.IsSoundValid( sound ) end - ----Update sound buffer with new data ----@param sound any ----@param data any ----@param sampleCount integer ----@return any RL.UpdateSound -function RL.UpdateSound( sound, data, sampleCount ) end - ----Unload wave data ----@param wave any ----@return any RL.UnloadWave -function RL.UnloadWave( wave ) end - ----Unload sound ----@param sound any ----@return any RL.UnloadSound -function RL.UnloadSound( sound ) end - ----Unload a sound alias (does not deallocate sample data) ----@param alias any ----@return any RL.UnloadSoundAlias -function RL.UnloadSoundAlias( alias ) end - ----Export wave data to file, returns true on success ----- Success return bool ----@param wave any ----@param fileName string ----@return any success -function RL.ExportWave( wave, fileName ) end - ----Export wave sample data to code (.h), returns true on success ----- Success return true ----@param wave any ----@param fileName string ----@return any success -function RL.ExportWaveAsCode( wave, fileName ) end - --- Audio - Wave/Sound management functions - ----Play a sound ----@param sound any ----@return any RL.PlaySound -function RL.PlaySound( sound ) end - ----Stop playing a sound ----@param sound any ----@return any RL.StopSound -function RL.StopSound( sound ) end - ----Pause a sound ----@param sound any ----@return any RL.PauseSound -function RL.PauseSound( sound ) end - ----Resume a paused sound ----@param sound any ----@return any RL.ResumeSound -function RL.ResumeSound( sound ) end - ----Check if a sound is currently playing ----- Success return bool ----@param sound any ----@return any playing -function RL.IsSoundPlaying( sound ) end - ----Set volume for a sound (1.0 is max level) ----@param sound any ----@param volume number ----@return any RL.SetSoundVolume -function RL.SetSoundVolume( sound, volume ) end - ----Set pitch for a sound (1.0 is base level) ----@param sound any ----@param pitch number ----@return any RL.SetSoundPitch -function RL.SetSoundPitch( sound, pitch ) end - ----Set pan for a sound (0.5 is center) ----@param sound any ----@param pan number ----@return any RL.SetSoundPan -function RL.SetSoundPan( sound, pan ) end - ----Get sound audio stream. Return as lightuserdata ----- Success return AudioStream ----@param sound any ----@return any stream -function RL.GetSoundStream( sound ) end - ----Convert wave data to desired format ----@param wave any ----@param sampleRate integer ----@param sampleSize integer ----@param channels integer ----@return any RL.WaveFormat -function RL.WaveFormat( wave, sampleRate, sampleSize, channels ) end - ----Load samples data from wave as a 32bit float data array ----- Success return float{} ----@param wave any ----@return any samples -function RL.LoadWaveSamples( wave ) end - ----Copy a wave to a new wave ----- Success return Wave ----@param wave any ----@return any wave -function RL.WaveCopy( wave ) end - ----Crop a wave to defined samples range ----@param wave any ----@param initSample integer ----@param finalSample integer ----@return any RL.WaveCrop -function RL.WaveCrop( wave, initSample, finalSample ) end - --- Audio - Music management functions - ----Load music stream from file ----- Success return Music ----@param fileName string ----@return any music -function RL.LoadMusicStream( fileName ) end - ----Load music stream from data ----- Success return Music ----@param fileType string ----@param data any ----@return any music -function RL.LoadMusicStreamFromMemory( fileType, data ) end - ----Checks if a music stream is valid (context and buffers initialized) ----- Success return bool ----@param music any ----@return any isValid -function RL.IsMusicValid( music ) end - ----Unload music stream ----@param music any ----@return any RL.UnloadMusicStream -function RL.UnloadMusicStream( music ) end - ----Start music playing ----@param music any ----@return any RL.PlayMusicStream -function RL.PlayMusicStream( music ) end - ----Check if music is playing ----- Success return bool ----@param music any ----@return any playing -function RL.IsMusicStreamPlaying( music ) end - ----Updates buffers for music streaming ----@param music any ----@return any RL.UpdateMusicStream -function RL.UpdateMusicStream( music ) end - ----Stop music playing ----@param music any ----@return any RL.StopMusicStream -function RL.StopMusicStream( music ) end - ----Pause music playing ----@param music any ----@return any RL.PauseMusicStream -function RL.PauseMusicStream( music ) end - ----Resume playing paused music ----@param music any ----@return any RL.ResumeMusicStream -function RL.ResumeMusicStream( music ) end - ----Seek music to a position (in seconds) ----@param music any ----@param position number ----@return any RL.SeekMusicStream -function RL.SeekMusicStream( music, position ) end - ----Set volume for music (1.0 is max level) ----@param music any ----@param volume number ----@return any RL.SetMusicVolume -function RL.SetMusicVolume( music, volume ) end - ----Set pitch for a music (1.0 is base level) ----@param music any ----@param pitch number ----@return any RL.SetMusicPitch -function RL.SetMusicPitch( music, pitch ) end - ----Set pan for a music (0.5 is center) ----@param music any ----@param pan number ----@return any RL.SetMusicPan -function RL.SetMusicPan( music, pan ) end - ----Set looping for a music ----@param music any ----@param looping boolean ----@return any RL.SetMusicLooping -function RL.SetMusicLooping( music, looping ) end - ----Get looping of a music ----- Success return bool ----@param music any ----@return any looping -function RL.GetMusicLooping( music ) end - ----Get music time length (in seconds) ----- Success return float ----@param music any ----@return any length -function RL.GetMusicTimeLength( music ) end - ----Get current music time played (in seconds) ----- Success return float ----@param music any ----@return any timePlayed -function RL.GetMusicTimePlayed( music ) end - ----Get music audio stream. Return as lightuserdata ----- Success return AudioStream ----@param music any ----@return any stream -function RL.GetMusicStream( music ) end - --- Audio - AudioStream management functions - ----Load audio stream (to stream raw audio pcm data) ----- Success return AudioStream ----@param sampleRate integer ----@param sampleSize integer ----@param channels integer ----@return any audioStream -function RL.LoadAudioStream( sampleRate, sampleSize, channels ) end - ----Checks if an audio stream is valid (buffers initialized) ----- Success return bool ----@param stream any ----@return any isValid -function RL.IsAudioStreamValid( stream ) end - ----Unload audio stream and free memory ----@param stream any ----@return any RL.UnloadAudioStream -function RL.UnloadAudioStream( stream ) end - ----Update audio stream buffers with data ----@param stream any ----@param data any ----@param frameCount integer ----@return any RL.UpdateAudioStream -function RL.UpdateAudioStream( stream, data, frameCount ) end - ----Check if any audio stream buffers requires refill ----- Success return bool ----@param stream any ----@return any isProcessed -function RL.IsAudioStreamProcessed( stream ) end - ----Play audio stream ----@param stream any ----@return any RL.PlayAudioStream -function RL.PlayAudioStream( stream ) end - ----Pause audio stream ----@param stream any ----@return any RL.PauseAudioStream -function RL.PauseAudioStream( stream ) end - ----Resume audio stream ----@param stream any ----@return any RL.ResumeAudioStream -function RL.ResumeAudioStream( stream ) end - ----Check if audio stream is playing ----- Success return bool ----@param stream any ----@return any isPlaying -function RL.IsAudioStreamPlaying( stream ) end - ----Stop audio stream ----@param stream any ----@return any RL.StopAudioStream -function RL.StopAudioStream( stream ) end - ----Set volume for audio stream (1.0 is max level) ----@param stream any ----@param volume number ----@return any RL.SetAudioStreamVolume -function RL.SetAudioStreamVolume( stream, volume ) end - ----Set pitch for audio stream (1.0 is base level) ----@param stream any ----@param pitch number ----@return any RL.SetAudioStreamPitch -function RL.SetAudioStreamPitch( stream, pitch ) end - ----Set pan for audio stream (0.5 is centered) ----@param stream any ----@param pan number ----@return any RL.SetAudioStreamPan -function RL.SetAudioStreamPan( stream, pan ) end - ----Default size for new audio streams ----@param size integer ----@return any RL.SetAudioStreamBufferSizeDefault -function RL.SetAudioStreamBufferSizeDefault( size ) end - ----Audio thread callback to request new data. ----AudioCallback should be lightuserdata function pointer ----@param stream any ----@param callback any ----@return any RL.SetAudioStreamCallback -function RL.SetAudioStreamCallback( stream, callback ) end - ----Attach audio stream processor to stream, receives the samples as 'float'. ----AudioCallback should be lightuserdata function pointer ----@param stream any ----@param processor any ----@return any RL.AttachAudioStreamProcessor -function RL.AttachAudioStreamProcessor( stream, processor ) end - ----Detach audio stream processor from stream. ----AudioCallback should be lightuserdata function pointer ----@param stream any ----@param processor any ----@return any RL.DetachAudioStreamProcessor -function RL.DetachAudioStreamProcessor( stream, processor ) end - ----Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'. ----AudioCallback should be lightuserdata function pointer ----@param processor any ----@return any RL.AttachAudioMixedProcessor -function RL.AttachAudioMixedProcessor( processor ) end - ----Detach audio stream processor from the entire audio pipeline. ----AudioCallback should be lightuserdata function pointer ----@param processor any ----@return any RL.DetachAudioMixedProcessor -function RL.DetachAudioMixedProcessor( processor ) end - --- Math - Utils - ----Round float value ----- Success return int ----@param value number ----@return any result -function RL.Round( value ) end - ----Sign of value ----- Success return int ----@param value number ----@return any result -function RL.Sign( value ) end - ----Clamp float value ----- Success return float ----@param value number ----@param min number ----@param max number ----@return any result -function RL.Clamp( value, min, max ) end - ----Calculate linear interpolation between two floats ----- Success return float ----@param a number ----@param b number ----@param amount number ----@return any result -function RL.Lerp( a, b, amount ) end - ----Normalize input value within input range ----- Success return float ----@param value number ----@param a number ----@param b number ----@return any result -function RL.Normalize( value, a, b ) end - ----Remap input value within input range to output range ----- Success return float ----@param value number ----@param inputStart number ----@param inputEnd number ----@param outputStart number ----@param outputEnd number ----@return any result -function RL.Remap( value, inputStart, inputEnd, outputStart, outputEnd ) end - ----Wrap input value from min to max ----- Success return float ----@param value number ----@param min number ----@param max number ----@return any result -function RL.Wrap( value, min, max ) end - ----Check whether two given floats are almost equal ----- Success return bool ----@param x number ----@param y number ----@return any result -function RL.FloatEquals( x, y ) end - --- Math - Vector2 - ----Vector with components value 0.0f ----- Success return Vector2 ----@return any result -function RL.Vector2Zero() end - ----Vector with components value 1.0f ----- Success return Vector2 ----@return any result -function RL.Vector2One() end - ----Add two vectors (v1 + v2) ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Add( v1, v2 ) end - ----Add vector and float value ----- Success return Vector2 ----@param v table ----@param add number ----@return any result -function RL.Vector2AddValue( v, add ) end - ----Subtract two vectors (v1 - v2) ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Subtract( v1, v2 ) end - ----Subtract vector by float value ----- Success return Vector2 ----@param v table ----@param sub number ----@return any result -function RL.Vector2SubtractValue( v, sub ) end - ----Calculate vector length ----- Success return float ----@param v any ----@return any result -function RL.Vector2Length( v ) end - ----Calculate vector square length ----- Success return float ----@param v any ----@return any result -function RL.Vector2LengthSqr( v ) end - ----Calculate two vectors dot product ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2DotProduct( v1, v2 ) end - ----Calculate distance between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Distance( v1, v2 ) end - ----Calculate square distance between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2DistanceSqr( v1, v2 ) end - ----Calculate angle between two vectors ----NOTE: Angle is calculated from origin point (0, 0) ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Angle( v1, v2 ) end - ----Calculate angle defined by a two vectors line ----NOTE: Parameters need to be normalized ----Current implementation should be aligned with glm::angle ----- Success return float ----@param a table ----@param b table ----@return any result -function RL.Vector2LineAngle( a, b ) end - ----Scale vector (multiply by value) ----- Success return Vector2 ----@param v table ----@param scale number ----@return any result -function RL.Vector2Scale( v, scale ) end - ----Multiply vector by vector ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Multiply( v1, v2 ) end - ----Negate vector ----- Success return Vector2 ----@param v table ----@return any result -function RL.Vector2Negate( v ) end - ----Divide vector by vector ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Divide( v1, v2 ) end - ----Normalize provided vector ----- Success return Vector2 ----@param v table ----@return any result -function RL.Vector2Normalize( v ) end - ----Transforms a Vector2 by a given Matrix ----- Success return Vector2 ----@param v table ----@param mat table ----@return any result -function RL.Vector2Transform( v, mat ) end - ----Calculate linear interpolation between two vectors ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@param amount number ----@return any result -function RL.Vector2Lerp( v1, v2, amount ) end - ----Calculate reflected vector to normal ----- Success return Vector2 ----@param v table ----@param normal table ----@return any result -function RL.Vector2Reflect( v, normal ) end - ----Get min value for each pair of components ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Min( v1, v2 ) end - ----Get max value for each pair of components ----- Success return Vector2 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Max( v1, v2 ) end - ----Rotate vector by angle ----- Success return Vector2 ----@param v table ----@param angle number ----@return any result -function RL.Vector2Rotate( v, angle ) end - ----Move Vector towards target ----- Success return Vector2 ----@param v table ----@param target table ----@param maxDistance number ----@return any result -function RL.Vector2MoveTowards( v, target, maxDistance ) end - ----Invert the given vector ----- Success return Vector2 ----@param v table ----@return any result -function RL.Vector2Invert( v ) end - ----Clamp the components of the vector between ----min and max values specified by the given vectors ----- Success return Vector2 ----@param v table ----@param min table ----@param max table ----@return any result -function RL.Vector2Clamp( v, min, max ) end - ----Clamp the magnitude of the vector between two min and max values ----- Success return Vector2 ----@param v table ----@param min number ----@param max number ----@return any result -function RL.Vector2ClampValue( v, min, max ) end - ----Check whether two given vectors are almost equal ----- Success return bool ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector2Equals( v1, v2 ) end - ----Compute the direction of a refracted ray ----v: normalized direction of the incoming ray ----n: normalized normal vector of the interface of two optical media ----r: ratio of the refractive index of the medium from where the ray comes ---- to the refractive index of the medium on the other side of the surface ----- Success return Vector2 ----@param v table ----@param n table ----@param r number ----@return any result -function RL.Vector2Refract( v, n, r ) end - --- Math - Vector 3 - ----Vector with components value 0.0f ----- Success return Vector3 ----@return any result -function RL.Vector3Zero() end - ----Vector with components value 1.0f ----- Success return Vector3 ----@return any result -function RL.Vector3One() end - ----Add two vectors ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Add( v1, v2 ) end - ----Add vector and float value ----- Success return Vector3 ----@param v table ----@param add number ----@return any result -function RL.Vector3AddValue( v, add ) end - ----Subtract two vectors ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Subtract( v1, v2 ) end - ----Subtract vector by float value ----- Success return Vector3 ----@param v table ----@param sub number ----@return any result -function RL.Vector3SubtractValue( v, sub ) end - ----Multiply vector by scalar ----- Success return Vector3 ----@param v table ----@param scalar number ----@return any result -function RL.Vector3Scale( v, scalar ) end - ----Multiply vector by vector ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Multiply( v1, v2 ) end - ----Calculate two vectors cross product ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3CrossProduct( v1, v2 ) end - ----Calculate one vector perpendicular vector ----- Success return Vector3 ----@param v table ----@return any result -function RL.Vector3Perpendicular( v ) end - ----Calculate vector length ----- Success return float ----@param v table ----@return any result -function RL.Vector3Length( v ) end - ----Calculate vector square length ----- Success return float ----@param v table ----@return any result -function RL.Vector3LengthSqr( v ) end - ----Calculate two vectors dot product ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3DotProduct( v1, v2 ) end - ----Calculate distance between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Distance( v1, v2 ) end - ----Calculate square distance between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3DistanceSqr( v1, v2 ) end - ----Calculate angle between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Angle( v1, v2 ) end - ----Negate provided vector (invert direction) ----- Success return Vector3 ----@param v table ----@return any result -function RL.Vector3Negate( v ) end - ----Divide vector by vector ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Divide( v1, v2 ) end - ----Normalize provided vector ----- Success return Vector3 ----@param v table ----@return any result -function RL.Vector3Normalize( v ) end - ----Calculate the projection of the vector v1 on to v2 ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Project( v1, v2 ) end - ----Calculate the rejection of the vector v1 on to v2 ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Reject( v1, v2 ) end - ----Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other. ----Gram-Schmidt function implementation ----- Success return Vector3, Vector3 ----@param v1 table ----@param v2 table ----@return any v1 ----@return any v2 -function RL.Vector3OrthoNormalize( v1, v2 ) end - ----Transforms a Vector3 by a given Matrix ----- Success return Vector3 ----@param v table ----@param mat table ----@return any result -function RL.Vector3Transform( v, mat ) end - ----Transform a vector by quaternion rotation ----- Success return Vector3 ----@param v table ----@param q table ----@return any result -function RL.Vector3RotateByQuaternion( v, q ) end - ----Rotates a vector around an axis ----- Success return Vector3 ----@param v table ----@param axis table ----@param angle number ----@return any result -function RL.Vector3RotateByAxisAngle( v, axis, angle ) end - ----Move Vector towards target ----- Success return Vector3 ----@param v table ----@param target table ----@param maxDistance number ----@return any result -function RL.Vector3MoveTowards( v, target, maxDistance ) end - ----Calculate linear interpolation between two vectors ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@param amount number ----@return any result -function RL.Vector3Lerp( v1, v2, amount ) end - ----Calculate cubic hermite interpolation between two vectors and their tangents ----as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic ----- Success return Vector3 ----@param v1 table ----@param tangent1 table ----@param v2 table ----@param tangent2 table ----@param amount number ----@return any result -function RL.Vector3CubicHermite( v1, tangent1, v2, tangent2, amount ) end - ----Calculate reflected vector to normal ----- Success return Vector3 ----@param v table ----@param normal table ----@return any result -function RL.Vector3Reflect( v, normal ) end - ----Get min value for each pair of components ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Min( v1, v2 ) end - ----Get max value for each pair of components ----- Success return Vector3 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Max( v1, v2 ) end - ----Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) ----NOTE: Assumes P is on the plane of the triangle ----- Success return Vector3 ----@param p table ----@param a table ----@param b table ----@param c table ----@return any result -function RL.Vector3Barycenter( p, a, b, c ) end - ----Projects a Vector3 from screen space into object space ----NOTE: We are avoiding calling other raymath functions despite available ----- Success return Vector3 ----@param source table ----@param projection table ----@param view table ----@return any result -function RL.Vector3Unproject( source, projection, view ) end - ----Invert the given vector ----- Success return Vector3 ----@param v table ----@return any result -function RL.Vector3Invert( v ) end - ----Clamp the components of the vector between ----min and max values specified by the given vectors ----- Success return Vector3 ----@param v table ----@param min table ----@param max table ----@return any result -function RL.Vector3Clamp( v, min, max ) end - ----Clamp the magnitude of the vector between two values ----- Success return Vector3 ----@param v table ----@param min number ----@param max number ----@return any result -function RL.Vector3ClampValue( v, min, max ) end - ----Check whether two given vectors are almost equal ----- Success return bool ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector3Equals( v1, v2 ) end - ----Compute the direction of a refracted ray where v specifies the ----normalized direction of the incoming ray, n specifies the ----normalized normal vector of the interface of two optical media, ----and r specifies the ratio of the refractive index of the medium ----from where the ray comes to the refractive index of the medium ----on the other side of the surface ----- Success return Vector3 ----@param v table ----@param n table ----@param r number ----@return any result -function RL.Vector3Refract( v, n, r ) end - --- Math - Vector4 - ----Vector with components value 0.0f ----- Success return Vector4 ----@return any result -function RL.Vector4Zero() end - ----Vector with components value 1.0f ----- Success return Vector4 ----@return any result -function RL.Vector4One() end - ----Add two vectors ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Add( v1, v2 ) end - ----Add vector and float value ----- Success return Vector4 ----@param v table ----@param add number ----@return any result -function RL.Vector4AddValue( v, add ) end - ----Subtract two vectors ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Subtract( v1, v2 ) end - ----Subtract vector by float value ----- Success return Vector4 ----@param v table ----@param sub number ----@return any result -function RL.Vector4SubtractValue( v, sub ) end - ----Calculate vector length ----- Success return float ----@param v table ----@return any result -function RL.Vector4Length( v ) end - ----Calculate vector square length ----- Success return float ----@param v table ----@return any result -function RL.Vector4LengthSqr( v ) end - ----Calculate two vectors dot product ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4DotProduct( v1, v2 ) end - ----Calculate distance between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Distance( v1, v2 ) end - ----Calculate square distance between two vectors ----- Success return float ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4DistanceSqr( v1, v2 ) end - ----Multiply vector by scalar ----- Success return Vector4 ----@param v table ----@param scalar number ----@return any result -function RL.Vector4Scale( v, scalar ) end - ----Multiply vector by vector ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Multiply( v1, v2 ) end - ----Negate provided vector (invert direction) ----- Success return Vector4 ----@param v table ----@return any result -function RL.Vector4Negate( v ) end - ----Divide vector by vector ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Divide( v1, v2 ) end - ----Normalize provided vector ----- Success return Vector4 ----@param v table ----@return any result -function RL.Vector4Normalize( v ) end - ----Get min value for each pair of components ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Min( v1, v2 ) end - ----Get max value for each pair of components ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Max( v1, v2 ) end - ----Calculate linear interpolation between two vectors ----- Success return Vector4 ----@param v1 table ----@param v2 table ----@param amount number ----@return any result -function RL.Vector4Lerp( v1, v2, amount ) end - ----Move Vector towards target ----- Success return Vector4 ----@param v table ----@param target table ----@param maxDistance number ----@return any result -function RL.Vector4MoveTowards( v, target, maxDistance ) end - ----Invert the given vector ----- Success return Vector4 ----@param v table ----@return any result -function RL.Vector4Invert( v ) end - ----Check whether two given vectors are almost equal ----- Success return bool ----@param v1 table ----@param v2 table ----@return any result -function RL.Vector4Equals( v1, v2 ) end - --- Math - Matrix - ----Compute matrix determinant ----- Success return float ----@param mat table ----@return any result -function RL.MatrixDeterminant( mat ) end - ----Get the trace of the matrix (sum of the values along the diagonal) ----- Success return float ----@param mat table ----@return any result -function RL.MatrixTrace( mat ) end - ----Transposes provided matrix ----- Success return Matrix ----@param mat table ----@return any result -function RL.MatrixTranspose( mat ) end - ----Invert provided matrix ----- Success return Matrix ----@param mat table ----@return any result -function RL.MatrixInvert( mat ) end - ----Get identity matrix ----- Success return Matrix ----@return any result -function RL.MatrixIdentity() end - ----Add two matrices ----- Success return Matrix ----@param left table ----@param right table ----@return any result -function RL.MatrixAdd( left, right ) end - ----Subtract two matrices (left - right) ----- Success return Matrix ----@param left table ----@param right table ----@return any result -function RL.MatrixSubtract( left, right ) end - ----Get two matrix multiplication ----- Success return Matrix ----@param left table ----@param right table ----@return any result -function RL.MatrixMultiply( left, right ) end - ----Get translation matrix ----- Success return Matrix ----@param translate table ----@return any result -function RL.MatrixTranslate( translate ) end - ----Create rotation matrix from axis and angle. NOTE: Angle should be provided in radians ----- Success return Matrix ----@param axis table ----@param angle number ----@return any result -function RL.MatrixRotate( axis, angle ) end - ----Get x-rotation matrix (angle in radians) ----- Success return Matrix ----@param angle number ----@return any result -function RL.MatrixRotateX( angle ) end - ----Get y-rotation matrix (angle in radians) ----- Success return Matrix ----@param angle number ----@return any result -function RL.MatrixRotateY( angle ) end - ----Get z-rotation matrix (angle in radians) ----- Success return Matrix ----@param angle number ----@return any result -function RL.MatrixRotateZ( angle ) end - ----Get xyz-rotation matrix (angles in radians) ----- Success return Matrix ----@param angles table ----@return any result -function RL.MatrixRotateXYZ( angles ) end - ----Get zyx-rotation matrix (angles in radians) ----- Success return Matrix ----@param angles table ----@return any result -function RL.MatrixRotateZYX( angles ) end - ----Get scaling matrix ----- Success return Matrix ----@param scale table ----@return any result -function RL.MatrixScale( scale ) end - ----Get perspective projection matrix ----- Success return Matrix ----@param left any ----@param right any ----@param bottom any ----@param top any ----@param near any ----@param far any ----@return any result -function RL.MatrixFrustum( left, right, bottom, top, near, far ) end - ----Get perspective projection matrix ----- Success return Matrix ----@param fovy any ----@param aspect any ----@param near any ----@param far any ----@return any result -function RL.MatrixPerspective( fovy, aspect, near, far ) end - ----Get orthographic projection matrix ----- Success return Matrix ----@param left any ----@param right any ----@param bottom any ----@param top any ----@param near any ----@param far any ----@return any result -function RL.MatrixOrtho( left, right, bottom, top, near, far ) end - ----Get camera look-at matrix (View matrix) ----- Success return Matrix ----@param eye table ----@param target table ----@param up table ----@return any result -function RL.MatrixLookAt( eye, target, up ) end - ----Decompose a transformation matrix into its rotational, translational and scaling components ----- Success return Vector3, Quaternion, Vector3 ----@param mat table ----@return any translation ----@return any rotation ----@return any scale -function RL.MatrixDecompose( mat ) end - --- Math - Quaternion - ----Add two quaternions ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@return any result -function RL.QuaternionAdd( q1, q2 ) end - ----Add quaternion and float value ----- Success return Quaternion ----@param q table ----@param add number ----@return any result -function RL.QuaternionAddValue( q, add ) end - ----Subtract two quaternions ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@return any result -function RL.QuaternionSubtract( q1, q2 ) end - ----Subtract quaternion and float value ----- Success return Quaternion ----@param q table ----@param sub number ----@return any result -function RL.QuaternionSubtractValue( q, sub ) end - ----Get identity quaternion ----- Success return Quaternion ----@return any result -function RL.QuaternionIdentity() end - ----Computes the length of a quaternion ----- Success return float ----@param q table ----@return any result -function RL.QuaternionLength( q ) end - ----Normalize provided quaternion ----- Success return Quaternion ----@param q table ----@return any result -function RL.QuaternionNormalize( q ) end - ----Invert provided quaternion ----- Success return Quaternion ----@param q table ----@return any result -function RL.QuaternionInvert( q ) end - ----Calculate two quaternion multiplication ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@return any result -function RL.QuaternionMultiply( q1, q2 ) end - ----Scale quaternion by float value ----- Success return Quaternion ----@param q table ----@param mul number ----@return any result -function RL.QuaternionScale( q, mul ) end - ----Divide two quaternions ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@return any result -function RL.QuaternionDivide( q1, q2 ) end - ----Calculate linear interpolation between two quaternions ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@param amount number ----@return any result -function RL.QuaternionLerp( q1, q2, amount ) end - ----Calculate slerp-optimized interpolation between two quaternions ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@param amount number ----@return any result -function RL.QuaternionNlerp( q1, q2, amount ) end - ----Calculates spherical linear interpolation between two quaternions ----- Success return Quaternion ----@param q1 table ----@param q2 table ----@param amount number ----@return any result -function RL.QuaternionSlerp( q1, q2, amount ) end - ----Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm ----as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic ----- Success return Quaternion ----@param q1 table ----@param outTangent1 table ----@param q2 table ----@param inTangent2 table ----@param t number ----@return any result -function RL.QuaternionCubicHermiteSpline( q1, outTangent1, q2, inTangent2, t ) end - ----Calculate quaternion based on the rotation from one vector to another ----- Success return Quaternion ----@param from table ----@param to table ----@return any result -function RL.QuaternionFromVector3ToVector3( from, to ) end - ----Get a quaternion for a given rotation matrix ----- Success return Quaternion ----@param mat table ----@return any result -function RL.QuaternionFromMatrix( mat ) end - ----Get a matrix for a given quaternion ----- Success return Matrix ----@param q table ----@return any result -function RL.QuaternionToMatrix( q ) end - ----Get rotation quaternion for an angle and axis ----NOTE: angle must be provided in radians ----- Success return Quaternion ----@param axis table ----@param angle number ----@return any result -function RL.QuaternionFromAxisAngle( axis, angle ) end - ----Get the rotation angle and axis for a given quaternion ----- Success return Vector3, float ----@param q table ----@return any axis ----@return any angle -function RL.QuaternionToAxisAngle( q ) end - ----Get the quaternion equivalent to Euler angles ----NOTE: Rotation order is ZYX ----- Success return Quaternion ----@param pitch number ----@param yaw number ----@param roll number ----@return any result -function RL.QuaternionFromEuler( pitch, yaw, roll ) end - ----Get the Euler angles equivalent to quaternion (roll, pitch, yaw) ----NOTE: Angles are returned in a Vector3 struct in radians ----- Success return Vector3 ----@param q table ----@return any result -function RL.QuaternionToEuler( q ) end - ----Transform a quaternion given a transformation matrix ----- Success return Quaternion ----@param q table ----@param mat table ----@return any result -function RL.QuaternionTransform( q, mat ) end - ----Check whether two given quaternions are almost equal ----- Success return bool ----@param q1 table ----@param q2 table ----@return any result -function RL.QuaternionEquals( q1, q2 ) end - --- Math - Frustum - ----Extract frustum from projection and modelView matrices. ----- Success return Vector4{} ----@param projection table ----@param modelview table ----@return any frustum -function RL.ExtractFrustum( projection, modelview ) end - ----Check if point inside frustum ----- Success return bool ----@param frustum table ----@param position table ----@return any inFrustum -function RL.PointInFrustum( frustum, position ) end - ----Check if sphere inside frustum ----- Success return bool ----@param frustum table ----@param position table ----@return any inFrustum -function RL.SphereInFrustum( frustum, position ) end - ----Check if AABB inside frustum ----- Success return bool ----@param frustum table ----@param min table ----@param max table ----@return any inFrustum -function RL.AABBInFrustum( frustum, min, max ) end - --- Gui - Global gui state control functions - ----Enable gui controls (global state) ----@return any RL.GuiEnable -function RL.GuiEnable() end - ----Disable gui controls (global state) ----@return any RL.GuiDisable -function RL.GuiDisable() end - ----Lock gui controls (global state) ----@return any RL.GuiLock -function RL.GuiLock() end - ----Unlock gui controls (global state) ----@return any RL.GuiUnlock -function RL.GuiUnlock() end - ----Check if gui is locked (global state) ----- Success return bool ----@return any locked -function RL.GuiIsLocked() end - ----Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f ----@param alpha number ----@return any RL.GuiSetAlpha -function RL.GuiSetAlpha( alpha ) end - ----Set gui state (global state) ----@param state integer ----@return any RL.GuiSetState -function RL.GuiSetState( state ) end - ----Get gui state (global state) ----- Success return int ----@return any state -function RL.GuiGetState() end - ----Set guiSliderDragging ----@param dragging boolean ----@return any RL.GuiSetSliderDragging -function RL.GuiSetSliderDragging( dragging ) end - ----Get guiSliderDragging ----- Success return bool ----@return any isSliderDragging -function RL.GuiGetSliderDragging() end - ----Set guiSliderActive ----@param rect any ----@return any RL.GuiSetSliderActive -function RL.GuiSetSliderActive( rect ) end - ----Get guiSliderActive ----- Success return Rectangle ----@return any isSliderDragging -function RL.GuiGetSliderActive() end - --- Gui - Font set/get functions - ----Set gui custom font (global state) ----@param font any ----@return any RL.GuiSetFont -function RL.GuiSetFont( font ) end - ----Get gui font (global state). Return as lightuserdata ----- Success return Font ----@return any font -function RL.GuiGetFont() end - --- Gui - Style set/get functions - ----Set one style property ----@param control integer ----@param property integer ----@param value integer ----@return any RL.GuiSetStyle -function RL.GuiSetStyle( control, property, value ) end - ----Get one style property ----- Success return int ----@param control integer ----@param property integer ----@return any value -function RL.GuiGetStyle( control, property ) end - --- Gui - Styles loading functions - ----Load style file over global style variable (.rgs) ----- Failure return nil ----- Success return true ----@param fileName string ----@return any success -function RL.GuiLoadStyle( fileName ) end - ----Load style default over global style ----@return any RL.GuiLoadStyleDefault -function RL.GuiLoadStyleDefault() end - --- Gui - Tooltips management functions - ----Enable gui tooltips (global state) ----@return any RL.GuiEnableTooltip -function RL.GuiEnableTooltip() end - ----Disable gui tooltips (global state) ----@return any RL.GuiDisableTooltip -function RL.GuiDisableTooltip() end - ----Set tooltip string ----@param tooltip string ----@return any RL.GuiSetTooltip -function RL.GuiSetTooltip( tooltip ) end - --- Gui - Icons functionality - ----Get text with icon id prepended (if supported) ----- Success return string ----@param iconId integer ----@param text string|nil ----@return any text -function RL.GuiIconText( iconId, text ) end - ----Set icon scale (1 by default) ----@param scale integer ----@return any RL.GuiSetIconScale -function RL.GuiSetIconScale( scale ) end - ----Get raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB ----- Success return Buffer ----@return any iconsBuffer -function RL.GuiGetIcons() end - ----Set raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB ----- Failure return false ----- Success return true ----@param iconBuffer any ----@return any success -function RL.GuiSetIcons( iconBuffer ) end - ----Load raygui icons file (.rgi) into internal icons data ----- Failure return nil ----- Success return strings{} ----@param fileName string ----@param loadIconsName boolean ----@return any iconNames -function RL.GuiLoadIcons( fileName, loadIconsName ) end - ----Draw icon ----@param iconId integer ----@param pos table ----@param pixelSize integer ----@param color table ----@return any RL.GuiDrawIcon -function RL.GuiDrawIcon( iconId, pos, pixelSize, color ) end - --- Gui - Container/separator controls, useful for controls organization - ----Window Box control, shows a window that can be closed ----- Success return int ----@param bounds table ----@param title string|nil ----@return any result -function RL.GuiWindowBox( bounds, title ) end - ----Group Box control with text name ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiGroupBox( bounds, text ) end - ----Line separator control, could contain text ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiLine( bounds, text ) end - ----Panel control, useful to group controls ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiPanel( bounds, text ) end - ----Tab Bar control, returns TAB to be closed or -1 ----- Success return int, int ----@param bounds table ----@param text string ----@param active integer ----@return any result ----@return any active -function RL.GuiTabBar( bounds, text, active ) end - ----Scroll Panel control ----- Success return int, Vector2, Rectangle ----@param bounds table ----@param text string|nil ----@param content table ----@param scroll table ----@param view table ----@return any result ----@return any scroll ----@return any view -function RL.GuiScrollPanel( bounds, text, content, scroll, view ) end - --- Gui - Basic controls set - ----Label control, shows text ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiLabel( bounds, text ) end - ----Button control, returns true when clicked ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiButton( bounds, text ) end - ----Label button control, show true when clicked ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiLabelButton( bounds, text ) end - ----Toggle Button control, returns true when active ----- Success return int, bool ----@param bounds table ----@param text string|nil ----@param active boolean ----@return any result ----@return any active -function RL.GuiToggle( bounds, text, active ) end - ----Toggle Group control, returns active toggle index ----- Success return int, int ----@param bounds table ----@param text string|nil ----@param active integer ----@return any result ----@return any active -function RL.GuiToggleGroup( bounds, text, active ) end - ----Toggle Slider control, returns true when clicked ----- Success return int, int ----@param bounds table ----@param text string|nil ----@param active integer ----@return any result ----@return any active -function RL.GuiToggleSlider( bounds, text, active ) end - ----Check Box control, returns true when active ----- Success return bool, Rectangle ----@param bounds table ----@param text string|nil ----@param checked boolean ----@return any result ----@return any checked ----@return any textBounds -function RL.GuiCheckBox( bounds, text, checked ) end - ----Combo Box control, returns selected item index ----- Success return int, int ----@param bounds table ----@param text string|nil ----@param active integer ----@return any result ----@return any active -function RL.GuiComboBox( bounds, text, active ) end - ----Dropdown Box control, returns selected item ----- Success return int, int ----@param bounds table ----@param text string ----@param active integer ----@param editMode boolean ----@return any result ----@return any active -function RL.GuiDropdownBox( bounds, text, active, editMode ) end - ----Spinner control, returns selected value ----- Success return int, int, Rectangle ----@param bounds table ----@param text string|nil ----@param value integer ----@param minValue integer ----@param maxValue integer ----@param editMode boolean ----@return any result ----@return any value ----@return any textBounds -function RL.GuiSpinner( bounds, text, value, minValue, maxValue, editMode ) end - ----Value Box control, updates input text with numbers ----- Success return int, int, Rectangle ----@param bounds table ----@param text string|nil ----@param value integer ----@param minValue integer ----@param maxValue integer ----@param editMode boolean ----@return any result ----@return any value ----@return any textBounds -function RL.GuiValueBox( bounds, text, value, minValue, maxValue, editMode ) end - ----Text Box control, updates input text ----- Success return int, string ----@param bounds table ----@param text string ----@param bufferSize integer ----@param editMode boolean ----@return any result ----@return any text -function RL.GuiTextBox( bounds, text, bufferSize, editMode ) end - ----Slider control, returns selected value ----- Success return int, float, Rectangle, Rectangle ----@param bounds table ----@param textLeft string|nil ----@param textRight string|nil ----@param value number ----@param minValue number ----@param maxValue number ----@return any result ----@return any value ----@return any textLeftBounds ----@return any textRightBounds -function RL.GuiSlider( bounds, textLeft, textRight, value, minValue, maxValue ) end - ----Slider Bar control, returns selected value ----- Success return int, float, Rectangle, Rectangle ----@param bounds table ----@param textLeft string|nil ----@param textRight string|nil ----@param value number ----@param minValue number ----@param maxValue number ----@return any result ----@return any value ----@return any textLeftBounds ----@return any textRightBounds -function RL.GuiSliderBar( bounds, textLeft, textRight, value, minValue, maxValue ) end - ----Progress Bar control, shows current progress value ----- Success return int, float, Rectangle, Rectangle ----@param bounds table ----@param textLeft string|nil ----@param textRight string|nil ----@param value number ----@param minValue number ----@param maxValue number ----@return any result ----@return any value ----@return any textLeftBounds ----@return any textRightBounds -function RL.GuiProgressBar( bounds, textLeft, textRight, value, minValue, maxValue ) end - ----Status Bar control, shows info text ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiStatusBar( bounds, text ) end - ----Dummy control for placeholders ----- Success return int ----@param bounds table ----@param text string|nil ----@return any result -function RL.GuiDummyRec( bounds, text ) end - ----Grid control, returns mouse cell position ----- Success return int, Vector2 ----@param bounds table ----@param text string|nil ----@param spacing number ----@param subdivs integer ----@param mouseCell table ----@return any result ----@return any mouseCell -function RL.GuiGrid( bounds, text, spacing, subdivs, mouseCell ) end - ----Scroll bar control ----- Success return int ----@param bounds table ----@param value integer ----@param minValue integer ----@param maxValue integer ----@return any value -function RL.GuiScrollBar( bounds, value, minValue, maxValue ) end - --- Gui - Advance controls set - ----List View control, returns selected list item index ----- Success return int, int, int ----@param bounds table ----@param text string|nil ----@param scrollIndex integer ----@param active integer ----@return any result ----@return any scrollIndex ----@return any active -function RL.GuiListView( bounds, text, scrollIndex, active ) end - ----List View with extended parameters ----- Success return int, int, int, int ----@param bounds table ----@param text string ----@param scrollIndex integer ----@param active integer ----@param focus integer ----@return any result ----@return any scrollIndex ----@return any active ----@return any focus -function RL.GuiListViewEx( bounds, text, scrollIndex, active, focus ) end - ----Message Box control, displays a message ----- Success return int ----@param bounds table ----@param title string|nil ----@param message string ----@param buttons string ----@return any result -function RL.GuiMessageBox( bounds, title, message, buttons ) end - ----Text Input Box control, ask for text, supports secret ----- Success return int, string, bool ----@param bounds table ----@param title string ----@param message string ----@param buttons string ----@param text string ----@param textMaxSize integer ----@param secretViewActive boolean ----@return any result ----@return any text ----@return any secretViewActive -function RL.GuiTextInputBox( bounds, title, message, buttons, text, textMaxSize, secretViewActive ) end - ----Color Picker control (multiple color controls) ----- Success return int, Color ----@param bounds table ----@param text string|nil ----@param color table ----@return any result ----@return any color -function RL.GuiColorPicker( bounds, text, color ) end - ----Color Panel control ----- Success return int, Color ----@param bounds table ----@param text string|nil ----@param color table ----@return any result ----@return any color -function RL.GuiColorPanel( bounds, text, color ) end - ----Color Bar Alpha control ----- Success return int, float ----@param bounds table ----@param text string|nil ----@param alpha number ----@return any result ----@return any alpha -function RL.GuiColorBarAlpha( bounds, text, alpha ) end - ----Color Bar Hue control ----- Success return int, float ----@param bounds table ----@param text string|nil ----@param value number ----@return any result ----@return any value -function RL.GuiColorBarHue( bounds, text, value ) end - ----Color Picker control that avoids conversion to RGB on each call (multiple color controls) ----- Success return int, Vector3 ----@param bounds table ----@param text string|nil ----@param colorHsv table ----@return any result ----@return any colorHsv -function RL.GuiColorPickerHSV( bounds, text, colorHsv ) end - ----Color Panel control that returns HSV color value, used by GuiColorPickerHSV() ----- Success return int, Vector3 ----@param bounds table ----@param text string|nil ----@param colorHsv table ----@return any result ----@return any colorHsv -function RL.GuiColorPanelHSV( bounds, text, colorHsv ) end - --- Lights - Light management functions - ----Create a light and get shader locations ----- Success return Light ----@param type integer ----@param position table ----@param target table ----@param color table ----@param shader any ----@return any light -function RL.CreateLight( type, position, target, color, shader ) end - ----Send light properties to shader ----@param shader any ----@param light any ----@return any RL.UpdateLightValues -function RL.UpdateLightValues( shader, light ) end - ----Set light type ----@param light any ----@param type integer ----@return any RL.SetLightType -function RL.SetLightType( light, type ) end - ----Set light position ----@param light any ----@param position table ----@return any RL.SetLightPosition -function RL.SetLightPosition( light, position ) end - ----Set light target ----@param light any ----@param target table ----@return any RL.SetLightTarget -function RL.SetLightTarget( light, target ) end - ----Set light color ----@param light any ----@param color table ----@return any RL.SetLightColor -function RL.SetLightColor( light, color ) end - ----Set light enabled ----@param light any ----@param enabled boolean ----@return any RL.SetLightEnabled -function RL.SetLightEnabled( light, enabled ) end - ----Get light type ----- Success return int ----@param light any ----@return any type -function RL.GetLightType( light ) end - ----Get light position ----- Success return Vector3 ----@param light any ----@return any position -function RL.GetLightPosition( light ) end - ----Get light target ----- Success return Vector3 ----@param light any ----@return any target -function RL.GetLightTarget( light ) end - ----Get light color ----- Success return Color ----@param light any ----@return any color -function RL.GetLightColor( light ) end - ----Get light enabled ----- Success return bool ----@param light any ----@return any enabled -function RL.IsLightEnabled( light ) end - --- RLGL - Matrix operations - ----Choose the current matrix to be transformed ----@param mode integer ----@return any RL.rlMatrixMode -function RL.rlMatrixMode( mode ) end - ----Push the current matrix to stack ----@return any RL.rlPushMatrix -function RL.rlPushMatrix() end - ----Pop latest inserted matrix from stack ----@return any RL.rlPopMatrix -function RL.rlPopMatrix() end - ----Reset current matrix to identity matrix ----@return any RL.rlLoadIdentity -function RL.rlLoadIdentity() end - ----Multiply the current matrix by a translation matrix ----@param translation table ----@return any RL.rlTranslatef -function RL.rlTranslatef( translation ) end - ----Multiply the current matrix by a rotation matrix ----@param angle number ----@param rotation table ----@return any RL.rlRotatef -function RL.rlRotatef( angle, rotation ) end - ----Multiply the current matrix by a scaling matrix ----@param scale table ----@return any RL.rlScalef -function RL.rlScalef( scale ) end - ----Multiply the current matrix by another matrix ----@param matrix table ----@return any RL.rlMultMatrixf -function RL.rlMultMatrixf( matrix ) end - ----Multiply the current matrix by a perspective matrix generated by parameters ----@param left number ----@param right number ----@param bottom number ----@param top number ----@param znear number ----@param zfar number ----@return any RL.rlFrustum -function RL.rlFrustum( left, right, bottom, top, znear, zfar ) end - ----Multiply the current matrix by an orthographic matrix generated by parameters ----@param left number ----@param right number ----@param bottom number ----@param top number ----@param znear number ----@param zfar number ----@return any RL.rlOrtho -function RL.rlOrtho( left, right, bottom, top, znear, zfar ) end - ----Set the viewport area (transformation from normalized device coordinates to window coordinates) ----NOTE: We store current viewport dimensions ----@param viewport table ----@return any RL.rlViewport -function RL.rlViewport( viewport ) end - ----Set clip planes distances ----@param nearPlane number ----@param farPlane number ----@return any RL.rlSetClipPlanes -function RL.rlSetClipPlanes( nearPlane, farPlane ) end - ----Get cull plane distance near ----- Success return float ----@return any distance -function RL.rlGetCullDistanceNear() end - ----Get cull plane distance far ----- Success return float ----@return any distance -function RL.rlGetCullDistanceFar() end - --- RLGL - Vertex level operations - ----Initialize drawing mode (how to organize vertex) ----@param mode integer ----@return any RL.rlBegin -function RL.rlBegin( mode ) end - ----Finish vertex providing ----@return any RL.rlEnd -function RL.rlEnd() end - ----Define one vertex (position) ----@param position table ----@return any RL.rlVertex2f -function RL.rlVertex2f( position ) end - ----Define one vertex (position) ----@param position table ----@return any RL.rlVertex3f -function RL.rlVertex3f( position ) end - ----Define one vertex (texture coordinate) - 2 float ----@param texCoord table ----@return any RL.rlTexCoord2f -function RL.rlTexCoord2f( texCoord ) end - ----Define one vertex (normal) - 3 float ----@param normal table ----@return any RL.rlNormal3f -function RL.rlNormal3f( normal ) end - ----Define one vertex (color) - 4 byte ----@param color table ----@return any RL.rlColor4ub -function RL.rlColor4ub( color ) end - ----Define one vertex (color) - 3 float ----@param color table ----@return any RL.rlColor3f -function RL.rlColor3f( color ) end - ----Define one vertex (color) - 4 float ----@param color table ----@return any RL.rlColor4f -function RL.rlColor4f( color ) end - --- RLGL - Vertex buffers state - ----Enable vertex array (VAO, if supported) ----- Success return bool ----@param vaoId integer ----@return any supported -function RL.rlEnableVertexArray( vaoId ) end - ----Disable vertex array (VAO, if supported) ----@return any RL.rlDisableVertexArray -function RL.rlDisableVertexArray() end - ----Enable vertex buffer (VBO) ----- Failure return false ----- Success return true ----@param id integer ----@return any RL.rlEnableVertexBuffer -function RL.rlEnableVertexBuffer( id ) end - ----Disable vertex buffer (VBO) ----@return any RL.rlDisableVertexBuffer -function RL.rlDisableVertexBuffer() end - ----Enable vertex buffer element (VBO element) ----@param id integer ----@return any RL.rlEnableVertexBufferElement -function RL.rlEnableVertexBufferElement( id ) end - ----Disable vertex buffer element (VBO element) ----@return any RL.rlDisableVertexBufferElement -function RL.rlDisableVertexBufferElement() end - ----Enable vertex attribute index ----@param index integer ----@return any RL.rlEnableVertexAttribute -function RL.rlEnableVertexAttribute( index ) end - ----Disable vertex attribute index ----@param index integer ----@return any RL.rlDisableVertexAttribute -function RL.rlDisableVertexAttribute( index ) end - ----Enable attribute state pointer ----@param vertexAttribType integer ----@param buffer any ----@return any RL.rlEnableStatePointer -function RL.rlEnableStatePointer( vertexAttribType, buffer ) end - ----Disable attribute state pointer ----@param vertexAttribType integer ----@return any RL.rlDisableStatePointer -function RL.rlDisableStatePointer( vertexAttribType ) end - --- RLGL - Textures state - ----Select and active a texture slot ----@param slot integer ----@return any RL.rlActiveTextureSlot -function RL.rlActiveTextureSlot( slot ) end - ----Enable texture ----@param id integer ----@return any RL.rlEnableTexture -function RL.rlEnableTexture( id ) end - ----Disable texture ----@return any RL.rlDisableTexture -function RL.rlDisableTexture() end - ----Enable texture cubemap ----@param id integer ----@return any RL.rlEnableTextureCubemap -function RL.rlEnableTextureCubemap( id ) end - ----Disable texture cubemap ----@return any RL.rlDisableTextureCubemap -function RL.rlDisableTextureCubemap() end - ----Set texture parameters (filter, wrap) ----@param id integer ----@param param integer ----@param value integer ----@return any RL.rlTextureParameters -function RL.rlTextureParameters( id, param, value ) end - ----Set cubemap parameters (filter, wrap) ----@param id integer ----@param param integer ----@param value integer ----@return any RL.rlCubemapParameters -function RL.rlCubemapParameters( id, param, value ) end - --- RLGL - Shader state - ----Enable shader program ----@param id integer ----@return any RL.rlEnableShader -function RL.rlEnableShader( id ) end - ----Disable shader program ----@return any RL.rlDisableShader -function RL.rlDisableShader() end - --- RLGL - Framebuffer state - ----Enable render texture (fbo) ----@param id integer ----@return any RL.rlEnableFramebuffer -function RL.rlEnableFramebuffer( id ) end - ----Disable render texture (fbo), return to default framebuffer ----@return any RL.rlDisableFramebuffer -function RL.rlDisableFramebuffer() end - ----Get the currently active render texture (fbo), 0 for default framebuffer ----- Success return int ----@return any framebuffer -function RL.rlGetActiveFramebuffer() end - ----Activate multiple draw color buffers ----@param count integer ----@return any RL.rlActiveDrawBuffers -function RL.rlActiveDrawBuffers( count ) end - ----Blit active framebuffer to main framebuffer ----@param srcRect table ----@param dstRect table ----@param bufferMask integer ----@return any RL.rlBlitFramebuffer -function RL.rlBlitFramebuffer( srcRect, dstRect, bufferMask ) end - ----Bind framebuffer (FBO) ----@param target integer ----@param framebuffer integer ----@return any RL.rlBindFramebuffer -function RL.rlBindFramebuffer( target, framebuffer ) end - --- RLGL - General render state - ----Enable color blending ----@return any RL.rlEnableColorBlend -function RL.rlEnableColorBlend() end - ----Disable color blending ----@return any RL.rlDisableColorBlend -function RL.rlDisableColorBlend() end - ----Enable depth test ----@return any RL.rlEnableDepthTest -function RL.rlEnableDepthTest() end - ----Disable depth test ----@return any RL.rlDisableDepthTest -function RL.rlDisableDepthTest() end - ----Enable depth write ----@return any RL.rlEnableDepthMask -function RL.rlEnableDepthMask() end - ----Disable depth write ----@return any RL.rlDisableDepthMask -function RL.rlDisableDepthMask() end - ----Enable backface culling ----@return any RL.rlEnableBackfaceCulling -function RL.rlEnableBackfaceCulling() end - ----Disable backface culling ----@return any RL.rlDisableBackfaceCulling -function RL.rlDisableBackfaceCulling() end - ----Color mask control ----@param r boolean ----@param g boolean ----@param b boolean ----@param a boolean ----@return any RL.rlColorMask -function RL.rlColorMask( r, g, b, a ) end - ----Set face culling mode ----@param mode integer ----@return any RL.rlSetCullFace -function RL.rlSetCullFace( mode ) end - ----Enable scissor test ----@return any RL.rlEnableScissorTest -function RL.rlEnableScissorTest() end - ----Disable scissor test ----@return any RL.rlDisableScissorTest -function RL.rlDisableScissorTest() end - ----Scissor test ----@param area table ----@return any RL.rlScissor -function RL.rlScissor( area ) end - ----Enable wire mode ----@return any RL.rlEnableWireMode -function RL.rlEnableWireMode() end - ----Enable point mode ----@return any RL.rlEnablePointMode -function RL.rlEnablePointMode() end - ----Disable wire mode ----@return any RL.rlDisableWireMode -function RL.rlDisableWireMode() end - ----Set the line drawing width ----@param width number ----@return any RL.rlSetLineWidth -function RL.rlSetLineWidth( width ) end - ----Get the line drawing width ----- Success return float ----@return any width -function RL.rlGetLineWidth() end - ----Enable line aliasing ----@return any RL.rlEnableSmoothLines -function RL.rlEnableSmoothLines() end - ----Disable line aliasing ----@return any RL.rlDisableSmoothLines -function RL.rlDisableSmoothLines() end - ----Enable stereo rendering ----@return any RL.rlEnableStereoRender -function RL.rlEnableStereoRender() end - ----Enable stereo rendering ----@return any RL.rlDisableStereoRender -function RL.rlDisableStereoRender() end - ----Check if stereo render is enabled ----- Success return bool ----@return any enabled -function RL.rlIsStereoRenderEnabled() end - ----Clear color buffer with color ----@param color table ----@return any RL.rlClearColor -function RL.rlClearColor( color ) end - ----Clear used screen buffers (color and depth) ----@return any RL.rlClearScreenBuffers -function RL.rlClearScreenBuffers() end - ----Check and log OpenGL error codes ----@return any RL.rlCheckErrors -function RL.rlCheckErrors() end - ----Set blending mode ----@param mode integer ----@return any RL.rlSetBlendMode -function RL.rlSetBlendMode( mode ) end - ----Set blending mode factor and equation (using OpenGL factors) ----@param glSrcFactor integer ----@param glDstFactor integer ----@param glEquation integer ----@return any RL.rlSetBlendFactors -function RL.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 any RL.rlSetBlendFactorsSeparate -function RL.rlSetBlendFactorsSeparate( glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, glEqAlpha ) end - --- RLGL - Initialization functions - ----Get current OpenGL version ----- Success return int ----@return any version -function RL.rlGetVersion() end - ----Set current framebuffer width ----@param width integer ----@return any version -function RL.rlSetFramebufferWidth( width ) end - ----Get default framebuffer width ----- Success return int ----@return any width -function RL.rlGetFramebufferWidth() end - ----Set current framebuffer height ----@param height integer ----@return any version -function RL.rlSetFramebufferHeight( height ) end - ----Get default framebuffer height ----- Success return int ----@return any height -function RL.rlGetFramebufferHeight() end - ----Get default texture id ----- Success return int ----@return any id -function RL.rlGetTextureIdDefault() end - ----Get default shader id ----- Success return int ----@return any id -function RL.rlGetShaderIdDefault() end - ----Get default shader locations ----- Success return int{} ----@return any locations -function RL.rlGetShaderLocsDefault() end - --- RLGL - Render batch management - ----Load a render batch system ----- Success return rlRenderBatch ----@param numBuffers integer ----@param bufferElements integer ----@return any renderBatch -function RL.rlLoadRenderBatch( numBuffers, bufferElements ) end - ----Unload render batch system ----@param renderBatch any ----@return any RL.rlUnloadRenderBatch -function RL.rlUnloadRenderBatch( renderBatch ) end - ----Draw render batch data (Update->Draw->Reset) ----@param renderBatch any ----@return any RL.rlDrawRenderBatch -function RL.rlDrawRenderBatch( renderBatch ) end - ----Set the active render batch for rlgl (nil for default internal) ----@param renderBatch any ----@return any RL.rlSetRenderBatchActive -function RL.rlSetRenderBatchActive( renderBatch ) end - ----Update and draw internal render batch ----@return any RL.rlDrawRenderBatchActive -function RL.rlDrawRenderBatchActive() end - ----Check internal buffer overflow for a given number of vertex and force a rlRenderBatch draw call if required ----- Success return bool ----@param vCount integer ----@return any overflow -function RL.rlCheckRenderBatchLimit( vCount ) end - ----Set current texture for render batch and check buffers limits ----@param id integer ----@return any RL.rlSetTexture -function RL.rlSetTexture( id ) end - --- RLGL - Vertex buffers management - ----Load vertex array (vao) if supported ----- Success return int ----@return any vaoId -function RL.rlLoadVertexArray() end - ----Load a vertex buffer attribute ----- Success return int ----@param buffer any ----@param dynamic boolean ----@return any vboId -function RL.rlLoadVertexBuffer( buffer, dynamic ) end - ----Load a new attributes element buffer ----- Success return int ----@param buffer any ----@param dynamic boolean ----@return any vboId -function RL.rlLoadVertexBufferElement( buffer, dynamic ) end - ----Update GPU buffer with new data ----@param bufferId integer ----@param buffer any ----@param offset integer ----@return any RL.rlUpdateVertexBuffer -function RL.rlUpdateVertexBuffer( bufferId, buffer, offset ) end - ----Update vertex buffer elements with new data ----@param id integer ----@param buffer any ----@param offset integer ----@return any RL.rlUpdateVertexBufferElements -function RL.rlUpdateVertexBufferElements( id, buffer, offset ) end - ----Unload vertex array object (VAO) ----@param vaoId integer ----@return any RL.rlUnloadVertexArray -function RL.rlUnloadVertexArray( vaoId ) end - ----Unload vertex buffer (VBO) ----@param vboId integer ----@return any RL.rlUnloadVertexBuffer -function RL.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 any RL.rlSetVertexAttribute -function RL.rlSetVertexAttribute( index, compSize, type, normalized, stride, offset ) end - ----Set vertex attribute divisor ----@param index integer ----@param divisor integer ----@return any RL.rlSetVertexAttributeDivisor -function RL.rlSetVertexAttributeDivisor( index, divisor ) end - ----Set vertex attribute default value ----@param locIndex integer ----@param value table ----@param attribType integer ----@return any RL.rlSetVertexAttributeDefault -function RL.rlSetVertexAttributeDefault( locIndex, value, attribType ) end - ----Draw vertex array ----@param offset integer ----@param count integer ----@return any RL.rlDrawVertexArray -function RL.rlDrawVertexArray( offset, count ) end - ----Draw vertex array elements ----@param offset integer ----@param count integer ----@param buffer any ----@return any RL.rlDrawVertexArrayElements -function RL.rlDrawVertexArrayElements( offset, count, buffer ) end - ----Draw vertex array instanced ----@param offset integer ----@param count integer ----@param instances integer ----@return any RL.rlDrawVertexArrayInstanced -function RL.rlDrawVertexArrayInstanced( offset, count, instances ) end - ----Draw vertex array elements instanced ----@param offset integer ----@param count integer ----@param buffer any ----@param instances integer ----@return any RL.rlDrawVertexArrayElementsInstanced -function RL.rlDrawVertexArrayElementsInstanced( offset, count, buffer, instances ) end - --- RLGL - Textures management - ----Load texture in GPU ----- Success return int ----@param data any ----@param size table ----@param format integer ----@param mipmapCount integer ----@return any id -function RL.rlLoadTexture( data, size, format, mipmapCount ) end - ----Load depth texture/renderbuffer (to be attached to fbo) ----- Success return int ----@param size table ----@param useRenderBuffer boolean ----@return any id -function RL.rlLoadTextureDepth( size, useRenderBuffer ) end - ----Load texture cubemap data ----- Success return int ----@param data any ----@param size integer ----@param format integer ----@param mipmapCount integer ----@return any id -function RL.rlLoadTextureCubemap( data, size, format, mipmapCount ) end - ----Update GPU texture with new data ----@param id integer ----@param offset table ----@param size table ----@param format integer ----@param data any ----@return any RL.rlUpdateTexture -function RL.rlUpdateTexture( id, offset, size, format, data ) end - ----Get OpenGL internal formats ----- Success return int, int, int ----@param format integer ----@return any glInternalFormat ----@return any glFormat ----@return any glType -function RL.rlGetGlTextureFormats( format ) end - ----Get name string for pixel format ----- Success return string ----@param format integer ----@return any name -function RL.rlGetPixelFormatName( format ) end - ----Unload texture from GPU memory ----@param id integer ----@return any RL.rlUnloadTexture -function RL.rlUnloadTexture( id ) end - ----Generate mipmap data for selected texture ----- Success return int ----@param id integer ----@param size table ----@param format integer ----@return any mipmapCount -function RL.rlGenTextureMipmaps( id, size, format ) end - ----Read texture pixel data ----- Success return Buffer ----@param id integer ----@param size table ----@param format integer ----@return any data -function RL.rlReadTexturePixels( id, size, format ) end - ----Read screen pixel data (color buffer) ----- Success return Buffer ----@param size table ----@return any data -function RL.rlReadScreenPixels( size ) end - --- RLGL - Framebuffer management (fbo) - ----Load an empty framebuffer ----- Success return int ----@return any fboId -function RL.rlLoadFramebuffer() end - ----Attach texture/renderbuffer to a framebuffer ----@param fboId integer ----@param texId integer ----@param attachType integer ----@param texType integer ----@param mipLevel integer ----@return any RL.rlFramebufferAttach -function RL.rlFramebufferAttach( fboId, texId, attachType, texType, mipLevel ) end - ----Verify framebuffer is complete ----- Success return bool ----@param id integer ----@return any isComplete -function RL.rlFramebufferComplete( id ) end - ----Delete framebuffer from GPU ----@param id integer ----@return any RL.rlUnloadFramebuffer -function RL.rlUnloadFramebuffer( id ) end - --- RLGL - Shaders management - ----Load shader from code strings ----- Success return int ----@param vsCode string ----@param fsCode string ----@return any shaderId -function RL.rlLoadShaderCode( vsCode, fsCode ) end - ----Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER) ----- Success return int ----@param shaderCode string ----@param type integer ----@return any shaderId -function RL.rlCompileShader( shaderCode, type ) end - ----Load custom shader program ----- Success return int ----@param vShaderId integer ----@param fShaderId integer ----@return any shaderProgramId -function RL.rlLoadShaderProgram( vShaderId, fShaderId ) end - ----Unload shader program ----@param id integer ----@return any RL.rlUnloadShaderProgram -function RL.rlUnloadShaderProgram( id ) end - ----Get shader location uniform ----- Success return int ----@param shaderId integer ----@param uniformName string ----@return any location -function RL.rlGetLocationUniform( shaderId, uniformName ) end - ----Get shader location attribute ----- Success return int ----@param shaderId integer ----@param attribName string ----@return any location -function RL.rlGetLocationAttrib( shaderId, attribName ) end - ----Set shader value uniform ----@param locIndex integer ----@param value any ----@param uniformType integer ----@param count integer ----@return any RL.rlSetUniform -function RL.rlSetUniform( locIndex, value, uniformType, count ) end - ----Set shader value matrix ----@param locIndex integer ----@param mat table ----@return any RL.rlSetUniformMatrix -function RL.rlSetUniformMatrix( locIndex, mat ) end - ----Set shader value matrices ----@param locIndex integer ----@param mat table ----@return any RL.rlSetUniformMatrices -function RL.rlSetUniformMatrices( locIndex, mat ) end - ----Set shader value sampler ----@param locIndex integer ----@param textureId integer ----@return any RL.rlSetUniformSampler -function RL.rlSetUniformSampler( locIndex, textureId ) end - ----Set shader currently active (id and locations) ----@param id integer ----@param locs table ----@return any RL.rlSetShader -function RL.rlSetShader( id, locs ) end - --- RLGL - Compute shader management - ----Load compute shader program ----- Success return int ----@param shaderId integer ----@return any programId -function RL.rlLoadComputeShaderProgram( shaderId ) end - ----Dispatch compute shader (equivalent to *draw* for graphics pipeline) ----@param groupX integer ----@param groupY integer ----@param groupZ integer ----@return any RL.rlComputeShaderDispatch -function RL.rlComputeShaderDispatch( groupX, groupY, groupZ ) end - --- RLGL - Shader buffer storage object management (ssbo) - ----Load shader storage buffer object (SSBO) ----- Success return int ----@param size integer ----@param data any ----@param usageHint integer ----@return any buffer -function RL.rlLoadShaderBuffer( size, data, usageHint ) end - ----Unload shader storage buffer object (SSBO) ----@param ssboId integer ----@return any RL.rlUnloadShaderBuffer -function RL.rlUnloadShaderBuffer( ssboId ) end - ----Update SSBO buffer data ----@param id integer ----@param data any ----@param offset integer ----@return any RL.rlUpdateShaderBuffer -function RL.rlUpdateShaderBuffer( id, data, offset ) end - ----Bind SSBO buffer ----@param id integer ----@param index integer ----@return any RL.rlBindShaderBuffer -function RL.rlBindShaderBuffer( id, index ) end - ----Read SSBO buffer data (GPU->CPU) ----- Success return Buffer ----@param id integer ----@param count integer ----@param offset integer ----@return any data -function RL.rlReadShaderBuffer( id, count, offset ) end - ----Copy SSBO data between buffers ----@param destId integer ----@param srcId integer ----@param destOffset integer ----@param srcOffset integer ----@param count integer ----@return any RL.rlCopyShaderBuffer -function RL.rlCopyShaderBuffer( destId, srcId, destOffset, srcOffset, count ) end - ----Get SSBO buffer size ----- Success return int ----@param id integer ----@return any size -function RL.rlGetShaderBufferSize( id ) end - --- RLGL - Buffer management - ----Bind image texture ----@param id integer ----@param index integer ----@param format integer ----@param readonly boolean ----@return any RL.rlBindImageTexture -function RL.rlBindImageTexture( id, index, format, readonly ) end - --- RLGL - Matrix state management - ----Get internal modelview matrix ----- Success return Matrix ----@return any modelview -function RL.rlGetMatrixModelview() end - ----Get internal projection matrix ----- Success return Matrix ----@return any projection -function RL.rlGetMatrixProjection() end - ----Get internal accumulated transform matrix ----- Success return Matrix ----@return any transform -function RL.rlGetMatrixTransform() end - ----Get internal projection matrix for stereo render (selected eye) ----- Success return Matrix ----@param eye integer ----@return any projection -function RL.rlGetMatrixProjectionStereo( eye ) end - ----Get internal view offset matrix for stereo render (selected eye) ----- Success return Matrix ----@param eye integer ----@return any viewOffset -function RL.rlGetMatrixViewOffsetStereo( eye ) end - ----Set a custom projection matrix (replaces internal projection matrix) ----@param proj table ----@return any RL.rlSetMatrixProjection -function RL.rlSetMatrixProjection( proj ) end - ----Set a custom modelview matrix (replaces internal modelview matrix) ----@param view table ----@return any RL.rlSetMatrixModelview -function RL.rlSetMatrixModelview( view ) end - ----Set eyes projection matrices for stereo rendering ----@param right table ----@param left table ----@return any RL.rlSetMatrixProjectionStereo -function RL.rlSetMatrixProjectionStereo( right, left ) end - ----Set eyes view offsets matrices for stereo rendering ----@param right table ----@param left table ----@return any RL.rlSetMatrixViewOffsetStereo -function RL.rlSetMatrixViewOffsetStereo( right, left ) end - --- OpenGL - Rendering - ----Clear buffers to preset values ----@param mask integer ----@return any RL.glClear -function RL.glClear( mask ) end - --- OpenGL - Frame Buffers - ----Copy a block of pixels from one framebuffer object to another. ----Use nil RenderTexture for window framebuffer ----@param srcTex any ----@param dstTex any ----@param srcRect table ----@param dstRect table ----@param mask integer ----@param filter integer ----@return any RL.glBlitFramebuffer -function RL.glBlitFramebuffer( srcTex, dstTex, srcRect, dstRect, mask, filter ) end - --- OpenGL - State Management - ----Specify mapping of depth values from normalized device coordinates to window coordinates ----@param nearVal number ----@param farVal number ----@return any RL.glDepthRange -function RL.glDepthRange( nearVal, farVal ) end - ----Enable server-side GL capabilities ----@param cap integer ----@return any RL.glEnable -function RL.glEnable( cap ) end - ----Disable server-side GL capabilities ----@param cap integer ----@return any RL.glDisable -function RL.glDisable( cap ) end - ----Set the scale and units used to calculate depth values ----@param factor number ----@param units number ----@return any RL.glPolygonOffset -function RL.glPolygonOffset( factor, units ) end - ----Set front and back function and reference value for stencil testing ----@param func integer ----@param ref integer ----@param mask integer ----@return any RL.glStencilFunc -function RL.glStencilFunc( func, ref, mask ) end - ----Set front and/or back function and reference value for stencil testing ----@param face integer ----@param func integer ----@param ref integer ----@param mask integer ----@return any RL.glStencilFuncSeparate -function RL.glStencilFuncSeparate( face, func, ref, mask ) end - ----Control the front and back writing of individual bits in the stencil planes ----@param mask integer ----@return any RL.glStencilMask -function RL.glStencilMask( mask ) end - ----Control the front and/or back writing of individual bits in the stencil planes ----@param face integer ----@param mask integer ----@return any RL.glStencilMaskSeparate -function RL.glStencilMaskSeparate( face, mask ) end - ----Set front and back stencil test actions ----@param sfail integer ----@param dpfail integer ----@param dppass integer ----@return any RL.glStencilOp -function RL.glStencilOp( sfail, dpfail, dppass ) end - ----Set front and back stencil test actions ----@param face integer ----@param sfail integer ----@param dpfail integer ----@param dppass integer ----@return any RL.glStencilOpSeparate -function RL.glStencilOpSeparate( face, sfail, dpfail, dppass ) end - --- OpenGL - Utility - ----Return a string describing the current GL connection. GL_EXTENSIONS returns the extension string supported by the implementation at index ----- Success return string ----@param name integer ----@param index integer|nil ----@return any connection -function RL.glGetString( name, index ) end - --- Easings - Linear Easing functions - ----Ease linear ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseLinear( t, b, c, d ) end - --- Easings - Sine Easing functions - ----Ease sine in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseSineIn( t, b, c, d ) end - ----Ease sine out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseSineOut( t, b, c, d ) end - ----Ease sine in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseSineInOut( t, b, c, d ) end - --- Easings - Circular Easing functions - ----Ease circle in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseCircIn( t, b, c, d ) end - ----Ease circle out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseCircOut( t, b, c, d ) end - ----Ease circle in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseCircInOut( t, b, c, d ) end - --- Easings - Cubic Easing functions - ----Ease cubic in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseCubicIn( t, b, c, d ) end - ----Ease cubic out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseCubicOut( t, b, c, d ) end - ----Ease cubic in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseCubicInOut( t, b, c, d ) end - --- Easings - Quadratic Easing functions - ----Ease quadratic in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseQuadIn( t, b, c, d ) end - ----Ease quadratic out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseQuadOut( t, b, c, d ) end - ----Ease quadratic in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseQuadInOut( t, b, c, d ) end - --- Easings - Exponential Easing functions - ----Ease exponential in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseExpoIn( t, b, c, d ) end - ----Ease exponential out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseExpoOut( t, b, c, d ) end - ----Ease exponential in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseExpoInOut( t, b, c, d ) end - --- Easings - Back Easing functions - ----Ease back in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseBackIn( t, b, c, d ) end - ----Ease back out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseBackOut( t, b, c, d ) end - ----Ease back in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseBackInOut( t, b, c, d ) end - --- Easings - Bounce Easing functions - ----Ease bounce in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseBounceIn( t, b, c, d ) end - ----Ease bounce out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseBounceOut( t, b, c, d ) end - ----Ease bounce in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseBounceInOut( t, b, c, d ) end - --- Easings - Elastic Easing functions - ----Ease elastic in ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseElasticIn( t, b, c, d ) end - ----Ease elastic out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseElasticOut( t, b, c, d ) end - ----Ease elastic in out ----- Success return float ----@param t number ----@param b number ----@param c number ----@param d number ----@return any value -function RL.EaseElasticInOut( t, b, c, d ) end - --- Bitwise Operations - Arithmetic - ----Equivalent to a & b in C ----- Success return int ----@param a integer ----@param b integer ----@return any result -function RL.BitAnd( a, b ) end - ----Equivalent to a | b in C ----- Success return int ----@param a integer ----@param b integer ----@return any result -function RL.BitOr( a, b ) end - ----Equivalent to a ^ b in C ----- Success return int ----@param a integer ----@param b integer ----@return any result -function RL.BitXor( a, b ) end - ----Equivalent to ~v in C ----- Success return int ----@param v integer ----@return any result -function RL.BitNot( v ) end - ----Equivalent to v << n in C ----- Success return int ----@param v integer ----@param n integer ----@return any result -function RL.BitShiftLeft( v, n ) end - ----Equivalent to v >> n in C ----- Success return int ----@param v integer ----@param n integer ----@return any result -function RL.BitShiftRight( v, n ) end - ----Set bit in index i to state b in value v ----- Success return int ----@param v integer ----@param i integer ----@param b boolean ----@return any result -function RL.BitSet( v, i, b ) end - ----Get bit in index i from value v ----- Success return bool ----@param v integer ----@param i integer ----@return any bit -function RL.BitGet( v, i ) end - ----Toggle bit in index i in value v ----- Success return int ----@param v integer ----@param i integer ----@return any result -function RL.BitToggle( v, i ) end - --- GLFW Core - Input-related functions: keyboard - ----This function returns the name of the specified printable key, encoded as UTF-8. ----If the key is KEY_UNKNOWN, the scancode is used to identify the key, ----otherwise the scancode is ignored. If you specify a non-printable key, ----or KEY_UNKNOWN and a scancode that maps to a non-printable key, ----this function returns nil but does not emit an error. ----- Success return string or nil ----@param key integer ----@param scancode integer ----@return any keyName -function RL.GetKeyName( key, scancode ) end - ----This function returns the platform-specific scancode of the specified key. ----If the key is KEY_UNKNOWN or does not exist on the keyboard this method will return -1. ----- Success return int ----@param key integer ----@return any scancode -function RL.GetKeyScancode( key ) end - diff --git a/SPLASH_SCREENS.md b/SPLASH_SCREENS.md deleted file mode 100644 index eb28565..0000000 --- a/SPLASH_SCREENS.md +++ /dev/null @@ -1,230 +0,0 @@ -# Splash Screens - -ReiLua includes a built-in splash screen system that displays splash screens before your game loads. This gives your game a polished appearance right from startup. - -## Overview - -When you run your ReiLua game, it automatically shows two splash screens in sequence: - -1. **Custom Text** - Clean, bold text on Raylib red background (similar to Squid Game style) -2. **"Made using"** - Text with Raylib and ReiLua logos displayed side-by-side - -Each splash screen: -- Fades in over 0.8 seconds -- Displays for 2.5 seconds -- Fades out over 0.8 seconds -- Total display time: 8.2 seconds for both screens - -## Features - -### Always Embedded - -The logo images are **always embedded** into the executable in both development and release builds. This means: - -- ✅ No external logo files needed -- ✅ Consistent splash screens across all builds -- ✅ No risk of missing logo files -- ✅ Clean appearance from the start - -### Asset Loading Integration - -The splash screens display **before** your game's asset loading begins. This means: - -1. User starts your game -2. Splash screens play (~8 seconds) -3. Your `RL.init()` function runs -4. Asset loading with progress indicator (if you use it) -5. Your game starts - -This creates a smooth, polished startup experience. - -## Skipping Splash Screens (Development) - -During development, you often need to test your game repeatedly. Waiting for splash screens every time can slow down your workflow. Use the `--no-logo` flag to skip them: - -```bash -# Windows -ReiLua.exe --no-logo - -# Linux/Mac -./ReiLua --no-logo - -# With other options -ReiLua.exe --log --no-logo -./ReiLua --no-logo path/to/game/ -``` - -**Note:** The `--no-logo` flag only works in development. In release builds, users should see the full splash screen sequence. - -## Technical Details - -### How It Works - -The splash screen system is implemented in C and runs before any Lua code executes: - -1. **Logo Embedding**: During build, `embed_logo.py` converts PNG files to C byte arrays -2. **Initialization**: Before calling `RL.init()`, the engine initializes splash screens -3. **Display Loop**: A dedicated loop handles timing, fading, and rendering -4. **Cleanup**: After completion, resources are freed and Lua code begins - -### Files - -- `src/splash.c` - Splash screen implementation -- `include/splash.h` - Header file -- `embed_logo.py` - Python script to embed logo images -- `logo/raylib_logo.png` - Raylib logo (embedded) -- `logo/reilua_logo.png` - ReiLua logo (embedded) - -### Build Integration - -The CMakeLists.txt automatically: - -1. Runs `embed_logo.py` during build -2. Generates `embedded_logo.h` with logo data -3. Defines `EMBED_LOGO` flag -4. Compiles `splash.c` with the project - -No manual steps required - it just works! - -## Customization - -### Changing Splash Screen Text - -To change the default text to your studio name: - -1. Open `src/splash.c` -2. Find the splash drawing function -3. Change the text line: - ```c - const char* text = "YOUR STUDIO NAME"; - ``` -4. Rebuild the project - -**Note:** Use ALL CAPS for the Squid Game-style aesthetic. - -### Changing Logos - -To use different logos: - -1. Replace `logo/raylib_logo.png` and/or `logo/reilua_logo.png` with your images -2. Recommended size: 256x256 or smaller (logos are auto-scaled to max 200px) -3. Format: PNG with transparency support -4. Rebuild the project - logos will be automatically embedded - -### Changing Timing - -To adjust how long each screen displays: - -1. Open `src/splash.c` -2. Modify these constants at the top: - ```c - #define FADE_IN_TIME 0.8f // Seconds to fade in - #define DISPLAY_TIME 2.5f // Seconds to display fully - #define FADE_OUT_TIME 0.8f // Seconds to fade out - ``` -3. Rebuild the project - -### Removing Splash Screens Entirely - -If you don't want any splash screens: - -1. Open `src/main.c` -2. Find this block: - ```c - /* Show splash screens if not skipped */ - if ( !skip_splash ) { - splashInit(); - // ... splash code ... - splashCleanup(); - } - ``` -3. Comment out or remove the entire block -4. Rebuild the project - -## Example: Complete Startup Sequence - -Here's what a typical game startup looks like with everything enabled: - -```bash -ReiLua.exe MyGame/ -``` - -**User Experience:** - -1. **Splash Screen 1** (4.1 seconds) - - Custom text displayed in bold (default: "YOUR STUDIO NAME") - - Red background (Raylib color #E62937) - - Subtle zoom effect - -2. **Splash Screen 2** (4.1 seconds) - - "Made using" text at top - - Raylib + ReiLua logos side-by-side (max 200px each) - - Black background - -3. **Asset Loading** (varies) - - Your loading screen with progress bar - - Shows "Loading texture1.png", "3/10", etc. - -4. **Game Start** - - Your game's main screen appears - - Player can interact - -## Best Practices - -1. **Keep --no-logo for Development**: Always use `--no-logo` during active development -2. **Test Without Flag**: Occasionally test without `--no-logo` to ensure splash screens work -3. **Customize for Your Studio**: Change the text and logos to match your branding -4. **Consider Total Time**: Splash (~8s) + Loading (varies) = Total startup time -5. **Optimize Loading**: Keep asset loading fast to maintain a good first impression - -## Troubleshooting - -### Splash Screens Don't Show - -**Problem**: Game starts immediately without splash screens - -**Solutions**: -- Check you're not using `--no-logo` flag -- Verify logos exist in `logo/` folder before building -- Check console output for embedding errors -- Rebuild project completely: `cmake .. && make clean && make` - -### Logos Appear Corrupted - -**Problem**: Logos display incorrectly or not at all - -**Solutions**: -- Verify PNG files are valid (open in image viewer) -- Check file sizes aren't too large (keep under 1MB each) -- Ensure PNGs use standard format (not progressive or exotic encoding) -- Rebuild project to regenerate embedded data - -### Compilation Errors - -**Problem**: Build fails with logo-related errors - -**Solutions**: -- Ensure Python 3 is installed and in PATH -- Check `embed_logo.py` has correct paths -- Verify `logo/` folder exists with both PNG files -- Check CMake output for specific error messages - -## Command Reference - -```bash -# Development (skip splash) -ReiLua --no-logo - -# Development with logging -ReiLua --log --no-logo - -# Production/testing (full splash) -ReiLua - -# Help -ReiLua --help -``` - ---- - -The splash screen system adds a polished touch to your ReiLua games with minimal effort. Customize it to match your studio's branding and give players a great first impression! diff --git a/UPGRADE_SUMMARY.md b/UPGRADE_SUMMARY.md deleted file mode 100644 index 5cdfe8f..0000000 --- a/UPGRADE_SUMMARY.md +++ /dev/null @@ -1,186 +0,0 @@ -# ReiLua Embedded Assets Upgrade - Summary - -## Overview -Successfully ported embedded assets, splash screens, and asset loading features from ReiLua-JamVersion to the main ReiLua repository on the `embedded-assets-support` branch. - -## Features Added - -### 1. **Embedded Main.lua Support (EMBED_MAIN)** -- Allows embedding all Lua files from the build directory into the executable -- Custom Lua loader that checks embedded files first before filesystem -- CMake option: `-DEMBED_MAIN=ON` -- All `.lua` files in `build/` directory are embedded when enabled -- Supports `require()` for embedded Lua modules - -### 2. **Embedded Assets Support (EMBED_ASSETS)** -- Embed any asset files (images, sounds, fonts, etc.) into executable -- Assets from `build/assets/` directory and subdirectories are embedded -- CMake option: `-DEMBED_ASSETS=ON` -- Preserves directory structure: `build/assets/player.png` → load as `"assets/player.png"` -- Transparent to Lua code - same paths work in dev and release - -### 3. **Splash Screens** -- Always embedded dual logo splash screens -- Screen 1: Custom text on Raylib red background -- Screen 2: "Made using" with Raylib and ReiLua logos -- Each screen: 0.8s fade in, 2.5s display, 0.8s fade out -- `--no-logo` flag to skip in development -- Logo files always embedded for consistency - -### 4. **Asset Loading Progress API** -- `RL.BeginAssetLoading(totalAssets)` - Initialize loading tracking -- `RL.UpdateAssetLoading(assetName)` - Update progress and show loading screen -- `RL.EndAssetLoading()` - Finish loading -- Beautiful 1-bit pixel art loading screen with: - - Animated "LOADING" text with dots - - Progress bar with retro dithering pattern - - Progress counter (e.g., "3/10") - - Current asset name display - - Pixel art corner decorations - -### 5. **Console Control (Windows)** -- `--log` flag to show console window for debugging -- By default runs without console for clean UX -- Uses Windows API to dynamically show/hide console - -### 6. **Font Embedding** -- Custom Oleaguid font always embedded for splash/loading screens -- Ensures consistent appearance across builds - -## Files Added/Modified - -### New Files -- **Python Scripts:** - - `embed_lua.py` - Embeds Lua files into C header - - `embed_assets.py` - Embeds asset files into C header - - `embed_logo.py` - Embeds splash screen logos - - `embed_font.py` - Embeds custom font - -- **Source Files:** - - `src/splash.c` - Splash screen implementation - - `include/splash.h` - Splash screen header - -- **Assets:** - - `logo/raylib_logo.png` - Raylib logo (2466 bytes) - - `logo/reilua_logo.png` - ReiLua logo (1191 bytes) - - `fonts/Oleaguid.ttf` - Custom font (112828 bytes) - -- **Documentation:** - - `EMBEDDING.md` - Complete guide to embedding Lua and assets - - `ASSET_LOADING.md` - Asset loading API documentation - - `SPLASH_SCREENS.md` - Splash screen customization guide - - `BUILD_SCRIPTS.md` - Build scripts documentation - -- **Build Scripts:** - - `build_dev.bat` / `build_dev.sh` - One-command development builds - - `build_release.bat` / `build_release.sh` - One-command release builds with embedding - -- **Icon and Resources:** - - `icon.ico` - Default Windows executable icon - - `resources.rc` - Windows resource file for exe metadata - -### Modified Files -- `CMakeLists.txt` - Added embedding options and build commands -- `src/main.c` - Added splash screens, console control, --no-logo flag -- `src/lua_core.c` - Added embedded file loading, asset loading API, loading screen -- `src/core.c` - Added asset loading API functions -- `include/core.h` - Added asset loading function declarations -- `include/lua_core.h` - Changed luaCallMain() return type to bool - -## Build Options - -### Quick Build (Recommended) - -**Development (Fast Iteration):** -```bash -# Windows -build_dev.bat - -# Linux/Unix -./build_dev.sh -``` - -**Release (Single Executable):** -```bash -# Copy files to build directory first -cd build -copy ..\*.lua . -mkdir assets -copy ..\assets\* assets\ - -# Then build -cd .. - -# Windows -build_release.bat - -# Linux/Unix -./build_release.sh -``` - -### Manual Build - -**Development Build (Fast Iteration):** -```bash -cmake -G "MinGW Makefiles" .. -mingw32-make -``` -- External Lua and asset files -- Fast edit-and-run workflow -- Use `--no-logo` to skip splash screens - -**Release Build (Single Executable):** -```bash -# Copy Lua files and assets to build directory -copy ..\*.lua . -mkdir assets -copy ..\assets\* assets\ - -# Configure with embedding -cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON -mingw32-make -``` -- Everything embedded in single .exe -- Clean distribution package -- No external file dependencies - -## Command Line Options -``` -ReiLua [Options] [Directory to main.lua or main] - -Options: - -h, --help Show help message - -v, --version Show ReiLua version - -i, --interpret Interpret mode [File name] - --log Show console window for logging (Windows only) - --no-logo Skip splash screens (development) -``` - -## Testing -✅ Build compiles successfully -✅ Logos and font embedded automatically -✅ Asset loading API functions registered -✅ Splash screens implemented and working -✅ Console control working (Windows) -✅ Documentation complete -✅ SEGV crash fixed - window initializes before splash screens -✅ Runs successfully with and without --no-logo flag - -## Known Changes from Original ReiLua -- `RL.config()` callback removed - window now initializes automatically -- Window opens with default 800x600 size, can be changed via window functions in `RL.init()` -- Custom font (Oleaguid) always loaded for consistent appearance -- `stateContextInit()` merged into `stateInit()` - -## Next Steps -1. Test with actual embedded Lua files -2. Test with embedded assets -3. Verify asset loading progress display -4. Test splash screens (run without --no-logo) -5. Create example game that uses all features -6. Merge to main branch when stable - -## Commit -- Branch: `embedded-assets-support` -- Commit: "Add embedded assets, splash screens, and asset loading support" -- All changes committed successfully diff --git a/ZED_EDITOR_SETUP.md b/ZED_EDITOR_SETUP.md deleted file mode 100644 index 7373a4e..0000000 --- a/ZED_EDITOR_SETUP.md +++ /dev/null @@ -1,579 +0,0 @@ -# Setting Up Zed Editor for ReiLua Development - -Zed is a high-performance, modern code editor built for speed and collaboration. This guide shows you how to set up Zed for the best ReiLua game development experience. - -## Why Zed? - -- ⚡ **Fast**: Written in Rust, extremely responsive -- 🧠 **Smart**: Built-in AI assistance (optional) -- 🎨 **Beautiful**: Clean, modern interface -- 🔧 **Powerful**: LSP support, multi-cursor editing, vim mode -- 🆓 **Free**: Open source and free to use - -## Installation - -### Download Zed - -Visit https://zed.dev/ and download for your platform: - -- **Windows**: Download installer and run -- **Mac**: Download .dmg and install -- **Linux**: - ```bash - curl https://zed.dev/install.sh | sh - ``` - -### First Launch - -1. Launch Zed -2. Choose your theme (light/dark) -3. Select keybindings (VS Code, Sublime, or default) -4. Optional: Sign in for collaboration features - -## Setting Up for ReiLua - -### 1. Install Lua Language Server - -The Lua Language Server provides autocomplete, error detection, and documentation. - -**Method 1: Automatic (Recommended)** -1. Open Zed -2. Open any `.lua` file -3. Zed will prompt to install Lua support -4. Click "Install" - -**Method 2: Manual** -1. Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (Mac) -2. Type "zed: install language server" -3. Select "Lua" - -### 2. Create Workspace Configuration - -Create a `.zed` folder in your project root: - -```bash -cd your_game_project -mkdir .zed -``` - -### 3. Configure Lua Language Server - -Create `.zed/settings.json` with ReiLua-specific settings: - -```json -{ - "lsp": { - "lua-language-server": { - "settings": { - "Lua": { - "runtime": { - "version": "Lua 5.4", - "path": [ - "?.lua", - "?/init.lua" - ] - }, - "diagnostics": { - "globals": [ - "RL" - ], - "disable": [ - "lowercase-global" - ] - }, - "workspace": { - "library": [ - "ReiLua_API.lua" - ], - "checkThirdParty": false - }, - "completion": { - "callSnippet": "Both", - "keywordSnippet": "Both" - }, - "hint": { - "enable": true, - "setType": true - } - } - } - } - }, - "languages": { - "Lua": { - "format_on_save": "on", - "formatter": "language_server", - "tab_size": 4, - "hard_tabs": false - } - }, - "tab_size": 4, - "soft_wrap": "editor_width", - "theme": "One Dark", - "buffer_font_size": 14, - "ui_font_size": 14 -} -``` - -**What this does:** -- Sets Lua 5.4 runtime (matches ReiLua) -- Adds `RL` as a global (prevents "undefined global" warnings) -- Loads ReiLua_API.lua for autocomplete -- Enables format-on-save -- Sets tab size to 4 spaces -- Enables type hints -- Disables third-party library checking (reduces noise) - -### 4. Add ReiLua API Definitions - -Copy `ReiLua_API.lua` to your project: - -```bash -# Windows -copy path\to\ReiLua\ReiLua_API.lua your_game_project\ - -# Linux/Mac -cp path/to/ReiLua/ReiLua_API.lua your_game_project/ -``` - -This file provides: -- Autocomplete for all 1000+ ReiLua functions -- Function signatures -- Parameter hints -- Documentation tooltips - -### 5. Create Tasks Configuration - -Create `.zed/tasks.json` for quick commands: - -```json -{ - "tasks": [ - { - "label": "Run Game (Dev)", - "command": "path/to/ReiLua.exe", - "args": ["--log", "--no-logo"], - "cwd": "${workspaceFolder}" - }, - { - "label": "Run Game (Production)", - "command": "path/to/ReiLua.exe", - "args": [], - "cwd": "${workspaceFolder}" - }, - { - "label": "Run Game with Logging", - "command": "path/to/ReiLua.exe", - "args": ["--log"], - "cwd": "${workspaceFolder}" - }, - { - "label": "Build Release", - "command": "path/to/ReiLua/build_release.bat", - "cwd": "path/to/ReiLua" - } - ] -} -``` - -**Usage:** -1. Press `Ctrl+Shift+P` / `Cmd+Shift+P` -2. Type "task: spawn" -3. Select your task - -Replace `path/to/ReiLua.exe` with the actual path to your ReiLua executable. - -## Essential Keyboard Shortcuts - -### Navigation - -| Shortcut | Action | Description | -|----------|--------|-------------| -| `Ctrl+P` / `Cmd+P` | Quick Open | Jump to any file instantly | -| `Ctrl+Shift+P` / `Cmd+Shift+P` | Command Palette | Access all commands | -| `Ctrl+T` / `Cmd+T` | Go to Symbol | Jump to function/variable | -| `F12` | Go to Definition | Jump to where something is defined | -| `Shift+F12` | Find References | Find all uses of a symbol | -| `Alt+←` / `Alt+→` | Navigate Back/Forward | Like browser navigation | -| `Ctrl+G` / `Cmd+G` | Go to Line | Jump to specific line number | - -### Editing - -| Shortcut | Action | Description | -|----------|--------|-------------| -| `Ctrl+D` / `Cmd+D` | Add Selection | Select next occurrence | -| `Alt+Click` | Add Cursor | Multiple cursors | -| `Ctrl+Shift+L` / `Cmd+Shift+L` | Select All Occurrences | Multi-cursor all matches | -| `Ctrl+/` / `Cmd+/` | Toggle Comment | Comment/uncomment line | -| `Alt+↑` / `Alt+↓` | Move Line Up/Down | Move current line | -| `Ctrl+Shift+D` / `Cmd+Shift+D` | Duplicate Line | Copy line below | -| `Ctrl+Shift+K` / `Cmd+Shift+K` | Delete Line | Remove entire line | -| `Ctrl+]` / `Cmd+]` | Indent | Indent selection | -| `Ctrl+[` / `Cmd+[` | Outdent | Unindent selection | - -### Search - -| Shortcut | Action | Description | -|----------|--------|-------------| -| `Ctrl+F` / `Cmd+F` | Find | Search in current file | -| `Ctrl+H` / `Cmd+H` | Replace | Find and replace | -| `Ctrl+Shift+F` / `Cmd+Shift+F` | Find in Files | Search entire project | -| `F3` / `Cmd+G` | Find Next | Next search result | -| `Shift+F3` / `Cmd+Shift+G` | Find Previous | Previous search result | - -### View - -| Shortcut | Action | Description | -|----------|--------|-------------| -| `Ctrl+\` / `Cmd+\` | Split Editor | Side-by-side editing | -| `` Ctrl+` `` / `` Cmd+` `` | Toggle Terminal | Show/hide terminal | -| `Ctrl+B` / `Cmd+B` | Toggle Sidebar | Show/hide file tree | -| `Ctrl+K Z` / `Cmd+K Z` | Zen Mode | Distraction-free mode | -| `Ctrl+K V` / `Cmd+K V` | Toggle Preview | For markdown files | - -### Code - -| Shortcut | Action | Description | -|----------|--------|-------------| -| `Ctrl+Space` | Trigger Autocomplete | Force show suggestions | -| `Ctrl+.` / `Cmd+.` | Code Actions | Quick fixes | -| `F2` | Rename Symbol | Rename variable/function | -| `Ctrl+K Ctrl+F` / `Cmd+K Cmd+F` | Format Selection | Format selected code | - -## Project Structure Best Practices - -### Recommended Layout - -``` -your_game/ -├── .zed/ -│ ├── settings.json -│ └── tasks.json -├── assets/ -│ ├── images/ -│ ├── sounds/ -│ └── fonts/ -├── lib/ -│ └── (your libraries) -├── src/ -│ ├── main.lua -│ ├── player.lua -│ ├── enemy.lua -│ └── game.lua -├── ReiLua_API.lua -└── README.md -``` - -### Using Multiple Folders - -Add ReiLua source for reference: - -1. File → Add Folder to Workspace -2. Select ReiLua source directory -3. Now you can reference ReiLua code easily - -## Advanced Features - -### Multi-Cursor Editing - -**Use cases:** -- Rename variables in multiple places -- Edit similar lines simultaneously -- Batch formatting - -**Example:** -1. Select a variable name -2. Press `Ctrl+D` repeatedly to select more occurrences -3. Type to edit all at once - -### Split Editor - -Work on multiple files simultaneously: - -1. Press `Ctrl+\` to split -2. Open different files in each pane -3. Example: `main.lua` on left, `player.lua` on right - -### Vim Mode (Optional) - -If you love Vim: - -1. `Ctrl+Shift+P` → "zed: toggle vim mode" -2. All Vim keybindings become available -3. Normal, Insert, Visual modes work -4. `:w` to save, `:q` to close, etc. - -### Live Grep - -Powerful project-wide search: - -1. Press `Ctrl+Shift+F` -2. Type your search query -3. Results show in context -4. Click to jump to location - -**Search tips:** -- Use regex with `.*` for patterns -- Search by file type: `*.lua` -- Exclude folders: Add to `.gitignore` - -### Collaboration (Optional) - -Share your coding session: - -1. Click "Share" button (top right) -2. Send link to teammate -3. Collaborate in real-time -4. See each other's cursors - -## Workflow Tips - -### 1. Quick File Switching - -``` -Ctrl+P → type filename → Enter -``` - -Example: `Ctrl+P` → "play" → selects `player.lua` - -### 2. Symbol Search - -``` -Ctrl+T → type function name → Enter -``` - -Example: `Ctrl+T` → "update" → jumps to `function RL.update()` - -### 3. Multi-File Editing - -1. `Ctrl+Shift+F` → Search for text -2. Results show all occurrences -3. Use multi-cursor to edit across files - -### 4. Integrated Terminal - -Keep terminal open while coding: - -1. `` Ctrl+` `` → Open terminal -2. Split view: code above, terminal below -3. Run `ReiLua.exe --log --no-logo` for testing - -### 5. Quick Testing Loop - -Set up this workflow: -1. Edit code in Zed -2. Save with `Ctrl+S` (autosave optional) -3. Switch to terminal with `` Ctrl+` `` -4. Press `↑` to recall previous command -5. Press `Enter` to run game - -## Troubleshooting - -### Lua Language Server Not Working - -**Problem**: No autocomplete or diagnostics - -**Solutions:** -1. Check LSP status: `Ctrl+Shift+P` → "lsp: show active servers" -2. Restart LSP: `Ctrl+Shift+P` → "lsp: restart" -3. Check `.zed/settings.json` syntax -4. Verify `ReiLua_API.lua` exists in project - -### ReiLua Functions Show as Undefined - -**Problem**: `RL.DrawText` shows as error - -**Solutions:** -1. Add `"RL"` to globals in `.zed/settings.json`: - ```json - "diagnostics": { - "globals": ["RL"] - } - ``` -2. Restart LSP - -### Format on Save Not Working - -**Problem**: Code doesn't format when saving - -**Solutions:** -1. Check formatter setting: - ```json - "languages": { - "Lua": { - "format_on_save": "on" - } - } - ``` -2. Ensure LSP is running -3. Try manual format: `Ctrl+Shift+F` - -### Tasks Not Showing - -**Problem**: Can't find run tasks - -**Solutions:** -1. Verify `.zed/tasks.json` exists -2. Check JSON syntax -3. Reload window: `Ctrl+Shift+P` → "zed: reload" - -## Themes and Appearance - -### Change Theme - -1. `Ctrl+Shift+P` → "theme selector: toggle" -2. Browse themes -3. Select one - -**Recommended for coding:** -- One Dark (dark) -- One Light (light) -- Andromeda (dark) -- GitHub Light (light) - -### Adjust Font Size - -**Method 1: Settings** -Edit `.zed/settings.json`: -```json -{ - "buffer_font_size": 14, - "ui_font_size": 14 -} -``` - -**Method 2: Quick Zoom** -- `Ctrl+=` / `Cmd+=` → Increase font -- `Ctrl+-` / `Cmd+-` → Decrease font -- `Ctrl+0` / `Cmd+0` → Reset font - -### Custom Font - -```json -{ - "buffer_font_family": "JetBrains Mono", - "buffer_font_size": 14 -} -``` - -**Recommended coding fonts:** -- JetBrains Mono -- Fira Code -- Cascadia Code -- Source Code Pro - -## Extensions and Enhancements - -### Install Extensions - -1. `Ctrl+Shift+X` / `Cmd+Shift+X` -2. Search for extensions -3. Click install - -### Recommended for Lua Development - -**Core:** -- ✅ Lua Language Server (built-in) - -**Productivity:** -- Better Comments - Enhanced comment highlighting -- Error Lens - Inline error display -- Bracket Pair Colorizer - Match brackets with colors - -**Optional:** -- GitHub Copilot - AI code suggestions (requires subscription) -- GitLens - Advanced git integration - -## Sample Workspace - -Here's a complete example setup: - -### Directory Structure -``` -MyGame/ -├── .zed/ -│ ├── settings.json -│ └── tasks.json -├── src/ -│ ├── main.lua -│ ├── player.lua -│ └── enemy.lua -├── assets/ -│ ├── player.png -│ └── music.wav -├── ReiLua_API.lua -└── README.md -``` - -### .zed/settings.json -```json -{ - "lsp": { - "lua-language-server": { - "settings": { - "Lua": { - "runtime": {"version": "Lua 5.4"}, - "diagnostics": {"globals": ["RL"]}, - "workspace": {"library": ["ReiLua_API.lua"]} - } - } - } - }, - "languages": { - "Lua": { - "format_on_save": "on", - "tab_size": 4 - } - }, - "theme": "One Dark", - "buffer_font_size": 14 -} -``` - -### .zed/tasks.json -```json -{ - "tasks": [ - { - "label": "Run Game", - "command": "C:/ReiLua/build/ReiLua.exe", - "args": ["--log", "--no-logo"] - } - ] -} -``` - -Now you can: -- Open project in Zed -- Get autocomplete for all RL functions -- Press `Ctrl+Shift+P` → "Run Game" to test -- Edit code with full LSP support - -## Tips for Efficient Development - -1. **Learn 5 shortcuts**: `Ctrl+P`, `Ctrl+Shift+F`, `Ctrl+D`, `F12`, `` Ctrl+` `` -2. **Use multi-cursor**: Speed up repetitive edits -3. **Split editor**: Work on related files side-by-side -4. **Keep terminal open**: Quick testing without leaving Zed -5. **Use Zen mode**: Focus during complex coding -6. **Enable autosave**: Never lose work - -## Next Steps - -✅ Install Zed -✅ Configure for Lua 5.4 -✅ Add ReiLua_API.lua to project -✅ Set up tasks for quick testing -✅ Learn essential shortcuts -✅ Start coding your game! - -## Additional Resources - -- **Zed Documentation**: https://zed.dev/docs -- **Zed GitHub**: https://github.com/zed-industries/zed -- **Community**: https://zed.dev/community -- **Keyboard Shortcuts**: View in Zed with `Ctrl+K Ctrl+S` - ---- - -Happy coding with Zed and ReiLua! 🚀 diff --git a/apiScanner.lua b/apiScanner.lua deleted file mode 100644 index 88a27cf..0000000 --- a/apiScanner.lua +++ /dev/null @@ -1,177 +0,0 @@ -local raylib = { - prefix = "RLAPI", - file = "raylib.h", - blacklist = { - GetScreenWidth = "Replaced by GetScreenSize", - GetScreenHeight = "Replaced by GetScreenSize", - GetRenderWidth = "Replaced by GetRenderSize", - GetRenderHeight = "Replaced by GetRenderSize", - GetMonitorWidth = "Replaced by GetMonitorSize", - GetMonitorHeight = "Replaced by GetMonitorSize", - GetMonitorPhysicalWidth = "Replaced by GetMonitorPhysicalSize", - GetMonitorPhysicalHeight = "Replaced by GetMonitorPhysicalSize", - UnloadRandomSequence = "Handled internally", - MemAlloc = "Buffer should be used instead", - MemRealloc = "Buffer should be used instead", - MemFree = "Buffer should be used instead", - SetTraceLogCallback = "Handled internally", - SetLoadFileDataCallback = "Not seen necessary", - SetSaveFileDataCallback = "Not seen necessary", - SetLoadFileTextCallback = "Not seen necessary", - SetSaveFileTextCallback = "Not seen necessary", - UnloadFileData = "Handled internally", - UnloadFileText = "Handled internally", - UnloadDirectoryFiles = "Handled internally", - UnloadDroppedFiles = "Handled internally", - GetMouseX = "Replaced by GetMousePosition", - GetMouseY = "Replaced by GetMousePosition", - GetTouchX = "Replaced by GetTouchPosition", - GetTouchY = "Replaced by GetTouchPosition", - UpdateCamera = "Replaced by UpdateCamera3D", - UpdateCameraPro = "Replaced by UpdateCameraPro3D", - DrawPixelV = "Replaced by DrawPixel", - DrawLineV = "Replaced by DrawLine", - DrawLineEx = "Replaced by DrawLine", - DrawCircleV = "Replaced by DrawCircle", - DrawCircleLinesV = "Replaced by DrawCircleLines", - DrawRectangleV = "Replaced by DrawRectangle", - DrawRectangleRec = "Replaced by DrawRectangle", - UnloadImageColors = "Handled internally", - UnloadImagePalette = "Handled internally", - ImageDrawPixelV = "Replaced by ImageDrawPixel", - ImageDrawLineV = "Replaced by ImageDrawLine", - ImageDrawCircleV = "Replaced by ImageDrawCircle", - ImageDrawCircleLinesV = "Replaced by ImageDrawCircleLines", - ImageDrawRectangleV = "Replaced by ImageDrawRectangle", - ImageDrawRectangleRec = "Replaced by ImageDrawRectangle", - DrawTextureV = "Replaced by DrawTexture", - UnloadFontData = "Handled internally", - UnloadUTF8 = "Handled internally", - UnloadCodepoints = "Handled internally", - TextCopy = "Can be replaced by Lua equivalent", - TextIsEqual = "Can be replaced by Lua equivalent", - TextLength = "Can be replaced by Lua equivalent", - TextFormat = "Can be replaced by Lua equivalent", - TextJoin = "Can be replaced by Lua equivalent", - TextAppend = "Can be replaced by Lua equivalent", - TextToUpper = "Can be replaced by Lua equivalent", - TextToLower = "Can be replaced by Lua equivalent", - TextToInteger = "Can be replaced by Lua equivalent", - TextToFloat = "Can be replaced by Lua equivalent", - DrawCubeV = "Replaced by DrawCube", - DrawCubeWiresV = "Replaced by DrawCubeWires", - UploadMesh = "Handled internally", - UpdateMeshBuffer = "Handled internally", - UnloadWaveSamples = "Handled internally", - GetPixelColor = "Not seen necessary", - SetPixelColor = "Not seen necessary", - }, - info = { - } -} -local rlgl = { - prefix = "RLAPI", - file = "rlgl.h", - blacklist = { - rlVertex2i = "Most likely not needed", - rlglInit = "Handled internally", - rlglClose = "Handled internally", - rlLoadExtensions = "Handled internally", - rlLoadDrawCube = "Most likely not needed", - rlLoadDrawQuad = "Most likely not needed", - }, - info = { - rlEnableStatePointer = "Available for GRAPHICS_API_OPENGL_11", - rlDisableStatePointer = "Available for GRAPHICS_API_OPENGL_11", - }, -} -local raygui = { - prefix = "RAYGUIAPI", - file = "raygui.h", - blacklist = { - }, - info = { - }, -} -local raymath = { - prefix = "RMAPI", - file = "raymath.h", - blacklist = { - Vector3ToFloatV = "Can be replaced by Lua equivalent", - MatrixToFloatV = "Can be replaced by Lua equivalent", - }, - info = { - }, -} -local easings = { - prefix = "EASEDEF", - file = "easings.h", - blacklist = { - EaseLinearNone = "Replaced by EaseLinear", - EaseLinearIn = "Replaced by EaseLinear", - EaseLinearOut = "Replaced by EaseLinear", - EaseLinearInOut = "Replaced by EaseLinear", - }, - info = { - }, -} - -local filePrefix = "../include/" -local headers = { - raylib, - rlgl, - raygui, - raymath, - easings, -} - -if RL.arg[4] == "--help" then - print( "You can get blacklisted functions with argument '--blacklist'. Give additional argument to find specific function." ) - return -end - -for _, header in ipairs( headers ) do - if RL.arg[4] == "--blacklist" then - if RL.arg[5] == nil then - print( "\nFunctions blacklisted from '"..header.file.."':\n" ) - - for func, info in pairs( header.blacklist ) do - print( func.."\t\""..info.."\"" ) - end - else - for func, info in pairs( header.blacklist ) do - if func:lower() == RL.arg[5]:lower() then - print( "\nFunction '"..func.."' blacklisted from '"..header.file.."'\t\""..info.."\"\n" ) - end - end - end - else - local file = io.open( filePrefix..header.file, "r" ) - - if file ~= nil then - local line = "" - - print( "\nFunctions not implemented from '"..header.file.."':\n" ) - - repeat - line = file:read( "*l" ) - - if line ~= nil and line:sub( 1, #header.prefix ) == header.prefix then - local splits = RL.TextSplit( line:sub( 1, RL.TextFindIndex( line, "(" ) ), " " ) - local func = splits[ #splits ] - func = func:gsub( "*", "" ) - - if RL[ func ] == nil and not header.blacklist[ func ] then - local output = func - - if header.info[ func ] ~= nil then - output = output.."\t\""..header.info[ func ].."\"" - end - - print( output ) - end - end - until line == nil - end - end -end diff --git a/build_dev.bat b/build_dev.bat deleted file mode 100644 index c1d79d2..0000000 --- a/build_dev.bat +++ /dev/null @@ -1,100 +0,0 @@ -@echo off -REM ReiLua Development Build Script -REM Run this from w64devkit shell or CMD with MinGW in PATH - -echo ================================ -echo ReiLua - Development Build -echo ================================ -echo. - -REM Navigate to build directory -cd build -if errorlevel 1 ( - echo ERROR: Cannot access build directory - exit /b 1 -) - -REM Clean old embedded files (important for dev builds!) -echo Cleaning old embedded files... -del /Q embedded_main.h embedded_assets.h 2>nul - -REM Warn about Lua files in build directory -dir /b *.lua >nul 2>&1 -if not errorlevel 1 ( - echo. - echo WARNING: Found Lua files in build directory! - echo Development builds should load from file system, not embed. - echo. - dir /b *.lua - echo. - set /p REMOVE="Remove these files from build directory? (Y/n): " - if /i not "%REMOVE%"=="n" ( - del /Q *.lua - echo Lua files removed. - ) - echo. -) - -REM Warn about assets folder in build directory -if exist "assets" ( - echo. - echo WARNING: Found assets folder in build directory! - echo Development builds should load from file system, not embed. - echo. - set /p REMOVE="Remove assets folder from build directory? (Y/n): " - if /i not "%REMOVE%"=="n" ( - rmdir /S /Q assets - echo Assets folder removed. - ) - echo. -) - -REM Clean old configuration if requested -if "%1"=="clean" ( - echo Cleaning build directory... - del /Q CMakeCache.txt *.o *.a 2>nul - rmdir /S /Q CMakeFiles 2>nul - echo Clean complete! - echo. -) - -REM Configure with MinGW -echo Configuring CMake for development... -cmake -G "MinGW Makefiles" .. - -if errorlevel 1 ( - echo. - echo ERROR: CMake configuration failed! - exit /b 1 -) - -echo. -echo Building ReiLua... -mingw32-make - -if errorlevel 1 ( - echo. - echo ERROR: Build failed! - exit /b 1 -) - -echo. -echo ================================ -echo Build Complete! -echo ================================ -echo. -echo Development build created successfully! -echo. -echo To run your game: -echo cd \path\to\your\game -echo \path\to\ReiLua\build\ReiLua.exe -echo. -echo To run with console logging: -echo \path\to\ReiLua\build\ReiLua.exe --log -echo. -echo Features: -echo - Lua files load from file system -echo - Assets load from file system -echo - Fast iteration - edit and reload -echo. -pause diff --git a/build_dev.sh b/build_dev.sh deleted file mode 100644 index 4383d36..0000000 --- a/build_dev.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash -# ReiLua Development Build Script -# Run this from w64devkit shell - -echo "================================" -echo "ReiLua - Development Build" -echo "================================" -echo "" - -# Navigate to build directory -cd build || exit 1 - -# Clean old embedded files (important for dev builds!) -echo "Cleaning old embedded files..." -rm -f embedded_main.h embedded_assets.h - -# Warn about Lua files in build directory -LUA_COUNT=$(ls *.lua 2>/dev/null | wc -l) -if [ "$LUA_COUNT" -gt 0 ]; then - echo "" - echo "WARNING: Found Lua files in build directory!" - echo "Development builds should load from file system, not embed." - echo "" - ls -1 *.lua - echo "" - read -p "Remove these files from build directory? (Y/n): " -n 1 -r - echo "" - if [[ ! $REPLY =~ ^[Nn]$ ]]; then - rm -f *.lua - echo "Lua files removed." - fi - echo "" -fi - -# Warn about assets folder in build directory -if [ -d "assets" ]; then - echo "" - echo "WARNING: Found assets folder in build directory!" - echo "Development builds should load from file system, not embed." - echo "" - read -p "Remove assets folder from build directory? (Y/n): " -n 1 -r - echo "" - if [[ ! $REPLY =~ ^[Nn]$ ]]; then - rm -rf assets - echo "Assets folder removed." - fi - echo "" -fi - -# Clean old configuration if requested -if [ "$1" == "clean" ]; then - echo "Cleaning build directory..." - rm -rf CMakeCache.txt CMakeFiles/ *.o *.a - echo "Clean complete!" - echo "" -fi - -# Configure with MinGW -echo "Configuring CMake for development..." -cmake -G "MinGW Makefiles" .. - -if [ $? -ne 0 ]; then - echo "" - echo "ERROR: CMake configuration failed!" - exit 1 -fi - -echo "" -echo "Building ReiLua..." -make - -if [ $? -ne 0 ]; then - echo "" - echo "ERROR: Build failed!" - exit 1 -fi - -echo "" -echo "================================" -echo "Build Complete!" -echo "================================" -echo "" -echo "Development build created successfully!" -echo "" -echo "To run your game:" -echo " cd /path/to/your/game" -echo " /path/to/ReiLua/build/ReiLua.exe" -echo "" -echo "To run with console logging:" -echo " /path/to/ReiLua/build/ReiLua.exe --log" -echo "" -echo "Features:" -echo " - Lua files load from file system" -echo " - Assets load from file system" -echo " - Fast iteration - edit and reload" -echo "" diff --git a/build_release.bat b/build_release.bat deleted file mode 100644 index 17b76c1..0000000 --- a/build_release.bat +++ /dev/null @@ -1,144 +0,0 @@ -@echo off -REM ReiLua Release Build Script -REM Run this from w64devkit shell or CMD with MinGW in PATH - -echo ================================ -echo ReiLua - Release Build -echo ================================ -echo. - -REM Check if we're in the right directory -if not exist "CMakeLists.txt" ( - echo ERROR: Please run this script from the ReiLua root directory - exit /b 1 -) - -REM Navigate to build directory -cd build -if errorlevel 1 ( - echo ERROR: Cannot access build directory - exit /b 1 -) - -REM Clean old embedded files -echo Cleaning old embedded files... -del /Q embedded_main.h embedded_assets.h 2>nul - -REM Check for Lua files -echo. -echo Checking for Lua files... -dir /b *.lua >nul 2>&1 -if errorlevel 1 ( - echo. - echo WARNING: No Lua files found in build directory! - echo. - echo Please copy your Lua files: - echo cd build - echo copy ..\your_game\*.lua . - echo. - set /p CONTINUE="Do you want to continue anyway? (y/N): " - if /i not "%CONTINUE%"=="y" exit /b 1 -) else ( - echo Found Lua files: - dir /b *.lua -) - -REM Check for assets folder -echo. -echo Checking for assets... -if not exist "assets" ( - echo. - echo WARNING: No assets folder found! - echo. - echo To embed assets, create the folder and copy files: - echo cd build - echo mkdir assets - echo copy ..\your_game\assets\* assets\ - echo. - set /p CONTINUE="Do you want to continue without assets? (y/N): " - if /i not "%CONTINUE%"=="y" exit /b 1 - set EMBED_ASSETS=OFF -) else ( - echo Found assets folder - set EMBED_ASSETS=ON -) - -echo. -echo ================================ -echo Build Configuration -echo ================================ -echo Lua Embedding: ON -echo Asset Embedding: %EMBED_ASSETS% -echo Build Type: Release -echo ================================ -echo. -pause - -REM Clean CMake cache -echo. -echo Cleaning CMake cache... -del /Q CMakeCache.txt 2>nul -rmdir /S /Q CMakeFiles 2>nul - -REM Configure with embedding enabled -echo. -echo Configuring CMake for release... -cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=%EMBED_ASSETS% -DCMAKE_BUILD_TYPE=Release - -if errorlevel 1 ( - echo. - echo ERROR: CMake configuration failed! - pause - exit /b 1 -) - -REM Build -echo. -echo Building ReiLua Release... -mingw32-make - -if errorlevel 1 ( - echo. - echo ERROR: Build failed! - pause - exit /b 1 -) - -REM Show summary -echo. -echo ================================ -echo Embedded Files Summary -echo ================================ - -if exist "embedded_main.h" ( - echo. - echo Embedded Lua files: - findstr /C:"Embedded file:" embedded_main.h -) - -if exist "embedded_assets.h" ( - echo. - echo Embedded assets: - findstr /C:"Embedded asset:" embedded_assets.h -) - -echo. -echo ================================ -echo Build Complete! -echo ================================ -echo. -echo Executable: ReiLua.exe -echo Location: %CD%\ReiLua.exe -echo. -echo Your game is ready for distribution! -echo. -echo To test the release build: -echo ReiLua.exe --log (with console) -echo ReiLua.exe (production mode) -echo. -echo To distribute: -echo - Copy ReiLua.exe to your distribution folder -echo - Rename it to your game name (optional) -echo - That's it! Single file distribution! -echo. -pause diff --git a/build_release.sh b/build_release.sh deleted file mode 100644 index 758ce34..0000000 --- a/build_release.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/bash -# ReiLua Release Build Script -# Run this from w64devkit shell - -echo "================================" -echo "ReiLua - Release Build" -echo "================================" -echo "" - -# Check if we're in the right directory -if [ ! -f "CMakeLists.txt" ]; then - echo "ERROR: Please run this script from the ReiLua root directory" - exit 1 -fi - -# Navigate to build directory -cd build || exit 1 - -# Clean old embedded files -echo "Cleaning old embedded files..." -rm -f embedded_main.h embedded_assets.h - -# Check for Lua files -echo "" -echo "Checking for Lua files..." -LUA_FILES=$(ls *.lua 2>/dev/null | wc -l) - -if [ "$LUA_FILES" -eq 0 ]; then - echo "" - echo "WARNING: No Lua files found in build directory!" - echo "" - echo "Please copy your Lua files:" - echo " cd build" - echo " cp ../your_game/*.lua ." - echo "" - read -p "Do you want to continue anyway? (y/N): " -n 1 -r - echo "" - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - exit 1 - fi -else - echo "Found $LUA_FILES Lua file(s):" - ls -1 *.lua -fi - -# Check for assets folder -echo "" -echo "Checking for assets..." -if [ ! -d "assets" ]; then - echo "" - echo "WARNING: No assets folder found!" - echo "" - echo "To embed assets, create the folder and copy files:" - echo " cd build" - echo " mkdir assets" - echo " cp ../your_game/assets/* assets/" - echo "" - read -p "Do you want to continue without assets? (y/N): " -n 1 -r - echo "" - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - exit 1 - fi - EMBED_ASSETS="OFF" -else - ASSET_FILES=$(find assets -type f 2>/dev/null | wc -l) - echo "Found $ASSET_FILES asset file(s) in assets folder" - EMBED_ASSETS="ON" -fi - -echo "" -echo "================================" -echo "Build Configuration" -echo "================================" -echo "Lua Embedding: ON" -echo "Asset Embedding: $EMBED_ASSETS" -echo "Build Type: Release" -echo "================================" -echo "" -read -p "Press Enter to continue or Ctrl+C to cancel..." - -# Clean CMake cache to ensure fresh configuration -echo "" -echo "Cleaning CMake cache..." -rm -rf CMakeCache.txt CMakeFiles/ - -# Configure with embedding enabled -echo "" -echo "Configuring CMake for release..." -cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=$EMBED_ASSETS -DCMAKE_BUILD_TYPE=Release - -if [ $? -ne 0 ]; then - echo "" - echo "ERROR: CMake configuration failed!" - exit 1 -fi - -# Build -echo "" -echo "Building ReiLua Release..." -make - -if [ $? -ne 0 ]; then - echo "" - echo "ERROR: Build failed!" - exit 1 -fi - -# Show embedded file info -echo "" -echo "================================" -echo "Embedded Files Summary" -echo "================================" - -if [ -f "embedded_main.h" ]; then - echo "" - echo "Embedded Lua files:" - grep 'Embedded file:' embedded_main.h | sed 's/.*Embedded file: / - /' -else - echo "No Lua files embedded" -fi - -if [ -f "embedded_assets.h" ]; then - echo "" - echo "Embedded assets:" - grep 'Embedded asset:' embedded_assets.h | sed 's/.*Embedded asset: / - /' | sed 's/ (.*//' -else - echo "No assets embedded" -fi - -# Get executable size -echo "" -echo "================================" -echo "Build Complete!" -echo "================================" -EXESIZE=$(du -h ReiLua.exe | cut -f1) -echo "" -echo "Executable: ReiLua.exe ($EXESIZE)" -echo "Location: $(pwd)/ReiLua.exe" -echo "" -echo "Your game is ready for distribution!" -echo "" -echo "To test the release build:" -echo " ./ReiLua.exe --log (with console)" -echo " ./ReiLua.exe (production mode)" -echo "" -echo "To distribute:" -echo " - Copy ReiLua.exe to your distribution folder" -echo " - Rename it to your game name (optional)" -echo " - That's it! Single file distribution!" -echo "" diff --git a/docgen.lua b/docgen.lua deleted file mode 100644 index 6b01765..0000000 --- a/docgen.lua +++ /dev/null @@ -1,457 +0,0 @@ ---[[ - Create api.md and ReiLua_API.lua files from c sources. - - To generate API for other platforms you need to change sourceFiles. -]]-- - --- Export each module as separate .md file. Does not affect on ReiLua_API.lua file. -local separate = false - -if arg ~= nil and arg[1] ~= nil and arg[1] == "-s" then - separate = true -end - -local function split( str, sep ) - if sep == nil then - sep = "%s" - end - - local t = {} - - for str in string.gmatch( str, "([^"..sep.."]+)" ) do - table.insert( t, str ) - end - - return t -end - -local function getParamType( param ) - if param == "Color" or param == "Vector2" or param == "Vector3" or param == "Vector4" - or param == "Quaternion" or param == "Matrix" or param == "Rectangle" then - return "table" - elseif param == "float" then return "number" - elseif param == "int" then return "integer" - elseif param == "string" then return "string" - elseif param == "bool" then return "boolean" - elseif param == "nil" then return "nil" - elseif param:sub( #param - 1, #param ) == "{}" then return "table" - else - return "any" - end -end - -local function getParam( param ) - local text = "" - local params = split( param, "|" ) - - for i, p in ipairs( params ) do - text = text..getParamType( p ) - - if i < #params then - text = text.."|" - end - end - - return text -end - -local function parseFunction( line ) - local splitted = split( line, "(" ) - local parString = splitted[2]:sub(2) - parString = parString:sub( 1, #parString - 2 ) - local parameters = split( parString, "," ) - local str = "" - local parStr = "" - - for i, par in ipairs( parameters ) do - local sepPar = split( par, " " ) - parStr = parStr..sepPar[2] - str = str.."---@param "..sepPar[2].." " - -- str = str..getParamType( sepPar[1] ).."\n" - str = str..getParam( sepPar[1] ).."\n" - - if i < #parameters then - parStr = parStr..", " - end - end - - local returnsAndFuncName = split( splitted[1], "=" ) - - for i, ret in ipairs( split( returnsAndFuncName[1]:sub(3), "," ) ) do - if ret:sub( 1, 1 ) == " " then - ret = ret:sub(2) - end - - str = str.."---@return any "..ret.."\n" - end - - str = str.."function "..returnsAndFuncName[ #returnsAndFuncName ]:sub(2) - - if parStr ~= "" then - str = str.."( "..parStr.." )" - else - str = str.."()" - end - - return str.." end\n" -end - -local apiFile = io.open( "../API.md", "w" ) -local luaApiFile = io.open( "../ReiLua_API.lua", "w" ) - --- Header -apiFile:write( "# ReiLua API\n" ) - --- Usage. - -apiFile:write( "\n## Functions\n" ) -apiFile:write( "\nApplication needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where \"main.lua\" is located can be given as argument. There are seven Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', 'RL.exit' and 'RL.config'.\n" ) - -local FUNC_DESC = { - init = "This function will be called after window has been initialized. Should be used as the main init point.", - update = "This function will be called every frame during execution. It will get time duration from last frame on argument 'delta'", - draw = "This function will be called every frame after update and it should have all rendering related functions. Note: Engine will call Raylib functions 'BeginDrawing()' before this function call and 'EndDrawing()' after it. You can still use RL.BeginDrawing() and RL.EndDrawing() manually from anywhere.", - event = "This function will be called on events input. Content of event table is determined by event type.", - log = "This function can be used for custom log message handling.", - exit = "This function will be called on program close. Cleanup could be done here.", - config = "This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point.", - load = "This function will be called when loading resource that allocates memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures.", - unload = "This function will be called when unloading resource that has allocated memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures.", -} - -apiFile:write( "\n---\n> function RL.init()\n\n"..FUNC_DESC.init.."\n\n---\n" ) -apiFile:write( "\n> function RL.update( delta )\n\n"..FUNC_DESC.update.."\n\n---\n" ) -apiFile:write( "\n> function RL.draw()\n\n"..FUNC_DESC.draw.."\n\n---\n" ) -apiFile:write( "\n> function RL.event( event )\n\n"..FUNC_DESC.event.."\n\n---\n" ) -apiFile:write( "\n> function RL.log( logLevel, message )\n\n"..FUNC_DESC.log.."\n\n---\n" ) -apiFile:write( "\n> function RL.exit()\n\n"..FUNC_DESC.exit.."\n\n---\n" ) -apiFile:write( "\n> function RL.config()\n\n"..FUNC_DESC.config.."\n\n---\n" ) -apiFile:write( "\n> function RL.load()\n\n"..FUNC_DESC.load.."\n\n---\n" ) -apiFile:write( "\n> function RL.unload()\n\n"..FUNC_DESC.unload.."\n\n---\n" ) - -luaApiFile:write( "-- Put this file into your project folder to provide annotations when using Lua language server.\n\n" ) -luaApiFile:write( "RL={}\n\n" ) -luaApiFile:write( "-- Functions.\n\n" ) - -luaApiFile:write( -"---"..FUNC_DESC.init.."\nfunction RL.init() end\n" ) -luaApiFile:write( -"---"..FUNC_DESC.update.."\n---@param delta number\nfunction RL.update( delta ) end\n" ) -luaApiFile:write( -"---"..FUNC_DESC.draw.."\nfunction RL.draw() end\n" ) -luaApiFile:write( -"---"..FUNC_DESC.event.."\n---@param event table\nfunction RL.event( event ) end\n" ) -luaApiFile:write( -"---"..FUNC_DESC.log.."\n---@param logLevel integer\n---@param message string\nfunction RL.log( logLevel, message ) end\n" ) -luaApiFile:write( -"---"..FUNC_DESC.exit.."\nfunction RL.exit() end\n" ) -luaApiFile:write( -"---"..FUNC_DESC.config.."\nfunction RL.config() end\n" ) - --- Object unloading. - -apiFile:write( "\n## Object unloading\n" ) -apiFile:write( "\nSome objects allocate memory that needs to be freed when object is no longer needed. By default objects like Textures are unloaded by the Lua garbage collector. It is generatty however recommended to handle this manually in more complex projects. You can change the behavior with SetGCUnload.\n" ) - --- Arguments. - -apiFile:write( "\n## Arguments\n" ) -apiFile:write( "\nArguments are stored in 'RL.arg' array.\n" ) - --- Structures. - -apiFile:write( "\n## Structures\n\ -Raylib structs in Lua\n\n---\n" ) - -apiFile:write( "\n> Vector2 = { 1.0, 1.0 } or { x = 1.0, y = 1.0 }\n\ -Vector2, 2 components\n\n---\n" ) -apiFile:write( "\n> Vector3 = { 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0 }\n\ -Vector3, 3 components\n\n---\n" ) -apiFile:write( "\n> Vector4 = { 1.0, 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0, w = 1.0 }\n\ -Vector4, 4 components\n\n---\n" ) -apiFile:write( "\n> Quaternion = { 0.0, 0.0, 0.0, 1.0 } or { x = 0.0, y = 0.0, z = 0.0, w = 1.0 }\n\ -Quaternion, 4 components (Vector4 alias)\n\n---\n" ) -apiFile:write( "\n> Matrix = { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } }\n\ -Matrix, 4x4 components, column major, OpenGL style, right-handed. Identity matrix example\n\n---\n" ) -apiFile:write( "\n> Color = { 255, 255, 255, 255 } or { r = 255, g = 255, b = 255, a = 255 }\n\ -Color, 4 components, R8G8B8A8 (32bit)\n\n---\n" ) -apiFile:write( "\n> Rectangle = { 0.0, 0.0, 1.0, 1.0 } or { x = 0.0, y = 0.0, width = 1.0, height = 1.0 }\n\ -Rectangle, 4 components\n\n---\n" ) -apiFile:write( "\n> Image = Userdata\n\ -Image, pixel data stored in CPU memory (RAM)\n\n---\n" ) -apiFile:write( "\n> Texture = Userdata\n\ -Texture, tex data stored in GPU memory (VRAM)\ -```\ -textureData = {\ - id = unsigned int, --OpenGL texture id\ - width = int, --Texture base width\ - height = int, --Texture base height\ - mipmaps = int, --Mipmap levels, 1 by default\ - format = int --Data format (PixelFormat type)\ -}\ -```\n\n---\n" ) -apiFile:write( "\n> RenderTexture = Userdata\n\ -RenderTexture, fbo for texture rendering\ -```\ -renderTextureData = {\ - id = unsigned int, --OpenGL framebuffer object id\ - texture = Texture, --Color buffer attachment texture\ - depth = Texture, --Depth buffer attachment texture\ -}\ -```\n\n---\n" ) -apiFile:write( "\n> Font = Userdata\n\ -Font, font texture and GlyphInfo array data\n\n---\n" ) -apiFile:write( "\n> Camera2D = Userdata\n\ -Camera2D, defines position/orientation in 2d space\n\n---\n" ) -apiFile:write( "\n> Camera3D = Userdata\n\ -Camera, defines position/orientation in 3d space\n\n---\n" ) -apiFile:write( "\n> Mesh = Userdata\n\ -Mesh, vertex data and vao/vbo\n\ -```\ -meshData = {\ - vertices = Vector3{}, --Vertex position (XYZ - 3 components per vertex) (shader-location = 0)\ - texcoords = Vector2{}, --Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)\ - texcoords2 = Vector2{}, --Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)\ - normals = Vector3{}, --Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)\ - tangents = Vector4{}, --Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)\ - colors = Color{}, --Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)\ - indices = int{} --Vertex indices (in case vertex data comes indexed)\ -}\ -```\n\n---\n" ) -apiFile:write( "\n> Material = Userdata\n\ -Material, includes shader and maps\n\ -```\ -materialData = {\ - shader = Shader,\ - maps = { --Material maps array (MAX_MATERIAL_MAPS)\ - {\ - MATERIAL_MAP_*, --Example MATERIAL_MAP_ALBEDO\ - {\ - texture = Texture, --Material map texture\ - color = Color, --Material map color\ - value = float, --Material map value\ - },\ - },\ - ...\ - },\ - params = { float, float, float, float } --Material generic parameters (if required)\ -}\ -```\n\n---\n" ) -apiFile:write( "\n> Model = Userdata\n\ -Model, meshes, materials and animation data\n\n---\n" ) -apiFile:write( "\n> Ray = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 } } or { position = { 0.0, 0.0, 0.0 }, direction = { 1.0, 0.0, 0.0 } }\n\ -Ray, ray for raycasting\n\n---\n" ) -apiFile:write( "\n> RayCollision = { hit = true, distance = 1.0, point = { 0.0, 0.0, 0.0 }, normal = { 0.0, 0.0, 1.0 } }\n\ -RayCollision, ray hit information\n\n---\n" ) -apiFile:write( "\n> BoundingBox = { { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 } } or { min = { 0.0, 0.0, 0.0 }, max = { 1.0, 1.0, 1.0 } }\n\ -BoundingBox\n\n---\n" ) -apiFile:write( "\n> GlyphInfo = Userdata\n\ -GlyphInfo, font characters glyphs info\n\ -```\ -glyphInfoData = {\ - value = int, --Character value (Unicode)\ - offsetX = int, --Character offset X when drawing\ - offsetY = int, --Character offset Y when drawing\ - advanceX = int, --Character advance position X\ - image = Image, --Character image data\ -}\ -```\n\n---\n" ) -apiFile:write( "\n> BoneInfo = { name = string[32], parent = int }\n\ -Bone, skeletal animation bone\n\n---\n" ) -apiFile:write( "\n> Transform = { translation = Vector3, rotation = Quaternion, scale = Vector3 }\n\ -Transform, vertex transformation data\n\n---\n" ) -apiFile:write( "\n> Wave = Userdata\n\ -Wave, audio wave data\n\n---\n" ) -apiFile:write( "\n> Sound = Userdata\n\ -Sound\n\n---\n" ) -apiFile:write( "\n> SoundAlias = Userdata\n\ -SoundAlias\n\n---\n" ) -apiFile:write( "\n> Music = Userdata\n\ -Music, audio stream, anything longer than ~10 seconds should be streamed\n\n---\n" ) -apiFile:write( "\n> NPatchInfo = { { 0, 0, 24, 24 }, 8, 8, 8, 8, NPATCH_NINE_PATCH } or { source = { 0, 0, 24, 24 }, left = 8, top = 8, right = 8, bottom = 8, layout = NPATCH_NINE_PATCH }\n\ -NPatchInfo, n-patch layout info\n\n---\n" ) -apiFile:write( "\n> ModelAnimations = Userdata\n\ -ModelAnimation\n\n---\n" ) -apiFile:write( "\n> AutomationEvent = Userdata\n\ -Automation event\n\n---\n" ) -apiFile:write( "\n> AutomationEventList = Userdata\n\ -Automation event list\n\n---\n" ) -apiFile:write( "\n> Buffer = Buffer userdata\n\ -Data buffer for C primitive types. Type should be one of the Buffer types.\n\n---\n" ) - -if separate then - apiFile:close() -end - --- Defines. - -local definesCount = 0 -local sourceFiles = { - "lua_core", - "platforms/core_desktop_glfw", - -- "platforms/core_desktop_sdl", -} - -for _, src in ipairs( sourceFiles ) do - local srcFile = io.open( "../src/"..src..".c", "r" ) - local writing = false - - if separate then - local splits = split( src, "/" ) - - apiFile = io.open( "../"..splits[ #splits ]..".md", "w" ) - end - - repeat - local line = srcFile:read( "*l" ) - local lineSplit = split( line, " " ) - - if line == "/*DOC_DEFINES_END*/" then - writing = false - break - end - - if writing then - if lineSplit[1] == "\t/*" then - local gategorySplit = split( line, "*" ) - apiFile:write( "\n## Defines - "..gategorySplit[2]:sub( 2, #gategorySplit[2] - 1 ).."\n" ) - luaApiFile:write( "\n-- Defines - "..gategorySplit[2]:sub( 2, #gategorySplit[2] - 1 ).."\n\n" ) - elseif lineSplit[1] ~= "#ifdef" and lineSplit[1] ~= "#endif" then - -- Remove comma from the end. - local defineName = lineSplit[2]:sub( 1, -2 ) - local value = RL[ defineName ] - local comment = lineSplit[6] -- First split after // - - if comment ~= nil then - local i = 7 - - while lineSplit[i] ~= nil do - comment = comment.." "..lineSplit[i] - i = i + 1 - end - luaApiFile:write( "---"..comment.."\n" ) - end - - definesCount = definesCount + 1 - - if value == nil then - apiFile:write( "\n"..defineName.." = nil\n\n" ) - luaApiFile:write( "RL."..defineName.."=nil\n" ) - elseif type( value ) == "table" then - -- All tables are colors. - apiFile:write( defineName.." = { " - ..math.floor( value[1] )..", "..math.floor( value[2] )..", " - ..math.floor( value[3] )..", "..math.floor( value[4] ).." }\n\n" ) - luaApiFile:write( "RL."..defineName.."={" - ..math.floor( value[1] )..","..math.floor( value[2] ).."," - ..math.floor( value[3] )..","..math.floor( value[4] ).."}\n" ) - else - apiFile:write( "> "..defineName.." = "..value.."\n\n" ) - luaApiFile:write( "RL."..defineName.."="..value.."\n" ) - end - - if comment ~= nil then - apiFile:write( comment.."\n\n" ) - end - - apiFile:write( "---\n\n" ) - end - end - - if line == "/*DOC_DEFINES_START*/" then - writing = true - end - until line == nil - - srcFile:close() -end - --- Functions and events. - -sourceFiles = { - "core", - "shapes", - "textures", - "text", - "models", - "audio", - "rmath", - "rgui", - "lights", - "rlgl", - "gl", - "easings", - "bitwiseOp", - "platforms/core_desktop_glfw", - -- "platforms/core_desktop_sdl", -} - -local functionCount = 0 - -for _, src in ipairs( sourceFiles ) do - local srcFile = io.open( "../src/"..src..".c", "r" ) - local line = "" - local funcStr = "" - local p = false - local event = false - - if separate then - local splits = split( src, "/" ) - - apiFile = io.open( "../"..splits[ #splits ]..".md", "a" ) - end - - repeat - line = srcFile:read( "*l" ) - - if line == "*/" then - p = false - apiFile:write( "\n---\n" ) - - if not event then - luaApiFile:write( funcStr.."\n" ) - funcStr = "" - end - -- There should be not function definition after events. - elseif line == "/* Events. */" then - event = true - end - - if p then - apiFile:write( line.."\n" ) - - if line:sub( 1, 2 ) == "##" then - if not event then - luaApiFile:write( "-- "..line:sub( 4 ).."\n" ) - end - elseif line:sub( 1, 1 ) == ">" then - -- Do not parse events. Only visible in API.md - if not event then - funcStr = parseFunction( line ) - functionCount = functionCount + 1 - end - elseif line:sub( 1, 1 ) ~= "" then - if not event then - luaApiFile:write( "---"..line.."\n" ) - end - end - end - - if line == "/*" then - p = true - apiFile:write( "\n" ) - end - until line == nil - - srcFile:close() - - if separate then - apiFile:close() - end -end - -if not separate then - apiFile:close() -end - -print( "Parsed:\n"..definesCount.." Defines\n"..functionCount.." Functions" ) diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..5359d3f --- /dev/null +++ b/docs/API.md @@ -0,0 +1,13179 @@ +# ReiLua API + +## Functions + +Application needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where "main.lua" is located can be given as argument. There are seven Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', 'RL.exit' and 'RL.config'. + +--- +> function RL.init() + +This function will be called after window has been initialized. Should be used as the main init point. + +--- + +> function RL.update( delta ) + +This function will be called every frame during execution. It will get time duration from last frame on argument 'delta' + +--- + +> function RL.draw() + +This function will be called every frame after update and it should have all rendering related functions. Note: Engine will call Raylib functions 'BeginDrawing()' before this function call and 'EndDrawing()' after it. You can still use RL.BeginDrawing() and RL.EndDrawing() manually from anywhere. + +--- + +> function RL.event( event ) + +This function will be called on events input. Content of event table is determined by event type. + +--- + +> function RL.log( logLevel, message ) + +This function can be used for custom log message handling. + +--- + +> function RL.exit() + +This function will be called on program close. Cleanup could be done here. + +--- + +> function RL.config() + +This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point. + +--- + +> function RL.load() + +This function will be called when loading resource that allocates memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures. + +--- + +> function RL.unload() + +This function will be called when unloading resource that has allocated memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures. + +--- + +## Object unloading + +Some objects allocate memory that needs to be freed when object is no longer needed. By default objects like Textures are unloaded by the Lua garbage collector. It is generatty however recommended to handle this manually in more complex projects. You can change the behavior with SetGCUnload. + +## Arguments + +Arguments are stored in 'RL.arg' array. + +## Structures + +Raylib structs in Lua + +--- + +> Vector2 = { 1.0, 1.0 } or { x = 1.0, y = 1.0 } + +Vector2, 2 components + +--- + +> Vector3 = { 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0 } + +Vector3, 3 components + +--- + +> Vector4 = { 1.0, 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0, w = 1.0 } + +Vector4, 4 components + +--- + +> Quaternion = { 0.0, 0.0, 0.0, 1.0 } or { x = 0.0, y = 0.0, z = 0.0, w = 1.0 } + +Quaternion, 4 components (Vector4 alias) + +--- + +> Matrix = { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } } + +Matrix, 4x4 components, column major, OpenGL style, right-handed. Identity matrix example + +--- + +> Color = { 255, 255, 255, 255 } or { r = 255, g = 255, b = 255, a = 255 } + +Color, 4 components, R8G8B8A8 (32bit) + +--- + +> Rectangle = { 0.0, 0.0, 1.0, 1.0 } or { x = 0.0, y = 0.0, width = 1.0, height = 1.0 } + +Rectangle, 4 components + +--- + +> Image = Userdata + +Image, pixel data stored in CPU memory (RAM) + +--- + +> Texture = Userdata + +Texture, tex data stored in GPU memory (VRAM) +``` +textureData = { + id = unsigned int, --OpenGL texture id + width = int, --Texture base width + height = int, --Texture base height + mipmaps = int, --Mipmap levels, 1 by default + format = int --Data format (PixelFormat type) +} +``` + +--- + +> RenderTexture = Userdata + +RenderTexture, fbo for texture rendering +``` +renderTextureData = { + id = unsigned int, --OpenGL framebuffer object id + texture = Texture, --Color buffer attachment texture + depth = Texture, --Depth buffer attachment texture +} +``` + +--- + +> Font = Userdata + +Font, font texture and GlyphInfo array data + +--- + +> Camera2D = Userdata + +Camera2D, defines position/orientation in 2d space + +--- + +> Camera3D = Userdata + +Camera, defines position/orientation in 3d space + +--- + +> Mesh = Userdata + +Mesh, vertex data and vao/vbo + +``` +meshData = { + vertices = Vector3{}, --Vertex position (XYZ - 3 components per vertex) (shader-location = 0) + texcoords = Vector2{}, --Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + texcoords2 = Vector2{}, --Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5) + normals = Vector3{}, --Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + tangents = Vector4{}, --Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) + colors = Color{}, --Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + indices = int{} --Vertex indices (in case vertex data comes indexed) +} +``` + +--- + +> Material = Userdata + +Material, includes shader and maps + +``` +materialData = { + shader = Shader, + maps = { --Material maps array (MAX_MATERIAL_MAPS) + { + MATERIAL_MAP_*, --Example MATERIAL_MAP_ALBEDO + { + texture = Texture, --Material map texture + color = Color, --Material map color + value = float, --Material map value + }, + }, + ... + }, + params = { float, float, float, float } --Material generic parameters (if required) +} +``` + +--- + +> Model = Userdata + +Model, meshes, materials and animation data + +--- + +> Ray = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 } } or { position = { 0.0, 0.0, 0.0 }, direction = { 1.0, 0.0, 0.0 } } + +Ray, ray for raycasting + +--- + +> RayCollision = { hit = true, distance = 1.0, point = { 0.0, 0.0, 0.0 }, normal = { 0.0, 0.0, 1.0 } } + +RayCollision, ray hit information + +--- + +> BoundingBox = { { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 } } or { min = { 0.0, 0.0, 0.0 }, max = { 1.0, 1.0, 1.0 } } + +BoundingBox + +--- + +> GlyphInfo = Userdata + +GlyphInfo, font characters glyphs info + +``` +glyphInfoData = { + value = int, --Character value (Unicode) + offsetX = int, --Character offset X when drawing + offsetY = int, --Character offset Y when drawing + advanceX = int, --Character advance position X + image = Image, --Character image data +} +``` + +--- + +> BoneInfo = { name = string[32], parent = int } + +Bone, skeletal animation bone + +--- + +> Transform = { translation = Vector3, rotation = Quaternion, scale = Vector3 } + +Transform, vertex transformation data + +--- + +> Wave = Userdata + +Wave, audio wave data + +--- + +> Sound = Userdata + +Sound + +--- + +> SoundAlias = Userdata + +SoundAlias + +--- + +> Music = Userdata + +Music, audio stream, anything longer than ~10 seconds should be streamed + +--- + +> NPatchInfo = { { 0, 0, 24, 24 }, 8, 8, 8, 8, NPATCH_NINE_PATCH } or { source = { 0, 0, 24, 24 }, left = 8, top = 8, right = 8, bottom = 8, layout = NPATCH_NINE_PATCH } + +NPatchInfo, n-patch layout info + +--- + +> ModelAnimations = Userdata + +ModelAnimation + +--- + +> AutomationEvent = Userdata + +Automation event + +--- + +> AutomationEventList = Userdata + +Automation event list + +--- + +> Buffer = Buffer userdata + +Data buffer for C primitive types. Type should be one of the Buffer types. + +--- + +## Defines - System/Window config flags +> FLAG_VSYNC_HINT = 64 + +Set to try enabling V-Sync on GPU + +--- + +> FLAG_FULLSCREEN_MODE = 2 + +Set to run program in fullscreen + +--- + +> FLAG_WINDOW_RESIZABLE = 4 + +Set to allow resizable window + +--- + +> FLAG_WINDOW_UNDECORATED = 8 + +Set to disable window decoration (frame and buttons) + +--- + +> FLAG_WINDOW_HIDDEN = 128 + +Set to hide window + +--- + +> FLAG_WINDOW_MINIMIZED = 512 + +Set to minimize window (iconify) + +--- + +> FLAG_WINDOW_MAXIMIZED = 1024 + +Set to maximize window (expanded to monitor) + +--- + +> FLAG_WINDOW_UNFOCUSED = 2048 + +Set to window non focused + +--- + +> FLAG_WINDOW_TOPMOST = 4096 + +Set to window always on top + +--- + +> FLAG_WINDOW_ALWAYS_RUN = 256 + +Set to allow windows running while minimized + +--- + +> FLAG_WINDOW_TRANSPARENT = 16 + +Set to allow transparent framebuffer + +--- + +> FLAG_WINDOW_HIGHDPI = 8192 + +Set to support HighDPI + +--- + +> FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384 + +Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED + +--- + +> FLAG_MSAA_4X_HINT = 32 + +Set to try enabling MSAA 4X + +--- + +> FLAG_INTERLACED_HINT = 65536 + +Set to try enabling interlaced video format (for V3D) + +--- + + +## Defines - Trace log level +> LOG_ALL = 0 + +Display all logs + +--- + +> LOG_TRACE = 1 + +Trace logging, intended for internal use only + +--- + +> LOG_DEBUG = 2 + +Debug logging, used for internal debugging, it should be disabled on release builds + +--- + +> LOG_INFO = 3 + +Info logging, used for program execution info + +--- + +> LOG_WARNING = 4 + +Warning logging, used on recoverable failures + +--- + +> LOG_ERROR = 5 + +Error logging, used on unrecoverable failures + +--- + +> LOG_FATAL = 6 + +Fatal logging, used to abort program: exit(EXIT_FAILURE) + +--- + +> LOG_NONE = 7 + +Disable logging + +--- + + +## Defines - Keyboard keys (US keyboard layout) +> KEY_NULL = 0 + +Key: NULL, used for no key pressed + +--- + +> KEY_APOSTROPHE = 39 + +Key: ' + +--- + +> KEY_COMMA = 44 + +Key: , + +--- + +> KEY_MINUS = 45 + +Key: - + +--- + +> KEY_PERIOD = 46 + +Key: . + +--- + +> KEY_SLASH = 47 + +Key: / + +--- + +> KEY_ZERO = 48 + +Key: 0 + +--- + +> KEY_ONE = 49 + +Key: 1 + +--- + +> KEY_TWO = 50 + +Key: 2 + +--- + +> KEY_THREE = 51 + +Key: 3 + +--- + +> KEY_FOUR = 52 + +Key: 4 + +--- + +> KEY_FIVE = 53 + +Key: 5 + +--- + +> KEY_SIX = 54 + +Key: 6 + +--- + +> KEY_SEVEN = 55 + +Key: 7 + +--- + +> KEY_EIGHT = 56 + +Key: 8 + +--- + +> KEY_NINE = 57 + +Key: 9 + +--- + +> KEY_SEMICOLON = 59 + +Key: ; + +--- + +> KEY_EQUAL = 61 + +Key: = + +--- + +> KEY_A = 65 + +Key: A | a + +--- + +> KEY_B = 66 + +Key: B | b + +--- + +> KEY_C = 67 + +Key: C | c + +--- + +> KEY_D = 68 + +Key: D | d + +--- + +> KEY_E = 69 + +Key: E | e + +--- + +> KEY_F = 70 + +Key: F | f + +--- + +> KEY_G = 71 + +Key: G | g + +--- + +> KEY_H = 72 + +Key: H | h + +--- + +> KEY_I = 73 + +Key: I | i + +--- + +> KEY_J = 74 + +Key: J | j + +--- + +> KEY_K = 75 + +Key: K | k + +--- + +> KEY_L = 76 + +Key: L | l + +--- + +> KEY_M = 77 + +Key: M | m + +--- + +> KEY_N = 78 + +Key: N | n + +--- + +> KEY_O = 79 + +Key: O | o + +--- + +> KEY_P = 80 + +Key: P | p + +--- + +> KEY_Q = 81 + +Key: Q | q + +--- + +> KEY_R = 82 + +Key: R | r + +--- + +> KEY_S = 83 + +Key: S | s + +--- + +> KEY_T = 84 + +Key: T | t + +--- + +> KEY_U = 85 + +Key: U | u + +--- + +> KEY_V = 86 + +Key: V | v + +--- + +> KEY_W = 87 + +Key: W | w + +--- + +> KEY_X = 88 + +Key: X | x + +--- + +> KEY_Y = 89 + +Key: Y | y + +--- + +> KEY_Z = 90 + +Key: Z | z + +--- + +> KEY_LEFT_BRACKET = 91 + +Key: [ + +--- + +> KEY_BACKSLASH = 92 + +Key: '\' + +--- + +> KEY_RIGHT_BRACKET = 93 + +Key: ] + +--- + +> KEY_GRAVE = 96 + +Key: ` + +--- + +> KEY_SPACE = 32 + +Key: Space + +--- + +> KEY_ESCAPE = 256 + +Key: Esc + +--- + +> KEY_ENTER = 257 + +Key: Enter + +--- + +> KEY_TAB = 258 + +Key: Tab + +--- + +> KEY_BACKSPACE = 259 + +Key: Backspace + +--- + +> KEY_INSERT = 260 + +Key: Ins + +--- + +> KEY_DELETE = 261 + +Key: Del + +--- + +> KEY_RIGHT = 262 + +Key: Cursor right + +--- + +> KEY_LEFT = 263 + +Key: Cursor left + +--- + +> KEY_DOWN = 264 + +Key: Cursor down + +--- + +> KEY_UP = 265 + +Key: Cursor up + +--- + +> KEY_PAGE_UP = 266 + +Key: Page up + +--- + +> KEY_PAGE_DOWN = 267 + +Key: Page down + +--- + +> KEY_HOME = 268 + +Key: Home + +--- + +> KEY_END = 269 + +Key: End + +--- + +> KEY_CAPS_LOCK = 280 + +Key: Caps lock + +--- + +> KEY_SCROLL_LOCK = 281 + +Key: Scroll down + +--- + +> KEY_NUM_LOCK = 282 + +Key: Num lock + +--- + +> KEY_PRINT_SCREEN = 283 + +Key: Print screen + +--- + +> KEY_PAUSE = 284 + +Key: Pause + +--- + +> KEY_F1 = 290 + +Key: F1 + +--- + +> KEY_F2 = 291 + +Key: F2 + +--- + +> KEY_F3 = 292 + +Key: F3 + +--- + +> KEY_F4 = 293 + +Key: F4 + +--- + +> KEY_F5 = 294 + +Key: F5 + +--- + +> KEY_F6 = 295 + +Key: F6 + +--- + +> KEY_F7 = 296 + +Key: F7 + +--- + +> KEY_F8 = 297 + +Key: F8 + +--- + +> KEY_F9 = 298 + +Key: F9 + +--- + +> KEY_F10 = 299 + +Key: F10 + +--- + +> KEY_F11 = 300 + +Key: F11 + +--- + +> KEY_F12 = 301 + +Key: F12 + +--- + +> KEY_LEFT_SHIFT = 340 + +Key: Shift left + +--- + +> KEY_LEFT_CONTROL = 341 + +Key: Control left + +--- + +> KEY_LEFT_ALT = 342 + +Key: Alt left + +--- + +> KEY_LEFT_SUPER = 343 + +Key: Super left + +--- + +> KEY_RIGHT_SHIFT = 344 + +Key: Shift right + +--- + +> KEY_RIGHT_CONTROL = 345 + +Key: Control right + +--- + +> KEY_RIGHT_ALT = 346 + +Key: Alt right + +--- + +> KEY_RIGHT_SUPER = 347 + +Key: Super right + +--- + +> KEY_KB_MENU = 348 + +Key: KB menu + +--- + +> KEY_KP_0 = 320 + +Key: Keypad 0 + +--- + +> KEY_KP_1 = 321 + +Key: Keypad 1 + +--- + +> KEY_KP_2 = 322 + +Key: Keypad 2 + +--- + +> KEY_KP_3 = 323 + +Key: Keypad 3 + +--- + +> KEY_KP_4 = 324 + +Key: Keypad 4 + +--- + +> KEY_KP_5 = 325 + +Key: Keypad 5 + +--- + +> KEY_KP_6 = 326 + +Key: Keypad 6 + +--- + +> KEY_KP_7 = 327 + +Key: Keypad 7 + +--- + +> KEY_KP_8 = 328 + +Key: Keypad 8 + +--- + +> KEY_KP_9 = 329 + +Key: Keypad 9 + +--- + +> KEY_KP_DECIMAL = 330 + +Key: Keypad . + +--- + +> KEY_KP_DIVIDE = 331 + +Key: Keypad / + +--- + +> KEY_KP_MULTIPLY = 332 + +Key: Keypad * + +--- + +> KEY_KP_SUBTRACT = 333 + +Key: Keypad - + +--- + +> KEY_KP_ADD = 334 + +Key: Keypad + + +--- + +> KEY_KP_ENTER = 335 + +Key: Keypad Enter + +--- + +> KEY_KP_EQUAL = 336 + +Key: Keypad = + +--- + +> KEY_BACK = 4 + +Key: Android back button + +--- + +> KEY_MENU = 5 + +Key: Android menu button + +--- + +> KEY_VOLUME_UP = 24 + +Key: Android volume up button + +--- + +> KEY_VOLUME_DOWN = 25 + +Key: Android volume down button + +--- + + +## Defines - Mouse buttons +> MOUSE_BUTTON_LEFT = 0 + +Mouse button left + +--- + +> MOUSE_BUTTON_RIGHT = 1 + +Mouse button right + +--- + +> MOUSE_BUTTON_MIDDLE = 2 + +Mouse button middle (pressed wheel) + +--- + +> MOUSE_BUTTON_SIDE = 3 + +Mouse button side (advanced mouse device) + +--- + +> MOUSE_BUTTON_EXTRA = 4 + +Mouse button extra (advanced mouse device) + +--- + +> MOUSE_BUTTON_FORWARD = 5 + +Mouse button forward (advanced mouse device) + +--- + +> MOUSE_BUTTON_BACK = 6 + +Mouse button back (advanced mouse device) + +--- + + +## Defines - Mouse cursor +> MOUSE_CURSOR_DEFAULT = 0 + +Default pointer shape + +--- + +> MOUSE_CURSOR_ARROW = 1 + +Arrow shape + +--- + +> MOUSE_CURSOR_IBEAM = 2 + +Text writing cursor shape + +--- + +> MOUSE_CURSOR_CROSSHAIR = 3 + +Cross shape + +--- + +> MOUSE_CURSOR_POINTING_HAND = 4 + +Pointing hand cursor + +--- + +> MOUSE_CURSOR_RESIZE_EW = 5 + +Horizontal resize/move arrow shape + +--- + +> MOUSE_CURSOR_RESIZE_NS = 6 + +Vertical resize/move arrow shape + +--- + +> MOUSE_CURSOR_RESIZE_NWSE = 7 + +Top-left to bottom-right diagonal resize/move arrow shape + +--- + +> MOUSE_CURSOR_RESIZE_NESW = 8 + +The top-right to bottom-left diagonal resize/move arrow shape + +--- + +> MOUSE_CURSOR_RESIZE_ALL = 9 + +The omnidirectional resize/move cursor shape + +--- + +> MOUSE_CURSOR_NOT_ALLOWED = 10 + +The operation-not-allowed shape + +--- + + +## Defines - Gamepad buttons +> GAMEPAD_BUTTON_UNKNOWN = 0 + +Unknown button, just for error checking + +--- + +> GAMEPAD_BUTTON_LEFT_FACE_UP = 1 + +Gamepad left DPAD up button + +--- + +> GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2 + +Gamepad left DPAD right button + +--- + +> GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3 + +Gamepad left DPAD down button + +--- + +> GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4 + +Gamepad left DPAD left button + +--- + +> GAMEPAD_BUTTON_RIGHT_FACE_UP = 5 + +Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) + +--- + +> GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6 + +Gamepad right button right (i.e. PS3: Square, Xbox: X) + +--- + +> GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7 + +Gamepad right button down (i.e. PS3: Cross, Xbox: A) + +--- + +> GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8 + +Gamepad right button left (i.e. PS3: Circle, Xbox: B) + +--- + +> GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9 + +Gamepad top/back trigger left (first), it could be a trailing button + +--- + +> GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10 + +Gamepad top/back trigger left (second), it could be a trailing button + +--- + +> GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11 + +Gamepad top/back trigger right (one), it could be a trailing button + +--- + +> GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12 + +Gamepad top/back trigger right (second), it could be a trailing button + +--- + +> GAMEPAD_BUTTON_MIDDLE_LEFT = 13 + +Gamepad center buttons, left one (i.e. PS3: Select) + +--- + +> GAMEPAD_BUTTON_MIDDLE = 14 + +Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) + +--- + +> GAMEPAD_BUTTON_MIDDLE_RIGHT = 15 + +Gamepad center buttons, right one (i.e. PS3: Start) + +--- + +> GAMEPAD_BUTTON_LEFT_THUMB = 16 + +Gamepad joystick pressed button left + +--- + +> GAMEPAD_BUTTON_RIGHT_THUMB = 17 + +Gamepad joystick pressed button right + +--- + + +## Defines - Gamepad axis +> GAMEPAD_AXIS_LEFT_X = 0 + +Gamepad left stick X axis + +--- + +> GAMEPAD_AXIS_LEFT_Y = 1 + +Gamepad left stick Y axis + +--- + +> GAMEPAD_AXIS_RIGHT_X = 2 + +Gamepad right stick X axis + +--- + +> GAMEPAD_AXIS_RIGHT_Y = 3 + +Gamepad right stick Y axis + +--- + +> GAMEPAD_AXIS_LEFT_TRIGGER = 4 + +Gamepad back trigger left, pressure level: [1..-1] + +--- + +> GAMEPAD_AXIS_RIGHT_TRIGGER = 5 + +Gamepad back trigger right, pressure level: [1..-1] + +--- + + +## Defines - Material map index +> MATERIAL_MAP_ALBEDO = 0 + +Albedo material (same as: MATERIAL_MAP_DIFFUSE) + +--- + +> MATERIAL_MAP_METALNESS = 1 + +Metalness material (same as: MATERIAL_MAP_SPECULAR) + +--- + +> MATERIAL_MAP_NORMAL = 2 + +Normal material + +--- + +> MATERIAL_MAP_ROUGHNESS = 3 + +Roughness material + +--- + +> MATERIAL_MAP_OCCLUSION = 4 + +Ambient occlusion material + +--- + +> MATERIAL_MAP_EMISSION = 5 + +Emission material + +--- + +> MATERIAL_MAP_HEIGHT = 6 + +Heightmap material + +--- + +> MATERIAL_MAP_CUBEMAP = 7 + +Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + +--- + +> MATERIAL_MAP_IRRADIANCE = 8 + +Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + +--- + +> MATERIAL_MAP_PREFILTER = 9 + +Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) + +--- + +> MATERIAL_MAP_BRDF = 10 + +Brdf material + +--- + +> MATERIAL_MAP_DIFFUSE = 0 + +Diffuce material (same as: MATERIAL_MAP_ALBEDO) + +--- + +> MATERIAL_MAP_SPECULAR = 1 + +Specular material (same as: MATERIAL_MAP_METALNESS) + +--- + + +## Defines - Shader location index +> SHADER_LOC_VERTEX_POSITION = 0 + +Shader location: vertex attribute: position + +--- + +> SHADER_LOC_VERTEX_TEXCOORD01 = 1 + +Shader location: vertex attribute: texcoord01 + +--- + +> SHADER_LOC_VERTEX_TEXCOORD02 = 2 + +Shader location: vertex attribute: texcoord02 + +--- + +> SHADER_LOC_VERTEX_NORMAL = 3 + +Shader location: vertex attribute: normal + +--- + +> SHADER_LOC_VERTEX_TANGENT = 4 + +Shader location: vertex attribute: tangent + +--- + +> SHADER_LOC_VERTEX_COLOR = 5 + +Shader location: vertex attribute: color + +--- + +> SHADER_LOC_MATRIX_MVP = 6 + +Shader location: matrix uniform: model-view-projection + +--- + +> SHADER_LOC_MATRIX_VIEW = 7 + +Shader location: matrix uniform: view (camera transform) + +--- + +> SHADER_LOC_MATRIX_PROJECTION = 8 + +Shader location: matrix uniform: projection + +--- + +> SHADER_LOC_MATRIX_MODEL = 9 + +Shader location: matrix uniform: model (transform) + +--- + +> SHADER_LOC_MATRIX_NORMAL = 10 + +Shader location: matrix uniform: normal + +--- + +> SHADER_LOC_VECTOR_VIEW = 11 + +Shader location: vector uniform: view + +--- + +> SHADER_LOC_COLOR_DIFFUSE = 12 + +Shader location: vector uniform: diffuse color + +--- + +> SHADER_LOC_COLOR_SPECULAR = 13 + +Shader location: vector uniform: specular color + +--- + +> SHADER_LOC_COLOR_AMBIENT = 14 + +Shader location: vector uniform: ambient color + +--- + +> SHADER_LOC_MAP_ALBEDO = 15 + +Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) + +--- + +> SHADER_LOC_MAP_METALNESS = 16 + +Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) + +--- + +> SHADER_LOC_MAP_NORMAL = 17 + +Shader location: sampler2d texture: normal + +--- + +> SHADER_LOC_MAP_ROUGHNESS = 18 + +Shader location: sampler2d texture: roughness + +--- + +> SHADER_LOC_MAP_OCCLUSION = 19 + +Shader location: sampler2d texture: occlusion + +--- + +> SHADER_LOC_MAP_EMISSION = 20 + +Shader location: sampler2d texture: emission + +--- + +> SHADER_LOC_MAP_HEIGHT = 21 + +Shader location: sampler2d texture: height + +--- + +> SHADER_LOC_MAP_CUBEMAP = 22 + +Shader location: samplerCube texture: cubemap + +--- + +> SHADER_LOC_MAP_IRRADIANCE = 23 + +Shader location: samplerCube texture: irradiance + +--- + +> SHADER_LOC_MAP_PREFILTER = 24 + +Shader location: samplerCube texture: prefilter + +--- + +> SHADER_LOC_MAP_BRDF = 25 + +Shader location: sampler2d texture: brdf + +--- + +> SHADER_LOC_VERTEX_BONEIDS = 26 + +Shader location: vertex attribute: boneIds + +--- + +> SHADER_LOC_VERTEX_BONEWEIGHTS = 27 + +Shader location: vertex attribute: boneWeights + +--- + +> SHADER_LOC_BONE_MATRICES = 28 + +Shader location: array of matrices uniform: boneMatrices + +--- + +> SHADER_LOC_MAP_DIFFUSE = 15 + +Shader location: sampler2d texture: diffuce (same as: SHADER_LOC_MAP_ALBEDO) + +--- + +> SHADER_LOC_MAP_SPECULAR = 16 + +Shader location: sampler2d texture: specular (same as: SHADER_LOC_MAP_METALNESS) + +--- + + +## Defines - Shader uniform data type +> SHADER_UNIFORM_FLOAT = 0 + +Shader uniform type: float + +--- + +> SHADER_UNIFORM_VEC2 = 1 + +Shader uniform type: vec2 (2 float) + +--- + +> SHADER_UNIFORM_VEC3 = 2 + +Shader uniform type: vec3 (3 float) + +--- + +> SHADER_UNIFORM_VEC4 = 3 + +Shader uniform type: vec4 (4 float) + +--- + +> SHADER_UNIFORM_INT = 4 + +Shader uniform type: int + +--- + +> SHADER_UNIFORM_IVEC2 = 5 + +Shader uniform type: ivec2 (2 int) + +--- + +> SHADER_UNIFORM_IVEC3 = 6 + +Shader uniform type: ivec3 (3 int) + +--- + +> SHADER_UNIFORM_IVEC4 = 7 + +Shader uniform type: ivec4 (4 int) + +--- + +> SHADER_UNIFORM_SAMPLER2D = 8 + +Shader uniform type: sampler2d + +--- + + +## Defines - Shader attribute data types +> SHADER_ATTRIB_FLOAT = 0 + +Shader attribute type: float + +--- + +> SHADER_ATTRIB_VEC2 = 1 + +Shader attribute type: vec2 (2 float) + +--- + +> SHADER_ATTRIB_VEC3 = 2 + +Shader attribute type: vec3 (3 float) + +--- + +> SHADER_ATTRIB_VEC4 = 3 + +Shader attribute type: vec4 (4 float) + +--- + + +## Defines - Pixel formats +> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 + +8 bit per pixel (no alpha) + +--- + +> PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 + +8*2 bpp (2 channels) + +--- + +> PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 + +16 bpp + +--- + +> PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 + +24 bpp + +--- + +> PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 + +16 bpp (1 bit alpha) + +--- + +> PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 + +16 bpp (4 bit alpha) + +--- + +> PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 + +32 bpp + +--- + +> PIXELFORMAT_UNCOMPRESSED_R32 = 8 + +32 bpp (1 channel - float) + +--- + +> PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 + +32*3 bpp (3 channels - float) + +--- + +> PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 + +32*4 bpp (4 channels - float) + +--- + +> PIXELFORMAT_COMPRESSED_DXT1_RGB = 14 + +4 bpp (no alpha) + +--- + +> PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15 + +4 bpp (1 bit alpha) + +--- + +> PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16 + +8 bpp + +--- + +> PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17 + +8 bpp + +--- + +> PIXELFORMAT_COMPRESSED_ETC1_RGB = 18 + +4 bpp + +--- + +> PIXELFORMAT_COMPRESSED_ETC2_RGB = 19 + +4 bpp + +--- + +> PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20 + +8 bpp + +--- + +> PIXELFORMAT_COMPRESSED_PVRT_RGB = 21 + +4 bpp + +--- + +> PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22 + +4 bpp + +--- + +> PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23 + +8 bpp + +--- + +> PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24 + +2 bpp + +--- + + +## Defines - Texture parameters: filter mode +> TEXTURE_FILTER_POINT = 0 + +No filter, just pixel approximation + +--- + +> TEXTURE_FILTER_BILINEAR = 1 + +Linear filtering + +--- + +> TEXTURE_FILTER_TRILINEAR = 2 + +Trilinear filtering (linear with mipmaps) + +--- + +> TEXTURE_FILTER_ANISOTROPIC_4X = 3 + +Anisotropic filtering 4x + +--- + +> TEXTURE_FILTER_ANISOTROPIC_8X = 4 + +Anisotropic filtering 8x + +--- + +> TEXTURE_FILTER_ANISOTROPIC_16X = 5 + +Anisotropic filtering 16x + +--- + + +## Defines - Texture parameters: wrap mode +> TEXTURE_WRAP_REPEAT = 0 + +Repeats texture in tiled mode + +--- + +> TEXTURE_WRAP_CLAMP = 1 + +Clamps texture to edge pixel in tiled mode + +--- + +> TEXTURE_WRAP_MIRROR_REPEAT = 2 + +Mirrors and repeats the texture in tiled mode + +--- + +> TEXTURE_WRAP_MIRROR_CLAMP = 3 + +Mirrors and clamps to border the texture in tiled mode + +--- + + +## Defines - Cubemap layouts +> CUBEMAP_LAYOUT_AUTO_DETECT = 0 + +Automatically detect layout type + +--- + +> CUBEMAP_LAYOUT_LINE_VERTICAL = 1 + +Layout is defined by a vertical line with faces + +--- + +> CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2 + +Layout is defined by a horizontal line with faces + +--- + +> CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3 + +Layout is defined by a 3x4 cross with cubemap faces + +--- + +> CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4 + +Layout is defined by a 4x3 cross with cubemap faces + +--- + + +## Defines - Font type, defines generation method +> FONT_DEFAULT = 0 + +Default font generation, anti-aliased + +--- + +> FONT_BITMAP = 1 + +Bitmap font generation, no anti-aliasing + +--- + +> FONT_SDF = 2 + +SDF font generation, requires external shader + +--- + + +## Defines - Color blending modes (pre-defined) +> BLEND_ALPHA = 0 + +Blend textures considering alpha (default) + +--- + +> BLEND_ADDITIVE = 1 + +Blend textures adding colors + +--- + +> BLEND_MULTIPLIED = 2 + +Blend textures multiplying colors + +--- + +> BLEND_ADD_COLORS = 3 + +Blend textures adding colors (alternative) + +--- + +> BLEND_SUBTRACT_COLORS = 4 + +Blend textures subtracting colors (alternative) + +--- + +> BLEND_ALPHA_PREMULTIPLY = 5 + +Blend premultiplied textures considering alpha + +--- + +> BLEND_CUSTOM = 6 + +Blend textures using custom src/dst factors (use rlSetBlendFactors()) + +--- + +> BLEND_CUSTOM_SEPARATE = 7 + +Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) + +--- + + +## Defines - Gesture +> GESTURE_NONE = 0 + +No gesture + +--- + +> GESTURE_TAP = 1 + +Tap gesture + +--- + +> GESTURE_DOUBLETAP = 2 + +Double tap gesture + +--- + +> GESTURE_HOLD = 4 + +Hold gesture + +--- + +> GESTURE_DRAG = 8 + +Drag gesture + +--- + +> GESTURE_SWIPE_RIGHT = 16 + +Swipe right gesture + +--- + +> GESTURE_SWIPE_LEFT = 32 + +Swipe left gesture + +--- + +> GESTURE_SWIPE_UP = 64 + +Swipe up gesture + +--- + +> GESTURE_SWIPE_DOWN = 128 + +Swipe down gesture + +--- + +> GESTURE_PINCH_IN = 256 + +Pinch in gesture + +--- + +> GESTURE_PINCH_OUT = 512 + +Pinch out gesture + +--- + + +## Defines - Camera system modes +> CAMERA_CUSTOM = 0 + +Custom camera + +--- + +> CAMERA_FREE = 1 + +Free camera + +--- + +> CAMERA_ORBITAL = 2 + +Orbital camera + +--- + +> CAMERA_FIRST_PERSON = 3 + +First person camera + +--- + +> CAMERA_THIRD_PERSON = 4 + +Third person camera + +--- + + +## Defines - Camera projection +> CAMERA_PERSPECTIVE = 0 + +Perspective projection + +--- + +> CAMERA_ORTHOGRAPHIC = 1 + +Orthographic projection + +--- + + +## Defines - N-patch layout +> NPATCH_NINE_PATCH = 0 + +Npatch layout: 3x3 tiles + +--- + +> NPATCH_THREE_PATCH_VERTICAL = 1 + +Npatch layout: 1x3 tiles + +--- + +> NPATCH_THREE_PATCH_HORIZONTAL = 2 + +Npatch layout: 3x1 tiles + +--- + + +## Defines - Colors +LIGHTGRAY = { 200, 200, 200, 255 } + +Light Gray + +--- + +GRAY = { 130, 130, 130, 255 } + +Gray + +--- + +DARKGRAY = { 80, 80, 80, 255 } + +Dark Gray + +--- + +YELLOW = { 253, 249, 0, 255 } + +Yellow + +--- + +GOLD = { 255, 203, 0, 255 } + +Gold + +--- + +ORANGE = { 255, 161, 0, 255 } + +Orange + +--- + +PINK = { 255, 109, 194, 255 } + +Pink + +--- + +RED = { 230, 41, 55, 255 } + +Red + +--- + +MAROON = { 190, 33, 55, 255 } + +Maroon + +--- + +GREEN = { 0, 228, 48, 255 } + +Green + +--- + +LIME = { 0, 158, 47, 255 } + +Lime + +--- + +DARKGREEN = { 0, 117, 44, 255 } + +Dark Green + +--- + +SKYBLUE = { 102, 191, 255, 255 } + +Sky Blue + +--- + +BLUE = { 0, 121, 241, 255 } + +Blue + +--- + +DARKBLUE = { 0, 82, 172, 255 } + +Dark Blue + +--- + +PURPLE = { 200, 122, 255, 255 } + +Purple + +--- + +VIOLET = { 135, 60, 190, 255 } + +Violet + +--- + +DARKPURPLE = { 112, 31, 126, 255 } + +Dark Purple + +--- + +BEIGE = { 211, 176, 131, 255 } + +Beige + +--- + +BROWN = { 127, 106, 79, 255 } + +Brown + +--- + +DARKBROWN = { 76, 63, 47, 255 } + +Dark Brown + +--- + +WHITE = { 255, 255, 255, 255 } + +White + +--- + +BLACK = { 0, 0, 0, 255 } + +Black + +--- + +BLANK = { 0, 0, 0, 0 } + +Blank (Transparent) + +--- + +MAGENTA = { 255, 0, 255, 255 } + +Magenta + +--- + +RAYWHITE = { 245, 245, 245, 255 } + +My own White (raylib logo) + +--- + + +## Defines - Math +> PI = 3.1415927410126 + +Pi + +--- + +> EPSILON = 9.9999999747524e-07 + +Epsilon + +--- + +> DEG2RAD = 0.017453292384744 + +Degrees to radians + +--- + +> RAD2DEG = 57.295776367188 + +Radians to degrees + +--- + + +## Defines - Gui control state +> STATE_NORMAL = 0 + +--- + +> STATE_FOCUSED = 1 + +--- + +> STATE_PRESSED = 2 + +--- + +> STATE_DISABLED = 3 + +--- + + +## Defines - Gui control text alignment +> TEXT_ALIGN_LEFT = 0 + +--- + +> TEXT_ALIGN_CENTER = 1 + +--- + +> TEXT_ALIGN_RIGHT = 2 + +--- + + +## Defines - Gui control text alignment vertical +> TEXT_ALIGN_TOP = 0 + +--- + +> TEXT_ALIGN_MIDDLE = 1 + +--- + +> TEXT_ALIGN_BOTTOM = 2 + +--- + + +## Defines - Gui control text wrap mode +> TEXT_WRAP_NONE = 0 + +--- + +> TEXT_WRAP_CHAR = 1 + +--- + +> TEXT_WRAP_WORD = 2 + +--- + + +## Defines - Gui controls +> DEFAULT = 0 + +--- + +> LABEL = 1 + +Used also for: LABELBUTTON + +--- + +> BUTTON = 2 + +--- + +> TOGGLE = 3 + +Used also for: TOGGLEGROUP + +--- + +> SLIDER = 4 + +Used also for: SLIDERBAR + +--- + +> PROGRESSBAR = 5 + +--- + +> CHECKBOX = 6 + +--- + +> COMBOBOX = 7 + +--- + +> DROPDOWNBOX = 8 + +--- + +> TEXTBOX = 9 + +Used also for: TEXTBOXMULTI + +--- + +> VALUEBOX = 10 + +--- + +> SPINNER = 11 + +Uses: BUTTON, VALUEBOX + +--- + +> LISTVIEW = 12 + +--- + +> COLORPICKER = 13 + +--- + +> SCROLLBAR = 14 + +--- + +> STATUSBAR = 15 + +--- + + +## Defines - Gui base properties for every control +> BORDER_COLOR_NORMAL = 0 + +--- + +> BASE_COLOR_NORMAL = 1 + +--- + +> TEXT_COLOR_NORMAL = 2 + +--- + +> BORDER_COLOR_FOCUSED = 3 + +--- + +> BASE_COLOR_FOCUSED = 4 + +--- + +> TEXT_COLOR_FOCUSED = 5 + +--- + +> BORDER_COLOR_PRESSED = 6 + +--- + +> BASE_COLOR_PRESSED = 7 + +--- + +> TEXT_COLOR_PRESSED = 8 + +--- + +> BORDER_COLOR_DISABLED = 9 + +--- + +> BASE_COLOR_DISABLED = 10 + +--- + +> TEXT_COLOR_DISABLED = 11 + +--- + +> BORDER_WIDTH = 12 + +--- + +> TEXT_PADDING = 13 + +--- + +> TEXT_ALIGNMENT = 14 + +--- + + +## Defines - Gui extended properties depend on control +> TEXT_SIZE = 16 + +Text size (glyphs max height) + +--- + +> TEXT_SPACING = 17 + +Text spacing between glyphs + +--- + +> LINE_COLOR = 18 + +Line control color + +--- + +> BACKGROUND_COLOR = 19 + +Background color + +--- + +> TEXT_LINE_SPACING = 20 + +Text spacing between lines + +--- + +> TEXT_ALIGNMENT_VERTICAL = 21 + +Text vertical alignment inside text bounds (after border and padding) + +--- + +> TEXT_WRAP_MODE = 22 + +Text wrap-mode inside text bounds + +--- + + +## Defines - Gui Toggle/ToggleGroup +> GROUP_PADDING = 16 + +ToggleGroup separation between toggles + +--- + + +## Defines - Gui Slider/SliderBar +> SLIDER_WIDTH = 16 + +Slider size of internal bar + +--- + +> SLIDER_PADDING = 17 + +Slider/SliderBar internal bar padding + +--- + + +## Defines - Gui ProgressBar +> PROGRESS_PADDING = 16 + +ProgressBar internal padding + +--- + + +## Defines - Gui ScrollBar +> ARROWS_SIZE = 16 + +--- + +> ARROWS_VISIBLE = 17 + +--- + +> SCROLL_SLIDER_PADDING = 18 + +(SLIDERBAR, SLIDER_PADDING) + +--- + +> SCROLL_SLIDER_SIZE = 19 + +--- + +> SCROLL_PADDING = 20 + +--- + +> SCROLL_SPEED = 21 + +--- + + +## Defines - Gui CheckBox +> CHECK_PADDING = 16 + +CheckBox internal check padding + +--- + + +## Defines - Gui ComboBox +> COMBO_BUTTON_WIDTH = 16 + +ComboBox right button width + +--- + +> COMBO_BUTTON_SPACING = 17 + +ComboBox button separation + +--- + + +## Defines - Gui DropdownBox +> ARROW_PADDING = 16 + +DropdownBox arrow separation from border and items + +--- + +> DROPDOWN_ITEMS_SPACING = 17 + +DropdownBox items separation + +--- + + +## Defines - Gui TextBox/TextBoxMulti/ValueBox/Spinner +> TEXT_READONLY = 16 + +TextBox in read-only mode: 0-text editable, 1-text no-editable + +--- + + +## Defines - Gui Spinner +> SPIN_BUTTON_WIDTH = 16 + +Spinner left/right buttons width + +--- + +> SPIN_BUTTON_SPACING = 17 + +Spinner buttons separation + +--- + + +## Defines - Gui ListView +> LIST_ITEMS_HEIGHT = 16 + +ListView items height + +--- + +> LIST_ITEMS_SPACING = 17 + +ListView items separation + +--- + +> SCROLLBAR_WIDTH = 18 + +ListView scrollbar size (usually width) + +--- + +> SCROLLBAR_SIDE = 19 + +ListView scrollbar side (0-left, 1-right) + +--- + + +## Defines - Gui ColorPicker +> COLOR_SELECTOR_SIZE = 16 + +--- + +> HUEBAR_WIDTH = 17 + +ColorPicker right hue bar width + +--- + +> HUEBAR_PADDING = 18 + +ColorPicker right hue bar separation from panel + +--- + +> HUEBAR_SELECTOR_HEIGHT = 19 + +ColorPicker right hue bar selector height + +--- + +> HUEBAR_SELECTOR_OVERFLOW = 20 + +ColorPicker right hue bar selector overflow + +--- + + +## Defines - Gui Icons enumeration +> ICON_NONE = 0 + +--- + +> ICON_FOLDER_FILE_OPEN = 1 + +--- + +> ICON_FILE_SAVE_CLASSIC = 2 + +--- + +> ICON_FOLDER_OPEN = 3 + +--- + +> ICON_FOLDER_SAVE = 4 + +--- + +> ICON_FILE_OPEN = 5 + +--- + +> ICON_FILE_SAVE = 6 + +--- + +> ICON_FILE_EXPORT = 7 + +--- + +> ICON_FILE_ADD = 8 + +--- + +> ICON_FILE_DELETE = 9 + +--- + +> ICON_FILETYPE_TEXT = 10 + +--- + +> ICON_FILETYPE_AUDIO = 11 + +--- + +> ICON_FILETYPE_IMAGE = 12 + +--- + +> ICON_FILETYPE_PLAY = 13 + +--- + +> ICON_FILETYPE_VIDEO = 14 + +--- + +> ICON_FILETYPE_INFO = 15 + +--- + +> ICON_FILE_COPY = 16 + +--- + +> ICON_FILE_CUT = 17 + +--- + +> ICON_FILE_PASTE = 18 + +--- + +> ICON_CURSOR_HAND = 19 + +--- + +> ICON_CURSOR_POINTER = 20 + +--- + +> ICON_CURSOR_CLASSIC = 21 + +--- + +> ICON_PENCIL = 22 + +--- + +> ICON_PENCIL_BIG = 23 + +--- + +> ICON_BRUSH_CLASSIC = 24 + +--- + +> ICON_BRUSH_PAINTER = 25 + +--- + +> ICON_WATER_DROP = 26 + +--- + +> ICON_COLOR_PICKER = 27 + +--- + +> ICON_RUBBER = 28 + +--- + +> ICON_COLOR_BUCKET = 29 + +--- + +> ICON_TEXT_T = 30 + +--- + +> ICON_TEXT_A = 31 + +--- + +> ICON_SCALE = 32 + +--- + +> ICON_RESIZE = 33 + +--- + +> ICON_FILTER_POINT = 34 + +--- + +> ICON_FILTER_BILINEAR = 35 + +--- + +> ICON_CROP = 36 + +--- + +> ICON_CROP_ALPHA = 37 + +--- + +> ICON_SQUARE_TOGGLE = 38 + +--- + +> ICON_SYMMETRY = 39 + +--- + +> ICON_SYMMETRY_HORIZONTAL = 40 + +--- + +> ICON_SYMMETRY_VERTICAL = 41 + +--- + +> ICON_LENS = 42 + +--- + +> ICON_LENS_BIG = 43 + +--- + +> ICON_EYE_ON = 44 + +--- + +> ICON_EYE_OFF = 45 + +--- + +> ICON_FILTER_TOP = 46 + +--- + +> ICON_FILTER = 47 + +--- + +> ICON_TARGET_POINT = 48 + +--- + +> ICON_TARGET_SMALL = 49 + +--- + +> ICON_TARGET_BIG = 50 + +--- + +> ICON_TARGET_MOVE = 51 + +--- + +> ICON_CURSOR_MOVE = 52 + +--- + +> ICON_CURSOR_SCALE = 53 + +--- + +> ICON_CURSOR_SCALE_RIGHT = 54 + +--- + +> ICON_CURSOR_SCALE_LEFT = 55 + +--- + +> ICON_UNDO = 56 + +--- + +> ICON_REDO = 57 + +--- + +> ICON_REREDO = 58 + +--- + +> ICON_MUTATE = 59 + +--- + +> ICON_ROTATE = 60 + +--- + +> ICON_REPEAT = 61 + +--- + +> ICON_SHUFFLE = 62 + +--- + +> ICON_EMPTYBOX = 63 + +--- + +> ICON_TARGET = 64 + +--- + +> ICON_TARGET_SMALL_FILL = 65 + +--- + +> ICON_TARGET_BIG_FILL = 66 + +--- + +> ICON_TARGET_MOVE_FILL = 67 + +--- + +> ICON_CURSOR_MOVE_FILL = 68 + +--- + +> ICON_CURSOR_SCALE_FILL = 69 + +--- + +> ICON_CURSOR_SCALE_RIGHT_FILL = 70 + +--- + +> ICON_CURSOR_SCALE_LEFT_FILL = 71 + +--- + +> ICON_UNDO_FILL = 72 + +--- + +> ICON_REDO_FILL = 73 + +--- + +> ICON_REREDO_FILL = 74 + +--- + +> ICON_MUTATE_FILL = 75 + +--- + +> ICON_ROTATE_FILL = 76 + +--- + +> ICON_REPEAT_FILL = 77 + +--- + +> ICON_SHUFFLE_FILL = 78 + +--- + +> ICON_EMPTYBOX_SMALL = 79 + +--- + +> ICON_BOX = 80 + +--- + +> ICON_BOX_TOP = 81 + +--- + +> ICON_BOX_TOP_RIGHT = 82 + +--- + +> ICON_BOX_RIGHT = 83 + +--- + +> ICON_BOX_BOTTOM_RIGHT = 84 + +--- + +> ICON_BOX_BOTTOM = 85 + +--- + +> ICON_BOX_BOTTOM_LEFT = 86 + +--- + +> ICON_BOX_LEFT = 87 + +--- + +> ICON_BOX_TOP_LEFT = 88 + +--- + +> ICON_BOX_CENTER = 89 + +--- + +> ICON_BOX_CIRCLE_MASK = 90 + +--- + +> ICON_POT = 91 + +--- + +> ICON_ALPHA_MULTIPLY = 92 + +--- + +> ICON_ALPHA_CLEAR = 93 + +--- + +> ICON_DITHERING = 94 + +--- + +> ICON_MIPMAPS = 95 + +--- + +> ICON_BOX_GRID = 96 + +--- + +> ICON_GRID = 97 + +--- + +> ICON_BOX_CORNERS_SMALL = 98 + +--- + +> ICON_BOX_CORNERS_BIG = 99 + +--- + +> ICON_FOUR_BOXES = 100 + +--- + +> ICON_GRID_FILL = 101 + +--- + +> ICON_BOX_MULTISIZE = 102 + +--- + +> ICON_ZOOM_SMALL = 103 + +--- + +> ICON_ZOOM_MEDIUM = 104 + +--- + +> ICON_ZOOM_BIG = 105 + +--- + +> ICON_ZOOM_ALL = 106 + +--- + +> ICON_ZOOM_CENTER = 107 + +--- + +> ICON_BOX_DOTS_SMALL = 108 + +--- + +> ICON_BOX_DOTS_BIG = 109 + +--- + +> ICON_BOX_CONCENTRIC = 110 + +--- + +> ICON_BOX_GRID_BIG = 111 + +--- + +> ICON_OK_TICK = 112 + +--- + +> ICON_CROSS = 113 + +--- + +> ICON_ARROW_LEFT = 114 + +--- + +> ICON_ARROW_RIGHT = 115 + +--- + +> ICON_ARROW_DOWN = 116 + +--- + +> ICON_ARROW_UP = 117 + +--- + +> ICON_ARROW_LEFT_FILL = 118 + +--- + +> ICON_ARROW_RIGHT_FILL = 119 + +--- + +> ICON_ARROW_DOWN_FILL = 120 + +--- + +> ICON_ARROW_UP_FILL = 121 + +--- + +> ICON_AUDIO = 122 + +--- + +> ICON_FX = 123 + +--- + +> ICON_WAVE = 124 + +--- + +> ICON_WAVE_SINUS = 125 + +--- + +> ICON_WAVE_SQUARE = 126 + +--- + +> ICON_WAVE_TRIANGULAR = 127 + +--- + +> ICON_CROSS_SMALL = 128 + +--- + +> ICON_PLAYER_PREVIOUS = 129 + +--- + +> ICON_PLAYER_PLAY_BACK = 130 + +--- + +> ICON_PLAYER_PLAY = 131 + +--- + +> ICON_PLAYER_PAUSE = 132 + +--- + +> ICON_PLAYER_STOP = 133 + +--- + +> ICON_PLAYER_NEXT = 134 + +--- + +> ICON_PLAYER_RECORD = 135 + +--- + +> ICON_MAGNET = 136 + +--- + +> ICON_LOCK_CLOSE = 137 + +--- + +> ICON_LOCK_OPEN = 138 + +--- + +> ICON_CLOCK = 139 + +--- + +> ICON_TOOLS = 140 + +--- + +> ICON_GEAR = 141 + +--- + +> ICON_GEAR_BIG = 142 + +--- + +> ICON_BIN = 143 + +--- + +> ICON_HAND_POINTER = 144 + +--- + +> ICON_LASER = 145 + +--- + +> ICON_COIN = 146 + +--- + +> ICON_EXPLOSION = 147 + +--- + +> ICON_1UP = 148 + +--- + +> ICON_PLAYER = 149 + +--- + +> ICON_PLAYER_JUMP = 150 + +--- + +> ICON_KEY = 151 + +--- + +> ICON_DEMON = 152 + +--- + +> ICON_TEXT_POPUP = 153 + +--- + +> ICON_GEAR_EX = 154 + +--- + +> ICON_CRACK = 155 + +--- + +> ICON_CRACK_POINTS = 156 + +--- + +> ICON_STAR = 157 + +--- + +> ICON_DOOR = 158 + +--- + +> ICON_EXIT = 159 + +--- + +> ICON_MODE_2D = 160 + +--- + +> ICON_MODE_3D = 161 + +--- + +> ICON_CUBE = 162 + +--- + +> ICON_CUBE_FACE_TOP = 163 + +--- + +> ICON_CUBE_FACE_LEFT = 164 + +--- + +> ICON_CUBE_FACE_FRONT = 165 + +--- + +> ICON_CUBE_FACE_BOTTOM = 166 + +--- + +> ICON_CUBE_FACE_RIGHT = 167 + +--- + +> ICON_CUBE_FACE_BACK = 168 + +--- + +> ICON_CAMERA = 169 + +--- + +> ICON_SPECIAL = 170 + +--- + +> ICON_LINK_NET = 171 + +--- + +> ICON_LINK_BOXES = 172 + +--- + +> ICON_LINK_MULTI = 173 + +--- + +> ICON_LINK = 174 + +--- + +> ICON_LINK_BROKE = 175 + +--- + +> ICON_TEXT_NOTES = 176 + +--- + +> ICON_NOTEBOOK = 177 + +--- + +> ICON_SUITCASE = 178 + +--- + +> ICON_SUITCASE_ZIP = 179 + +--- + +> ICON_MAILBOX = 180 + +--- + +> ICON_MONITOR = 181 + +--- + +> ICON_PRINTER = 182 + +--- + +> ICON_PHOTO_CAMERA = 183 + +--- + +> ICON_PHOTO_CAMERA_FLASH = 184 + +--- + +> ICON_HOUSE = 185 + +--- + +> ICON_HEART = 186 + +--- + +> ICON_CORNER = 187 + +--- + +> ICON_VERTICAL_BARS = 188 + +--- + +> ICON_VERTICAL_BARS_FILL = 189 + +--- + +> ICON_LIFE_BARS = 190 + +--- + +> ICON_INFO = 191 + +--- + +> ICON_CROSSLINE = 192 + +--- + +> ICON_HELP = 193 + +--- + +> ICON_FILETYPE_ALPHA = 194 + +--- + +> ICON_FILETYPE_HOME = 195 + +--- + +> ICON_LAYERS_VISIBLE = 196 + +--- + +> ICON_LAYERS = 197 + +--- + +> ICON_WINDOW = 198 + +--- + +> ICON_HIDPI = 199 + +--- + +> ICON_FILETYPE_BINARY = 200 + +--- + +> ICON_HEX = 201 + +--- + +> ICON_SHIELD = 202 + +--- + +> ICON_FILE_NEW = 203 + +--- + +> ICON_FOLDER_ADD = 204 + +--- + +> ICON_ALARM = 205 + +--- + +> ICON_CPU = 206 + +--- + +> ICON_ROM = 207 + +--- + +> ICON_STEP_OVER = 208 + +--- + +> ICON_STEP_INTO = 209 + +--- + +> ICON_STEP_OUT = 210 + +--- + +> ICON_RESTART = 211 + +--- + +> ICON_BREAKPOINT_ON = 212 + +--- + +> ICON_BREAKPOINT_OFF = 213 + +--- + +> ICON_BURGER_MENU = 214 + +--- + +> ICON_CASE_SENSITIVE = 215 + +--- + +> ICON_REG_EXP = 216 + +--- + +> ICON_FOLDER = 217 + +--- + +> ICON_FILE = 218 + +--- + +> ICON_SAND_TIMER = 219 + +--- + + +## Defines - Light type +> LIGHT_DIRECTIONAL = 0 + +Directional light + +--- + +> LIGHT_POINT = 1 + +Point light + +--- + + +## Defines - RLGL Default internal render batch elements limits +> RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192 + +Default internal render batch elements limits + +--- + +> RL_DEFAULT_BATCH_BUFFERS = 1 + +Default number of batch buffers (multi-buffering) + +--- + +> RL_DEFAULT_BATCH_DRAWCALLS = 256 + +Default number of batch draw calls (by state changes: mode, texture) + +--- + +> RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 + +Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture()) + +--- + + +## Defines - RLGL Internal Matrix stack +> RL_MAX_MATRIX_STACK_SIZE = 32 + +Maximum size of internal Matrix stack + +--- + + +## Defines - RLGL Shader limits +> RL_MAX_SHADER_LOCATIONS = 32 + +Maximum number of shader locations supported + +--- + + +## Defines - RLGL Projection matrix culling +> RL_CULL_DISTANCE_NEAR = 0.01 + +Default projection matrix near cull distance + +--- + +> RL_CULL_DISTANCE_FAR = 1000 + +Default projection matrix far cull distance + +--- + + +## Defines - RLGL Texture parameters +> RL_TEXTURE_WRAP_S = 10242 + +GL_TEXTURE_WRAP_S + +--- + +> RL_TEXTURE_WRAP_T = 10243 + +GL_TEXTURE_WRAP_T + +--- + +> RL_TEXTURE_MAG_FILTER = 10240 + +GL_TEXTURE_MAG_FILTER + +--- + +> RL_TEXTURE_MIN_FILTER = 10241 + +GL_TEXTURE_MIN_FILTER + +--- + +> RL_TEXTURE_FILTER_NEAREST = 9728 + +GL_NEAREST + +--- + +> RL_TEXTURE_FILTER_LINEAR = 9729 + +GL_LINEAR + +--- + +> RL_TEXTURE_FILTER_MIP_NEAREST = 9984 + +GL_NEAREST_MIPMAP_NEAREST + +--- + +> RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 9986 + +GL_NEAREST_MIPMAP_LINEAR + +--- + +> RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 9985 + +GL_LINEAR_MIPMAP_NEAREST + +--- + +> RL_TEXTURE_FILTER_MIP_LINEAR = 9987 + +GL_LINEAR_MIPMAP_LINEAR + +--- + +> RL_TEXTURE_FILTER_ANISOTROPIC = 12288 + +Anisotropic filter (custom identifier) + +--- + +> RL_TEXTURE_MIPMAP_BIAS_RATIO = 16384 + +Texture mipmap bias, percentage ratio (custom identifier) + +--- + +> RL_TEXTURE_WRAP_REPEAT = 10497 + +GL_REPEAT + +--- + +> RL_TEXTURE_WRAP_CLAMP = 33071 + +GL_CLAMP_TO_EDGE + +--- + +> RL_TEXTURE_WRAP_MIRROR_REPEAT = 33648 + +GL_MIRRORED_REPEAT + +--- + +> RL_TEXTURE_WRAP_MIRROR_CLAMP = 34626 + +GL_MIRROR_CLAMP_EXT + +--- + + +## Defines - RLGL Matrix modes (equivalent to OpenGL) +> RL_MODELVIEW = 5888 + +GL_MODELVIEW + +--- + +> RL_PROJECTION = 5889 + +GL_PROJECTION + +--- + +> RL_TEXTURE = 5890 + +GL_TEXTURE + +--- + + +## Defines - RLGL Primitive assembly draw modes +> RL_LINES = 1 + +GL_LINES + +--- + +> RL_TRIANGLES = 4 + +GL_TRIANGLES + +--- + +> RL_QUADS = 7 + +GL_QUADS + +--- + + +## Defines - RLGL GL equivalent data types +> RL_UNSIGNED_BYTE = 5121 + +GL_UNSIGNED_BYTE + +--- + +> RL_FLOAT = 5126 + +GL_FLOAT + +--- + + +## Defines - RLGL GL buffer usage hint +> RL_STREAM_DRAW = 35040 + +GL_STREAM_DRAW + +--- + +> RL_STREAM_READ = 35041 + +GL_STREAM_READ + +--- + +> RL_STREAM_COPY = 35042 + +GL_STREAM_COPY + +--- + +> RL_STATIC_DRAW = 35044 + +GL_STATIC_DRAW + +--- + +> RL_STATIC_READ = 35045 + +GL_STATIC_READ + +--- + +> RL_STATIC_COPY = 35046 + +GL_STATIC_COPY + +--- + +> RL_DYNAMIC_DRAW = 35048 + +GL_DYNAMIC_DRAW + +--- + +> RL_DYNAMIC_READ = 35049 + +GL_DYNAMIC_READ + +--- + +> RL_DYNAMIC_COPY = 35050 + +GL_DYNAMIC_COPY + +--- + + +## Defines - RLGL Shader type +> RL_FRAGMENT_SHADER = 35632 + +GL_FRAGMENT_SHADER + +--- + +> RL_VERTEX_SHADER = 35633 + +GL_VERTEX_SHADER + +--- + +> RL_COMPUTE_SHADER = 37305 + +GL_COMPUTE_SHADER + +--- + + +## Defines - RLGL GL blending factors +> RL_ZERO = 0 + +GL_ZERO + +--- + +> RL_ONE = 1 + +GL_ONE + +--- + +> RL_SRC_COLOR = 768 + +GL_SRC_COLOR + +--- + +> RL_ONE_MINUS_SRC_COLOR = 769 + +GL_ONE_MINUS_SRC_COLOR + +--- + +> RL_SRC_ALPHA = 770 + +GL_SRC_ALPHA + +--- + +> RL_ONE_MINUS_SRC_ALPHA = 771 + +GL_ONE_MINUS_SRC_ALPHA + +--- + +> RL_DST_ALPHA = 772 + +GL_DST_ALPHA + +--- + +> RL_ONE_MINUS_DST_ALPHA = 773 + +GL_ONE_MINUS_DST_ALPHA + +--- + +> RL_DST_COLOR = 774 + +GL_DST_COLOR + +--- + +> RL_ONE_MINUS_DST_COLOR = 775 + +GL_ONE_MINUS_DST_COLOR + +--- + +> RL_SRC_ALPHA_SATURATE = 776 + +GL_SRC_ALPHA_SATURATE + +--- + +> RL_CONSTANT_COLOR = 32769 + +GL_CONSTANT_COLOR + +--- + +> RL_ONE_MINUS_CONSTANT_COLOR = 32770 + +GL_ONE_MINUS_CONSTANT_COLOR + +--- + +> RL_CONSTANT_ALPHA = 32771 + +GL_CONSTANT_ALPHA + +--- + +> RL_ONE_MINUS_CONSTANT_ALPHA = 32772 + +GL_ONE_MINUS_CONSTANT_ALPHA + +--- + + +## Defines - RLGL GL blending functions/equations +> RL_FUNC_ADD = 32774 + +GL_FUNC_ADD + +--- + +> RL_MIN = 32775 + +GL_MIN + +--- + +> RL_MAX = 32776 + +GL_MAX + +--- + +> RL_FUNC_SUBTRACT = 32778 + +GL_FUNC_SUBTRACT + +--- + +> RL_FUNC_REVERSE_SUBTRACT = 32779 + +GL_FUNC_REVERSE_SUBTRACT + +--- + +> RL_BLEND_EQUATION = 32777 + +GL_BLEND_EQUATION + +--- + +> RL_BLEND_EQUATION_RGB = 32777 + +GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION) + +--- + +> RL_BLEND_EQUATION_ALPHA = 34877 + +GL_BLEND_EQUATION_ALPHA + +--- + +> RL_BLEND_DST_RGB = 32968 + +GL_BLEND_DST_RGB + +--- + +> RL_BLEND_SRC_RGB = 32969 + +GL_BLEND_SRC_RGB + +--- + +> RL_BLEND_DST_ALPHA = 32970 + +GL_BLEND_DST_ALPHA + +--- + +> RL_BLEND_SRC_ALPHA = 32971 + +GL_BLEND_SRC_ALPHA + +--- + +> RL_BLEND_COLOR = 32773 + +GL_BLEND_COLOR + +--- + +> RL_READ_FRAMEBUFFER = 36008 + +GL_READ_FRAMEBUFFER + +--- + +> RL_DRAW_FRAMEBUFFER = 36009 + +GL_DRAW_FRAMEBUFFER + +--- + + +## Defines - RLGL Default shader vertex attribute locations +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION = 0 + +--- + +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD = 1 + +--- + +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL = 2 + +--- + +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR = 3 + +--- + +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT = 4 + +--- + +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 = 5 + +--- + +> RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES = 6 + +--- + + +RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS = nil + +--- + + +RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS = nil + +--- + + +## Defines - RLGL GlVersion +> RL_OPENGL_11 = 1 + +OpenGL 1.1 + +--- + +> RL_OPENGL_21 = 2 + +OpenGL 2.1 (GLSL 120) + +--- + +> RL_OPENGL_33 = 3 + +OpenGL 3.3 (GLSL 330) + +--- + +> RL_OPENGL_43 = 4 + +OpenGL 4.3 (using GLSL 330) + +--- + +> RL_OPENGL_ES_20 = 5 + +OpenGL ES 2.0 (GLSL 100) + +--- + + +## Defines - RLGL Framebuffer attachment type +> RL_ATTACHMENT_COLOR_CHANNEL0 = 0 + +Framebuffer attachment type: color 0 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL1 = 1 + +Framebuffer attachment type: color 1 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL2 = 2 + +Framebuffer attachment type: color 2 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL3 = 3 + +Framebuffer attachment type: color 3 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL4 = 4 + +Framebuffer attachment type: color 4 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL5 = 5 + +Framebuffer attachment type: color 5 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL6 = 6 + +Framebuffer attachment type: color 6 + +--- + +> RL_ATTACHMENT_COLOR_CHANNEL7 = 7 + +Framebuffer attachment type: color 7 + +--- + +> RL_ATTACHMENT_DEPTH = 100 + +Framebuffer attachment type: depth + +--- + +> RL_ATTACHMENT_STENCIL = 200 + +Framebuffer attachment type: stencil + +--- + + +## Defines - RLGL Framebuffer texture attachment type +> RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0 + +Framebuffer texture attachment type: cubemap, +X side + +--- + +> RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1 + +Framebuffer texture attachment type: cubemap, -X side + +--- + +> RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2 + +Framebuffer texture attachment type: cubemap, +Y side + +--- + +> RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3 + +Framebuffer texture attachment type: cubemap, -Y side + +--- + +> RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4 + +Framebuffer texture attachment type: cubemap, +Z side + +--- + +> RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5 + +Framebuffer texture attachment type: cubemap, -Z side + +--- + +> RL_ATTACHMENT_TEXTURE2D = 100 + +Framebuffer texture attachment type: texture2d + +--- + +> RL_ATTACHMENT_RENDERBUFFER = 200 + +Framebuffer texture attachment type: renderbuffer + +--- + + +## Defines - RLGL CullMode +> RL_CULL_FACE_FRONT = 0 + +--- + +> RL_CULL_FACE_BACK = 1 + +--- + + +## Defines - OpenGL Bitfield mask +> GL_COLOR_BUFFER_BIT = 16384 + +--- + +> GL_DEPTH_BUFFER_BIT = 256 + +--- + +> GL_STENCIL_BUFFER_BIT = 1024 + +--- + + +## Defines - OpenGL Texture parameter +> GL_NEAREST = 9728 + +--- + +> GL_LINEAR = 9729 + +--- + + +## Defines - OpenGL Capability +> GL_BLEND = 3042 + +If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc + +--- + +> GL_CULL_FACE = 2884 + +If enabled, cull polygons based on their winding in window coordinates. See glCullFace + +--- + +> GL_DEPTH_TEST = 2929 + +If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRangef + +--- + +> GL_DITHER = 3024 + +If enabled, dither color components or indices before they are written to the color buffer + +--- + +> GL_POLYGON_OFFSET_FILL = 32823 + +If enabled, an offset is added to depth values of a polygon's fragments produced by rasterization. See glPolygonOffset + +--- + +> GL_POLYGON_OFFSET_LINE = 10754 + +--- + +> GL_POLYGON_OFFSET_POINT = 10753 + +--- + +> GL_SAMPLE_ALPHA_TO_COVERAGE = 32926 + +If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value + +--- + +> GL_SAMPLE_COVERAGE = 32928 + +If enabled, the fragment's coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE, invert the coverage value. See glSampleCoverage + +--- + +> GL_SCISSOR_TEST = 3089 + +If enabled, discard fragments that are outside the scissor rectangle. See glScissor + +--- + +> GL_STENCIL_TEST = 2960 + +If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp + +--- + + +## Defines - OpenGL Test function +> GL_NEVER = 512 + +Always fails + +--- + +> GL_LESS = 513 + +Passes if ( ref & mask ) < ( stencil & mask ) + +--- + +> GL_LEQUAL = 515 + +Passes if ( ref & mask ) <= ( stencil & mask ) + +--- + +> GL_GREATER = 516 + +Passes if ( ref & mask ) > ( stencil & mask ) + +--- + +> GL_GEQUAL = 518 + +Passes if ( ref & mask ) >= ( stencil & mask ) + +--- + +> GL_EQUAL = 514 + +Passes if ( ref & mask ) = ( stencil & mask ) + +--- + +> GL_NOTEQUAL = 517 + +Passes if ( ref & mask ) != ( stencil & mask ) + +--- + +> GL_ALWAYS = 519 + +Always passes + +--- + + +## Defines - OpenGL Face +> GL_FRONT = 1028 + +--- + +> GL_BACK = 1029 + +--- + +> GL_FRONT_AND_BACK = 1032 + +--- + + +## Defines - OpenGL Stencil test +> GL_KEEP = 7680 + +Keeps the current value + +--- + +> GL_ZERO = 0 + +Sets the stencil buffer value to 0 + +--- + +> GL_REPLACE = 7681 + +Sets the stencil buffer value to ref, as specified by glStencilFunc + +--- + +> GL_INCR = 7682 + +Increments the current stencil buffer value. Clamps to the maximum representable unsigned value + +--- + +> GL_INCR_WRAP = 34055 + +Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value + +--- + +> GL_DECR = 7683 + +Decrements the current stencil buffer value. Clamps to 0 + +--- + +> GL_DECR_WRAP = 34056 + +Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero + +--- + +> GL_INVERT = 5386 + +Bitwise inverts the current stencil buffer value + +--- + + +## Defines - OpenGL Connection +> GL_VENDOR = 7936 + +Returns the company responsible for this GL implementation. This name does not change from release to release + +--- + +> GL_RENDERER = 7937 + +Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release + +--- + +> GL_VERSION = 7938 + +Returns a version or release number of the form OpenGLES + +--- + +> GL_SHADING_LANGUAGE_VERSION = 35724 + +Returns a version or release number for the shading language of the form OpenGLESGLSLES + +--- + +> GL_EXTENSIONS = 7939 + +Returns a space-separated list of supported extensions to GL + +--- + + +## Defines - CBuffer Data type +> BUFFER_UNSIGNED_CHAR = 0 + +C type unsigned char + +--- + +> BUFFER_UNSIGNED_SHORT = 1 + +C type unsigned short + +--- + +> BUFFER_UNSIGNED_INT = 2 + +C type unsigned int + +--- + +> BUFFER_UNSIGNED_LONG = 3 + +C type unsigned long + +--- + +> BUFFER_CHAR = 4 + +C type char + +--- + +> BUFFER_SHORT = 5 + +C type short + +--- + +> BUFFER_INT = 6 + +C type int + +--- + +> BUFFER_LONG = 7 + +C type long + +--- + +> BUFFER_FLOAT = 8 + +C type float + +--- + +> BUFFER_DOUBLE = 9 + +C type double + +--- + + +## Defines - Keyboard keys (US keyboard layout) +> GLFW_KEY_UNKNOWN = -1 + +Key: Unknown + +--- + + +## Defines - GLFW API tokens. +> GLFW_RELEASE = 0 + +The key or mouse button was released + +--- + +> GLFW_PRESS = 1 + +The key or mouse button was pressed + +--- + +> GLFW_REPEAT = 2 + +The key was held down until it repeated + +--- + +> GLFW_CONNECTED = 262145 + +Joystick connected + +--- + +> GLFW_DISCONNECTED = 262146 + +Joystick disconnected + +--- + + +## Defines - GLFW Window Events. +> GLFW_WINDOW_SIZE_EVENT = 0 + +GLFW event window size changed + +--- + +> GLFW_WINDOW_MAXIMIZE_EVENT = 1 + +GLFW event window maximize + +--- + +> GLFW_WINDOW_ICONYFY_EVENT = 2 + +GLFW event window iconify + +--- + +> GLFW_WINDOW_FOCUS_EVENT = 3 + +GLFW event window focus + +--- + +> GLFW_WINDOW_DROP_EVENT = 4 + +GLFW event window drop + +--- + + +## Defines - GLFW Input Events. +> GLFW_KEY_EVENT = 5 + +GLFW event keyboard key + +--- + +> GLFW_CHAR_EVENT = 6 + +GLFW event Unicode character + +--- + +> GLFW_MOUSE_BUTTON_EVENT = 7 + +GLFW event mouse button + +--- + +> GLFW_MOUSE_CURSOR_POS_EVENT = 8 + +GLFW event cursor position + +--- + +> GLFW_MOUSE_SCROLL_EVENT = 9 + +GLFW event mouse scroll + +--- + +> GLFW_CURSOR_ENTER_EVENT = 10 + +GLFW event cursor enter/leave + +--- + +> GLFW_JOYSTICK_EVENT = 11 + +GLFW event joystick + +--- + + +## Defines - GLFW Pen Tablet Events. NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445. + +assignGlobalInt = nil + +// GLFW event pen tablet data + +--- + + +assignGlobalInt = nil + +// GLFW event pen tablet cursor + +--- + + +assignGlobalInt = nil + +// GLFW event pen tablet proximity + +--- + + +## Core - Window-related functions + +--- + +> RL.InitWindow( Vector2 size, string title ) + +Initialize window and OpenGL context. Note! Should be called only in RL.config. +InitWindow will still be called automatically before RL.init + +--- + +> RL.CloseWindow() + +Close window and unload OpenGL context and free all resources + +--- + +> RL.WindowShouldClose() + +Check if application should close (KEY_ESCAPE pressed or windows close icon clicked). +Note! Not needed unless you want to make custom main loop + +--- + +> state = RL.IsWindowReady() + +Check if window has been initialized successfully + +- Success return bool + +--- + +> state = RL.IsWindowFullscreen() + +Check if window is currently fullscreen + +- Success return bool + +--- + +> state = RL.IsWindowHidden() + +Check if window is currently hidden (only PLATFORM_DESKTOP) + +- Success return bool + +--- + +> state = RL.IsWindowMinimized() + +Check if window is currently minimized (only PLATFORM_DESKTOP) + +- Success return bool + +--- + +> state = RL.IsWindowMaximized() + +Check if window is currently maximized (only PLATFORM_DESKTOP) + +- Success return bool + +--- + +> state = RL.IsWindowFocused() + +Check if window is currently focused (only PLATFORM_DESKTOP) + +- Success return bool + +--- + +> resized = RL.IsWindowResized() + +Check if window has been resized from last frame + +- Success return bool + +--- + +> state = RL.IsWindowState( int flag ) + +Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) + +- Success return bool + +--- + +> RL.SetWindowState( int flag ) + +Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) + +--- + +> resized = RL.ClearWindowState( int flag ) + +Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) + +- Success return bool + +--- + +> RL.ToggleFullscreen() + +Toggle window state: fullscreen/windowed, resizes monitor to match window resolution + +--- + +> RL.ToggleBorderlessWindowed() + +Toggle window state: borderless windowed, resizes window to match monitor resolution + +--- + +> RL.MaximizeWindow() + +Set window state: maximized, if resizable (only PLATFORM_DESKTOP) + +--- + +> RL.MinimizeWindow() + +Set window state: minimized, if resizable (only PLATFORM_DESKTOP) + +--- + +> RL.RestoreWindow() + +Set window state: not minimized/maximized (only PLATFORM_DESKTOP) + +--- + +> RL.SetWindowIcon( Image image ) + +Set icon for window (Only PLATFORM_DESKTOP) + +--- + +> RL.SetWindowIcons( Image{} images ) + +Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) + +--- + +> RL.SetWindowTitle( string title ) + +Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) + +--- + +> RL.SetWindowPosition( Vector2 pos ) + +Set window position on screen + +--- + +> RL.SetWindowMonitor( int monitor ) + +Set monitor for the current window + +--- + +> RL.SetWindowMinSize( Vector2 size ) + +Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) + +--- + +> RL.SetWindowMaxSize( Vector2 size ) + +Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) + +--- + +> RL.SetWindowSize( Vector2 size ) + +Set window dimensions + +--- + +> RL.SetWindowOpacity( float opacity ) + +Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) + +--- + +> RL.SetWindowFocused() + +Set window focused (only PLATFORM_DESKTOP) + +--- + +> windowHandle = RL.GetWindowHandle() + +Get native window handle. Return as lightuserdata + +- Success return lightuserdata + +--- + +> size = RL.GetScreenSize() + +Get screen size + +- Success return Vector2 + +--- + +> size = RL.GetRenderSize() + +Get render size + +- Success return Vector2 + +--- + +> count = RL.GetMonitorCount() + +Get number of connected monitors + +- Success return int + +--- + +> monitor = RL.GetCurrentMonitor() + +Get current connected monitor + +- Success return int + +--- + +> position = RL.GetMonitorPosition( int monitor ) + +Get specified monitor position + +- Success return Vector2 + +--- + +> size = RL.GetMonitorSize( int monitor ) + +Get specified monitor size + +- Success return Vector2 + +--- + +> size = RL.GetMonitorPhysicalSize( int monitor ) + +Get specified monitor physical size in millimetres + +- Success return Vector2 + +--- + +> refreshRate = RL.GetMonitorRefreshRate( int monitor ) + +Get specified monitor refresh rate + +- Success return int + +--- + +> position = RL.GetWindowPosition() + +Get window position on monitor + +- Success return Vector2 + +--- + +> dpi = RL.GetWindowScaleDPI() + +Get window scale DPI factor + +- Success return Vector2 + +--- + +> name = RL.GetMonitorName( int monitor ) + +Get the human-readable, UTF-8 encoded name of the specified monitor + +- Success return string + +--- + +> RL.SetClipboardText( string text ) + +Set clipboard text content + +--- + +> text = RL.GetClipboardText() + +Get clipboard text content + +- Success return string + +--- + +> image = RL.GetClipboardImage() + +Get clipboard image content + +- Success return Image + +--- + +> RL.EnableEventWaiting() + +Enable waiting for events on EndDrawing(), no automatic event polling + +--- + +> RL.DisableEventWaiting() + +Disable waiting for events on EndDrawing(), automatic events polling + +--- + +## Core - Cursor-related functions + +--- + +> RL.ShowCursor() + +Shows cursor + +--- + +> RL.HideCursor() + +Hides cursor + +--- + +> hidden = RL.IsCursorHidden() + +Check if cursor is not visible + +- Success return bool + +--- + +> RL.EnableCursor() + +Enables cursor (unlock cursor) + +--- + +> RL.DisableCursor() + +Disables cursor (lock cursor) + +--- + +> onSreen = RL.IsCursorOnScreen() + +Check if cursor is on the screen + +- Success return bool + +--- + +## Core - Drawing-related functions + +--- + +> RL.ClearBackground( Color color ) + +Set background color (framebuffer clear color) + +--- + +> RL.BeginDrawing() + +Setup canvas (framebuffer) to start drawing + +--- + +> RL.EndDrawing() + +End canvas drawing and swap buffers (double buffering) + +--- + +> RL.BeginMode2D( camera2D camera ) + +Begin 2D mode with custom camera (2D) + +--- + +> RL.EndMode2D() + +Ends 2D mode with custom camera + +--- + +> RL.BeginMode3D( camera3D camera ) + +Begin 3D mode with custom camera (3D) + +--- + +> RL.EndMode3D() + +Ends 3D mode and returns to default 2D orthographic mode + +--- + +> RL.BeginTextureMode( RenderTexture target ) + +Begin drawing to render texture + +--- + +> RL.EndTextureMode() + +Ends drawing to render texture + +--- + +> RL.BeginShaderMode( Shader shader ) + +Begin custom shader drawing + +--- + +> RL.EndShaderMode() + +End custom shader drawing (use default shader) + +--- + +> RL.BeginBlendMode( int mode ) + +Begin blending mode (BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED...) + +--- + +> RL.EndBlendMode() + +End blending mode (reset to default: BLEND_ALPHA) + +--- + +> RL.BeginScissorMode( Rectangle rectange ) + +Begin scissor mode (define screen area for following drawing) + +--- + +> RL.EndScissorMode() + +End scissor mode + +--- + +## Core - Shader management functions + +--- + +> shader = RL.LoadShader( string|nil vsFileName, string|nil fsFileName ) + +Load shader from files and bind default locations. +NOTE: Set nil if no shader + +- Failure return nil +- Success return Shader + +--- + +> shader = RL.LoadShaderFromMemory( string|nil vsCode, string|nil fsCode ) + +Load shader from code strings and bind default locations +NOTE: Set nil if no shader + +- Failure return nil +- Success return Shader + +--- + +> isValid = RL.IsShaderValid( Shader shader ) + +Check if a shader is valid (loaded on GPU) + +- Success return bool + +--- + +> shaderId = RL.GetShaderId( Shader shader ) + +Get shader program id + +- Success return int + +--- + +> location = RL.GetShaderLocation( Shader shader, string uniformName ) + +Get shader uniform location + +- Success return int + +--- + +> location = RL.GetShaderLocationAttrib( Shader shader, string attribName ) + +Get shader attribute location + +- Success return int + +--- + +> RL.SetShaderLocationIndex( Shader shader, int shaderLocationIndex, int location ) + +Set shader location index + +--- + +> location = RL.GetShaderLocationIndex( Shader shader, int shaderLocationIndex ) + +Get shader location index + +- Success return int + +--- + +> RL.SetShaderValueMatrix( Shader shader, int locIndex, Matrix mat ) + +Set shader uniform value (matrix 4x4) + +--- + +> RL.SetShaderValueTexture( Shader shader, int locIndex, Texture texture ) + +Set shader uniform value for texture (sampler2d) + +--- + +> RL.SetShaderValue( Shader shader, int locIndex, number{} values, int uniformType ) + +Set shader uniform value +NOTE: Even one value should be in table + +--- + +> RL.SetShaderValueV( Shader shader, int locIndex, number{} values, int uniformType, int count ) + +Set shader uniform value vector +NOTE: Even one value should be in table + +--- + +> RL.SetShaderValueWithBuffer( Shader shader, int locIndex, Buffer values, int uniformType ) + +Set shader uniform value using Buffer object + +--- + +> RL.SetShaderValueVWithBuffer( Shader shader, int locIndex, Buffer values, int uniformType, int count ) + +Set shader uniform value vector using Buffer object + +--- + +> RL.UnloadShader( Shader shader ) + +Unload shader from GPU memory (VRAM) + +--- + +## Core - Screen-space-related functions + +--- + +> ray = RL.GetScreenToWorldRay( Vector2 mousePosition, Camera3D camera ) + +Get a ray trace from screen position (i.e mouse) + +- Success return Ray + +--- + +> ray = RL.GetScreenToWorldRayEx( Vector2 mousePosition, Camera3D camera, Vector2 size ) + +Get a ray trace from screen position (i.e mouse) in a viewport + +- Success return Ray + +--- + +> position = RL.GetWorldToScreen( Vector3 position, Camera3D camera ) + +Get the screen space position for a 3d world space position + +- Success return Vector2 + +--- + +> position = RL.GetWorldToScreenEx( Vector3 position, Camera3D camera, Vector2 size ) + +Get size position for a 3d world space position + +- Success return Vector2 + +--- + +> position = RL.GetWorldToScreen2D( Vector2 position, Camera2D camera ) + +Get the screen space position for a 2d camera world space position + +- Success return Vector2 + +--- + +> position = RL.GetScreenToWorld2D( Vector2 position, Camera2D camera ) + +Get the world space position for a 2d camera screen space position + +- Success return Vector2 + +--- + +> matrix = RL.GetCameraMatrix( Camera3D camera ) + +Get camera transform matrix (view matrix) + +- Success return Matrix + +--- + +> matrix = RL.GetCameraMatrix2D( Camera2D camera ) + +Get camera 2d transform matrix + +- Success return Matrix + +--- + +## Core - Timing-related functions + +--- + +> RL.SetTargetFPS( int fps ) + +Set target FPS (maximum) + +--- + +> delta = RL.GetFrameTime() + +Get time in seconds for last frame drawn (Delta time) + +- Success return float + +--- + +> time = RL.GetTime() + +Get elapsed time in seconds since InitWindow() + +- Success return float + +--- + +> FPS = RL.GetFPS() + +Get current FPS + +- Success return int + +--- + +## Core - Custom frame control functions + +--- + +> RL.SwapScreenBuffer() + +Swap back buffer with front buffer (screen drawing) + +--- + +> RL.PollInputEvents() + +Register all input events + +--- + +> RL.WaitTime( number seconds ) + +Wait for some time (halt program execution) + +--- + +## Core - Random values generation functions + +--- + +> RL.SetRandomSeed( int seed ) + +Set the seed for the random number generator + +--- + +> time = RL.GetRandomValue( int min, int max ) + +Get a random value between min and max (both included) + +- Success return int + +--- + +> sequence = RL.LoadRandomSequence( int count, int min, int max ) + +Load random values sequence, no values repeated + +- Success return int{} + +--- + +## Core - Misc + +--- + +> RL.TakeScreenshot( string fileName ) + +Takes a screenshot of current screen (filename extension defines format) + +--- + +> RL.SetConfigFlags( int flags ) + +Setup init configuration flags (view FLAGS) + +--- + +> RL.TraceLog( int logLevel, string text ) + +Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) + +--- + +> RL.SetTraceLogLevel( int logLevel ) + +Set the current threshold (minimum) log level + +--- + +> RL.SetLogLevelInvalid( int logLevel ) + +Set the log level for bad function calls and invalid data formats. + +--- + +> logLevel = RL.GetLogLevelInvalid() + +Get the log level for bad function calls and invalid data formats. + +- Success return int + +--- + +> RL.OpenURL( string url ) + +Open URL with default system browser (if available) + +--- + +> enabled = RL.IsGCUnloadEnabled() + +Check if Lua garbage collection is set to unload object data + +- Success return bool + +--- + +> RL.SetGCUnload( bool enabled ) + +Set Lua garbage collection to unload object data + +--- + +> platform = RL.GetPlatform() + +Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten" + +- Success return string + +--- + +## Core - Files management functions + +--- + +> buffer = RL.LoadFileData( string fileName ) + +Load file data as byte array (read). Buffer type is BUFFER_UNSIGNED_CHAR + +- Success return Buffer + +--- + +> success = RL.SaveFileData( string fileName, buffer Buffer ) + +Save data to file from byte array (write), returns true on success + +- Success return bool + +--- + +> success = RL.ExportDataAsCode( Buffer buffer, string fileName ) + +Export data to code (.h), returns true on success + +- Success return bool + +--- + +> text = RL.LoadFileText( string fileName ) + +Load text data from file (read) + +- Success return string + +--- + +> success = RL.SaveFileText( string fileName, string text ) + +Save text data to file (write), returns true on success + +- Success return bool + +--- + +## Core - Files system functions + +--- + +> path = RL.GetBasePath() + +Return game directory (where main.lua is located) + +- Success return string + +--- + +> fileExists = RL.FileExists( string fileName ) + +Check if file exists + +- Success return bool + +--- + +> dirExists = RL.DirectoryExists( string dirPath ) + +Check if a directory path exists + +- Success return bool + +--- + +> hasFileExtension = RL.IsFileExtension( string fileName, string ext ) + +Check file extension (Including point: .png, .wav) + +- Success return bool + +--- + +> length = RL.GetFileLength( string fileName ) + +Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) + +- Success return int + +--- + +> extension = RL.GetFileExtension( string fileName ) + +Get pointer to extension for a filename string (Includes dot: '.png') + +- Success return string + +--- + +> fileName = RL.GetFileName( string filePath ) + +Get pointer to filename for a path string + +- Success return string + +--- + +> fileName = RL.GetFileNameWithoutExt( string filePath ) + +Get filename string without extension (Uses static string) + +- Success return string + +--- + +> filePath = RL.GetDirectoryPath( string filePath ) + +Get full path for a given fileName with path (Uses static string) + +- Success return string + +--- + +> directory = RL.GetPrevDirectoryPath( string dirPath ) + +Get previous directory path for a given path (Uses static string) + +- Success return string + +--- + +> directory = RL.GetWorkingDirectory() + +Get current working directory (Uses static string) + +- Success return string + +--- + +> directory = RL.GetApplicationDirectory() + +Get the directory of the running application (uses static string) + +- Success return string + +--- + +> success = RL.MakeDirectory( string dirPath ) + +Create directories (including full path requested), returns 0 on success + +- Success return int + +--- + +> success = RL.ChangeDirectory( string directory ) + +Change working directory, return true on success + +- Success return bool + +--- + +> isFile = RL.IsPathFile( string path ) + +Check if a given path is a file or a directory + +- Success return bool + +--- + +> isValid = RL.IsFileNameValid( string fileName ) + +Check if fileName is valid for the platform/OS + +- Success return bool + +--- + +> fileNames = RL.LoadDirectoryFiles( string dirPath ) + +Load directory filepaths + +- Success return string{} + +--- + +> fileNames = RL.LoadDirectoryFilesEx( string basePath, string|nil filter, bool scanSubdirs ) + +Load directory filepaths with extension filtering and recursive directory scan + +- Success return string{} + +--- + +> iSFileDropped = RL.IsFileDropped() + +Check if a file has been dropped into window + +- Success return bool + +--- + +> files = RL.LoadDroppedFiles() + +Load dropped filepaths + +- Success return string{} + +--- + +> time = RL.GetFileModTime( string fileName ) + +Get file modification time (Last write time) + +- Success return int + +--- + +## Core - Compression/Encoding functionality + +--- + +> compData = RL.CompressData( Buffer buffer ) + +Compress data (DEFLATE algorithm) + +- Success return Buffer + +--- + +> decompData = RL.DecompressData( Buffer compData ) + +Decompress data (DEFLATE algorithm). + +- Success Buffer + +--- + +> encodedData, outputSize = RL.EncodeDataBase64( string data ) + +Encode data to Base64 string + +- Success return string, int + +--- + +> decodedData, outputSize = RL.DecodeDataBase64( string data ) + +Decode Base64 string data + +- Success return string, int + +--- + +> code = RL.ComputeCRC32( Buffer data ) + +Compute CRC32 hash code. + +- Failure return false +- Success return int + +--- + +> code = RL.ComputeMD5( Buffer data ) + +Compute MD5 hash code, returns static int[4] (16 bytes). + +- Failure return false +- Success return int{4} + +--- + +> code = RL.ComputeSHA1( Buffer data ) + +Compute SHA1 hash code, returns static int[5] (20 bytes). + +- Failure return false +- Success return int{5} + +--- + +## Core - Automation events functionality + +--- + +> eventList = RL.LoadAutomationEventList( string|nil fileName ) + +Load automation events list from file, nil for empty list, capacity = MAX_AUTOMATION_EVENTS + +- Success return AutomationEventList + +--- + +> RL.UnloadAutomationEventList( AutomationEventList list ) + +Unload automation events list from file + +--- + +> success = RL.ExportAutomationEventList( string fileName ) + +Export automation events list as text file + +- Failure return false +- Success return true + +--- + +> RL.SetAutomationEventList( AutomationEventList list ) + +Set automation event list to record to + +--- + +> RL.SetAutomationEventBaseFrame( int frame ) + +Set automation event internal base frame to start recording + +--- + +> RL.StartAutomationEventRecording() + +Start recording automation events (AutomationEventList must be set) + +--- + +> RL.StopAutomationEventRecording() + +Stop recording automation events + +--- + +> RL.PlayAutomationEvent( AutomationEvent event ) + +Play a recorded automation event + +--- + +> capacity = RL.GetAutomationEventListCapacity( AutomationEventList list ) + +Get automation event list capacity + +- Success return int + +--- + +> count = RL.GetAutomationEventListCount( AutomationEventList list ) + +Get automation event list count + +- Success return int + +--- + +> event = RL.GetAutomationEvent( AutomationEventList list, int index ) + +Get automation event from automation event list. Return as lightuserdata + +- Failure return nil +- Success return AutomationEvent + +--- + +> frame = RL.GetAutomationEventFrame( AutomationEvent event ) + +Get automation event frame + +- Success return int + +--- + +> type = RL.GetAutomationEventType( AutomationEvent event ) + +Get automation event type + +- Success return int + +--- + +> params = RL.GetAutomationEventParams( AutomationEvent event ) + +Get automation event params + +- Success return int{} + +--- + +## Core - Input-related functions: keyboard + +--- + +> pressed = RL.IsKeyPressed( int key ) + +Detect if a key has been pressed once + +- Success return bool + +--- + +> pressed = RL.IsKeyPressedRepeat( int key ) + +Check if a key has been pressed again (Only PLATFORM_DESKTOP) + +- Success return bool + +--- + +> pressed = RL.IsKeyDown( int key ) + +Detect if a key is being pressed + +- Success return bool + +--- + +> released = RL.IsKeyReleased( int key ) + +Detect if a key has been released once + +- Success return bool + +--- + +> released = RL.IsKeyUp( int key ) + +Check if a key is NOT being pressed + +- Success return bool + +--- + +> keycode = RL.GetKeyPressed() + +Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty + +- Success return int + +--- + +> unicode = RL.GetCharPressed() + +Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty + +- Success return int + +--- + +> RL.SetExitKey( int key ) + +Set a custom key to exit program (default is ESC) + +--- + +## Core - Input-related functions: gamepads + +--- + +> available = RL.IsGamepadAvailable( int gamepad ) + +Detect if a gamepad is available + +- Success return bool + +--- + +> name = RL.GetGamepadName( int gamepad ) + +Return gamepad internal name id + +- Success return string + +--- + +> pressed = RL.IsGamepadButtonPressed( int gamepad, int button ) + +Detect if a gamepad button has been pressed once + +- Success return bool + +--- + +> pressed = RL.IsGamepadButtonDown( int gamepad, int button ) + +Detect if a gamepad button is being pressed + +- Success return bool + +--- + +> released = RL.IsGamepadButtonReleased( int gamepad, int button ) + +Detect if a gamepad button has been released once + +- Success return bool + +--- + +> notPressed = RL.IsGamepadButtonUp( int gamepad, int button ) + +Check if a gamepad button is NOT being pressed + +- Success return bool + +--- + +> button = RL.GetGamepadButtonPressed() + +Get the last gamepad button pressed + +- Success return int + +--- + +> count = RL.GetGamepadAxisCount( int gamepad ) + +Return gamepad axis count for a gamepad + +- Success return int + +--- + +> value = RL.GetGamepadAxisMovement( int gamepad, int axis ) + +Return axis movement value for a gamepad axis + +- Success return float + +--- + +> result = RL.SetGamepadMappings( string mappings ) + +Set internal gamepad mappings (SDL_GameControllerDB) + +- Success return int + +--- + +> RL.SetGamepadVibration( int gamepad, float leftMotor, float rightMotor, float duration ) + +Set gamepad vibration for both motors (duration in seconds) + +--- + +## Core - Input-related functions: mouse + +--- + +> pressed = RL.IsMouseButtonPressed( int button ) + +Detect if a mouse button has been pressed once + +- Success return bool + +--- + +> pressed = RL.IsMouseButtonDown( int button ) + +Detect if a mouse button is being pressed + +- Success return bool + +--- + +> released = RL.IsMouseButtonReleased( int button ) + +Detect if a mouse button has been released once + +- Success return bool + +--- + +> released = RL.IsMouseButtonUp( int button ) + +Check if a mouse button is NOT being pressed + +- Success return bool + +--- + +> position = RL.GetMousePosition() + +Returns mouse position + +- Success return Vector2 + +--- + +> position = RL.GetMouseDelta() + +Get mouse delta between frames + +- Success return Vector2 + +--- + +> RL.SetMousePosition( Vector2 position ) + +Set mouse position XY + +--- + +> RL.SetMouseOffset( Vector2 offset ) + +Set mouse offset + +--- + +> RL.SetMouseScale( Vector2 scale ) + +Set mouse scaling + +--- + +> offset = RL.GetMouseOffset() + +Get mouse offset + +- Success return Vector2 + +--- + +> scale = RL.GetMouseScale() + +Get mouse scale + +- Success return Vector2 + +--- + +> movement = RL.GetMouseWheelMove() + +Get mouse wheel movement for X or Y, whichever is larger + +- Success return float + +--- + +> movement = RL.GetMouseWheelMoveV() + +Get mouse wheel movement for both X and Y + +- Success return Vector2 + +--- + +> RL.SetMouseCursor( int cursor ) + +Set mouse cursor + +--- + +## Core - Input-related functions: touch + +--- + +> position = RL.GetTouchPosition( int index ) + +Get touch position XY for a touch point index (relative to screen size) + +- Success return Vector2 + +--- + +> id = RL.GetTouchPointId( int index ) + +Get touch point identifier for given index + +- Success return int + +--- + +> count = RL.GetTouchPointCount() + +Get touch point identifier for given index + +- Success return int + +--- + +## Core - Input-related functions: gestures + +--- + +> RL.SetGesturesEnabled( unsigned int flags ) + +Enable a set of gestures using flags + +--- + +> detected = RL.IsGestureDetected( int gesture ) + +Check if a gesture have been detected + +- Success return bool + +--- + +> gesture = RL.GetGestureDetected() + +Get latest detected gesture + +- Success return int + +--- + +> time = RL.GetGestureHoldDuration() + +Get gesture hold time in milliseconds + +- Success return float + +--- + +> vector = RL.GetGestureDragVector() + +Get gesture drag vector + +- Success return Vector2 + +--- + +> angle = RL.GetGestureDragAngle() + +Get gesture drag angle + +- Success return float + +--- + +> vector = RL.GetGesturePinchVector() + +Get gesture pinch delta + +- Success return Vector2 + +--- + +> angle = RL.GetGesturePinchAngle() + +Get gesture pinch angle + +- Success return float + +--- + +## Core - Camera2D System functions + +--- + +> camera2D = RL.CreateCamera2D() + +Return camera2D set to default configuration + +- Success return Camera2D + +--- + +> RL.SetCamera2DTarget( camera2D camera, Vector2 target ) + +Set camera target (rotation and zoom origin) + +--- + +> RL.SetCamera2DOffset( camera2D camera, Vector2 offset ) + +Set camera offset (displacement from target) + +--- + +> RL.SetCamera2DRotation( camera2D camera, float rotation ) + +Set camera rotation in degrees + +--- + +> RL.SetCamera2DZoom( camera2D camera, float zoom ) + +Set camera zoom (scaling), should be 1.0f by default + +--- + +> target = RL.GetCamera2DTarget( camera2D camera ) + +Get camera2D target + +- Success return Vector2 + +--- + +> offset = RL.GetCamera2DOffset( camera2D camera ) + +Get camera2D offset + +- Success return Vector2 + +--- + +> rotation = RL.GetCamera2DRotation( camera2D camera ) + +Get camera2D rotation + +- Success return float + +--- + +> zoom = RL.GetCamera2DZoom( camera2D camera ) + +Get camera2D zoom + +- Success return float + +--- + +## Core - Camera3D System functions + +--- + +> camera = RL.CreateCamera3D() + +Return camera3D id set to default configuration + +- Success return int + +--- + +> RL.SetCamera3DPosition( camera3D camera, Vector3 position ) + +Set camera position (Remember to call "RL.UpdateCamera3D()" to apply changes) + +--- + +> RL.SetCamera3DTarget( camera3D camera, Vector3 target ) + +Set camera target it looks-at + +--- + +> RL.SetCamera3DUp( camera3D camera, Vector3 up ) + +Set camera up vector (Rotation over it's axis) + +--- + +> RL.SetCamera3DFovy( camera3D camera, float fovy ) + +Set camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + +--- + +> RL.SetCamera3DProjection( camera3D camera, int projection ) + +Set camera projection mode (CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC) + +--- + +> position = RL.GetCamera3DPosition( camera3D camera ) + +Get camera position + +- Success return Vector3 + +--- + +> target = RL.GetCamera3DTarget( camera3D camera ) + +Get camera target it looks-at + +- Success return Vector3 + +--- + +> up = RL.GetCamera3DUp( camera3D camera ) + +Get camera up vector (Rotation over it's axis) + +- Success return Vector3 + +--- + +> fovy = RL.GetCamera3DFovy( camera3D camera ) + +Get camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + +- Success return float + +--- + +> projection = RL.GetCamera3DProjection( camera3D camera ) + +Get camera projection mode + +- Success return int + +--- + +> forward = RL.GetCamera3DForward( camera3D camera ) + +Returns the cameras forward vector (normalized) + +- Success return Vector3 + +--- + +> up = RL.GetCamera3DUpNormalized( camera3D camera ) + +Returns the cameras up vector (normalized) +Note: The up vector might not be perpendicular to the forward vector + +- Success return Vector3 + +--- + +> right = RL.GetCamera3DRight( camera3D camera ) + +Returns the cameras right vector (normalized) + +- Success return Vector3 + +--- + +> RL.Camera3DMoveForward( camera3D camera, float distance, bool moveInWorldPlane ) + +Moves the camera in it's forward direction + +--- + +> RL.Camera3DMoveUp( camera3D camera, float distance ) + +Moves the camera in it's up direction + +--- + +> RL.Camera3DMoveRight( camera3D camera, float distance, bool moveInWorldPlane ) + +Moves the camera target in it's current right direction + +--- + +> RL.Camera3DMoveToTarget( camera3D camera, float delta ) + +Moves the camera position closer/farther to/from the camera target + +--- + +> RL.Camera3DYaw( camera3D camera, float angle, bool rotateAroundTarget ) + +Rotates the camera around it's up vector +Yaw is "looking left and right" +If rotateAroundTarget is false, the camera rotates around it's position +Note: angle must be provided in radians + +--- + +> RL.Camera3DPitch( camera3D camera, float angle, bool lockView, bool rotateAroundTarget, bool rotateUp ) + +Rotates the camera around it's right vector, pitch is "looking up and down" +- lockView prevents camera overrotation (aka "somersaults") +- rotateAroundTarget defines if rotation is around target or around it's position +- rotateUp rotates the up direction as well (typically only usefull in CAMERA_FREE) +NOTE: angle must be provided in radians + +--- + +> RL.Camera3DRoll( camera3D camera, float angle ) + +Rotates the camera around it's forward vector +Roll is "turning your head sideways to the left or right" +Note: angle must be provided in radians + +--- + +> view = RL.GetCamera3DViewMatrix( camera3D camera ) + +Returns the camera view matrix + +- Success return Matrix + +--- + +> projection = RL.GetCamera3DProjectionMatrix( camera3D camera, float aspect ) + +Returns the camera projection matrix + +- Success return Matrix + +--- + +> RL.UpdateCamera3D( camera3D camera, int mode ) + +Update camera position for selected mode + +--- + +> RL.UpdateCamera3DPro( camera3D camera, Vector3 movement, Vector3 rotation, float zoom ) + +Update camera movement, movement/rotation values should be provided by user + +--- + +## Core - Buffer management functions + +--- + +> buffer = RL.LoadBuffer( data{} buffer, int type ) + +Load Buffer. Type should be one of the Buffer types. Empty buffer will set data to NULL. + +- Success return Buffer + +--- + +> buffer = RL.LoadBufferFormatted( int length, int type, int value ) + +Load formatted buffer with all values set to 'value' + +- Success return Buffer + +--- + +> buffer = RL.LoadBufferFromFile( string path, int type ) + +Read buffer data from binary file + +- Failure return nil +- Success return Buffer + +--- + +> buffer = RL.LoadBufferFromString( string buffer ) + +Read buffer data from string + +- Failure return nil +- Success return Buffer + +--- + +> RL.UnloadBuffer( Buffer buffer ) + +Unload buffer data + +--- + +> RL.CopyBufferData( Buffer dst, Buffer src, int posDst, int posSrc, int size ) + +Copy buffer data to another buffer. Size is in bytes + +--- + +> RL.SetBufferData( Buffer buffer, int position, any{} values ) + +Set buffer data value + +--- + +> RL.SwapBufferEndianness( Buffer buffer ) + +Swap buffer endianness from big endian to little endian and vice versa + +--- + +> data = RL.GetBufferData( Buffer buffer, int position, int length ) + +Get buffer data as table in the format it was stored + +- Success return data{} + +--- + +> string = RL.GetBufferAsString( Buffer buffer ) + +Get buffer as string + +- Success return string + +--- + +> type = RL.GetBufferType( Buffer buffer ) + +Get buffer type + +- Success return int + +--- + +> size = RL.GetBufferSize( Buffer buffer ) + +Get buffer size in bytes + +- Success return int + +--- + +> size = RL.GetBufferElementSize( Buffer buffer ) + +Get buffer element size in bytes + +- Success return int + +--- + +> length = RL.GetBufferLength( Buffer buffer ) + +Get buffer element count + +- Success return int + +--- + +> RL.ExportBuffer( Buffer buffer, string path ) + +Write buffer data to binary file + +--- + +## Shapes - Basic shapes drawing functions + +--- + +> RL.SetShapesTexture( Texture texture, Rectangle source ) + +Set texture and rectangle to be used on shapes drawing +NOTE: It can be useful when using basic shapes and one single font, +defining a font char white rectangle would allow drawing everything in a single draw call + +--- + +> texture = RL.GetShapesTexture() + +Get texture that is used for shapes drawing. Return as lightuserdata + +- Success return Texture + +--- + +> source = RL.GetShapesTextureRectangle() + +Get texture source rectangle that is used for shapes drawing + +- Success return Rectangle + +--- + +> RL.DrawPixel( Vector2 pos, Color color ) + +Draw a pixel + +--- + +> RL.DrawLine( Vector2 startPos, Vector2 endPos, float thickness, Color color ) + +Draw a line defining thickness + +--- + +> RL.DrawLineStrip( Vector2{} points, Color color ) + +Draw lines sequence + +--- + +> RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color ) + +Draw a line using cubic-bezier curves in-out + +--- + +> RL.DrawCircle( Vector2 center, float radius, Color color ) + +Draw a color-filled circle + +--- + +> RL.DrawCircleSector( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color ) + +Draw a piece of a circle + +--- + +> RL.DrawCircleSectorLines( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color ) + +Draw circle sector outline + +--- + +> RL.DrawCircleGradient( Vector2 center, float radius, Color color1, Color color2 ) + +Draw a gradient-filled circle + +--- + +> RL.DrawCircleLines( Vector2 center, float radius, Color color ) + +Draw circle outline + +--- + +> RL.DrawEllipse( Vector2 center, float radiusH, float radiusV, Color color ) + +Draw ellipse + +--- + +> RL.DrawEllipseLines( Vector2 center, float radiusH, float radiusV, Color color ) + +Draw ellipse outline + +--- + +> RL.DrawRing( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color ) + +Draw ring + +--- + +> RL.DrawRingLines( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color ) + +Draw ring outline + +--- + +> RL.DrawRectangle( Rectangle rec, Color color ) + +Draw a color-filled rectangle + +--- + +> RL.DrawRectanglePro( Rectangle rec, Vector2 origin, float rotation, Color color ) + +Draw a color-filled rectangle with pro parameters + +--- + +> RL.DrawRectangleGradientV( Rectangle rectangle, Color color1, Color color2 ) + +Draw a vertical-gradient-filled rectangle + +--- + +> RL.DrawRectangleGradientH( Rectangle rectangle, Color color1, Color color2 ) + +Draw a horizontal-gradient-filled rectangle + +--- + +> RL.DrawRectangleGradientEx( Rectangle rectangle, Color col1, Color col2, Color col3, Color col4 ) + +Draw a gradient-filled rectangle with custom vertex colors + +--- + +> RL.DrawRectangleLines( Rectangle rec, Color color ) + +Draw rectangle outline + +--- + +> RL.DrawRectangleLinesEx( Rectangle rec, int lineThick, Color color ) + +Draw rectangle outline with extended parameters + +--- + +> RL.DrawRectangleRounded( Rectangle rec, float roundness, int segments, Color color ) + +Draw rectangle with rounded edges + +--- + +> RL.DrawRectangleRoundedLines( Rectangle rec, float roundness, int segments, Color color ) + +Draw rectangle lines with rounded edges + +--- + +> RL.DrawRectangleRoundedLinesEx( Rectangle rec, float roundness, int segments, float lineThick, Color color ) + +Draw rectangle with rounded edges outline + +--- + +> RL.DrawTriangle( Vector2 v1, Vector2 v2, Vector2 v3, Color color ) + +Draw a color-filled triangle (Vertex in counter-clockwise order!) + +--- + +> RL.DrawTriangleLines( Vector2 v1, Vector2 v2, Vector2 v3, Color color ) + +Draw triangle outline (Vertex in counter-clockwise order!) + +--- + +> RL.DrawTriangleFan( Vector2{} points, Color color ) + +Draw a triangle fan defined by points (first vertex is the center) + +--- + +> RL.DrawTriangleStrip( Vector2{} points, Color color ) + +Draw a triangle strip defined by points + +--- + +> RL.DrawPoly( Vector2 center, int sides, float radius, float rotation, Color color ) + +Draw a regular polygon (Vector version) + +--- + +> RL.DrawPolyLines( Vector2 center, int sides, float radius, float rotation, Color color ) + +Draw a polygon outline of n sides + +--- + +> RL.DrawPolyLinesEx( Vector2 center, int sides, float radius, float rotation, float lineThick, Color color ) + +Draw a polygon outline of n sides with extended parameters + +--- + +## Shapes - Splines drawing functions + +--- + +> RL.DrawSplineLinear( Vector2{} points, float thick, Color color ) + +Draw spline: Linear, minimum 2 points + +--- + +> RL.DrawSplineBasis( Vector2{} points, float thick, Color color ) + +Draw spline: B-Spline, minimum 4 points + +--- + +> RL.DrawSplineCatmullRom( Vector2{} points, float thick, Color color ) + +Draw spline: Catmull-Rom, minimum 4 points + +--- + +> RL.DrawSplineBezierQuadratic( Vector2{} points, float thick, Color color ) + +Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] + +--- + +> RL.DrawSplineBezierCubic( Vector2{} points, float thick, Color color ) + +Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] + +--- + +> RL.DrawSplineSegmentLinear( Vector2 p1, Vector2 p2, float thick, Color color ) + +Draw spline segment: Linear, 2 points + +--- + +> RL.DrawSplineSegmentBasis( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color ) + +Draw spline segment: B-Spline, 4 points + +--- + +> RL.DrawSplineSegmentCatmullRom( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color ) + +Draw spline segment: Catmull-Rom, 4 points + +--- + +> RL.DrawSplineSegmentBezierQuadratic( Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color ) + +Draw spline segment: Quadratic Bezier, 2 points, 1 control point + +--- + +> RL.DrawSplineSegmentBezierCubic( Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color ) + +Draw spline segment: Cubic Bezier, 2 points, 2 control points + +--- + +## Shapes - Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] + +--- + +> point = RL.GetSplinePointLinear( Vector2 startPos, Vector2 endPos, float t ) + +Get (evaluate) spline point: Linear + +- Success return Vector2 + +--- + +> point = RL.GetSplinePointBasis( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t ) + +Get (evaluate) spline point: B-Spline + +- Success return Vector2 + +--- + +> point = RL.GetSplinePointCatmullRom( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t ) + +Get (evaluate) spline point: Catmull-Rom + +- Success return Vector2 + +--- + +> point = RL.GetSplinePointBezierQuad( Vector2 p1, Vector2 c2, Vector2 p3, float t ) + +Get (evaluate) spline point: Quadratic Bezier + +- Success return Vector2 + +--- + +> point = RL.GetSplinePointBezierCubic( Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t ) + +Get (evaluate) spline point: Cubic Bezier + +- Success return Vector2 + +--- + +## Shapes - Basic shapes collision detection functions + +--- + +> collision = RL.CheckCollisionRecs( Rectangle rec1, Rectangle rec2 ) + +Check collision between two rectangles + +- Success return bool + +--- + +> collision = RL.CheckCollisionCircles( Vector2 center1, float radius1, Vector2 center2, float radius2 ) + +Check collision between two circles + +- Success return bool + +--- + +> collision = RL.CheckCollisionCircleRec( Vector2 center, float radius, Rectangle rec ) + +Check collision between circle and rectangle + +- Success return bool + +--- + +> collision = RL.CheckCollisionCircleLine( Vector2 center, float radius, Vector2 p1, Vector2 p2 ) + +Check if circle collides with a line created betweeen two points [p1] and [p2] + +- Success return bool + +--- + +> collision = RL.CheckCollisionPointRec( Vector2 point, Rectangle rec ) + +Check if point is inside rectangle + +- Success return bool + +--- + +> collision = RL.CheckCollisionPointCircle( Vector2 point, Vector2 center, float radius ) + +Check if point is inside circle + +- Success return bool + +--- + +> collision = RL.CheckCollisionPointTriangle( Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3 ) + +Check if point is inside a triangle + +- Success return bool + +--- + +> collision = RL.CheckCollisionPointPoly( Vector2 point, Vector2{} points ) + +Check if point is within a polygon described by array of vertices + +- Success return bool + +--- + +> collision, position = RL.CheckCollisionLines( Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2 ) + +Check the collision between two lines defined by two points each, returns collision point by reference + +- Success return bool, Vector2 + +--- + +> collision = RL.CheckCollisionPointLine( Vector2 point, Vector2 p1, Vector2 p2, int threshold ) + +Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] + +- Success return bool + +--- + +> rectangle = RL.GetCollisionRec( Rectangle rec1, Rectangle rec2 ) + +Get collision rectangle for two rectangles collision + +- Success return Rectangle + +--- + +> rects{} = RL.RectPack( Rectangle{} rects, Vector2 size, int padding ) + +Useful for e.g. packing rectangular textures into an atlas. stbrp_pack_rects + +- Success return Rectangle{} + +--- + +## Textures - Image loading functions + +--- + +> image = RL.LoadImage( string fileName ) + +Load image from file into CPU memory (RAM) + +- Failure return nil +- Success return Image + +--- + +> image = RL.LoadImageRaw( string fileName, Vector2 size, int format, int headerSize ) + +Load image from RAW file data + +- Failure return nil +- Success return Image + +--- + +> image, frameCount = RL.LoadImageAnim( string fileName ) + +Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format + +- Failure return nil +- Success return Image, int + +--- + +> image, frameCount = RL.LoadImageAnimFromMemory( string fileType, Buffer fileData ) + +Load image sequence from memory buffer. All frames are returned in RGBA format + +- Success return Image, int + +--- + +> image, frameCount = RL.LoadImageFromMemory( string fileType, Buffer data ) + +Load image from memory buffer, fileType refers to extension: i.e. '.png' + +- Success return Image + +--- + +> image, frameCount = RL.LoadImageFromData( Buffer data, Vector2 size, int mipmaps, int format ) + +Load image from data + +- Success return Image + +--- + +> image = RL.LoadImageFromTexture( Texture texture ) + +Load image from GPU texture data + +- Success return Image + +--- + +> image = RL.LoadImageFromScreen() + +Load image from screen buffer and (screenshot) + +- Success return Image + +--- + +> isValid = RL.IsImageValid( Image image ) + +Check if an image is valid (data and parameters) + +- Success return bool + +--- + +> RL.UnloadImage( Image image ) + +Unload image from CPU memory (RAM) + +--- + +> success = RL.ExportImage( Image image, string fileName ) + +Export image data to file, returns true on success + +- Success return bool + +--- + +> buffer = RL.ExportImageToMemory( Image image, string fileType ) + +Export image to memory buffer + +- Success return Buffer + +--- + +> success = RL.ExportImageAsCode( Image image, string fileName ) + +Export image as code file defining an array of bytes, returns true on success + +- Success return bool + +--- + +## Textures - Image generation functions + +--- + +> image = RL.GenImageColor( Vector2 size, Color color ) + +Generate image: plain color + +- Success return Image + +--- + +> image = RL.GenImageGradientLinear( Vector2 size, int direction, Color a, Color b ) + +Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient + +- Success return Image + +--- + +> image = RL.GenImageGradientRadial( Vector2 size, float density, Color inner, Color outer ) + +Generate image: radial gradient + +- Success return Image + +--- + +> image = RL.GenImageGradientSquare( Vector2 size, float density, Color inner, Color outer ) + +Generate image: square gradient + +- Success return Image + +--- + +> image = RL.GenImageChecked( Vector2 size, Vector2 checks, Color col1, Color col2 ) + +Generate image: checked + +- Success return Image + +--- + +> image = RL.GenImageWhiteNoise( Vector2 size, float factor ) + +Generate image: white noise + +- Success return Image + +--- + +> image = RL.GenImagePerlinNoise( Vector2 size, Vector2 offset, float factor ) + +Generate image: perlin noise + +- Success return Image + +--- + +> image = RL.GenImageCellular( Vector2 size, int tileSize ) + +Generate image: cellular algorithm. Bigger tileSize means bigger cells + +- Success return Image + +--- + +> image = RL.GenImageText( Vector2 size, string text ) + +Generate image: grayscale image from text data + +- Success return Image + +--- + +## Textures - Image manipulation functions + +--- + +> image = RL.ImageCopy( Image image ) + +Create an image duplicate (useful for transformations) + +- Success return Image + +--- + +> image = RL.ImageFromImage( Image image, Rectangle rec ) + +Create an image from another image piece + +- Success return Image + +--- + +> image = RL.ImageFromChannel( Image image, int selectedChannel ) + +Create an image from a selected channel of another image (GRAYSCALE) + +- Success return Image + +--- + +> image = RL.ImageText( string text, int fontSize, Color tint ) + +Create an image from text (default font) + +- Success return Image + +--- + +> image = RL.ImageTextEx( Font font, string text, float fontSize, float spacing, Color tint ) + +Create an image from text (custom sprite font) + +- Success return Image + +--- + +> RL.ImageFormat( Image image, int newFormat ) + +Convert image data to desired format + +--- + +> RL.ImageToPOT( Image image, Color fill ) + +Convert image to POT (power-of-two) + +--- + +> RL.ImageCrop( Image image, Rectangle crop ) + +Crop an image to a defined rectangle + +--- + +> RL.ImageAlphaCrop( Image image, float threshold ) + +Crop image depending on alpha value + +--- + +> RL.ImageAlphaClear( Image image, Color color, float threshold ) + +Clear alpha channel to desired color + +--- + +> RL.ImageAlphaMask( Image image, Image alphaMask ) + +Apply alpha mask to image + +--- + +> RL.ImageAlphaPremultiply( Image image ) + +Premultiply alpha channel + +--- + +> RL.ImageBlurGaussian( Image image, int blurSize ) + +Apply Gaussian blur using a box blur approximation + +--- + +> RL.ImageKernelConvolution( Image image, float{} kernel ) + +Apply custom square convolution kernel to image + +--- + +> RL.ImageResize( Image image, Vector2 size ) + +Resize image (Bicubic scaling algorithm) + +--- + +> RL.ImageResizeNN( Image image, Vector2 size ) + +Resize image (Nearest-Neighbor scaling algorithm) + +--- + +> RL.ImageResizeCanvas( Image image, Vector2 size, Vector2 offset, Color fill ) + +Resize canvas and fill with color + +--- + +> RL.ImageMipmaps( Image image ) + +Generate all mipmap levels for a provided image + +--- + +> RL.ImageDither( Image image, Color bpp ) + +Dither image data to 16bpp or lower (Floyd-Steinberg dithering) + +--- + +> RL.ImageFlipVertical( Image image ) + +Flip image vertically + +--- + +> RL.ImageFlipHorizontal( Image image ) + +Flip image horizontally + +--- + +> RL.ImageRotate( Image image, int degrees ) + +Rotate image by input angle in degrees (-359 to 359) + +--- + +> RL.ImageRotateCW( Image image ) + +Rotate image clockwise 90deg + +--- + +> RL.ImageRotateCCW( Image image ) + +Rotate image counter-clockwise 90deg + +--- + +> RL.ImageColorTint( Image image, Color color ) + +Modify image color: tint + +--- + +> RL.ImageColorInvert( Image image ) + +Modify image color: invert + +--- + +> RL.ImageColorGrayscale( Image image ) + +Modify image color: grayscale + +--- + +> RL.ImageColorContrast( Image image, float contrast ) + +Modify image color: contrast (-100 to 100) + +--- + +> RL.ImageColorBrightness( Image image, int brightness ) + +Modify image color: brightness (-255 to 255) + +--- + +> RL.ImageColorReplace( Image image, Color color, Color replace ) + +Modify image color: replace color + +--- + +> colors = RL.LoadImageColors( Image image ) + +Load color data from image as a Color array (RGBA - 32bit) + +- Success return Color{} + +--- + +> colors = RL.LoadImagePalette( Image image, int maxPaletteSize ) + +Load colors palette from image as a Color array (RGBA - 32bit) + +- Success return Color{} + +--- + +> rectangle = RL.GetImageAlphaBorder( Image image, float threshold ) + +Get image alpha border rectangle + +- Success return Rectangle + +--- + +> color = RL.GetImageColor( Image image, Vector2 pixelPos ) + +Get image pixel color at (x, y) position + +- Success return Color + +--- + +## Textures - Image configuration functions + +--- + +> RL.SetImageData( Image image, Buffer data ) + +Set image data from Buffer + +--- + +> imageData = RL.GetImageData( Image image ) + +Get image data as Buffer + +- Success return Buffer + +--- + +> size = RL.GetImageSize( Image image ) + +Get image size + +- Success return Vector2 + +--- + +> mipmaps = RL.GetImageMipmaps( Image image ) + +Get image mipmaps. Mipmap levels, 1 by default + +- Success return int + +--- + +> format = RL.GetImageFormat( Image image ) + +Get image data format (PixelFormat type) + +- Success return int + +--- + +## Textures - Image drawing functions + +--- + +> RL.ImageClearBackground( Image dst, Color color ) + +Clear image background with given color + +--- + +> RL.ImageDrawPixel( Image dst, Vector2 position, Color color ) + +Draw pixel within an image + +--- + +> RL.ImageDrawLine( Image dst, Vector2 start, Vector2 end, Color color ) + +Draw line within an image + +--- + +> RL.ImageDrawLineEx( Image dst, Vector2 start, Vector2 end, int thick, Color color ) + +Draw a line defining thickness within an image + +--- + +> RL.ImageDrawCircle( Image dst, Vector2 center, int radius, Color color ) + +Draw circle within an image + +--- + +> RL.ImageDrawCircleLines( Image dst, Vector2 center, int radius, Color color ) + +Draw circle outline within an image + +--- + +> RL.ImageDrawRectangle( Image dst, Rectangle rec, Color color ) + +Draw rectangle within an image + +--- + +> RL.ImageDrawRectangleLines( Image dst, Rectangle rec, int thick, Color color ) + +Draw rectangle lines within an image + +--- + +> RL.ImageDrawTriangle( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color ) + +Draw triangle within an image + +--- + +> RL.ImageDrawTriangleEx( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3 ) + +Draw triangle with interpolated colors within an image + +--- + +> RL.ImageDrawTriangleLines( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color ) + +Draw triangle outline within an image + +--- + +> RL.ImageDrawTriangleFan( Image dst, Vector2{} points, Color color ) + +Draw a triangle fan defined by points within an image (first vertex is the center) + +--- + +> RL.ImageDrawTriangleStrip( Image dst, Vector2{} points, Color color ) + +Draw a triangle strip defined by points within an image + +--- + +> RL.ImageDraw( Image dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint ) + +Draw a source image within a destination image (Tint applied to source) + +--- + +> RL.ImageDrawText( Image dst, string text, Vector2 position, float fontSize, Color tint ) + +Draw text (using default font) within an image (destination) + +--- + +> RL.ImageDrawTextEx( Image dst, Font font, string text, Vector2 position, float fontSize, float spacing, Color tint ) + +Draw text (Custom sprite font) within an image (Destination) + +--- + +## Textures - Texture loading functions + +--- + +> texture = RL.GetTextureDefault() + +Get default texture. Return as lightuserdata + +- Success return Texture + +--- + +> texture = RL.LoadTexture( string fileName ) + +Load texture from file into GPU memory ( VRAM ) + +- Failure return nil +- Success return Texture + +--- + +> texture = RL.LoadTextureFromImage( Image image ) + +Load texture from image data + +- Success return Texture + +--- + +> texture = RL.LoadTextureCubemap( Image image, int layout ) + +Load cubemap from image, multiple image cubemap layouts supported + +- Success return Texture + +--- + +> texture = RL.LoadTextureFromData( Texture{} textureData ) + +Load Texture from data + +- Success return Texture + +--- + +> renderTexture = RL.LoadRenderTexture( Vector2 size ) + +Load texture for rendering (framebuffer) + +- Success return RenderTexture + +--- + +> renderTexture = RL.LoadRenderTextureFromData( Texture{} renderTextureData ) + +Load RenderTexture from data (framebuffer) + +- Success return RenderTexture + +--- + +> isValid = RL.IsTextureValid( Texture texture ) + +Check if a texture is valid (loaded in GPU) + +- Success return bool + +--- + +> RL.UnloadTexture( Texture texture ) + +Unload texture from GPU memory (VRAM) + +--- + +> isValid = RL.IsRenderTextureValid( RenderTexture target ) + +Check if a render texture is valid (loaded in GPU) + +- Success return bool + +--- + +> RL.UnloadRenderTexture( RenderTexture target ) + +Unload render texture from GPU memory (VRAM) + +--- + +> RL.UpdateTexture( Texture texture, Buffer pixels ) + +Update GPU texture with new data + +--- + +> RL.UpdateTextureRec( Texture texture, Rectangle rec, Buffer pixels ) + +Update GPU texture rectangle with new data. + +--- + +## Textures - Texture configuration functions + +--- + +> RL.GenTextureMipmaps( Texture texture ) + +Generate GPU mipmaps for a texture + +--- + +> RL.SetTextureFilter( Texture texture, int filter ) + +Set texture scaling filter mode (TEXTURE_FILTER_POINT, TEXTURE_FILTER_BILINEAR...) + +--- + +> RL.SetTextureWrap( Texture texture, int wrap ) + +Set texture wrapping mode (TEXTURE_WRAP_REPEAT, TEXTURE_WRAP_CLAMP...) + +--- + +> id = RL.GetTextureId( Texture texture ) + +Get OpenGL texture id + +- Success return int + +--- + +> size = RL.GetTextureSize( Texture texture ) + +Get texture size + +- Success return Vector2 + +--- + +> mipmaps = RL.GetTextureMipmaps( Texture texture ) + +Get texture mipmaps. Mipmap levels, 1 by default + +- Success return int + +--- + +> format = RL.GetTextureFormat( Texture texture ) + +Get texture data format (PixelFormat type) + +- Success return int + +--- + +## Textures - Texture drawing functions + +--- + +> RL.DrawTexture( Texture texture, Vector2 position, Color tint ) + +Draw a Texture2D + +--- + +> RL.DrawTextureEx( Texture texture, Vector2 position, float rotation, float scale, Color tint ) + +Draw a Texture2D with extended parameters + +--- + +> RL.DrawTextureRec( Texture texture, Rectangle source, Vector2 position, Color tint ) + +Draw a part of a texture defined by a rectangle + +--- + +> RL.DrawTexturePro( Texture texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint ) + +Draw a part of a texture defined by a rectangle with "pro" parameters + +--- + +> RL.DrawTextureNPatch( Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint ) + +Draws a texture (or part of it) that stretches or shrinks nicely + +--- + +> RL.DrawTextureNPatchRepeat( Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint ) + +Draws a texture (or part of it) that repeats nicely + +--- + +## Textures - RenderTexture configuration functions + +--- + +> id = RL.GetRenderTextureId( RenderTexture renderTexture ) + +Get OpenGL framebuffer object id + +- Success return int + +--- + +> texture = RL.GetRenderTextureTexture( RenderTexture renderTexture ) + +Get color buffer attachment texture. Returns as lightuserdata + +- Success return Texture + +--- + +> texture = RL.GetRenderTextureDepthTexture( RenderTexture renderTexture ) + +Get depth buffer attachment texture. Returns as lightuserdata + +- Success return Texture + +--- + +## Textures - Color/pixel related functions + +--- + +> isEqual = RL.ColorIsEqual( Color col1, Color col2 ) + +Check if two colors are equal + +- Success return bool + +--- + +> color = RL.Fade( Color color, float alpha ) + +Returns color with alpha applied, alpha goes from 0.0f to 1.0f + +- Success return Color + +--- + +> value = RL.ColorToInt( Color color ) + +Returns hexadecimal value for a Color + +- Success return int + +--- + +> color = RL.ColorNormalize( Color color ) + +Returns Color normalized as float [0..1] + +- Success return Vector4 + +--- + +> color = RL.ColorFromNormalized( Vector4 normalized ) + +Color from normalized values [0..1] + +- Success return Color + +--- + +> HSV = RL.ColorToHSV( Color color ) + +Returns HSV values for a Color, hue [0..360], saturation/value [0..1] + +- Success return Vector3 + +--- + +> color = RL.ColorFromHSV( float hue, float saturation, float value ) + +Returns a Color from HSV values, hue [0..360], saturation/value [0..1] + +- Success return Color + +--- + +> color = RL.ColorTint( Color color, Color tint ) + +Get color multiplied with another color + +- Success return Color + +--- + +> color = RL.ColorBrightness( Color color, float factor ) + +Get color with brightness correction, brightness factor goes from -1.0f to 1.0f + +- Success return Color + +--- + +> color = RL.ColorContrast( Color color, float contrast ) + +Get color with contrast correction, contrast values between -1.0f and 1.0f + +- Success return Color + +--- + +> color = RL.ColorAlpha( Color color, float alpha ) + +Returns color with alpha applied, alpha goes from 0.0f to 1.0f + +- Success return Color + +--- + +> color = RL.ColorAlphaBlend( Color dst, Color src, Color tint ) + +Returns src alpha-blended into dst color with tint + +- Success return Color + +--- + +> color = RL.ColorLerp( Color color1, Color color2, float factor ) + +Get color lerp interpolation between two colors, factor [0.0f..1.0f] + +- Success return Color + +--- + +> color = RL.GetColor( int hexValue ) + +Get Color structure from hexadecimal value + +- Success return Color + +--- + +> size = RL.GetPixelDataSize( Vector2 size, int format ) + +Get pixel data size in bytes for certain format + +- Success return int + +--- + +## Text - Font loading/unloading functions + +--- + +> font = RL.GetFontDefault() + +Get the default Font. Return as lightuserdata + +- Success return Font + +--- + +> font = RL.LoadFont( string fileName ) + +Load font from file into GPU memory (VRAM) + +- Failure return nil +- Success return Font + +--- + +> font = RL.LoadFontEx( string fileName, int fontSize, int{}|nil codepoints ) + +Load font from file with extended parameters, use NULL for codepoints to load the default character set + +- Failure return nil +- Success return Font + +--- + +> font = RL.LoadFontFromImage( Image image, Color key, int firstChar ) + +Load font from Image (XNA style) + +- Success return Font + +--- + +> font = RL.LoadFontFromMemory( string fileType, Buffer fileData, int fontSize, int{} codepoints ) + +Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. NOTE: fileData type should be unsigned char + +- Success return Font + +--- + +> font = RL.LoadFontFromData( Font{} fontData ) + +Load Font from data + +- Success return Font + +--- + +> font = RL.FontCopy( Font font ) + +Load font copy as new userdata + +- Success return Font + +--- + +> isValid = RL.IsFontValid( Font font ) + +Check if a font is valid (font data loaded, WARNING: GPU texture not checked) + +- Success return bool + +--- + +> glyphs = RL.LoadFontData( Buffer fileData, int fontSize, int{} codepoints, int type ) + +Load font data for further use. NOTE: fileData type should be unsigned char + +- Success return GlyphInfo{} + +--- + +> image, rectangles = RL.GenImageFontAtlas( GlyphInfo{} glyphs, int fontSize, int padding, int packMethod ) + +Generate image font atlas using chars info. NOTE: Packing method: 0-Default, 1-Skyline + +- Success Image, Rectangle{} + +--- + +> RL.UnloadFont( Font font ) + +Unload font from GPU memory (VRAM) + +--- + +> RL.ExportFontAsCode( Font font, string fileName ) + +Export font as code file, returns true on success + +- Success return bool + +--- + +## Text - Text drawing functions + +--- + +> RL.DrawFPS( Vector2 pos ) + +Draw current FPS + +--- + +> RL.DrawText( string text, Vector2 position, float fontSize, Color tint ) + +Draw text (using default font) + +--- + +> RL.DrawTextEx( Font font, string text, Vector2 position, float fontSize, float spacing, Color tint ) + +Draw text using font and additional parameters + +--- + +> RL.DrawTextPro( Font font, string text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint ) + +Draw text using Font and pro parameters (rotation) + +--- + +> RL.DrawTextCodepoint( Font font, int codepoint, Vector2 position, float fontSize, Color tint ) + +Draw one character (codepoint) + +--- + +> RL.DrawTextCodepoints( Font font, int{} codepoints, Vector2 position, float fontSize, float spacing, Color tint ) + +Draw multiple character (codepoint) + +--- + +> mouseCharId, textOffset = RL.DrawTextBoxed( Font font, string text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, bool limitHeight, Vector2|nil textOffset, int|nil tabSize ) + +Draw text inside rectangle limits. Return character id from mouse position (default 0). +textOffset can be used to set start position inside rectangle. Usefull to pass from previous +DrawTextBoxed for continuous text. +Support for tint change with "\a#FFFFFFFF" + +- Success return int, Vector2 + +--- + +## Text - Text font info functions + +--- + +> RL.SetTextLineSpacing( int spacing ) + +Set vertical line spacing when drawing with line-breaks + +--- + +> spacing = RL.GetTextLineSpacing() + +Get vertical line spacing when drawing with line-breaks + +- Success return int + +--- + +> width = RL.MeasureText( string text, int fontSize ) + +Measure string width for default font + +- Success return int + +--- + +> size = RL.MeasureTextEx( Font font, string text, float fontSize, float spacing ) + +Measure string size for Font + +- Success return Vector2 + +--- + +> size, textOffset = RL.MeasureTextBoxed( Font font, string text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, bool limitHeight, Vector2 textOffset, int|nil tabSize ) + +Measure text inside rectangle limits. + +- Success return Vector2, Vector2 + +--- + +> index = RL.GetGlyphIndex( Font font, int codepoint ) + +Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found + +- Success return int + +--- + +> glyphInfo = RL.GetGlyphInfo( Font font, int codepoint ) + +Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found. Return as lightuserdata + +- Success return GlyphInfo + +--- + +> glyphInfo = RL.GetGlyphInfoByIndex( Font font, int index ) + +Get glyph font info data by index. Return as lightuserdata + +- Failure return nil +- Success return GlyphInfo + +--- + +> rect = RL.GetGlyphAtlasRec( Font font, int codepoint ) + +Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found + +- Success return Rectangle + +--- + +> rect = RL.GetGlyphAtlasRecByIndex( Font font, int index ) + +Get glyph rectangle in font atlas by index + +- Failure return nil +- Success return Rectangle + +--- + +> baseSize = RL.GetFontBaseSize( Font font ) + +Get font base size (default chars height) + +- Success return int + +--- + +> glyphCount = RL.GetFontGlyphCount( Font font ) + +Get font number of glyph characters + +- Success return int + +--- + +> glyphPadding = RL.GetFontGlyphPadding( Font font ) + +Get font padding around the glyph characters + +- Success return int + +--- + +> texture = RL.GetFontTexture( Font font ) + +Get font texture atlas containing the glyphs. Return as lightuserdata + +- Success return Texture + +--- + +## Text - GlyphInfo management functions + +--- + +> glyphInfo = RL.LoadGlyphInfo( GlyphInfo{} glyphInfoData ) + +Load GlyphInfo from data + +- Success return GlyphInfo + +--- + +> RL.UnloadGlyphInfo( GlyphInfo glyphInfo ) + +Unload glyphInfo image from CPU memory (RAM) + +--- + +> RL.SetGlyphInfoValue( GlyphInfo glyphInfo, int value ) + +Set glyphInfo character value (Unicode) + +--- + +> RL.SetGlyphInfoOffset( GlyphInfo glyphInfo, Vector2 offset ) + +Set glyphInfo character offset when drawing + +--- + +> RL.SetGlyphInfoAdvanceX( GlyphInfo glyphInfo, int advanceX ) + +Set glyphInfo character advance position X + +--- + +> RL.SetGlyphInfoImage( GlyphInfo glyphInfo, Image image ) + +Set glyphInfo character image data + +--- + +> value = RL.GetGlyphInfoValue( GlyphInfo glyphInfo ) + +Get glyphInfo character value (Unicode) + +- Success return int + +--- + +> offset = RL.GetGlyphInfoOffset( GlyphInfo glyphInfo ) + +Get glyphInfo character offset when drawing + +- Success return Vector2 + +--- + +> advanceX = RL.GetGlyphInfoAdvanceX( GlyphInfo glyphInfo ) + +Get glyphInfo character advance position X + +- Success return int + +--- + +> image = RL.GetGlyphInfoImage( GlyphInfo glyphInfo ) + +Get glyphInfo character image data. Return as lightuserdata + +- Success return Image + +--- + +## Text - Text codepoints management functions (unicode characters) + +--- + +> string = RL.LoadUTF8( int{} codepoints ) + +Load UTF-8 text encoded from codepoints array + +- Success return string + +--- + +> codepoints = RL.LoadCodepoints( string text ) + +Load all codepoints from a UTF-8 text string + +- Success return int{} + +--- + +> count = RL.GetCodepointCount( string text ) + +Get total number of codepoints in a UTF-8 encoded string + +- Success return int + +--- + +> codepoint, codepointSize = RL.GetCodepoint( string text, int position ) + +Get codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure + +- Success return int, int + +--- + +> codepoint, codepointSize = RL.GetCodepointNext( string text, int position ) + +Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure + +- Success return int, int + +--- + +> codepoint, codepointSize = RL.GetCodepointPrevious( string text, int position ) + +Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure + +- Success return int, int + +--- + +> string = RL.CodepointToUTF8( int codepoint ) + +Encode one codepoint into UTF-8 byte array + +- Success return string + +--- + +## Text - Text strings management functions (no UTF-8 strings, only byte chars) + +--- + +> text = RL.TextSubtext( string text, int position, int length ) + +Get a piece of a text string + +- Success return string + +--- + +> text = RL.TextReplace( string text, string replace, string by ) + +Replace text string + +- Success return string + +--- + +> text = RL.TextInsert( string text, string insert, int position ) + +Insert text in a specific position, moves all text forward + +- Success return string + +--- + +> splits = RL.TextSplit( string text, char delimiter ) + +Split text into multiple strings + +- Success return string{} + +--- + +> index = RL.TextFindIndex( string text, string find ) + +Find first text occurrence within a string + +- Success return int + +--- + +> text = RL.TextToPascal( string text ) + +Get Pascal case notation version of provided string + +- Success return string + +--- + +> text = RL.TextToSnake( string text ) + +Get Snake case notation version of provided string + +- Success return string + +--- + +> text = RL.TextToCamel( string text ) + +Get Camel case notation version of provided string + +- Success return string + +--- + +## Models - Basic geometric 3D shapes drawing functions + +--- + +> RL.DrawLine3D( Vector3 startPos, Vector3 endPos, Color color ) + +Draw a line in 3D world space + +--- + +> RL.DrawPoint3D( Vector3 position, Color color ) + +Draw a point in 3D space, actually a small line + +--- + +> RL.DrawCircle3D( Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color ) + +Draw a circle in 3D world space + +--- + +> RL.DrawTriangle3D( Vector3 v1, Vector3 v2, Vector3 v3, Color color ) + +Draw a color-filled triangle (Vertex in counter-clockwise order!) + +--- + +> RL.DrawTriangleStrip3D( Vector3{} points, Color color ) + +Draw a triangle strip defined by points + +--- + +> RL.DrawCube( Vector3 position, Vector3 size, Color color ) + +Draw cube + +--- + +> RL.DrawCubeWires( Vector3 position, Vector3 size, Color color ) + +Draw cube wires + +--- + +> RL.DrawSphere( Vector3 centerPos, float radius, Color color ) + +Draw sphere + +--- + +> RL.DrawSphereEx( Vector3 centerPos, float radius, int rings, int slices, Color color ) + +Draw sphere with extended parameters + +--- + +> RL.DrawSphereWires( Vector3 centerPos, float radius, int rings, int slices, Color color ) + +Draw sphere wires + +--- + +> RL.DrawCylinder( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color ) + +Draw a cylinder/cone + +--- + +> RL.DrawCylinderEx( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color ) + +Draw a cylinder with base at startPos and top at endPos + +--- + +> RL.DrawCylinderWires( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color ) + +Draw a cylinder/cone wires + +--- + +> RL.DrawCylinderWiresEx( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color ) + +Draw a cylinder wires with base at startPos and top at endPos + +--- + +> RL.DrawCapsule( Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color ) + +Draw a capsule with the center of its sphere caps at startPos and endPos + +--- + +> RL.DrawCapsuleWires( Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color ) + +Draw capsule wireframe with the center of its sphere caps at startPos and endPos + +--- + +> RL.DrawPlane( Vector3 centerPos, Vector2 size, Color color ) + +Draw a plane XZ + +--- + +> RL.DrawQuad3DTexture( Texture texture, Vector3{} vertices, Vector2{} texCoords, Color{} colors ) + +Draw 3D textured quad. (Texture coordinates opengl style 0.0 - 1.0) + +--- + +> RL.DrawRay( Ray ray, Color color ) + +Draw a ray line + +--- + +> RL.DrawGrid( int slices, float spacing ) + +Draw a grid (Centered at ( 0, 0, 0 )) + +--- + +> RL.DrawGridEx( Vector2 slices, Vector2 spacing, Matrix transform, Color color, Vector2|nil divider, Color|nil dividerColor ) + +Draw a grid with extended parameters. Optionally you can define divider with different color for every n slices + +--- + +## Models - Model management functions + +--- + +> model = RL.LoadModel( string fileName ) + +Load model from files (Meshes and materials) + +- Failure return nil +- Success return Model + +--- + +> model = RL.LoadModelFromMesh( Mesh mesh ) + +Load model from generated mesh (Default material) + +- Success return Model + +--- + +> isValid = RL.IsModelValid( Model model ) + +Check if a model is valid (loaded in GPU, VAO/VBOs) + +- Success return bool + +--- + +> RL.UnloadModel( Model model ) + +Unload model (meshes/materials) from memory (RAM and/or VRAM) + +--- + +> boundingBox = RL.GetModelBoundingBox( Model model ) + +Compute model bounding box limits (considers all meshes) + +- Success return BoundingBox + +--- + +> RL.SetModelTransform( Model model, Matrix transform ) + +Set model transform matrix + +--- + +> success = RL.SetModelMesh( Model model, int meshId, Mesh mesh ) + +Set model mesh. + +- Failure return false +- Success return true + +--- + +> success = RL.SetModelMaterial( Model model, int materialId, Material material ) + +Set material to model material + +- Failure return false +- Success return true + +--- + +> RL.SetModelMeshMaterial( Model model, int meshId, int materialId ) + +Set material for a mesh (Mesh and material on this model) + +--- + +> success = RL.SetModelBone( Model model, int boneId, BoneInfo bone ) + +Set model bone information (skeleton) + +- Failure return false +- Success return true + +--- + +> success = RL.SetModelBindPose( Model model, int boneId, Transform pose ) + +Set model bones base transformation (pose) + +- Failure return false +- Success return true + +--- + +> transform = RL.GetModelTransform( Model model ) + +Get model transform matrix + +- Success return Matrix + +--- + +> meshCount = RL.GetModelMeshCount( Model model ) + +Get model number of meshes + +- Success return int + +--- + +> meshCount = RL.GetModelMaterialCount( Model model ) + +Get model number of materials + +- Success return int + +--- + +> mesh = RL.GetModelMesh( Model model, int meshId ) + +Get model mesh. Return as lightuserdata + +- Failure return nil +- Success return Mesh + +--- + +> material = RL.GetModelMaterial( Model model, int materialId ) + +Get model material. Return as lightuserdata + +- Failure return nil +- Success return Material + +--- + +> boneCount = RL.GetModelBoneCount( Model model ) + +Get model number of bones + +- Success return int + +--- + +> bone = RL.GetModelBone( Model model, int boneId ) + +Get model bones information (skeleton) + +- Failure return nil +- Success return BoneInfo + +--- + +> pose = RL.GetModelBindPose( Model model, int boneId ) + +Get models bones base transformation (pose) + +- Failure return nil +- Success return Transform + +--- + +## Models - Model drawing functions + +--- + +> RL.DrawModel( Model model, Vector3 position, float scale, Color tint ) + +Draw a model (With texture if set) + +--- + +> RL.DrawModelEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) + +Draw a model with extended parameters + +--- + +> RL.DrawModelWires( Model model, Vector3 position, float scale, Color tint ) + +Draw a model wires (with texture if set) + +--- + +> RL.DrawModelWiresEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) + +Draw a model wires (with texture if set) with extended parameters + +--- + +> RL.DrawModelPoints( Model model, Vector3 position, float scale, Color tint ) + +Draw a model as points + +--- + +> RL.DrawModelPointsEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint ) + +Draw a model as points with extended parameters + +--- + +> RL.DrawBoundingBox( BoundingBox box, Color color ) + +Draw bounding box (wires) + +--- + +> RL.DrawBillboard( Camera3D camera, Texture texture, Vector3 position, float size, Color tint ) + +Draw a billboard texture + +--- + +> RL.DrawBillboardRec( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector2 size, Color tint ) + +Draw a billboard texture defined by source + +--- + +> RL.DrawBillboardPro( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint ) + +Draw a billboard texture defined by source and rotation + +--- + +## Models - Mesh management functions + +--- + +> RL.UpdateMesh( Mesh mesh, Mesh{} meshData ) + +Update mesh vertex data in GPU. +NOTE: Mainly intented to be used with custom meshes. + +--- + +> RL.UnloadMesh( Mesh mesh ) + +Unload mesh data from CPU and GPU + +--- + +> RL.DrawMesh( Mesh mesh, Material material, Matrix transform ) + +Draw a 3d mesh with material and transform + +--- + +> RL.DrawMeshInstanced( Mesh mesh, Material material, Buffer transforms, int instances ) + +Draw multiple mesh instances with material and different transforms + +--- + +> success = RL.SetMeshColor( Mesh mesh, Color color ) + +Updades mesh color vertex attribute buffer +NOTE: Currently only works on custom mesh + +- Failure return false +- Success return true + +--- + +> success = RL.ExportMesh( Mesh mesh, string fileName ) + +Export mesh data to file, returns true on success + +- Success return bool + +--- + +> success = RL.ExportMeshAsCode( Mesh mesh, string fileName ) + +Export mesh as code file (.h) defining multiple arrays of vertex attributes + +- Success return bool + +--- + +> boundingBox = RL.GetMeshBoundingBox( Mesh mesh ) + +Compute mesh bounding box limits + +- Success return BoundingBox + +--- + +> RL.GenMeshTangents( Mesh mesh ) + +Compute mesh tangents + +--- + +> meshData = RL.GetMeshData( Mesh mesh ) + +Get mesh vertex attributes data as table. + +- Success return Mesh{} + +--- + +## Models - Mesh generation functions + +--- + +> mesh = RL.GenMeshPoly( int sides, float radius ) + +Generate polygonal mesh + +- Success return Mesh + +--- + +> mesh = RL.GenMeshPlane( float width, float length, int resX, int resZ ) + +Generate plane mesh (With subdivisions) + +- Success return Mesh + +--- + +> mesh = RL.GenMeshCube( Vector3 size ) + +Generate cuboid mesh + +- Success return Mesh + +--- + +> mesh = RL.GenMeshSphere( float radius, int rings, int slices ) + +Generate sphere mesh (Standard sphere) + +- Success return Mesh + +--- + +> mesh = RL.GenMeshHemiSphere( float radius, int rings, int slices ) + +Generate half-sphere mesh (no bottom cap) + +- Success return Mesh + +--- + +> mesh = RL.GenMeshCylinder( float radius, float height, int slices ) + +Generate cylinder mesh + +- Success return Mesh + +--- + +> mesh = RL.GenMeshCone( float radius, float height, int slices ) + +Generate cone/pyramid mesh + +- Success return Mesh + +--- + +> mesh = RL.GenMeshTorus( float radius, float size, int radSeg, int sides ) + +Generate torus mesh + +- Success return Mesh + +--- + +> mesh = RL.GenMeshKnot( float radius, float size, int radSeg, int sides ) + +Generate torus mesh + +- Success return Mesh + +--- + +> mesh = RL.GenMeshHeightmap( Image heightmap, Vector3 size ) + +Generate heightmap mesh from image data + +- Success return Mesh + +--- + +> mesh = RL.GenMeshCubicmap( Image cubicmap, Vector3 cubeSize ) + +Generate cubes-based map mesh from image data + +- Success return Mesh + +--- + +> mesh = RL.GenMeshCustom( Mesh{} meshData, bool dynamic ) + +Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO + +- Success return Mesh + +--- + +## Models - Material management functions + +--- + +> materials = RL.LoadMaterials( string fileName ) + +Load materials from model file + +- Success return Material{} + +--- + +> material = RL.GetMaterialDefault() + +Default material for reference. Return as lightuserdata + +- Success return Material + +--- + +> material = RL.LoadMaterialDefault() + +Load default material as new object + +- Success return Material + +--- + +> material = RL.CreateMaterial( Material{} materialData ) + +Load material from table. See material table definition + +- Success return Material + +--- + +> isValid = RL.IsMaterialValid( Material material ) + +Check if a material is valid (shader assigned, map textures loaded in GPU) + +- Success return bool + +--- + +> RL.UnloadMaterial( Material material, bool freeAll ) + +Unload material from GPU memory (VRAM). Note! Use freeAll to unload shaders and textures + +--- + +> RL.SetMaterialTexture( Material material, int mapType, Texture texture ) + +Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...) + +--- + +> RL.SetMaterialColor( Material material, int mapType, Color color ) + +Set color for a material map type + +--- + +> RL.SetMaterialValue( Material material, int mapType, float value ) + +Set value for a material map type + +--- + +> RL.SetMaterialShader( Material material, Shader shader ) + +Set shader for material + +--- + +> RL.SetMaterialParams( Material material, float{} params ) + +Set material generic parameters (if required) + +--- + +> texture = RL.GetMaterialTexture( Material material, int mapType ) + +Get texture from material map type. Return as lightuserdata + +- Success return Texture + +--- + +> color = RL.GetMaterialColor( Material material, int mapType ) + +Get color from material map type + +- Success return Color + +--- + +> value = RL.GetMaterialValue( Material material, int mapType ) + +Get color from material map type + +- Success return float + +--- + +> shader = RL.GetMaterialShader( Material material ) + +Get material shader. Return as lightuserdata + +- Success return Shader + +--- + +> params = RL.GetMaterialParams( Material material ) + +Get material parameters + +- Success return float{} + +--- + +## Model - Model animations management functions + +--- + +> animations = RL.LoadModelAnimations( string fileName ) + +Load model animations from file + +- Failure return nil +- Success return ModelAnimations{} + +--- + +> RL.UpdateModelAnimation( Model model, ModelAnimation animation, int frame ) + +Update model animation pose + +--- + +> RL.UpdateModelAnimationBones( Model model, ModelAnimation animation, int frame ) + +Update model animation mesh bone matrices (GPU skinning) + +--- + +> RL.UnloadModelAnimation( ModelAnimation animation ) + +Unload animation data + +--- + +> RL.UnloadModelAnimations( ModelAnimation{} animations ) + +Unload animation table data + +--- + +> valid = RL.IsModelAnimationValid( Model model, ModelAnimation animation ) + +Check model animation skeleton match + +- Success return bool + +--- + +> success = RL.SetModelAnimationBone( ModelAnimation animation, int boneId, BoneInfo bone ) + +Set modelAnimation bones information (skeleton) + +- Failure return false +- Success return true + +--- + +> success = RL.SetModelAnimationFramePose( ModelAnimation animation, int frame, int boneId, Transform pose ) + +Set modelAnimation bones base transformation (pose) + +- Failure return false +- Success return true + +--- + +> RL.SetModelAnimationName( ModelAnimation animation, string name ) + +Set modelAnimation name + +--- + +> boneCount = RL.GetModelAnimationBoneCount( ModelAnimation animation ) + +Return modelAnimation bone count + +- Success return int + +--- + +> frameCount = RL.GetModelAnimationFrameCount( ModelAnimation animation ) + +Return modelAnimation frame count + +- Success return int + +--- + +> bone = RL.GetModelAnimationBone( ModelAnimation animation, int boneId ) + +Get modelAnimation bones information (skeleton) + +- Failure return nil +- Success return BoneInfo + +--- + +> pose = RL.GetModelAnimationFramePose( ModelAnimation animation, int frame, int boneId ) + +Get modelAnimation bones base transformation (pose) + +- Failure return nil +- Success return Transform + +--- + +> name = RL.GetModelAnimationName( ModelAnimation animation ) + +Get modelAnimation name + +- Success return string + +--- + +## Model - Collision detection functions + +--- + +> collision = RL.CheckCollisionSpheres( Vector3 center1, float radius1, Vector3 center2, float radius2 ) + +Check collision between two spheres + +- Success return bool + +--- + +> collision = RL.CheckCollisionBoxes( BoundingBox box1, BoundingBox box2 ) + +Check collision between two bounding boxes + +- Success return bool + +--- + +> collision = RL.CheckCollisionBoxSphere( BoundingBox box, Vector3 center, float radius ) + +Check collision between box and sphere + +- Success return bool + +--- + +> rayCollision = RL.GetRayCollisionSphere( Ray ray, Vector3 center, float radius ) + +Get collision info between ray and sphere. ( RayCollision is Lua table of { hit, distance, point, normal } ) + +- Success return RayCollision + +--- + +> rayCollision = RL.GetRayCollisionBox( Ray ray, BoundingBox box ) + +Get collision info between ray and box + +- Success return RayCollision + +--- + +> rayCollision = RL.GetRayCollisionMesh( Ray ray, Mesh mesh, Matrix transform ) + +Get collision info between ray and mesh + +- Success return RayCollision + +--- + +> rayCollision = RL.GetRayCollisionTriangle( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3 ) + +Get collision info between ray and triangle + +- Success return RayCollision + +--- + +> rayCollision = RL.GetRayCollisionQuad( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4 ) + +Get collision info between ray and quad. NOTE: The points are expected to be in counter-clockwise winding + +- Success return RayCollision + +--- + +> cells, exitPoint = RL.GetRayBoxCells( Ray ray, BoundingBox box, Vector3 cellSize ) + +Get cell positions inside box that intersect with the ray. Also returns ray exit point. Returns empty table if ray misses the box + +- Success return Vector3{}, RayCollision|nil + +--- + +## Audio - Audio device management functions + +--- + +> RL.InitAudioDevice() + +Initialize audio device and context + +--- + +> RL.CloseAudioDevice() + +Close the audio device and context + +--- + +> isReady = RL.IsAudioDeviceReady() + +Check if audio device has been initialized successfully + +- Success return bool + +--- + +> RL.SetMasterVolume( float volume ) + +Set master volume (listener) + +--- + +> volume = RL.GetMasterVolume() + +Get master volume (listener) + +- Success return float + +--- + +## Audio - Wave/Sound loading/unloading functions + +--- + +> sound = RL.LoadSound( string fileName ) + +Load sound from file + +- Failure return nil +- Success return Sound + +--- + +> wave = RL.LoadWave( string fileName ) + +Load wave data from file + +- Failure return nil +- Success return Wave + +--- + +> wave = RL.LoadWaveFromMemory( string fileType, Buffer data ) + +Load wave from memory buffer, fileType refers to extension: i.e. '.wav' + +- Success return Wave + +--- + +> isValid = RL.IsWaveValid( Wave wave ) + +Checks if wave data is valid (data loaded and parameters) + +- Success return bool + +--- + +> sound = RL.LoadSoundFromWave( Wave wave ) + +Load sound from wave data + +- Success return Sound + +--- + +> sound = RL.LoadSoundAlias( Sound source ) + +Create a new sound that shares the same sample data as the source sound, does not own the sound data + +- Success return Sound + +--- + +> isValid = RL.IsSoundValid( Sound sound ) + +Checks if a sound is valid (data loaded and buffers initialized) + +- Success return bool + +--- + +> RL.UpdateSound( Sound sound, Buffer data, int sampleCount ) + +Update sound buffer with new data + +--- + +> RL.UnloadWave( Wave wave ) + +Unload wave data + +--- + +> RL.UnloadSound( Sound sound ) + +Unload sound + +--- + +> RL.UnloadSoundAlias( Sound alias ) + +Unload a sound alias (does not deallocate sample data) + +--- + +> success = RL.ExportWave( Wave wave, string fileName ) + +Export wave data to file, returns true on success + +- Success return bool + +--- + +> success = RL.ExportWaveAsCode( Wave wave, string fileName ) + +Export wave sample data to code (.h), returns true on success + +- Success return true + +--- + +## Audio - Wave/Sound management functions + +--- + +> RL.PlaySound( Sound sound ) + +Play a sound + +--- + +> RL.StopSound( Sound sound ) + +Stop playing a sound + +--- + +> RL.PauseSound( Sound sound ) + +Pause a sound + +--- + +> RL.ResumeSound( Sound sound ) + +Resume a paused sound + +--- + +> playing = RL.IsSoundPlaying( Sound sound ) + +Check if a sound is currently playing + +- Success return bool + +--- + +> RL.SetSoundVolume( Sound sound, float volume ) + +Set volume for a sound (1.0 is max level) + +--- + +> RL.SetSoundPitch( Sound sound, float pitch ) + +Set pitch for a sound (1.0 is base level) + +--- + +> RL.SetSoundPan( Sound sound, float pan ) + +Set pan for a sound (0.5 is center) + +--- + +> stream = RL.GetSoundStream( Sound sound ) + +Get sound audio stream. Return as lightuserdata + +- Success return AudioStream + +--- + +> RL.WaveFormat( Wave wave, int sampleRate, int sampleSize, int channels ) + +Convert wave data to desired format + +--- + +> samples = RL.LoadWaveSamples( Wave wave ) + +Load samples data from wave as a 32bit float data array + +- Success return float{} + +--- + +> wave = RL.WaveCopy( Wave wave ) + +Copy a wave to a new wave + +- Success return Wave + +--- + +> RL.WaveCrop( Wave wave, int initSample, int finalSample ) + +Crop a wave to defined samples range + +--- + +## Audio - Music management functions + +--- + +> music = RL.LoadMusicStream( string fileName ) + +Load music stream from file + +- Success return Music + +--- + +> music = RL.LoadMusicStreamFromMemory( string fileType, Buffer data ) + +Load music stream from data + +- Success return Music + +--- + +> isValid = RL.IsMusicValid( Music music ) + +Checks if a music stream is valid (context and buffers initialized) + +- Success return bool + +--- + +> RL.UnloadMusicStream( Music music ) + +Unload music stream + +--- + +> RL.PlayMusicStream( Music music ) + +Start music playing + +--- + +> playing = RL.IsMusicStreamPlaying( Music music ) + +Check if music is playing + +- Success return bool + +--- + +> RL.UpdateMusicStream( Music music ) + +Updates buffers for music streaming + +--- + +> RL.StopMusicStream( Music music ) + +Stop music playing + +--- + +> RL.PauseMusicStream( Music music ) + +Pause music playing + +--- + +> RL.ResumeMusicStream( Music music ) + +Resume playing paused music + +--- + +> RL.SeekMusicStream( Music music, float position ) + +Seek music to a position (in seconds) + +--- + +> RL.SetMusicVolume( Music music, float volume ) + +Set volume for music (1.0 is max level) + +--- + +> RL.SetMusicPitch( Music music, float pitch ) + +Set pitch for a music (1.0 is base level) + +--- + +> RL.SetMusicPan( Music music, float pan ) + +Set pan for a music (0.5 is center) + +--- + +> RL.SetMusicLooping( Music music, bool looping ) + +Set looping for a music + +--- + +> looping = RL.GetMusicLooping( Music music ) + +Get looping of a music + +- Success return bool + +--- + +> length = RL.GetMusicTimeLength( Music music ) + +Get music time length (in seconds) + +- Success return float + +--- + +> timePlayed = RL.GetMusicTimePlayed( Music music ) + +Get current music time played (in seconds) + +- Success return float + +--- + +> stream = RL.GetMusicStream( Music music ) + +Get music audio stream. Return as lightuserdata + +- Success return AudioStream + +--- + +## Audio - AudioStream management functions + +--- + +> audioStream = RL.LoadAudioStream( int sampleRate, int sampleSize, int channels ) + +Load audio stream (to stream raw audio pcm data) + +- Success return AudioStream + +--- + +> isValid = RL.IsAudioStreamValid( AudioStream stream ) + +Checks if an audio stream is valid (buffers initialized) + +- Success return bool + +--- + +> RL.UnloadAudioStream( AudioStream stream ) + +Unload audio stream and free memory + +--- + +> RL.UpdateAudioStream( AudioStream stream, Buffer data, int frameCount ) + +Update audio stream buffers with data + +--- + +> isProcessed = RL.IsAudioStreamProcessed( AudioStream stream ) + +Check if any audio stream buffers requires refill + +- Success return bool + +--- + +> RL.PlayAudioStream( AudioStream stream ) + +Play audio stream + +--- + +> RL.PauseAudioStream( AudioStream stream ) + +Pause audio stream + +--- + +> RL.ResumeAudioStream( AudioStream stream ) + +Resume audio stream + +--- + +> isPlaying = RL.IsAudioStreamPlaying( AudioStream stream ) + +Check if audio stream is playing + +- Success return bool + +--- + +> RL.StopAudioStream( AudioStream stream ) + +Stop audio stream + +--- + +> RL.SetAudioStreamVolume( AudioStream stream, float volume ) + +Set volume for audio stream (1.0 is max level) + +--- + +> RL.SetAudioStreamPitch( AudioStream stream, float pitch ) + +Set pitch for audio stream (1.0 is base level) + +--- + +> RL.SetAudioStreamPan( AudioStream stream, float pan ) + +Set pan for audio stream (0.5 is centered) + +--- + +> RL.SetAudioStreamBufferSizeDefault( int size ) + +Default size for new audio streams + +--- + +> RL.SetAudioStreamCallback( AudioStream stream, AudioCallback callback ) + +Audio thread callback to request new data. +AudioCallback should be lightuserdata function pointer + +--- + +> RL.AttachAudioStreamProcessor( AudioStream stream, AudioCallback processor ) + +Attach audio stream processor to stream, receives the samples as 'float'. +AudioCallback should be lightuserdata function pointer + +--- + +> RL.DetachAudioStreamProcessor( AudioStream stream, AudioCallback processor ) + +Detach audio stream processor from stream. +AudioCallback should be lightuserdata function pointer + +--- + +> RL.AttachAudioMixedProcessor( AudioCallback processor ) + +Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'. +AudioCallback should be lightuserdata function pointer + +--- + +> RL.DetachAudioMixedProcessor( AudioCallback processor ) + +Detach audio stream processor from the entire audio pipeline. +AudioCallback should be lightuserdata function pointer + +--- + +## Math - Utils + +--- + +> result = RL.Round( float value ) + +Round float value + +- Success return int + +--- + +> result = RL.Sign( float value ) + +Sign of value + +- Success return int + +--- + +> result = RL.Clamp( float value, float min, float max ) + +Clamp float value + +- Success return float + +--- + +> result = RL.Lerp( float a, float b, float amount ) + +Calculate linear interpolation between two floats + +- Success return float + +--- + +> result = RL.Normalize( float value, float a, float b ) + +Normalize input value within input range + +- Success return float + +--- + +> result = RL.Remap( float value, float inputStart, float inputEnd, float outputStart, float outputEnd ) + +Remap input value within input range to output range + +- Success return float + +--- + +> result = RL.Wrap( float value, float min, float max ) + +Wrap input value from min to max + +- Success return float + +--- + +> result = RL.FloatEquals( float x, float y ) + +Check whether two given floats are almost equal + +- Success return bool + +--- + +## Math - Vector2 + +--- + +> result = RL.Vector2Zero() + +Vector with components value 0.0f + +- Success return Vector2 + +--- + +> result = RL.Vector2One() + +Vector with components value 1.0f + +- Success return Vector2 + +--- + +> result = RL.Vector2Add( Vector2 v1, Vector2 v2 ) + +Add two vectors (v1 + v2) + +- Success return Vector2 + +--- + +> result = RL.Vector2AddValue( Vector2 v, float add ) + +Add vector and float value + +- Success return Vector2 + +--- + +> result = RL.Vector2Subtract( Vector2 v1, Vector2 v2 ) + +Subtract two vectors (v1 - v2) + +- Success return Vector2 + +--- + +> result = RL.Vector2SubtractValue( Vector2 v, float sub ) + +Subtract vector by float value + +- Success return Vector2 + +--- + +> result = RL.Vector2Length( vector2 v ) + +Calculate vector length + +- Success return float + +--- + +> result = RL.Vector2LengthSqr( vector2 v ) + +Calculate vector square length + +- Success return float + +--- + +> result = RL.Vector2DotProduct( Vector2 v1, Vector2 v2 ) + +Calculate two vectors dot product + +- Success return float + +--- + +> result = RL.Vector2Distance( Vector2 v1, Vector2 v2 ) + +Calculate distance between two vectors + +- Success return float + +--- + +> result = RL.Vector2DistanceSqr( Vector2 v1, Vector2 v2 ) + +Calculate square distance between two vectors + +- Success return float + +--- + +> result = RL.Vector2Angle( Vector2 v1, Vector2 v2 ) + +Calculate angle between two vectors +NOTE: Angle is calculated from origin point (0, 0) + +- Success return float + +--- + +> result = RL.Vector2LineAngle( Vector2 a, Vector2 b ) + +Calculate angle defined by a two vectors line +NOTE: Parameters need to be normalized +Current implementation should be aligned with glm::angle + +- Success return float + +--- + +> result = RL.Vector2Scale( Vector2 v, float scale ) + +Scale vector (multiply by value) + +- Success return Vector2 + +--- + +> result = RL.Vector2Multiply( Vector2 v1, Vector2 v2 ) + +Multiply vector by vector + +- Success return Vector2 + +--- + +> result = RL.Vector2Negate( Vector2 v ) + +Negate vector + +- Success return Vector2 + +--- + +> result = RL.Vector2Divide( Vector2 v1, Vector2 v2 ) + +Divide vector by vector + +- Success return Vector2 + +--- + +> result = RL.Vector2Normalize( Vector2 v ) + +Normalize provided vector + +- Success return Vector2 + +--- + +> result = RL.Vector2Transform( Vector2 v, Matrix mat ) + +Transforms a Vector2 by a given Matrix + +- Success return Vector2 + +--- + +> result = RL.Vector2Lerp( Vector2 v1, Vector2 v2, float amount ) + +Calculate linear interpolation between two vectors + +- Success return Vector2 + +--- + +> result = RL.Vector2Reflect( Vector2 v, Vector2 normal ) + +Calculate reflected vector to normal + +- Success return Vector2 + +--- + +> result = RL.Vector2Min( Vector2 v1, Vector2 v2 ) + +Get min value for each pair of components + +- Success return Vector2 + +--- + +> result = RL.Vector2Max( Vector2 v1, Vector2 v2 ) + +Get max value for each pair of components + +- Success return Vector2 + +--- + +> result = RL.Vector2Rotate( Vector2 v, float angle ) + +Rotate vector by angle + +- Success return Vector2 + +--- + +> result = RL.Vector2MoveTowards( Vector2 v, Vector2 target, float maxDistance ) + +Move Vector towards target + +- Success return Vector2 + +--- + +> result = RL.Vector2Invert( Vector2 v ) + +Invert the given vector + +- Success return Vector2 + +--- + +> result = RL.Vector2Clamp( Vector2 v, Vector2 min, Vector2 max ) + +Clamp the components of the vector between +min and max values specified by the given vectors + +- Success return Vector2 + +--- + +> result = RL.Vector2ClampValue( Vector2 v, float min, float max ) + +Clamp the magnitude of the vector between two min and max values + +- Success return Vector2 + +--- + +> result = RL.Vector2Equals( Vector2 v1, Vector2 v2 ) + +Check whether two given vectors are almost equal + +- Success return bool + +--- + +> result = RL.Vector2Refract( Vector2 v, Vector2 n, float r ) + +Compute the direction of a refracted ray +v: normalized direction of the incoming ray +n: normalized normal vector of the interface of two optical media +r: ratio of the refractive index of the medium from where the ray comes + to the refractive index of the medium on the other side of the surface + +- Success return Vector2 + +--- + +## Math - Vector 3 + +--- + +> result = RL.Vector3Zero() + +Vector with components value 0.0f + +- Success return Vector3 + +--- + +> result = RL.Vector3One() + +Vector with components value 1.0f + +- Success return Vector3 + +--- + +> result = RL.Vector3Add( Vector3 v1, Vector3 v2 ) + +Add two vectors + +- Success return Vector3 + +--- + +> result = RL.Vector3AddValue( Vector3 v, float add ) + +Add vector and float value + +- Success return Vector3 + +--- + +> result = RL.Vector3Subtract( Vector3 v1, Vector3 v2 ) + +Subtract two vectors + +- Success return Vector3 + +--- + +> result = RL.Vector3SubtractValue( Vector3 v, float sub ) + +Subtract vector by float value + +- Success return Vector3 + +--- + +> result = RL.Vector3Scale( Vector3 v, float scalar ) + +Multiply vector by scalar + +- Success return Vector3 + +--- + +> result = RL.Vector3Multiply( Vector3 v1, Vector3 v2 ) + +Multiply vector by vector + +- Success return Vector3 + +--- + +> result = RL.Vector3CrossProduct( Vector3 v1, Vector3 v2 ) + +Calculate two vectors cross product + +- Success return Vector3 + +--- + +> result = RL.Vector3Perpendicular( Vector3 v ) + +Calculate one vector perpendicular vector + +- Success return Vector3 + +--- + +> result = RL.Vector3Length( Vector3 v ) + +Calculate vector length + +- Success return float + +--- + +> result = RL.Vector3LengthSqr( Vector3 v ) + +Calculate vector square length + +- Success return float + +--- + +> result = RL.Vector3DotProduct( Vector3 v1, Vector3 v2 ) + +Calculate two vectors dot product + +- Success return float + +--- + +> result = RL.Vector3Distance( Vector3 v1, Vector3 v2 ) + +Calculate distance between two vectors + +- Success return float + +--- + +> result = RL.Vector3DistanceSqr( Vector3 v1, Vector3 v2 ) + +Calculate square distance between two vectors + +- Success return float + +--- + +> result = RL.Vector3Angle( Vector3 v1, Vector3 v2 ) + +Calculate angle between two vectors + +- Success return float + +--- + +> result = RL.Vector3Negate( Vector3 v ) + +Negate provided vector (invert direction) + +- Success return Vector3 + +--- + +> result = RL.Vector3Divide( Vector3 v1, Vector3 v2 ) + +Divide vector by vector + +- Success return Vector3 + +--- + +> result = RL.Vector3Normalize( Vector3 v ) + +Normalize provided vector + +- Success return Vector3 + +--- + +> result = RL.Vector3Project( Vector3 v1, Vector3 v2 ) + +Calculate the projection of the vector v1 on to v2 + +- Success return Vector3 + +--- + +> result = RL.Vector3Reject( Vector3 v1, Vector3 v2 ) + +Calculate the rejection of the vector v1 on to v2 + +- Success return Vector3 + +--- + +> v1, v2 = RL.Vector3OrthoNormalize( Vector3 v1, Vector3 v2 ) + +Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other. +Gram-Schmidt function implementation + +- Success return Vector3, Vector3 + +--- + +> result = RL.Vector3Transform( Vector3 v, Matrix mat ) + +Transforms a Vector3 by a given Matrix + +- Success return Vector3 + +--- + +> result = RL.Vector3RotateByQuaternion( Vector3 v, Quaternion q ) + +Transform a vector by quaternion rotation + +- Success return Vector3 + +--- + +> result = RL.Vector3RotateByAxisAngle( Vector3 v, Vector3 axis, float angle ) + +Rotates a vector around an axis + +- Success return Vector3 + +--- + +> result = RL.Vector3MoveTowards( Vector3 v, Vector3 target, float maxDistance ) + +Move Vector towards target + +- Success return Vector3 + +--- + +> result = RL.Vector3Lerp( Vector3 v1, Vector3 v2, float amount ) + +Calculate linear interpolation between two vectors + +- Success return Vector3 + +--- + +> result = RL.Vector3CubicHermite( Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount ) + +Calculate cubic hermite interpolation between two vectors and their tangents +as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic + +- Success return Vector3 + +--- + +> result = RL.Vector3Reflect( Vector3 v, Vector3 normal ) + +Calculate reflected vector to normal + +- Success return Vector3 + +--- + +> result = RL.Vector3Min( Vector3 v1, Vector3 v2 ) + +Get min value for each pair of components + +- Success return Vector3 + +--- + +> result = RL.Vector3Max( Vector3 v1, Vector3 v2 ) + +Get max value for each pair of components + +- Success return Vector3 + +--- + +> result = RL.Vector3Barycenter( Vector3 p, Vector3 a, Vector3 b, Vector3 c ) + +Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) +NOTE: Assumes P is on the plane of the triangle + +- Success return Vector3 + +--- + +> result = RL.Vector3Unproject( Vector3 source, Matrix projection, Matrix view ) + +Projects a Vector3 from screen space into object space +NOTE: We are avoiding calling other raymath functions despite available + +- Success return Vector3 + +--- + +> result = RL.Vector3Invert( Vector3 v ) + +Invert the given vector + +- Success return Vector3 + +--- + +> result = RL.Vector3Clamp( Vector3 v, Vector3 min, Vector3 max ) + +Clamp the components of the vector between +min and max values specified by the given vectors + +- Success return Vector3 + +--- + +> result = RL.Vector3ClampValue( Vector3 v, float min, float max ) + +Clamp the magnitude of the vector between two values + +- Success return Vector3 + +--- + +> result = RL.Vector3Equals( Vector3 v1, Vector3 v2 ) + +Check whether two given vectors are almost equal + +- Success return bool + +--- + +> result = RL.Vector3Refract( Vector3 v, Vector3 n, float r ) + +Compute the direction of a refracted ray where v specifies the +normalized direction of the incoming ray, n specifies the +normalized normal vector of the interface of two optical media, +and r specifies the ratio of the refractive index of the medium +from where the ray comes to the refractive index of the medium +on the other side of the surface + +- Success return Vector3 + +--- + +## Math - Vector4 + +--- + +> result = RL.Vector4Zero() + +Vector with components value 0.0f + +- Success return Vector4 + +--- + +> result = RL.Vector4One() + +Vector with components value 1.0f + +- Success return Vector4 + +--- + +> result = RL.Vector4Add( Vector4 v1, Vector4 v2 ) + +Add two vectors + +- Success return Vector4 + +--- + +> result = RL.Vector4AddValue( Vector4 v, float add ) + +Add vector and float value + +- Success return Vector4 + +--- + +> result = RL.Vector4Subtract( Vector4 v1, Vector4 v2 ) + +Subtract two vectors + +- Success return Vector4 + +--- + +> result = RL.Vector4SubtractValue( Vector4 v, float sub ) + +Subtract vector by float value + +- Success return Vector4 + +--- + +> result = RL.Vector4Length( Vector4 v ) + +Calculate vector length + +- Success return float + +--- + +> result = RL.Vector4LengthSqr( Vector4 v ) + +Calculate vector square length + +- Success return float + +--- + +> result = RL.Vector4DotProduct( Vector4 v1, Vector4 v2 ) + +Calculate two vectors dot product + +- Success return float + +--- + +> result = RL.Vector4Distance( Vector4 v1, Vector4 v2 ) + +Calculate distance between two vectors + +- Success return float + +--- + +> result = RL.Vector4DistanceSqr( Vector4 v1, Vector4 v2 ) + +Calculate square distance between two vectors + +- Success return float + +--- + +> result = RL.Vector4Scale( Vector4 v, float scalar ) + +Multiply vector by scalar + +- Success return Vector4 + +--- + +> result = RL.Vector4Multiply( Vector4 v1, Vector4 v2 ) + +Multiply vector by vector + +- Success return Vector4 + +--- + +> result = RL.Vector4Negate( Vector4 v ) + +Negate provided vector (invert direction) + +- Success return Vector4 + +--- + +> result = RL.Vector4Divide( Vector4 v1, Vector4 v2 ) + +Divide vector by vector + +- Success return Vector4 + +--- + +> result = RL.Vector4Normalize( Vector4 v ) + +Normalize provided vector + +- Success return Vector4 + +--- + +> result = RL.Vector4Min( Vector4 v1, Vector4 v2 ) + +Get min value for each pair of components + +- Success return Vector4 + +--- + +> result = RL.Vector4Max( Vector4 v1, Vector4 v2 ) + +Get max value for each pair of components + +- Success return Vector4 + +--- + +> result = RL.Vector4Lerp( Vector4 v1, Vector4 v2, float amount ) + +Calculate linear interpolation between two vectors + +- Success return Vector4 + +--- + +> result = RL.Vector4MoveTowards( Vector4 v, Vector4 target, float maxDistance ) + +Move Vector towards target + +- Success return Vector4 + +--- + +> result = RL.Vector4Invert( Vector4 v ) + +Invert the given vector + +- Success return Vector4 + +--- + +> result = RL.Vector4Equals( Vector4 v1, Vector4 v2 ) + +Check whether two given vectors are almost equal + +- Success return bool + +--- + +## Math - Matrix + +--- + +> result = RL.MatrixDeterminant( Matrix mat ) + +Compute matrix determinant + +- Success return float + +--- + +> result = RL.MatrixTrace( Matrix mat ) + +Get the trace of the matrix (sum of the values along the diagonal) + +- Success return float + +--- + +> result = RL.MatrixTranspose( Matrix mat ) + +Transposes provided matrix + +- Success return Matrix + +--- + +> result = RL.MatrixInvert( Matrix mat ) + +Invert provided matrix + +- Success return Matrix + +--- + +> result = RL.MatrixIdentity() + +Get identity matrix + +- Success return Matrix + +--- + +> result = RL.MatrixAdd( Matrix left, Matrix right ) + +Add two matrices + +- Success return Matrix + +--- + +> result = RL.MatrixSubtract( Matrix left, Matrix right ) + +Subtract two matrices (left - right) + +- Success return Matrix + +--- + +> result = RL.MatrixMultiply( Matrix left, Matrix right ) + +Get two matrix multiplication + +- Success return Matrix + +--- + +> result = RL.MatrixTranslate( Vector3 translate ) + +Get translation matrix + +- Success return Matrix + +--- + +> result = RL.MatrixRotate( Vector3 axis, float angle ) + +Create rotation matrix from axis and angle. NOTE: Angle should be provided in radians + +- Success return Matrix + +--- + +> result = RL.MatrixRotateX( float angle ) + +Get x-rotation matrix (angle in radians) + +- Success return Matrix + +--- + +> result = RL.MatrixRotateY( float angle ) + +Get y-rotation matrix (angle in radians) + +- Success return Matrix + +--- + +> result = RL.MatrixRotateZ( float angle ) + +Get z-rotation matrix (angle in radians) + +- Success return Matrix + +--- + +> result = RL.MatrixRotateXYZ( Vector3 angles ) + +Get xyz-rotation matrix (angles in radians) + +- Success return Matrix + +--- + +> result = RL.MatrixRotateZYX( Vector3 angles ) + +Get zyx-rotation matrix (angles in radians) + +- Success return Matrix + +--- + +> result = RL.MatrixScale( Vector3 scale ) + +Get scaling matrix + +- Success return Matrix + +--- + +> result = RL.MatrixFrustum( double left, double right, double bottom, double top, double near, double far ) + +Get perspective projection matrix + +- Success return Matrix + +--- + +> result = RL.MatrixPerspective( double fovy, double aspect, double near, double far ) + +Get perspective projection matrix + +- Success return Matrix + +--- + +> result = RL.MatrixOrtho( double left, double right, double bottom, double top, double near, double far ) + +Get orthographic projection matrix + +- Success return Matrix + +--- + +> result = RL.MatrixLookAt( Vector3 eye, Vector3 target, Vector3 up ) + +Get camera look-at matrix (View matrix) + +- Success return Matrix + +--- + +> translation, rotation, scale = RL.MatrixDecompose( Matrix mat ) + +Decompose a transformation matrix into its rotational, translational and scaling components + +- Success return Vector3, Quaternion, Vector3 + +--- + +## Math - Quaternion + +--- + +> result = RL.QuaternionAdd( Quaternion q1, Quaternion q2 ) + +Add two quaternions + +- Success return Quaternion + +--- + +> result = RL.QuaternionAddValue( Quaternion q, float add ) + +Add quaternion and float value + +- Success return Quaternion + +--- + +> result = RL.QuaternionSubtract( Quaternion q1, Quaternion q2 ) + +Subtract two quaternions + +- Success return Quaternion + +--- + +> result = RL.QuaternionSubtractValue( Quaternion q, float sub ) + +Subtract quaternion and float value + +- Success return Quaternion + +--- + +> result = RL.QuaternionIdentity() + +Get identity quaternion + +- Success return Quaternion + +--- + +> result = RL.QuaternionLength( Quaternion q ) + +Computes the length of a quaternion + +- Success return float + +--- + +> result = RL.QuaternionNormalize( Quaternion q ) + +Normalize provided quaternion + +- Success return Quaternion + +--- + +> result = RL.QuaternionInvert( Quaternion q ) + +Invert provided quaternion + +- Success return Quaternion + +--- + +> result = RL.QuaternionMultiply( Quaternion q1, Quaternion q2 ) + +Calculate two quaternion multiplication + +- Success return Quaternion + +--- + +> result = RL.QuaternionScale( Quaternion q, float mul ) + +Scale quaternion by float value + +- Success return Quaternion + +--- + +> result = RL.QuaternionDivide( Quaternion q1, Quaternion q2 ) + +Divide two quaternions + +- Success return Quaternion + +--- + +> result = RL.QuaternionLerp( Quaternion q1, Quaternion q2, float amount ) + +Calculate linear interpolation between two quaternions + +- Success return Quaternion + +--- + +> result = RL.QuaternionNlerp( Quaternion q1, Quaternion q2, float amount ) + +Calculate slerp-optimized interpolation between two quaternions + +- Success return Quaternion + +--- + +> result = RL.QuaternionSlerp( Quaternion q1, Quaternion q2, float amount ) + +Calculates spherical linear interpolation between two quaternions + +- Success return Quaternion + +--- + +> result = RL.QuaternionCubicHermiteSpline( Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t ) + +Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm +as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic + +- Success return Quaternion + +--- + +> result = RL.QuaternionFromVector3ToVector3( Vector3 from, Vector3 to ) + +Calculate quaternion based on the rotation from one vector to another + +- Success return Quaternion + +--- + +> result = RL.QuaternionFromMatrix( Matrix mat ) + +Get a quaternion for a given rotation matrix + +- Success return Quaternion + +--- + +> result = RL.QuaternionToMatrix( Quaternion q ) + +Get a matrix for a given quaternion + +- Success return Matrix + +--- + +> result = RL.QuaternionFromAxisAngle( Vector3 axis, float angle ) + +Get rotation quaternion for an angle and axis +NOTE: angle must be provided in radians + +- Success return Quaternion + +--- + +> axis, angle = RL.QuaternionToAxisAngle( Quaternion q ) + +Get the rotation angle and axis for a given quaternion + +- Success return Vector3, float + +--- + +> result = RL.QuaternionFromEuler( float pitch, float yaw, float roll ) + +Get the quaternion equivalent to Euler angles +NOTE: Rotation order is ZYX + +- Success return Quaternion + +--- + +> result = RL.QuaternionToEuler( Quaternion q ) + +Get the Euler angles equivalent to quaternion (roll, pitch, yaw) +NOTE: Angles are returned in a Vector3 struct in radians + +- Success return Vector3 + +--- + +> result = RL.QuaternionTransform( Quaternion q, Matrix mat ) + +Transform a quaternion given a transformation matrix + +- Success return Quaternion + +--- + +> result = RL.QuaternionEquals( Quaternion q1, Quaternion q2 ) + +Check whether two given quaternions are almost equal + +- Success return bool + +--- + +## Math - Frustum + +--- + +> frustum = RL.ExtractFrustum( Matrix projection, Matrix modelview ) + +Extract frustum from projection and modelView matrices. + +- Success return Vector4{} + +--- + +> inFrustum = RL.PointInFrustum( Vector4{} frustum, Vector3 position ) + +Check if point inside frustum + +- Success return bool + +--- + +> inFrustum = RL.SphereInFrustum( Vector4{} frustum, Vector3 position ) + +Check if sphere inside frustum + +- Success return bool + +--- + +> inFrustum = RL.AABBInFrustum( Vector4{} frustum, Vector3 min, Vector3 max ) + +Check if AABB inside frustum + +- Success return bool + +--- + +## Gui - Global gui state control functions + +--- + +> RL.GuiEnable() + +Enable gui controls (global state) + +--- + +> RL.GuiDisable() + +Disable gui controls (global state) + +--- + +> RL.GuiLock() + +Lock gui controls (global state) + +--- + +> RL.GuiUnlock() + +Unlock gui controls (global state) + +--- + +> locked = RL.GuiIsLocked() + +Check if gui is locked (global state) + +- Success return bool + +--- + +> RL.GuiSetAlpha( float alpha ) + +Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f + +--- + +> RL.GuiSetState( int state ) + +Set gui state (global state) + +--- + +> state = RL.GuiGetState() + +Get gui state (global state) + +- Success return int + +--- + +> RL.GuiSetSliderDragging( bool dragging ) + +Set guiSliderDragging + +--- + +> isSliderDragging = RL.GuiGetSliderDragging() + +Get guiSliderDragging + +- Success return bool + +--- + +> RL.GuiSetSliderActive( Rectange rect ) + +Set guiSliderActive + +--- + +> isSliderDragging = RL.GuiGetSliderActive() + +Get guiSliderActive + +- Success return Rectangle + +--- + +## Gui - Font set/get functions + +--- + +> RL.GuiSetFont( Font font ) + +Set gui custom font (global state) + +--- + +> font = RL.GuiGetFont() + +Get gui font (global state). Return as lightuserdata + +- Success return Font + +--- + +## Gui - Style set/get functions + +--- + +> RL.GuiSetStyle( int control, int property, int value ) + +Set one style property + +--- + +> value = RL.GuiGetStyle( int control, int property ) + +Get one style property + +- Success return int + +--- + +## Gui - Styles loading functions + +--- + +> success = RL.GuiLoadStyle( string fileName ) + +Load style file over global style variable (.rgs) + +- Failure return nil +- Success return true + +--- + +> RL.GuiLoadStyleDefault() + +Load style default over global style + +--- + +## Gui - Tooltips management functions + +--- + +> RL.GuiEnableTooltip() + +Enable gui tooltips (global state) + +--- + +> RL.GuiDisableTooltip() + +Disable gui tooltips (global state) + +--- + +> RL.GuiSetTooltip( string tooltip ) + +Set tooltip string + +--- + +## Gui - Icons functionality + +--- + +> text = RL.GuiIconText( int iconId, string|nil text ) + +Get text with icon id prepended (if supported) + +- Success return string + +--- + +> RL.GuiSetIconScale( int scale ) + +Set icon scale (1 by default) + +--- + +> iconsBuffer = RL.GuiGetIcons() + +Get raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB + +- Success return Buffer + +--- + +> success = RL.GuiSetIcons( Buffer iconBuffer ) + +Set raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB + +- Failure return false +- Success return true + +--- + +> iconNames = RL.GuiLoadIcons( string fileName, bool loadIconsName ) + +Load raygui icons file (.rgi) into internal icons data + +- Failure return nil +- Success return strings{} + +--- + +> RL.GuiDrawIcon( int iconId, Vector2 pos, int pixelSize, Color color ) + +Draw icon + +--- + +## Gui - Container/separator controls, useful for controls organization + +--- + +> result = RL.GuiWindowBox( Rectangle bounds, string|nil title ) + +Window Box control, shows a window that can be closed + +- Success return int + +--- + +> result = RL.GuiGroupBox( Rectangle bounds, string|nil text ) + +Group Box control with text name + +- Success return int + +--- + +> result = RL.GuiLine( Rectangle bounds, string|nil text ) + +Line separator control, could contain text + +- Success return int + +--- + +> result = RL.GuiPanel( Rectangle bounds, string|nil text ) + +Panel control, useful to group controls + +- Success return int + +--- + +> result, active = RL.GuiTabBar( Rectangle bounds, string text, int active ) + +Tab Bar control, returns TAB to be closed or -1 + +- Success return int, int + +--- + +> result, scroll, view = RL.GuiScrollPanel( Rectangle bounds, string|nil text, Rectangle content, Vector2 scroll, Rectangle view ) + +Scroll Panel control + +- Success return int, Vector2, Rectangle + +--- + +## Gui - Basic controls set + +--- + +> result = RL.GuiLabel( Rectangle bounds, string|nil text ) + +Label control, shows text + +- Success return int + +--- + +> result = RL.GuiButton( Rectangle bounds, string|nil text ) + +Button control, returns true when clicked + +- Success return int + +--- + +> result = RL.GuiLabelButton( Rectangle bounds, string|nil text ) + +Label button control, show true when clicked + +- Success return int + +--- + +> result, active = RL.GuiToggle( Rectangle bounds, string|nil text, bool active ) + +Toggle Button control, returns true when active + +- Success return int, bool + +--- + +> result, active = RL.GuiToggleGroup( Rectangle bounds, string|nil text, int active ) + +Toggle Group control, returns active toggle index + +- Success return int, int + +--- + +> result, active = RL.GuiToggleSlider( Rectangle bounds, string|nil text, int active ) + +Toggle Slider control, returns true when clicked + +- Success return int, int + +--- + +> result, checked, textBounds = RL.GuiCheckBox( Rectangle bounds, string|nil text, bool checked ) + +Check Box control, returns true when active + +- Success return bool, Rectangle + +--- + +> result, active = RL.GuiComboBox( Rectangle bounds, string|nil text, int active ) + +Combo Box control, returns selected item index + +- Success return int, int + +--- + +> result, active = RL.GuiDropdownBox( Rectangle bounds, string text, int active, bool editMode ) + +Dropdown Box control, returns selected item + +- Success return int, int + +--- + +> result, value, textBounds = RL.GuiSpinner( Rectangle bounds, string|nil text, int value, int minValue, int maxValue, bool editMode ) + +Spinner control, returns selected value + +- Success return int, int, Rectangle + +--- + +> result, value, textBounds = RL.GuiValueBox( Rectangle bounds, string|nil text, int value, int minValue, int maxValue, bool editMode ) + +Value Box control, updates input text with numbers + +- Success return int, int, Rectangle + +--- + +> result, text = RL.GuiTextBox( Rectangle bounds, string text, int bufferSize, bool editMode ) + +Text Box control, updates input text + +- Success return int, string + +--- + +> result, value, textLeftBounds, textRightBounds = RL.GuiSlider( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue ) + +Slider control, returns selected value + +- Success return int, float, Rectangle, Rectangle + +--- + +> result, value, textLeftBounds, textRightBounds = RL.GuiSliderBar( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue ) + +Slider Bar control, returns selected value + +- Success return int, float, Rectangle, Rectangle + +--- + +> result, value, textLeftBounds, textRightBounds = RL.GuiProgressBar( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue ) + +Progress Bar control, shows current progress value + +- Success return int, float, Rectangle, Rectangle + +--- + +> result = RL.GuiStatusBar( Rectangle bounds, string|nil text ) + +Status Bar control, shows info text + +- Success return int + +--- + +> result = RL.GuiDummyRec( Rectangle bounds, string|nil text ) + +Dummy control for placeholders + +- Success return int + +--- + +> result, mouseCell = RL.GuiGrid( Rectangle bounds, string|nil text, float spacing, int subdivs, Vector2 mouseCell ) + +Grid control, returns mouse cell position + +- Success return int, Vector2 + +--- + +> value = RL.GuiScrollBar( Rectangle bounds, int value, int minValue, int maxValue ) + +Scroll bar control + +- Success return int + +--- + +## Gui - Advance controls set + +--- + +> result, scrollIndex, active = RL.GuiListView( Rectangle bounds, string|nil text, int scrollIndex, int active ) + +List View control, returns selected list item index + +- Success return int, int, int + +--- + +> result, scrollIndex, active, focus = RL.GuiListViewEx( Rectangle bounds, string text, int scrollIndex, int active, int focus ) + +List View with extended parameters + +- Success return int, int, int, int + +--- + +> result = RL.GuiMessageBox( Rectangle bounds, string|nil title, string message, string buttons ) + +Message Box control, displays a message + +- Success return int + +--- + +> result, text, secretViewActive = RL.GuiTextInputBox( Rectangle bounds, string title, string message, string buttons, string text, int textMaxSize, bool secretViewActive ) + +Text Input Box control, ask for text, supports secret + +- Success return int, string, bool + +--- + +> result, color = RL.GuiColorPicker( Rectangle bounds, string|nil text, Color color ) + +Color Picker control (multiple color controls) + +- Success return int, Color + +--- + +> result, color = RL.GuiColorPanel( Rectangle bounds, string|nil text, Color color ) + +Color Panel control + +- Success return int, Color + +--- + +> result, alpha = RL.GuiColorBarAlpha( Rectangle bounds, string|nil text, float alpha ) + +Color Bar Alpha control + +- Success return int, float + +--- + +> result, value = RL.GuiColorBarHue( Rectangle bounds, string|nil text, float value ) + +Color Bar Hue control + +- Success return int, float + +--- + +> result, colorHsv = RL.GuiColorPickerHSV( Rectangle bounds, string|nil text, Vector3 colorHsv ) + +Color Picker control that avoids conversion to RGB on each call (multiple color controls) + +- Success return int, Vector3 + +--- + +> result, colorHsv = RL.GuiColorPanelHSV( Rectangle bounds, string|nil text, Vector3 colorHsv ) + +Color Panel control that returns HSV color value, used by GuiColorPickerHSV() + +- Success return int, Vector3 + +--- + +## Lights - Light management functions + +--- + +> light = RL.CreateLight( int type, Vector3 position, Vector3 target, Color color, Shader shader ) + +Create a light and get shader locations + +- Success return Light + +--- + +> RL.UpdateLightValues( Shader shader, Light light ) + +Send light properties to shader + +--- + +> RL.SetLightType( Light light, int type ) + +Set light type + +--- + +> RL.SetLightPosition( Light light, Vector3 position ) + +Set light position + +--- + +> RL.SetLightTarget( Light light, Vector3 target ) + +Set light target + +--- + +> RL.SetLightColor( Light light, Color color ) + +Set light color + +--- + +> RL.SetLightEnabled( Light light, bool enabled ) + +Set light enabled + +--- + +> type = RL.GetLightType( Light light ) + +Get light type + +- Success return int + +--- + +> position = RL.GetLightPosition( Light light ) + +Get light position + +- Success return Vector3 + +--- + +> target = RL.GetLightTarget( Light light ) + +Get light target + +- Success return Vector3 + +--- + +> color = RL.GetLightColor( Light light ) + +Get light color + +- Success return Color + +--- + +> enabled = RL.IsLightEnabled( Light light ) + +Get light enabled + +- Success return bool + +--- + +## RLGL - Matrix operations + +--- + +> RL.rlMatrixMode( int mode ) + +Choose the current matrix to be transformed + +--- + +> RL.rlPushMatrix() + +Push the current matrix to stack + +--- + +> RL.rlPopMatrix() + +Pop latest inserted matrix from stack + +--- + +> RL.rlLoadIdentity() + +Reset current matrix to identity matrix + +--- + +> RL.rlTranslatef( Vector3 translation ) + +Multiply the current matrix by a translation matrix + +--- + +> RL.rlRotatef( float angle, Vector3 rotation ) + +Multiply the current matrix by a rotation matrix + +--- + +> RL.rlScalef( Vector3 scale ) + +Multiply the current matrix by a scaling matrix + +--- + +> RL.rlMultMatrixf( Matrix matrix ) + +Multiply the current matrix by another matrix + +--- + +> RL.rlFrustum( float left, float right, float bottom, float top, float znear, float zfar ) + +Multiply the current matrix by a perspective matrix generated by parameters + +--- + +> RL.rlOrtho( float left, float right, float bottom, float top, float znear, float zfar ) + +Multiply the current matrix by an orthographic matrix generated by parameters + +--- + +> RL.rlViewport( Rectangle viewport ) + +Set the viewport area (transformation from normalized device coordinates to window coordinates) +NOTE: We store current viewport dimensions + +--- + +> RL.rlSetClipPlanes( float nearPlane, float farPlane ) + +Set clip planes distances + +--- + +> distance = RL.rlGetCullDistanceNear() + +Get cull plane distance near + +- Success return float + +--- + +> distance = RL.rlGetCullDistanceFar() + +Get cull plane distance far + +- Success return float + +--- + +## RLGL - Vertex level operations + +--- + +> RL.rlBegin( int mode ) + +Initialize drawing mode (how to organize vertex) + +--- + +> RL.rlEnd() + +Finish vertex providing + +--- + +> RL.rlVertex2f( Vector2 position ) + +Define one vertex (position) + +--- + +> RL.rlVertex3f( Vector3 position ) + +Define one vertex (position) + +--- + +> RL.rlTexCoord2f( Vector2 texCoord ) + +Define one vertex (texture coordinate) - 2 float + +--- + +> RL.rlNormal3f( Vector3 normal ) + +Define one vertex (normal) - 3 float + +--- + +> RL.rlColor4ub( Color color ) + +Define one vertex (color) - 4 byte + +--- + +> RL.rlColor3f( Vector3 color ) + +Define one vertex (color) - 3 float + +--- + +> RL.rlColor4f( Vector4 color ) + +Define one vertex (color) - 4 float + +--- + +## RLGL - Vertex buffers state + +--- + +> supported = RL.rlEnableVertexArray( int vaoId ) + +Enable vertex array (VAO, if supported) + +- Success return bool + +--- + +> RL.rlDisableVertexArray() + +Disable vertex array (VAO, if supported) + +--- + +> RL.rlEnableVertexBuffer( int id ) + +Enable vertex buffer (VBO) + +- Failure return false +- Success return true + +--- + +> RL.rlDisableVertexBuffer() + +Disable vertex buffer (VBO) + +--- + +> RL.rlEnableVertexBufferElement( int id ) + +Enable vertex buffer element (VBO element) + +--- + +> RL.rlDisableVertexBufferElement() + +Disable vertex buffer element (VBO element) + +--- + +> RL.rlEnableVertexAttribute( int index ) + +Enable vertex attribute index + +--- + +> RL.rlDisableVertexAttribute( int index ) + +Disable vertex attribute index + +--- + +> RL.rlEnableStatePointer( int vertexAttribType, Buffer buffer ) + +Enable attribute state pointer + +--- + +> RL.rlDisableStatePointer( int vertexAttribType ) + +Disable attribute state pointer + +--- + +## RLGL - Textures state + +--- + +> RL.rlActiveTextureSlot( int slot ) + +Select and active a texture slot + +--- + +> RL.rlEnableTexture( int id ) + +Enable texture + +--- + +> RL.rlDisableTexture() + +Disable texture + +--- + +> RL.rlEnableTextureCubemap( int id ) + +Enable texture cubemap + +--- + +> RL.rlDisableTextureCubemap() + +Disable texture cubemap + +--- + +> RL.rlTextureParameters( int id, int param, int value ) + +Set texture parameters (filter, wrap) + +--- + +> RL.rlCubemapParameters( int id, int param, int value ) + +Set cubemap parameters (filter, wrap) + +--- + +## RLGL - Shader state + +--- + +> RL.rlEnableShader( int id ) + +Enable shader program + +--- + +> RL.rlDisableShader() + +Disable shader program + +--- + +## RLGL - Framebuffer state + +--- + +> RL.rlEnableFramebuffer( int id ) + +Enable render texture (fbo) + +--- + +> RL.rlDisableFramebuffer() + +Disable render texture (fbo), return to default framebuffer + +--- + +> framebuffer = RL.rlGetActiveFramebuffer() + +Get the currently active render texture (fbo), 0 for default framebuffer + +- Success return int + +--- + +> RL.rlActiveDrawBuffers( int count ) + +Activate multiple draw color buffers + +--- + +> RL.rlBlitFramebuffer( Rectangle srcRect, Rectangle dstRect, int bufferMask ) + +Blit active framebuffer to main framebuffer + +--- + +> RL.rlBindFramebuffer( int target, int framebuffer ) + +Bind framebuffer (FBO) + +--- + +## RLGL - General render state + +--- + +> RL.rlEnableColorBlend() + +Enable color blending + +--- + +> RL.rlDisableColorBlend() + +Disable color blending + +--- + +> RL.rlEnableDepthTest() + +Enable depth test + +--- + +> RL.rlDisableDepthTest() + +Disable depth test + +--- + +> RL.rlEnableDepthMask() + +Enable depth write + +--- + +> RL.rlDisableDepthMask() + +Disable depth write + +--- + +> RL.rlEnableBackfaceCulling() + +Enable backface culling + +--- + +> RL.rlDisableBackfaceCulling() + +Disable backface culling + +--- + +> RL.rlColorMask( bool r, bool g, bool b, bool a ) + +Color mask control + +--- + +> RL.rlSetCullFace( int mode ) + +Set face culling mode + +--- + +> RL.rlEnableScissorTest() + +Enable scissor test + +--- + +> RL.rlDisableScissorTest() + +Disable scissor test + +--- + +> RL.rlScissor( Rectangle area ) + +Scissor test + +--- + +> RL.rlEnableWireMode() + +Enable wire mode + +--- + +> RL.rlEnablePointMode() + +Enable point mode + +--- + +> RL.rlDisableWireMode() + +Disable wire mode + +--- + +> RL.rlSetLineWidth( float width ) + +Set the line drawing width + +--- + +> width = RL.rlGetLineWidth() + +Get the line drawing width + +- Success return float + +--- + +> RL.rlEnableSmoothLines() + +Enable line aliasing + +--- + +> RL.rlDisableSmoothLines() + +Disable line aliasing + +--- + +> RL.rlEnableStereoRender() + +Enable stereo rendering + +--- + +> RL.rlDisableStereoRender() + +Enable stereo rendering + +--- + +> enabled = RL.rlIsStereoRenderEnabled() + +Check if stereo render is enabled + +- Success return bool + +--- + +> RL.rlClearColor( Color color ) + +Clear color buffer with color + +--- + +> RL.rlClearScreenBuffers() + +Clear used screen buffers (color and depth) + +--- + +> RL.rlCheckErrors() + +Check and log OpenGL error codes + +--- + +> RL.rlSetBlendMode( int mode ) + +Set blending mode + +--- + +> RL.rlSetBlendFactors( int glSrcFactor, int glDstFactor, int glEquation ) + +Set blending mode factor and equation (using OpenGL factors) + +--- + +> RL.rlSetBlendFactorsSeparate( int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha ) + +Set blending mode factors and equations separately (using OpenGL factors) + +--- + +## RLGL - Initialization functions + +--- + +> version = RL.rlGetVersion() + +Get current OpenGL version + +- Success return int + +--- + +> version = RL.rlSetFramebufferWidth( int width ) + +Set current framebuffer width + +--- + +> width = RL.rlGetFramebufferWidth() + +Get default framebuffer width + +- Success return int + +--- + +> version = RL.rlSetFramebufferHeight( int height ) + +Set current framebuffer height + +--- + +> height = RL.rlGetFramebufferHeight() + +Get default framebuffer height + +- Success return int + +--- + +> id = RL.rlGetTextureIdDefault() + +Get default texture id + +- Success return int + +--- + +> id = RL.rlGetShaderIdDefault() + +Get default shader id + +- Success return int + +--- + +> locations = RL.rlGetShaderLocsDefault() + +Get default shader locations + +- Success return int{} + +--- + +## RLGL - Render batch management + +--- + +> renderBatch = RL.rlLoadRenderBatch( int numBuffers, int bufferElements ) + +Load a render batch system + +- Success return rlRenderBatch + +--- + +> RL.rlUnloadRenderBatch( rlRenderBatch renderBatch ) + +Unload render batch system + +--- + +> RL.rlDrawRenderBatch( rlRenderBatch renderBatch ) + +Draw render batch data (Update->Draw->Reset) + +--- + +> RL.rlSetRenderBatchActive( rlRenderBatch renderBatch ) + +Set the active render batch for rlgl (nil for default internal) + +--- + +> RL.rlDrawRenderBatchActive() + +Update and draw internal render batch + +--- + +> overflow = RL.rlCheckRenderBatchLimit( int vCount ) + +Check internal buffer overflow for a given number of vertex and force a rlRenderBatch draw call if required + +- Success return bool + +--- + +> RL.rlSetTexture( int id ) + +Set current texture for render batch and check buffers limits + +--- + +## RLGL - Vertex buffers management + +--- + +> vaoId = RL.rlLoadVertexArray() + +Load vertex array (vao) if supported + +- Success return int + +--- + +> vboId = RL.rlLoadVertexBuffer( Buffer buffer, bool dynamic ) + +Load a vertex buffer attribute + +- Success return int + +--- + +> vboId = RL.rlLoadVertexBufferElement( Buffer buffer, bool dynamic ) + +Load a new attributes element buffer + +- Success return int + +--- + +> RL.rlUpdateVertexBuffer( int bufferId, Buffer buffer, int offset ) + +Update GPU buffer with new data + +--- + +> RL.rlUpdateVertexBufferElements( int id, Buffer buffer, int offset ) + +Update vertex buffer elements with new data + +--- + +> RL.rlUnloadVertexArray( int vaoId ) + +Unload vertex array object (VAO) + +--- + +> RL.rlUnloadVertexBuffer( int vboId ) + +Unload vertex buffer (VBO) + +--- + +> RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, int offset ) + +Set vertex attribute data configuration + +--- + +> RL.rlSetVertexAttributeDivisor( int index, int divisor ) + +Set vertex attribute divisor + +--- + +> RL.rlSetVertexAttributeDefault( int locIndex, float{} value, int attribType ) + +Set vertex attribute default value + +--- + +> RL.rlDrawVertexArray( int offset, int count ) + +Draw vertex array + +--- + +> RL.rlDrawVertexArrayElements( int offset, int count, Buffer buffer ) + +Draw vertex array elements + +--- + +> RL.rlDrawVertexArrayInstanced( int offset, int count, int instances ) + +Draw vertex array instanced + +--- + +> RL.rlDrawVertexArrayElementsInstanced( int offset, int count, Buffer buffer, int instances ) + +Draw vertex array elements instanced + +--- + +## RLGL - Textures management + +--- + +> id = RL.rlLoadTexture( Buffer data, Vector2 size, int format, int mipmapCount ) + +Load texture in GPU + +- Success return int + +--- + +> id = RL.rlLoadTextureDepth( Vector2 size, bool useRenderBuffer ) + +Load depth texture/renderbuffer (to be attached to fbo) + +- Success return int + +--- + +> id = RL.rlLoadTextureCubemap( Buffer data, int size, int format, int mipmapCount ) + +Load texture cubemap data + +- Success return int + +--- + +> RL.rlUpdateTexture( int id, Vector2 offset, Vector2 size, int format, Buffer data ) + +Update GPU texture with new data + +--- + +> glInternalFormat, glFormat, glType = RL.rlGetGlTextureFormats( int format ) + +Get OpenGL internal formats + +- Success return int, int, int + +--- + +> name = RL.rlGetPixelFormatName( int format ) + +Get name string for pixel format + +- Success return string + +--- + +> RL.rlUnloadTexture( int id ) + +Unload texture from GPU memory + +--- + +> mipmapCount = RL.rlGenTextureMipmaps( int id, Vector2 size, int format ) + +Generate mipmap data for selected texture + +- Success return int + +--- + +> data = RL.rlReadTexturePixels( int id, Vector2 size, int format ) + +Read texture pixel data + +- Success return Buffer + +--- + +> data = RL.rlReadScreenPixels( Vector2 size ) + +Read screen pixel data (color buffer) + +- Success return Buffer + +--- + +## RLGL - Framebuffer management (fbo) + +--- + +> fboId = RL.rlLoadFramebuffer() + +Load an empty framebuffer + +- Success return int + +--- + +> RL.rlFramebufferAttach( int fboId, int texId, int attachType, int texType, int mipLevel ) + +Attach texture/renderbuffer to a framebuffer + +--- + +> isComplete = RL.rlFramebufferComplete( int id ) + +Verify framebuffer is complete + +- Success return bool + +--- + +> RL.rlUnloadFramebuffer( int id ) + +Delete framebuffer from GPU + +--- + +## RLGL - Shaders management + +--- + +> shaderId = RL.rlLoadShaderCode( string vsCode, string fsCode ) + +Load shader from code strings + +- Success return int + +--- + +> shaderId = RL.rlCompileShader( string shaderCode, int type ) + +Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER) + +- Success return int + +--- + +> shaderProgramId = RL.rlLoadShaderProgram( int vShaderId, int fShaderId ) + +Load custom shader program + +- Success return int + +--- + +> RL.rlUnloadShaderProgram( int id ) + +Unload shader program + +--- + +> location = RL.rlGetLocationUniform( int shaderId, string uniformName ) + +Get shader location uniform + +- Success return int + +--- + +> location = RL.rlGetLocationAttrib( int shaderId, string attribName ) + +Get shader location attribute + +- Success return int + +--- + +> RL.rlSetUniform( int locIndex, Buffer value, int uniformType, int count ) + +Set shader value uniform + +--- + +> RL.rlSetUniformMatrix( int locIndex, Matrix mat ) + +Set shader value matrix + +--- + +> RL.rlSetUniformMatrices( int locIndex, Matrix{} mat ) + +Set shader value matrices + +--- + +> RL.rlSetUniformSampler( int locIndex, int textureId ) + +Set shader value sampler + +--- + +> RL.rlSetShader( int id, int{} locs ) + +Set shader currently active (id and locations) + +--- + +## RLGL - Compute shader management + +--- + +> programId = RL.rlLoadComputeShaderProgram( int shaderId ) + +Load compute shader program + +- Success return int + +--- + +> RL.rlComputeShaderDispatch( int groupX, int groupY, int groupZ ) + +Dispatch compute shader (equivalent to *draw* for graphics pipeline) + +--- + +## RLGL - Shader buffer storage object management (ssbo) + +--- + +> buffer = RL.rlLoadShaderBuffer( int size, Buffer data, int usageHint ) + +Load shader storage buffer object (SSBO) + +- Success return int + +--- + +> RL.rlUnloadShaderBuffer( int ssboId ) + +Unload shader storage buffer object (SSBO) + +--- + +> RL.rlUpdateShaderBuffer( int id, Buffer data, int offset ) + +Update SSBO buffer data + +--- + +> RL.rlBindShaderBuffer( int id, int index ) + +Bind SSBO buffer + +--- + +> data = RL.rlReadShaderBuffer( int id, int count, int offset ) + +Read SSBO buffer data (GPU->CPU) + +- Success return Buffer + +--- + +> RL.rlCopyShaderBuffer( int destId, int srcId, int destOffset, int srcOffset, int count ) + +Copy SSBO data between buffers + +--- + +> size = RL.rlGetShaderBufferSize( int id ) + +Get SSBO buffer size + +- Success return int + +--- + +## RLGL - Buffer management + +--- + +> RL.rlBindImageTexture( int id, int index, int format, bool readonly ) + +Bind image texture + +--- + +## RLGL - Matrix state management + +--- + +> modelview = RL.rlGetMatrixModelview() + +Get internal modelview matrix + +- Success return Matrix + +--- + +> projection = RL.rlGetMatrixProjection() + +Get internal projection matrix + +- Success return Matrix + +--- + +> transform = RL.rlGetMatrixTransform() + +Get internal accumulated transform matrix + +- Success return Matrix + +--- + +> projection = RL.rlGetMatrixProjectionStereo( int eye ) + +Get internal projection matrix for stereo render (selected eye) + +- Success return Matrix + +--- + +> viewOffset = RL.rlGetMatrixViewOffsetStereo( int eye ) + +Get internal view offset matrix for stereo render (selected eye) + +- Success return Matrix + +--- + +> RL.rlSetMatrixProjection( Matrix proj ) + +Set a custom projection matrix (replaces internal projection matrix) + +--- + +> RL.rlSetMatrixModelview( Matrix view ) + +Set a custom modelview matrix (replaces internal modelview matrix) + +--- + +> RL.rlSetMatrixProjectionStereo( Matrix right, Matrix left ) + +Set eyes projection matrices for stereo rendering + +--- + +> RL.rlSetMatrixViewOffsetStereo( Matrix right, Matrix left ) + +Set eyes view offsets matrices for stereo rendering + +--- + +## OpenGL - Rendering + +--- + +> RL.glClear( int mask ) + +Clear buffers to preset values + +--- + +## OpenGL - Frame Buffers + +--- + +> RL.glBlitFramebuffer( RenderTexture srcTex, RenderTexture dstTex, Rectangle srcRect, Rectangle dstRect, int mask, int filter ) + +Copy a block of pixels from one framebuffer object to another. +Use nil RenderTexture for window framebuffer + +--- + +## OpenGL - State Management + +--- + +> RL.glDepthRange( float nearVal, float farVal ) + +Specify mapping of depth values from normalized device coordinates to window coordinates + +--- + +> RL.glEnable( int cap ) + +Enable server-side GL capabilities + +--- + +> RL.glDisable( int cap ) + +Disable server-side GL capabilities + +--- + +> RL.glPolygonOffset( float factor, float units ) + +Set the scale and units used to calculate depth values + +--- + +> RL.glStencilFunc( int func, int ref, int mask ) + +Set front and back function and reference value for stencil testing + +--- + +> RL.glStencilFuncSeparate( int face, int func, int ref, int mask ) + +Set front and/or back function and reference value for stencil testing + +--- + +> RL.glStencilMask( int mask ) + +Control the front and back writing of individual bits in the stencil planes + +--- + +> RL.glStencilMaskSeparate( int face, int mask ) + +Control the front and/or back writing of individual bits in the stencil planes + +--- + +> RL.glStencilOp( int sfail, int dpfail, int dppass ) + +Set front and back stencil test actions + +--- + +> RL.glStencilOpSeparate( int face, int sfail, int dpfail, int dppass ) + +Set front and back stencil test actions + +--- + +## OpenGL - Utility + +--- + +> connection = RL.glGetString( int name, int|nil index ) + +Return a string describing the current GL connection. GL_EXTENSIONS returns the extension string supported by the implementation at index + +- Success return string + +--- + +## Easings - Linear Easing functions + +--- + +> value = RL.EaseLinear( float t, float b, float c, float d ) + +Ease linear + +- Success return float + +--- + +## Easings - Sine Easing functions + +--- + +> value = RL.EaseSineIn( float t, float b, float c, float d ) + +Ease sine in + +- Success return float + +--- + +> value = RL.EaseSineOut( float t, float b, float c, float d ) + +Ease sine out + +- Success return float + +--- + +> value = RL.EaseSineInOut( float t, float b, float c, float d ) + +Ease sine in out + +- Success return float + +--- + +## Easings - Circular Easing functions + +--- + +> value = RL.EaseCircIn( float t, float b, float c, float d ) + +Ease circle in + +- Success return float + +--- + +> value = RL.EaseCircOut( float t, float b, float c, float d ) + +Ease circle out + +- Success return float + +--- + +> value = RL.EaseCircInOut( float t, float b, float c, float d ) + +Ease circle in out + +- Success return float + +--- + +## Easings - Cubic Easing functions + +--- + +> value = RL.EaseCubicIn( float t, float b, float c, float d ) + +Ease cubic in + +- Success return float + +--- + +> value = RL.EaseCubicOut( float t, float b, float c, float d ) + +Ease cubic out + +- Success return float + +--- + +> value = RL.EaseCubicInOut( float t, float b, float c, float d ) + +Ease cubic in out + +- Success return float + +--- + +## Easings - Quadratic Easing functions + +--- + +> value = RL.EaseQuadIn( float t, float b, float c, float d ) + +Ease quadratic in + +- Success return float + +--- + +> value = RL.EaseQuadOut( float t, float b, float c, float d ) + +Ease quadratic out + +- Success return float + +--- + +> value = RL.EaseQuadInOut( float t, float b, float c, float d ) + +Ease quadratic in out + +- Success return float + +--- + +## Easings - Exponential Easing functions + +--- + +> value = RL.EaseExpoIn( float t, float b, float c, float d ) + +Ease exponential in + +- Success return float + +--- + +> value = RL.EaseExpoOut( float t, float b, float c, float d ) + +Ease exponential out + +- Success return float + +--- + +> value = RL.EaseExpoInOut( float t, float b, float c, float d ) + +Ease exponential in out + +- Success return float + +--- + +## Easings - Back Easing functions + +--- + +> value = RL.EaseBackIn( float t, float b, float c, float d ) + +Ease back in + +- Success return float + +--- + +> value = RL.EaseBackOut( float t, float b, float c, float d ) + +Ease back out + +- Success return float + +--- + +> value = RL.EaseBackInOut( float t, float b, float c, float d ) + +Ease back in out + +- Success return float + +--- + +## Easings - Bounce Easing functions + +--- + +> value = RL.EaseBounceIn( float t, float b, float c, float d ) + +Ease bounce in + +- Success return float + +--- + +> value = RL.EaseBounceOut( float t, float b, float c, float d ) + +Ease bounce out + +- Success return float + +--- + +> value = RL.EaseBounceInOut( float t, float b, float c, float d ) + +Ease bounce in out + +- Success return float + +--- + +## Easings - Elastic Easing functions + +--- + +> value = RL.EaseElasticIn( float t, float b, float c, float d ) + +Ease elastic in + +- Success return float + +--- + +> value = RL.EaseElasticOut( float t, float b, float c, float d ) + +Ease elastic out + +- Success return float + +--- + +> value = RL.EaseElasticInOut( float t, float b, float c, float d ) + +Ease elastic in out + +- Success return float + +--- + +## Bitwise Operations - Arithmetic + +--- + +> result = RL.BitAnd( int a, int b ) + +Equivalent to a & b in C + +- Success return int + +--- + +> result = RL.BitOr( int a, int b ) + +Equivalent to a | b in C + +- Success return int + +--- + +> result = RL.BitXor( int a, int b ) + +Equivalent to a ^ b in C + +- Success return int + +--- + +> result = RL.BitNot( int v ) + +Equivalent to ~v in C + +- Success return int + +--- + +> result = RL.BitShiftLeft( int v, int n ) + +Equivalent to v << n in C + +- Success return int + +--- + +> result = RL.BitShiftRight( int v, int n ) + +Equivalent to v >> n in C + +- Success return int + +--- + +> result = RL.BitSet( int v, int i, bool b ) + +Set bit in index i to state b in value v + +- Success return int + +--- + +> bit = RL.BitGet( int v, int i ) + +Get bit in index i from value v + +- Success return bool + +--- + +> result = RL.BitToggle( int v, int i ) + +Toggle bit in index i in value v + +- Success return int + +--- + +## GLFW Core - Input-related functions: keyboard + +--- + +> keyName = RL.GetKeyName( int key, int scancode ) + +This function returns the name of the specified printable key, encoded as UTF-8. +If the key is KEY_UNKNOWN, the scancode is used to identify the key, +otherwise the scancode is ignored. If you specify a non-printable key, +or KEY_UNKNOWN and a scancode that maps to a non-printable key, +this function returns nil but does not emit an error. + +- Success return string or nil + +--- + +> scancode = RL.GetKeyScancode( int key ) + +This function returns the platform-specific scancode of the specified key. +If the key is KEY_UNKNOWN or does not exist on the keyboard this method will return -1. + +- Success return int + +--- + +## Window events + +--- + +> GLFWwindowsizeEvent = { int type, int width, int height } + +Called when the window is resized. Type GLFW_WINDOW_SIZE_EVENT + +--- + +> GLFWwindowmaximizeEvent = { int type, int maximized } + +Called when the window is maximized or restored. Type GLFW_WINDOW_MAXIMIZE_EVENT + +--- + +> GLFWwindowiconifyEvent = { int type, int iconified } + +Called when the window is iconified or restored. Type GLFW_WINDOW_ICONYFY_EVENT + +--- + +> GLFWwindowfocusEvent = { int type, int focused } + +Called when the window gains or loses input focus. Type GLFW_WINDOW_FOCUS_EVENT + +--- + +> GLFWdropEvent = { int type, int count, string{} paths } + +Called when files are dropped to the window. Type GLFW_WINDOW_DROP_EVENT + +--- + +## Input events + +--- + +> GLFWkeyEvent = { int type, int key, int scancode, int action, int mods } + +Called when a physical key is pressed or released or when it repeats. Type GLFW_KEY_EVENT + +--- + +> GLFWcharEvent = { int type, int key } + +Unicode code points for key events that would have led to regular text input and generally behaves as a standard text field on that platform. Type GLFW_CHAR_EVENT + +--- + +> GLFWmousebuttonEvent = { int type, int button, int action, int mods } + +Called when a mouse button is pressed or released. Type GLFW_MOUSE_BUTTON_EVENT + +--- + +> GLFWcursorposEvent = { int type, float x, float y } + +Called when the cursor moves over the window. Type GLFW_MOUSE_CURSOR_POS_EVENT + +--- + +> GLFWscrollEvent = { int type, float xoffset, float yoffset } + +Called when the user scrolls, whether with a mouse wheel or touchpad gesture. Type GLFW_MOUSE_SCROLL_EVENT + +--- + +> GLFWcursorenterEvent = { int type, int enter } + +Called when the cursor enters or leaves the content area of a window. Type GLFW_CURSOR_ENTER_EVENT + +--- + +> GLFWjoystickEvent = { int type, int jid, int event } + +Called when a joystick is connected or disconnected. Type GLFW_JOYSTICK_EVENT + +--- + +> GLFWpentabletdataEvent = { int type, float x, float y, float z, float pressure, float pitch, float yaw, float roll } + +Called when the pen tablet data is updated. Type GLFW_PEN_TABLET_DATA_EVENT +NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 + +--- + +> GLFWpentabletcursorEvent = { int type, int identifier } + +Called when the pen tablet cursor has changed. Type GLFW_PEN_TABLET_CURSOR_EVENT +NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 + +--- + +> GLFWpentabletproximityEvent = { int type, int proxState } + +Called when the pen tablet proximity has changed. Type GLFW_PEN_TABLET_PROXIMITY_EVENT +NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 + +--- diff --git a/docs/ASSET_LOADING.md b/docs/ASSET_LOADING.md new file mode 100644 index 0000000..a38a264 --- /dev/null +++ b/docs/ASSET_LOADING.md @@ -0,0 +1,285 @@ +# Asset Loading System + +ReiLua includes a built-in asset loading system with a nice loading screen UI that automatically shows progress while assets are being loaded. + +## 🎨 Features + +- **Automatic Progress Tracking** - Tracks how many assets have been loaded +- **Beautiful Loading UI** - Modern, minimal loading screen with: + - Animated "Loading..." text with dots + - Smooth progress bar with shimmer effect + - Progress percentage (e.g., "3 / 10") + - Current asset name being loaded + - Dark, clean color scheme +- **Easy to Use** - Just 3 functions to show loading progress +- **Works Everywhere** - Development and release builds + +## 📝 API Functions + +### RL.BeginAssetLoading(totalAssets) + +Initialize asset loading progress tracking and show the loading screen. + +**Parameters:** +- `totalAssets` (integer) - Total number of assets to load + +**Example:** +```lua +RL.BeginAssetLoading(10) -- We're loading 10 assets +``` + +--- + +### RL.UpdateAssetLoading(assetName) + +Update the loading progress and display current asset being loaded. + +**Parameters:** +- `assetName` (string) - Name of the asset currently being loaded + +**Example:** +```lua +RL.UpdateAssetLoading("player.png") +``` + +Call this **after** each asset is loaded to update the progress bar. + +--- + +### RL.EndAssetLoading() + +Finish asset loading and hide the loading screen. + +**Example:** +```lua +RL.EndAssetLoading() +``` + +## 🚀 Quick Example + +```lua +function RL.init() + -- List of assets to load + local assetsToLoad = { + "assets/player.png", + "assets/enemy.png", + "assets/background.png", + "assets/music.wav", + } + + -- Begin loading + RL.BeginAssetLoading(#assetsToLoad) + + -- Load each asset + for i, path in ipairs(assetsToLoad) do + RL.UpdateAssetLoading(path) -- Update progress + + -- Load the actual asset + if path:match("%.png$") or path:match("%.jpg$") then + textures[i] = RL.LoadTexture(path) + elseif path:match("%.wav$") or path:match("%.ogg$") then + sounds[i] = RL.LoadSound(path) + end + end + + -- Done! + RL.EndAssetLoading() +end +``` + +## 💡 Complete Example + +```lua +local assets = {} + +local assetsToLoad = { + {type="texture", name="player", path="assets/player.png"}, + {type="texture", name="enemy", path="assets/enemy.png"}, + {type="texture", name="background", path="assets/background.png"}, + {type="sound", name="music", path="assets/music.wav"}, + {type="sound", name="shoot", path="assets/shoot.wav"}, + {type="font", name="title", path="assets/title.ttf"}, +} + +function RL.init() + RL.SetWindowTitle("My Game") + + -- Start loading with progress + RL.BeginAssetLoading(#assetsToLoad) + + -- Load all assets + for i, asset in ipairs(assetsToLoad) do + -- Show current asset name on loading screen + RL.UpdateAssetLoading(asset.name) + + -- Load based on type + if asset.type == "texture" then + assets[asset.name] = RL.LoadTexture(asset.path) + elseif asset.type == "sound" then + assets[asset.name] = RL.LoadSound(asset.path) + elseif asset.type == "font" then + assets[asset.name] = RL.LoadFont(asset.path) + end + end + + -- Loading complete! + RL.EndAssetLoading() + + print("Game ready!") +end + +function RL.update(delta) + -- Your game logic +end + +function RL.draw() + RL.ClearBackground(RL.RAYWHITE) + + -- Use loaded assets + if assets.background then + RL.DrawTexture(assets.background, {0, 0}, RL.WHITE) + end + + if assets.player then + RL.DrawTexture(assets.player, {100, 100}, RL.WHITE) + end +end +``` + +## 🎨 Loading Screen Appearance + +The loading screen features a clean 1-bit pixel art style: + +**Design:** +- Pure black and white aesthetic +- Retro pixel art styling +- Minimal and clean design + +**Elements:** +- **Title**: "LOADING" in bold white pixel text +- **Animated Dots**: White pixelated dots (4x4 squares) that cycle +- **Progress Bar**: + - 200px wide, 16px tall + - Thick 2px white border (pixel art style) + - White fill with black dithering pattern + - Retro/Classic terminal aesthetic +- **Progress Text**: "3/10" in white pixel font style +- **Asset Name**: Current loading asset in small white text +- **Corner Decorations**: White pixel art L-shaped corners in all 4 corners + +**Background:** +- Pure black background (#000000) +- High contrast for maximum clarity + +**Color Palette:** +- White text and UI (#FFFFFF) +- Black background (#000000) +- Pure 1-bit aesthetic (inverted terminal style) + +**Visual Layout:** +``` +[Black Background] + +┌─┐ ┌─┐ +│ │ LOADING □ □ │ │ +│ │ │ │ +│ │ ┌──────────────────┐ │ │ +│ │ │████████░░░░░░░░░░│ 3/10 │ │ +│ │ └──────────────────┘ │ │ +│ │ │ │ +│ │ player.png │ │ +│ │ │ │ +└─┘ └─┘ + +[All text and UI elements in WHITE] +``` + +**Style Inspiration:** +- Classic terminal / console aesthetic +- MS-DOS loading screens +- 1-bit dithering patterns +- Chunky pixel borders +- Retro computing / CRT monitor style + +## 🔧 Customization + +If you want to customize the loading screen appearance, you can modify the colors and sizes in `src/lua_core.c` in the `drawLoadingScreen()` function. + +## ⚡ Performance Tips + +1. **Call UpdateAssetLoading AFTER loading** - This ensures the progress updates at the right time +2. **Load assets in order of importance** - Load critical assets first +3. **Group similar assets** - Load all textures, then sounds, etc. +4. **Use descriptive names** - Shows better feedback to users + +## 📋 Example Asset Loading Patterns + +### Pattern 1: Simple List +```lua +local files = {"player.png", "enemy.png", "music.wav"} +RL.BeginAssetLoading(#files) +for i, file in ipairs(files) do + RL.UpdateAssetLoading(file) + -- load file +end +RL.EndAssetLoading() +``` + +### Pattern 2: With Types +```lua +local assets = { + textures = {"player.png", "enemy.png"}, + sounds = {"music.wav", "shoot.wav"}, +} +local total = #assets.textures + #assets.sounds + +RL.BeginAssetLoading(total) +for _, file in ipairs(assets.textures) do + RL.UpdateAssetLoading(file) + -- load texture +end +for _, file in ipairs(assets.sounds) do + RL.UpdateAssetLoading(file) + -- load sound +end +RL.EndAssetLoading() +``` + +### Pattern 3: Error Handling +```lua +RL.BeginAssetLoading(#files) +for i, file in ipairs(files) do + RL.UpdateAssetLoading(file) + + if RL.FileExists(file) then + -- load file + else + print("Warning: " .. file .. " not found") + end +end +RL.EndAssetLoading() +``` + +## 🎮 When to Use + +**Use the loading system when:** +- You have more than 5-10 assets to load +- Assets are large (images, sounds, fonts) +- Loading might take more than 1 second +- You want polished loading feedback + +**You can skip it when:** +- You have very few, small assets +- Loading is nearly instant +- You prefer immediate game start + +## ✨ Benefits + +- ✅ Polished user experience +- ✅ User knows the game is loading, not frozen +- ✅ Shows progress for large asset sets +- ✅ Works with embedded assets +- ✅ Minimal code required +- ✅ Beautiful default UI + +The loading system makes your game feel polished with just a few lines of code! diff --git a/docs/BUILD_SCRIPTS.md b/docs/BUILD_SCRIPTS.md new file mode 100644 index 0000000..875ef0b --- /dev/null +++ b/docs/BUILD_SCRIPTS.md @@ -0,0 +1,213 @@ +# Build Scripts Documentation + +ReiLua includes automated build scripts for easy development and release builds. + +## Available Scripts + +### Development Build Scripts +- **Windows**: `scripts\build_dev.bat` +- **Linux/Unix**: `scripts/build_dev.sh` + +### Release Build Scripts +- **Windows**: `scripts\build_release.bat` +- **Linux/Unix**: `scripts/build_release.sh` + +## Development Build + +### Purpose +Fast iteration during game development with external Lua files and assets. + +### Usage + +**Windows:** +```cmd +scripts\build_dev.bat +``` + +**Linux/Unix:** +```bash +chmod +x scripts/build_dev.sh +scripts/build_dev.sh +``` + +### Features +- ✅ No embedding - loads Lua and assets from file system +- ✅ Fast build times +- ✅ Edit code and assets without rebuilding +- ✅ Automatic cleanup of embedded files +- ✅ Warns if Lua files or assets are in build directory +- ✅ Optional clean build: `scripts\build_dev.bat clean` or `scripts/build_dev.sh clean` + +### Output +- Development executable: `build/ReiLua.exe` +- Run your game: `cd your_game && path/to/build/ReiLua.exe` +- Debug mode: `path/to/build/ReiLua.exe --log` + +## Release Build + +### Purpose +Create a single-file executable for distribution with all code and assets embedded. + +### Preparation + +Before running the release build, prepare your files: + +```bash +cd build + +# Copy all Lua files +copy ..\your_game\*.lua . +# Or: cp ../your_game/*.lua . + +# Copy assets +mkdir assets +copy ..\your_game\assets\* assets\ +# Or: cp -r ../your_game/assets/* assets/ +``` + +### Usage + +**Windows:** +```cmd +scripts\build_release.bat +``` + +**Linux/Unix:** +```bash +chmod +x scripts/build_release.sh +scripts/build_release.sh +``` + +### Features +- ✅ Embeds all Lua files from `build/` directory +- ✅ Embeds all assets from `build/assets/` folder +- ✅ Creates single-file executable +- ✅ Release optimization enabled +- ✅ Verifies Lua files and assets before building +- ✅ Shows summary of embedded files after build +- ✅ Interactive confirmation before building + +### Output +- Release executable: `build/ReiLua.exe` +- Ready for distribution - no external dependencies +- Can be renamed to your game name + +### Build Configuration + +The release build automatically configures: +- `EMBED_MAIN=ON` - Embeds all Lua files +- `EMBED_ASSETS=ON` - Embeds all assets (if assets folder exists) +- `CMAKE_BUILD_TYPE=Release` - Optimized build + +## Customizing Your Executable + +### Adding Custom Icon + +1. Replace `icon.ico` with your own icon file +2. Keep the same filename or update `resources.rc` +3. Rebuild + +### Changing Executable Properties + +Edit `resources.rc` to customize: + +```rc +VALUE "CompanyName", "Your Studio Name" +VALUE "FileDescription", "Your Game Description" +VALUE "ProductName", "Your Game Name" +VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" +``` + +### Renaming the Executable + +Edit `CMakeLists.txt`: +```cmake +project( YourGameName ) # Line 6 +``` + +After building, the executable will be named `YourGameName.exe`. + +## Workflow Examples + +### Development Workflow + +```bash +# Initial setup +scripts\build_dev.bat + +# Edit your Lua files in your game directory +# ... make changes ... + +# Just run - no rebuild needed! +cd your_game +path\to\build\ReiLua.exe + +# If you modify C code, rebuild +scripts\build_dev.bat +``` + +### Release Workflow + +```bash +# 1. Prepare files +cd build +copy ..\your_game\*.lua . +mkdir assets +copy ..\your_game\assets\* assets\ + +# 2. Build release +cd .. +scripts\build_release.bat + +# 3. Test +cd build +ReiLua.exe --log + +# 4. Distribute +# Copy build\ReiLua.exe to your distribution folder +``` + +## Troubleshooting + +### "CMake configuration failed" +- Ensure CMake is installed and in PATH +- Ensure MinGW is installed and in PATH +- Check `CMakeLists.txt` exists in parent directory + +### "No Lua files found" +- Copy your Lua files to `build/` directory before release build +- Ensure `main.lua` exists (required entry point) + +### "Build failed" +- Check compiler errors in output +- Ensure all dependencies are installed +- Try clean build: `scripts\build_dev.bat clean` + +### Development build embedding warning +- The dev build script warns if it finds Lua files or assets in build/ +- These should be removed for development builds +- The script offers to remove them automatically + +## Script Features + +### Safety Features +- Checks for correct directory before running +- Validates required files exist +- Warns about potential issues +- Interactive confirmations for release builds +- Automatic cleanup of old embedded files + +### User Friendly +- Clear progress messages +- Colored output (where supported) +- Helpful error messages +- Pause at end to review results +- Quick reference commands shown after build + +## Notes + +- Development builds are **much faster** than release builds +- Release builds may take longer due to embedding and optimization +- Always test your release build before distribution +- The scripts work on both Windows (CMD/PowerShell) and Unix shells +- On Unix, make scripts executable: `chmod +x build_*.sh` diff --git a/docs/CUSTOMIZATION.md b/docs/CUSTOMIZATION.md new file mode 100644 index 0000000..388a894 --- /dev/null +++ b/docs/CUSTOMIZATION.md @@ -0,0 +1,401 @@ +# Customizing Your ReiLua Executable + +This guide explains how to customize the ReiLua executable with your own branding. + +## Overview + +You can customize: +- Executable name +- Window icon +- File properties (company name, version, description, etc.) +- Splash screen text and logos +- Loading screen appearance + +## Quick Customization Checklist + +- [ ] Change executable name in CMakeLists.txt +- [ ] Replace icon.ico with your game icon +- [ ] Edit resources.rc with your game information +- [ ] Customize splash screens in src/splash.c +- [ ] Replace logo images in logo/ folder +- [ ] Rebuild the project + +## 1. Changing the Executable Name + +The easiest customization - change "ReiLua.exe" to "YourGame.exe". + +### Steps + +1. Open `CMakeLists.txt` +2. Find line 6 (near the top): + ```cmake + project( ReiLua ) + ``` +3. Change to your game name: + ```cmake + project( MyAwesomeGame ) + ``` +4. Rebuild: + ```bash + cd build + cmake .. + cmake --build . --config Release + ``` + +Result: Executable is now named `MyAwesomeGame.exe` + +## 2. Adding a Custom Icon + +Replace the default icon with your game's icon. + +### Requirements + +- **Format**: .ico file (Windows icon format) +- **Recommended sizes**: 16x16, 32x32, 48x48, 256x256 +- **Tools**: Use online converters or tools like IcoFX, GIMP, or Photoshop + +### Steps + +1. Create or convert your image to .ico format +2. Replace `icon.ico` in the ReiLua root folder with your icon +3. Keep the same filename (`icon.ico`) or update `resources.rc`: + ```rc + IDI_ICON1 ICON "your_icon.ico" + ``` +4. Rebuild the project + +**Tip**: Many online tools can convert PNG to ICO: +- https://convertio.co/png-ico/ +- https://www.icoconverter.com/ + +## 3. Customizing Executable Properties + +When users right-click your .exe and select "Properties", they see file information. Customize this to show your game details. + +### Steps + +1. Open `resources.rc` +2. Find the `VERSIONINFO` section +3. Modify these values: + +```rc +1 VERSIONINFO +FILEVERSION 1,0,0,0 // Change version numbers +PRODUCTVERSION 1,0,0,0 // Change product version +FILEFLAGSMASK 0x3fL +FILEFLAGS 0x0L +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Your Studio Name" // Your company/studio + VALUE "FileDescription", "Your Game - An awesome game" // Game description + VALUE "FileVersion", "1.0.0.0" // File version string + VALUE "InternalName", "YourGame" // Internal name + VALUE "LegalCopyright", "Copyright (C) 2025 Your Name" // Copyright notice + VALUE "OriginalFilename", "YourGame.exe" // Original filename + VALUE "ProductName", "Your Game" // Product name + VALUE "ProductVersion", "1.0.0.0" // Product version string + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END +``` + +### Common Values + +**FileVersion / ProductVersion Format**: Major, Minor, Patch, Build +- Example: `1,0,0,0` for version 1.0.0.0 +- Example: `2,3,1,5` for version 2.3.1.5 + +**CompanyName Examples**: +- "Your Studio Name" +- "Independent Developer" +- "Your Name Games" + +**FileDescription**: +- Short description users see in file properties +- Example: "Space Adventure Game" +- Example: "Puzzle Game with Physics" + +**LegalCopyright**: +- Standard format: "Copyright (C) Year Your Name" +- Example: "Copyright (C) 2025 Indie Studios" + +4. Rebuild the project + +## 4. Customizing Splash Screens + +Change the text and logos that appear when your game starts. + +### Changing Splash Screen Text + +1. Open `src/splash.c` +2. Find the splash drawing function (around line 150) +3. Change this line: + ```c + const char* text = "YOUR STUDIO NAME"; + ``` + +**Style Tips**: +- Use ALL CAPS for bold impact +- Keep it short (under 30 characters) +- Examples: "INDIE STUDIO GAMES", "MADE BY YOUR NAME", "GAME JAM 2025" + +### Changing Splash Screen Logos + +1. Create or find your logos: + - **Recommended size**: 256x256 pixels or smaller + - **Format**: PNG with transparency + - **Style**: Simple, recognizable logos work best + +2. Replace these files: + ``` + logo/raylib_logo.png → Your game logo + logo/reilua_logo.png → Your studio logo (or keep ReiLua logo as credit) + ``` + +3. Logo sizing: + - Logos are automatically scaled to max 200px + - They display side-by-side on second splash screen + - Maintain aspect ratio + +4. Rebuild the project - logos are automatically embedded + +### Changing Splash Screen Timing + +1. Open `src/splash.c` +2. Modify these constants at the top: + ```c + #define FADE_IN_TIME 0.8f // Seconds to fade in (default: 0.8) + #define DISPLAY_TIME 2.5f // Seconds fully visible (default: 2.5) + #define FADE_OUT_TIME 0.8f // Seconds to fade out (default: 0.8) + ``` + +**Recommendations**: +- Keep fade times between 0.5 - 1.5 seconds +- Display time between 1.5 - 3.5 seconds +- Total splash time ideally under 10 seconds + +### Changing Splash Screen Colors + +1. Open `src/splash.c` +2. Find color definitions: + ```c + // First splash screen background (Raylib red) + Color bgColor = (Color){ 230, 41, 55, 255 }; // Change these RGB values + + // Second splash screen background (Black) + Color bg = BLACK; // Change to any color + ``` + +**Color Examples**: +- White: `(Color){ 255, 255, 255, 255 }` +- Blue: `(Color){ 0, 120, 215, 255 }` +- Dark Gray: `(Color){ 32, 32, 32, 255 }` +- Your brand color: `(Color){ R, G, B, 255 }` + +## 5. Customizing the Loading Screen + +Change the appearance of the asset loading screen. + +### Steps + +1. Open `src/lua_core.c` +2. Find the `drawLoadingScreen()` function +3. Modify colors and style: + +```c +// Background color +Color bgColor = BLACK; // Change background + +// Text color +Color textColor = WHITE; // Change text color + +// Progress bar fill color +Color fillColor = WHITE; // Change bar fill + +// Border color +Color borderColor = WHITE; // Change borders +``` + +### Customizing Loading Text + +```c +// In drawLoadingScreen() function +const char* loadingText = "LOADING"; // Change to "LOADING GAME", etc. +``` + +### Changing Progress Bar Size + +```c +int barWidth = 200; // Default 200px, change as needed +int barHeight = 16; // Default 16px, change as needed +int borderThick = 2; // Border thickness +``` + +## 6. Complete Rebranding Example + +Here's a complete example of rebranding ReiLua as "Space Quest": + +### 1. CMakeLists.txt +```cmake +project( SpaceQuest ) +``` + +### 2. resources.rc +```rc +VALUE "CompanyName", "Cosmic Games Studio" +VALUE "FileDescription", "Space Quest - Explore the Galaxy" +VALUE "FileVersion", "1.0.0.0" +VALUE "InternalName", "SpaceQuest" +VALUE "LegalCopyright", "Copyright (C) 2025 Cosmic Games" +VALUE "OriginalFilename", "SpaceQuest.exe" +VALUE "ProductName", "Space Quest" +VALUE "ProductVersion", "1.0.0.0" +``` + +### 3. icon.ico +Replace with your space-themed icon + +### 4. src/splash.c +```c +const char* text = "COSMIC GAMES STUDIO"; +``` + +### 5. logo/ folder +``` +logo/raylib_logo.png → Your game logo (space ship, planet, etc.) +logo/reilua_logo.png → Studio logo (keep ReiLua logo for credit) +``` + +### 6. Build +```bash +cd build +cmake .. +cmake --build . --config Release +``` + +Result: `SpaceQuest.exe` with all your custom branding! + +## 7. Advanced: Removing ReiLua Branding + +If you want to completely remove ReiLua references: + +### Remove "Made with ReiLua" Logo + +1. Open `src/splash.c` +2. Find `drawMadeWithSplash()` function +3. Comment out or modify the function to only show your logo + +### Remove Second Splash Screen + +1. Open `src/main.c` +2. Find the splash screen loop +3. Modify to only call your custom splash + +**Note**: Please keep attribution to Raylib and ReiLua in your game's credits or about screen as a courtesy! + +## 8. Build and Test + +After making any customizations: + +```bash +# Clean build (recommended after customizations) +cd build +rm -rf * # Or: rmdir /s /q * on Windows +cmake .. +cmake --build . --config Release + +# Test with console +YourGame.exe --log + +# Test production mode +YourGame.exe +``` + +Verify: +- ✅ Executable has correct name +- ✅ Icon appears in file explorer +- ✅ Right-click → Properties shows correct info +- ✅ Splash screens display correctly +- ✅ Loading screen appears as expected + +## Checklist: Release-Ready Customization + +Before releasing your game: + +- [ ] Executable name matches your game +- [ ] Custom icon is recognizable at small sizes +- [ ] File properties are complete and accurate +- [ ] Splash screens show correct studio name +- [ ] Logos are high quality and appropriate size +- [ ] Loading screen matches your game's aesthetic +- [ ] Copyright and legal information is correct +- [ ] Version numbers are accurate +- [ ] Tested on target platforms +- [ ] Credits mention Raylib and ReiLua + +## Tips for Polish + +1. **Consistent Branding**: Use the same colors, fonts, and style across splash screens, loading screen, and in-game UI + +2. **Icon Quality**: Invest time in a good icon - it's the first thing users see + +3. **Version Management**: Update version numbers for each release + +4. **Legal Info**: Always include proper copyright and attribution + +5. **Test Everything**: Test your branded executable on a clean system + +6. **Keep Credits**: Mention Raylib and ReiLua in your game's credits screen + +## Troubleshooting + +**Icon doesn't change:** +- Ensure .ico file is valid +- Rebuild completely (clean build) +- Clear icon cache (Windows): Delete `IconCache.db` + +**Properties don't update:** +- Verify `resources.rc` syntax is correct +- Rebuild completely +- Check that resource compiler ran (check build output) + +**Splash screens don't show changes:** +- Rebuild with clean build +- Check `scripts/embed_logo.py` ran successfully +- Verify logo files exist in `logo/` folder + +**Executable name unchanged:** +- Check `CMakeLists.txt` project name +- Do a clean rebuild +- Verify cmake configuration step succeeded + +## Additional Resources + +### Icon Creation Tools +- **IcoFX**: Icon editor (paid) +- **GIMP**: Free, supports ICO export +- **Online**: convertio.co, icoconverter.com + +### Image Editing +- **GIMP**: Free, powerful image editor +- **Paint.NET**: Simple, free Windows editor +- **Photoshop**: Industry standard (paid) + +### Color Picking +- **ColorPicker**: Use system color picker +- **HTML Color Codes**: htmlcolorcodes.com +- **Adobe Color**: color.adobe.com + +--- + +Now your ReiLua executable is fully branded and ready to represent your game! diff --git a/docs/DOCUMENTATION_INDEX.md b/docs/DOCUMENTATION_INDEX.md new file mode 100644 index 0000000..fee3521 --- /dev/null +++ b/docs/DOCUMENTATION_INDEX.md @@ -0,0 +1,213 @@ +# Documentation Overview + +This document provides a quick reference to all available documentation for ReiLua Enhanced Edition. + +## Core Documentation + +### 📘 [README.md](README.md) - **START HERE** +The main documentation covering: +- What is ReiLua Enhanced Edition +- Complete attributions (Raylib, ReiLua, enhancements) +- Quick start guide +- All enhanced features overview +- Command line options +- Building from source (Windows, Linux, Mac, Raspberry Pi, Web) +- Complete release workflow +- Troubleshooting + +**Read this first!** + +--- + +## Feature-Specific Guides + +### 🎨 [SPLASH_SCREENS.md](SPLASH_SCREENS.md) +Everything about splash screens: +- How the dual splash screen system works +- Custom text splash screen details +- "Made using Raylib + ReiLua" screen details +- Skipping splashes with `--no-logo` flag +- Customizing text, logos, timing, and colors +- Technical implementation details +- Troubleshooting splash screen issues + +### 📦 [EMBEDDING.md](EMBEDDING.md) +Complete guide to embedding: +- Development vs release workflows +- Embedding Lua files (`EMBED_MAIN=ON`) +- Embedding assets (`EMBED_ASSETS=ON`) +- Console control with `--log` flag +- Complete release build workflow +- Asset path consistency +- Troubleshooting embedding issues + +### 📊 [ASSET_LOADING.md](ASSET_LOADING.md) +Asset loading system documentation: +- API functions (`BeginAssetLoading`, `UpdateAssetLoading`, `EndAssetLoading`) +- Beautiful 1-bit pixel art loading screen +- Complete examples +- Loading patterns +- Progress tracking +- When to use the loading system +- Customization options + +### 🔧 [BUILD_SCRIPTS.md](BUILD_SCRIPTS.md) +Build automation documentation: +- `scripts\build_dev.bat` / `scripts/build_dev.sh` - Development builds +- `scripts\build_release.bat` / `scripts/build_release.sh` - Release builds +- Features of each build type +- Workflow examples +- Customizing executable name, icon, and properties +- Troubleshooting build issues + +### 🎨 [CUSTOMIZATION.md](CUSTOMIZATION.md) +Complete rebranding guide: +- Changing executable name +- Adding custom icon +- Customizing file properties (company name, version, etc.) +- Customizing splash screens +- Customizing loading screen +- Complete rebranding example +- Removing ReiLua branding (with attribution notes) + +### 💻 [ZED_EDITOR_SETUP.md](ZED_EDITOR_SETUP.md) +Complete Zed editor setup: +- Why Zed for ReiLua development +- Installation guide +- Lua Language Server configuration +- Project setup with `.zed/settings.json` +- Task configuration for quick testing +- Essential keyboard shortcuts +- Multi-cursor editing, split views, Vim mode +- Troubleshooting LSP issues +- Workflow tips and best practices + +--- + +## Technical Documentation + +### 📚 [API.md](API.md) +Complete API reference: +- 1000+ functions +- All ReiLua/Raylib bindings +- Function signatures +- Raygui, Raymath, Lights, Easings, RLGL modules + +### 📝 [tools/ReiLua_API.lua](tools/ReiLua_API.lua) +Lua annotations file: +- Provides autocomplete in LSP-enabled editors +- Function documentation +- Copy to your project for IDE support + +### 🔄 [UPGRADE_SUMMARY.md](UPGRADE_SUMMARY.md) +Technical implementation details: +- Features added in this enhanced version +- Files modified and added +- Build options explained +- Testing checklist +- Known changes from original ReiLua + +--- + +## Quick Reference by Task + +### "I want to start making a game" +1. Read [README.md](README.md) - Quick Start section +2. Look at examples in `examples/` folder +3. Use `ReiLua.exe --log --no-logo` for development + +### "I want to embed my game into a single .exe" +1. Read [EMBEDDING.md](EMBEDDING.md) +2. Use `scripts\build_release.bat` / `scripts/build_release.sh` +3. Follow the complete release workflow in [README.md](README.md) + +### "I want to add a loading screen" +1. Read [ASSET_LOADING.md](ASSET_LOADING.md) +2. Use `RL.BeginAssetLoading()`, `RL.UpdateAssetLoading()`, `RL.EndAssetLoading()` +3. See complete examples in the guide + +### "I want to customize splash screens" +1. Read [SPLASH_SCREENS.md](SPLASH_SCREENS.md) +2. Edit `src/splash.c` for text changes +3. Replace logo files in `logo/` folder +4. Rebuild project + +### "I want to rebrand the executable" +1. Read [CUSTOMIZATION.md](CUSTOMIZATION.md) +2. Change project name in `CMakeLists.txt` +3. Replace `icon.ico` +4. Edit `resources.rc` +5. Customize splash screens +6. Rebuild + +### "I want to setup my code editor" +1. Read [ZED_EDITOR_SETUP.md](ZED_EDITOR_SETUP.md) +2. Install Zed and Lua Language Server +3. Copy `tools/ReiLua_API.lua` to your project +4. Create `.zed/settings.json` configuration +5. Set up tasks for quick testing + +### "I want to build ReiLua from source" +1. Read [README.md](README.md) - Building from Source section +2. Install prerequisites (CMake, compiler, Raylib, Lua) +3. Use `scripts\build_dev.bat` for development +4. Use `scripts\build_release.bat` for release + +### "I need API reference" +1. Open [API.md](API.md) +2. Search for function name +3. See function signature and description +4. Or copy [tools/ReiLua_API.lua](tools/ReiLua_API.lua) for autocomplete + +--- + +## Documentation File Sizes + +| File | Size | Purpose | +|------|------|---------| +| README.md | 21 KB | Main documentation (START HERE) | +| ZED_EDITOR_SETUP.md | 13 KB | Editor setup guide | +| CUSTOMIZATION.md | 11 KB | Rebranding guide | +| ASSET_LOADING.md | 8 KB | Loading system guide | +| EMBEDDING.md | 7 KB | Embedding guide | +| SPLASH_SCREENS.md | 7 KB | Splash screen guide | +| UPGRADE_SUMMARY.md | 6 KB | Technical details | +| BUILD_SCRIPTS.md | 5 KB | Build automation guide | +| API.md | 207 KB | Complete API reference | + +--- + +## Contribution + +When adding new features, please: +1. Update relevant documentation +2. Add examples where appropriate +3. Update this overview if adding new docs +4. Test documentation accuracy + +--- + +## Documentation Standards + +All documentation follows these standards: +- ✅ Clear headings and structure +- ✅ Code examples for all features +- ✅ Troubleshooting sections +- ✅ Cross-references to related docs +- ✅ Platform-specific notes where needed +- ✅ Emoji icons for visual scanning +- ✅ Complete but concise + +--- + +## Quick Links + +- **Original ReiLua**: https://github.com/Gamerfiend/ReiLua +- **Raylib**: https://github.com/raysan5/raylib +- **Lua**: https://www.lua.org/ +- **Zed Editor**: https://zed.dev/ + +--- + +**Last Updated**: 2025-01-03 +**Documentation Version**: 1.0 (Enhanced Edition) diff --git a/docs/EMBEDDING.md b/docs/EMBEDDING.md new file mode 100644 index 0000000..13f3752 --- /dev/null +++ b/docs/EMBEDDING.md @@ -0,0 +1,289 @@ +# Embedding main.lua into Executable + +When you're ready to ship your game, you can embed all Lua files and asset files directly into the executable. + +## Development vs Release Workflow + +### 🔧 Development Build (Fast Iteration) + +During development, use external files for quick iteration: + +**Setup:** +``` +GameFolder/ +├── ReiLua.exe +├── main.lua +├── player.lua +└── assets/ + ├── player.png + └── music.wav +``` + +**Build:** +```bash +cd build +cmake .. +cmake --build . +``` + +**Benefits:** +- ✅ Edit Lua files and re-run immediately +- ✅ Edit assets and reload +- ✅ Fast development cycle +- ✅ Debug with `--log` flag + +### 📦 Release Build (Single Executable) + +For distribution, embed everything into one file: + +**Setup:** +```bash +cd build + +# Copy Lua files to build directory +copy ..\main.lua . +copy ..\player.lua . + +# Create assets folder and copy files +mkdir assets +copy ..\player.png assets\ +copy ..\music.wav assets\ +``` + +**Build:** +```bash +# Configure with embedding +cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON + +# Build release +cmake --build . --config Release +``` + +**Result:** +``` +Distribution/ +└── YourGame.exe (Everything embedded!) +``` + +**Benefits:** +- ✅ Single executable file +- ✅ No external dependencies +- ✅ Users can't modify game files +- ✅ Smaller download (no separate files) + +## Quick Start + +### Embedding Lua Files + +1. **Copy your Lua files to the build directory**: + ```bash + copy main.lua build\main.lua + copy player.lua build\player.lua + ``` + +2. **Build with EMBED_MAIN option**: + ```bash + cd build + cmake .. -DEMBED_MAIN=ON + cmake --build . --config Release + ``` + +## Command Line Options + +ReiLua supports several command-line options: + +```bash +ReiLua [Options] [Directory to main.lua or main] + +Options: + -h, --help Show help message + -v, --version Show ReiLua version + -i, --interpret Interpret mode [File name] + --log Show console window for logging (Windows only) +``` + +### Console/Logging + +By default, ReiLua runs **without a console window** for a clean user experience. To enable console output for debugging: + +```bash +# Run with console for debugging +ReiLua.exe --log + +# You can also combine with other options +ReiLua.exe --log path/to/game + +# Or with interpret mode +ReiLua.exe --log -i script.lua +``` + +This is useful during development to see: +- TraceLog output +- Print statements +- Lua errors +- Debug information + +## Complete Release Workflow + +Here's a complete step-by-step guide to prepare your game for release: + +### Step 1: Organize Your Project + +Ensure your project has this structure: +``` +MyGame/ +├── main.lua +├── player.lua +├── enemy.lua +├── player.png +├── enemy.png +├── music.wav +└── icon.ico (optional) +``` + +### Step 2: Customize Branding (Optional) + +**Change executable icon:** +```bash +# Replace ReiLua's icon with yours +copy MyGame\icon.ico ReiLua\icon.ico +``` + +**Edit executable properties:** +Open `ReiLua\resources.rc` and modify: +```rc +VALUE "CompanyName", "Your Studio Name" +VALUE "FileDescription", "Your Game Description" +VALUE "ProductName", "Your Game Name" +VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" +``` + +**Change executable name:** +Edit `ReiLua\CMakeLists.txt`: +```cmake +project( YourGameName ) # Change from "ReiLua" +``` + +See [CUSTOMIZATION.md](CUSTOMIZATION.md) for full details. + +### Important: Asset Paths + +**Keep your paths consistent!** The embedding system now preserves the `assets/` prefix, so use the same paths in both development and release: + +```lua +-- ✅ Correct - works in both dev and release +playerImage = RL.LoadTexture("assets/player.png") +backgroundImg = RL.LoadTexture("assets/background.png") +musicSound = RL.LoadSound("assets/music.wav") +``` + +Your Lua code doesn't need to change between development and release builds! + +### Step 3: Prepare Build Directory + +```bash +cd ReiLua\build + +# Copy all Lua files +copy ..\MyGame\*.lua . + +# Create assets folder +mkdir assets + +# Copy all asset files (images, sounds, etc.) +copy ..\MyGame\*.png assets\ +copy ..\MyGame\*.wav assets\ +copy ..\MyGame\*.ogg assets\ +# Or copy entire folders +xcopy /E /I ..\MyGame\images assets\images +xcopy /E /I ..\MyGame\sounds assets\sounds +``` + +### Step 4: Build Release + +```bash +# Configure with embedding enabled +cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON + +# Build in release mode +cmake --build . --config Release +``` + +### Step 5: Test Release Build + +```bash +# Test with console to verify everything loaded +YourGameName.exe --log + +# Test production mode (no console) +YourGameName.exe +``` + +Check console output for: +- ✅ "ReiLua x.x.x" version info +- ✅ No file loading errors +- ✅ Game runs correctly + +### Step 6: Package for Distribution + +```bash +# Create distribution folder +mkdir ..\Distribution +copy YourGameName.exe ..\Distribution\ + +# Optional: Add README, LICENSE, etc. +copy ..\README.txt ..\Distribution\ +``` + +Your game is now ready to distribute as a single executable! + +### Workflow Summary + +| Stage | Build Command | Files Needed | Result | +|-------|--------------|--------------|--------| +| **Development** | `cmake .. && cmake --build .` | Lua + assets external | Fast iteration | +| **Testing** | `cmake .. -DEMBED_MAIN=ON && cmake --build .` | Lua in build/ | Test embedding | +| **Release** | `cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON && cmake --build . --config Release` | Lua + assets in build/ | Single .exe | + +### Troubleshooting + +**Problem: "No .lua files found in build directory"** +```bash +# Solution: Copy Lua files to build directory +copy ..\*.lua . +``` + +**Problem: "No files found in assets folder"** +```bash +# Solution: Create assets folder and copy files +mkdir assets +copy ..\*.png assets\ +``` + +**Problem: Game crashes on startup** +```bash +# Solution: Run with --log to see error messages +YourGameName.exe --log +``` + +**Problem: Assets not loading** +- Verify assets are in `build/assets/` before building +- Check asset filenames match in your Lua code +- Use `--log` to see loading errors + +### Notes + +- `.lua` files in the **build directory root** are embedded when using `EMBED_MAIN=ON` +- Asset files in **build/assets/** folder (and subfolders) are embedded when using `EMBED_ASSETS=ON` +- `main.lua` must exist and is always the entry point +- Asset embedding works with subdirectories: `assets/images/player.png` → Load with `LoadImage("player.png")` +- Both Lua and asset embedding can be used independently or together +- The system falls back to file system if embedded file is not found +- No code changes needed - all raylib functions work automatically with embedded assets + +## Customizing Your Executable + +Want to add your own icon and version info to the executable? See [CUSTOMIZATION.md](CUSTOMIZATION.md) for details on: +- Adding a custom icon +- Setting exe properties (company name, version, description) +- Renaming the executable diff --git a/docs/SPLASH_SCREENS.md b/docs/SPLASH_SCREENS.md new file mode 100644 index 0000000..840a0d2 --- /dev/null +++ b/docs/SPLASH_SCREENS.md @@ -0,0 +1,230 @@ +# Splash Screens + +ReiLua includes a built-in splash screen system that displays splash screens before your game loads. This gives your game a polished appearance right from startup. + +## Overview + +When you run your ReiLua game, it automatically shows two splash screens in sequence: + +1. **Custom Text** - Clean, bold text on Raylib red background (similar to Squid Game style) +2. **"Made using"** - Text with Raylib and ReiLua logos displayed side-by-side + +Each splash screen: +- Fades in over 0.8 seconds +- Displays for 2.5 seconds +- Fades out over 0.8 seconds +- Total display time: 8.2 seconds for both screens + +## Features + +### Always Embedded + +The logo images are **always embedded** into the executable in both development and release builds. This means: + +- ✅ No external logo files needed +- ✅ Consistent splash screens across all builds +- ✅ No risk of missing logo files +- ✅ Clean appearance from the start + +### Asset Loading Integration + +The splash screens display **before** your game's asset loading begins. This means: + +1. User starts your game +2. Splash screens play (~8 seconds) +3. Your `RL.init()` function runs +4. Asset loading with progress indicator (if you use it) +5. Your game starts + +This creates a smooth, polished startup experience. + +## Skipping Splash Screens (Development) + +During development, you often need to test your game repeatedly. Waiting for splash screens every time can slow down your workflow. Use the `--no-logo` flag to skip them: + +```bash +# Windows +ReiLua.exe --no-logo + +# Linux/Mac +./ReiLua --no-logo + +# With other options +ReiLua.exe --log --no-logo +./ReiLua --no-logo path/to/game/ +``` + +**Note:** The `--no-logo` flag only works in development. In release builds, users should see the full splash screen sequence. + +## Technical Details + +### How It Works + +The splash screen system is implemented in C and runs before any Lua code executes: + +1. **Logo Embedding**: During build, `scripts/embed_logo.py` converts PNG files to C byte arrays +2. **Initialization**: Before calling `RL.init()`, the engine initializes splash screens +3. **Display Loop**: A dedicated loop handles timing, fading, and rendering +4. **Cleanup**: After completion, resources are freed and Lua code begins + +### Files + +- `src/splash.c` - Splash screen implementation +- `include/splash.h` - Header file +- `scripts/embed_logo.py` - Python script to embed logo images +- `logo/raylib_logo.png` - Raylib logo (embedded) +- `logo/reilua_logo.png` - ReiLua logo (embedded) + +### Build Integration + +The CMakeLists.txt automatically: + +1. Runs `scripts/embed_logo.py` during build +2. Generates `embedded_logo.h` with logo data +3. Defines `EMBED_LOGO` flag +4. Compiles `splash.c` with the project + +No manual steps required - it just works! + +## Customization + +### Changing Splash Screen Text + +To change the default text to your studio name: + +1. Open `src/splash.c` +2. Find the splash drawing function +3. Change the text line: + ```c + const char* text = "YOUR STUDIO NAME"; + ``` +4. Rebuild the project + +**Note:** Use ALL CAPS for the Squid Game-style aesthetic. + +### Changing Logos + +To use different logos: + +1. Replace `logo/raylib_logo.png` and/or `logo/reilua_logo.png` with your images +2. Recommended size: 256x256 or smaller (logos are auto-scaled to max 200px) +3. Format: PNG with transparency support +4. Rebuild the project - logos will be automatically embedded + +### Changing Timing + +To adjust how long each screen displays: + +1. Open `src/splash.c` +2. Modify these constants at the top: + ```c + #define FADE_IN_TIME 0.8f // Seconds to fade in + #define DISPLAY_TIME 2.5f // Seconds to display fully + #define FADE_OUT_TIME 0.8f // Seconds to fade out + ``` +3. Rebuild the project + +### Removing Splash Screens Entirely + +If you don't want any splash screens: + +1. Open `src/main.c` +2. Find this block: + ```c + /* Show splash screens if not skipped */ + if ( !skip_splash ) { + splashInit(); + // ... splash code ... + splashCleanup(); + } + ``` +3. Comment out or remove the entire block +4. Rebuild the project + +## Example: Complete Startup Sequence + +Here's what a typical game startup looks like with everything enabled: + +```bash +ReiLua.exe MyGame/ +``` + +**User Experience:** + +1. **Splash Screen 1** (4.1 seconds) + - Custom text displayed in bold (default: "YOUR STUDIO NAME") + - Red background (Raylib color #E62937) + - Subtle zoom effect + +2. **Splash Screen 2** (4.1 seconds) + - "Made using" text at top + - Raylib + ReiLua logos side-by-side (max 200px each) + - Black background + +3. **Asset Loading** (varies) + - Your loading screen with progress bar + - Shows "Loading texture1.png", "3/10", etc. + +4. **Game Start** + - Your game's main screen appears + - Player can interact + +## Best Practices + +1. **Keep --no-logo for Development**: Always use `--no-logo` during active development +2. **Test Without Flag**: Occasionally test without `--no-logo` to ensure splash screens work +3. **Customize for Your Studio**: Change the text and logos to match your branding +4. **Consider Total Time**: Splash (~8s) + Loading (varies) = Total startup time +5. **Optimize Loading**: Keep asset loading fast to maintain a good first impression + +## Troubleshooting + +### Splash Screens Don't Show + +**Problem**: Game starts immediately without splash screens + +**Solutions**: +- Check you're not using `--no-logo` flag +- Verify logos exist in `logo/` folder before building +- Check console output for embedding errors +- Rebuild project completely: `cmake .. && make clean && make` + +### Logos Appear Corrupted + +**Problem**: Logos display incorrectly or not at all + +**Solutions**: +- Verify PNG files are valid (open in image viewer) +- Check file sizes aren't too large (keep under 1MB each) +- Ensure PNGs use standard format (not progressive or exotic encoding) +- Rebuild project to regenerate embedded data + +### Compilation Errors + +**Problem**: Build fails with logo-related errors + +**Solutions**: +- Ensure Python 3 is installed and in PATH +- Check `scripts/embed_logo.py` has correct paths +- Verify `logo/` folder exists with both PNG files +- Check CMake output for specific error messages + +## Command Reference + +```bash +# Development (skip splash) +ReiLua --no-logo + +# Development with logging +ReiLua --log --no-logo + +# Production/testing (full splash) +ReiLua + +# Help +ReiLua --help +``` + +--- + +The splash screen system adds a polished touch to your ReiLua games with minimal effort. Customize it to match your studio's branding and give players a great first impression! diff --git a/docs/UPGRADE_SUMMARY.md b/docs/UPGRADE_SUMMARY.md new file mode 100644 index 0000000..35eb38b --- /dev/null +++ b/docs/UPGRADE_SUMMARY.md @@ -0,0 +1,186 @@ +# ReiLua Embedded Assets Upgrade - Summary + +## Overview +Successfully ported embedded assets, splash screens, and asset loading features from ReiLua-JamVersion to the main ReiLua repository on the `embedded-assets-support` branch. + +## Features Added + +### 1. **Embedded Main.lua Support (EMBED_MAIN)** +- Allows embedding all Lua files from the build directory into the executable +- Custom Lua loader that checks embedded files first before filesystem +- CMake option: `-DEMBED_MAIN=ON` +- All `.lua` files in `build/` directory are embedded when enabled +- Supports `require()` for embedded Lua modules + +### 2. **Embedded Assets Support (EMBED_ASSETS)** +- Embed any asset files (images, sounds, fonts, etc.) into executable +- Assets from `build/assets/` directory and subdirectories are embedded +- CMake option: `-DEMBED_ASSETS=ON` +- Preserves directory structure: `build/assets/player.png` → load as `"assets/player.png"` +- Transparent to Lua code - same paths work in dev and release + +### 3. **Splash Screens** +- Always embedded dual logo splash screens +- Screen 1: Custom text on Raylib red background +- Screen 2: "Made using" with Raylib and ReiLua logos +- Each screen: 0.8s fade in, 2.5s display, 0.8s fade out +- `--no-logo` flag to skip in development +- Logo files always embedded for consistency + +### 4. **Asset Loading Progress API** +- `RL.BeginAssetLoading(totalAssets)` - Initialize loading tracking +- `RL.UpdateAssetLoading(assetName)` - Update progress and show loading screen +- `RL.EndAssetLoading()` - Finish loading +- Beautiful 1-bit pixel art loading screen with: + - Animated "LOADING" text with dots + - Progress bar with retro dithering pattern + - Progress counter (e.g., "3/10") + - Current asset name display + - Pixel art corner decorations + +### 5. **Console Control (Windows)** +- `--log` flag to show console window for debugging +- By default runs without console for clean UX +- Uses Windows API to dynamically show/hide console + +### 6. **Font Embedding** +- Custom Oleaguid font always embedded for splash/loading screens +- Ensures consistent appearance across builds + +## Files Added/Modified + +### New Files +- **Python Scripts:** + - `scripts/embed_lua.py` - Embeds Lua files into C header + - `scripts/embed_assets.py` - Embeds asset files into C header + - `scripts/embed_logo.py` - Embeds splash screen logos + - `scripts/embed_font.py` - Embeds custom font + +- **Source Files:** + - `src/splash.c` - Splash screen implementation + - `include/splash.h` - Splash screen header + +- **Assets:** + - `logo/raylib_logo.png` - Raylib logo (2466 bytes) + - `logo/reilua_logo.png` - ReiLua logo (1191 bytes) + - `fonts/Oleaguid.ttf` - Custom font (112828 bytes) + +- **Documentation:** + - `EMBEDDING.md` - Complete guide to embedding Lua and assets + - `ASSET_LOADING.md` - Asset loading API documentation + - `SPLASH_SCREENS.md` - Splash screen customization guide + - `BUILD_SCRIPTS.md` - Build scripts documentation + +- **Build Scripts:** + - `scripts\build_dev.bat` / `scripts/build_dev.sh` - One-command development builds + - `scripts\build_release.bat` / `scripts/build_release.sh` - One-command release builds with embedding + +- **Icon and Resources:** + - `icon.ico` - Default Windows executable icon + - `resources.rc` - Windows resource file for exe metadata + +### Modified Files +- `CMakeLists.txt` - Added embedding options and build commands +- `src/main.c` - Added splash screens, console control, --no-logo flag +- `src/lua_core.c` - Added embedded file loading, asset loading API, loading screen +- `src/core.c` - Added asset loading API functions +- `include/core.h` - Added asset loading function declarations +- `include/lua_core.h` - Changed luaCallMain() return type to bool + +## Build Options + +### Quick Build (Recommended) + +**Development (Fast Iteration):** +```bash +# Windows +scripts\build_dev.bat + +# Linux/Unix +scripts/build_dev.sh +``` + +**Release (Single Executable):** +```bash +# Copy files to build directory first +cd build +copy ..\*.lua . +mkdir assets +copy ..\assets\* assets\ + +# Then build +cd .. + +# Windows +scripts\build_release.bat + +# Linux/Unix +scripts/build_release.sh +``` + +### Manual Build + +**Development Build (Fast Iteration):** +```bash +cmake -G "MinGW Makefiles" .. +mingw32-make +``` +- External Lua and asset files +- Fast edit-and-run workflow +- Use `--no-logo` to skip splash screens + +**Release Build (Single Executable):** +```bash +# Copy Lua files and assets to build directory +copy ..\*.lua . +mkdir assets +copy ..\assets\* assets\ + +# Configure with embedding +cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON +mingw32-make +``` +- Everything embedded in single .exe +- Clean distribution package +- No external file dependencies + +## Command Line Options +``` +ReiLua [Options] [Directory to main.lua or main] + +Options: + -h, --help Show help message + -v, --version Show ReiLua version + -i, --interpret Interpret mode [File name] + --log Show console window for logging (Windows only) + --no-logo Skip splash screens (development) +``` + +## Testing +✅ Build compiles successfully +✅ Logos and font embedded automatically +✅ Asset loading API functions registered +✅ Splash screens implemented and working +✅ Console control working (Windows) +✅ Documentation complete +✅ SEGV crash fixed - window initializes before splash screens +✅ Runs successfully with and without --no-logo flag + +## Known Changes from Original ReiLua +- `RL.config()` callback removed - window now initializes automatically +- Window opens with default 800x600 size, can be changed via window functions in `RL.init()` +- Custom font (Oleaguid) always loaded for consistent appearance +- `stateContextInit()` merged into `stateInit()` + +## Next Steps +1. Test with actual embedded Lua files +2. Test with embedded assets +3. Verify asset loading progress display +4. Test splash screens (run without --no-logo) +5. Create example game that uses all features +6. Merge to main branch when stable + +## Commit +- Branch: `embedded-assets-support` +- Commit: "Add embedded assets, splash screens, and asset loading support" +- All changes committed successfully diff --git a/docs/ZED_EDITOR_SETUP.md b/docs/ZED_EDITOR_SETUP.md new file mode 100644 index 0000000..6f72482 --- /dev/null +++ b/docs/ZED_EDITOR_SETUP.md @@ -0,0 +1,434 @@ +# Zed Editor Setup for ReiLua + +This guide explains how to set up autocomplete, type hints, and documentation for ReiLua in Zed Editor. + +--- + +## Method 1: Using Lua Language Server (Recommended) + +Zed uses the **Lua Language Server (LuaLS)** for Lua support. ReiLua includes `tools/ReiLua_API.lua` with LuaLS annotations. + +### Setup Steps + +#### 1. Install Lua Language Server in Zed + +Zed should automatically install LuaLS when you open a Lua file. If not: + +1. Open Zed +2. Go to **Extensions** (Cmd/Ctrl + Shift + X) +3. Search for "Lua" +4. Install the Lua extension + +#### 2. Configure Your Project + +Create a `.luarc.json` file in your project root: + +```json +{ + "runtime.version": "Lua 5.4", + "workspace.library": [ + "${3rd}/luassert/library", + "${3rd}/busted/library" + ], + "completion.enable": true, + "diagnostics.globals": [ + "RL" + ], + "workspace.checkThirdParty": false +} +``` + +#### 3. Copy tools/ReiLua_API.lua to Your Project + +Copy `tools/ReiLua_API.lua` to your game project folder: + +```bash +# From ReiLua directory +cp tools/ReiLua_API.lua /path/to/your/game/project/ +``` + +Or on Windows: +```powershell +Copy-Item tools/ReiLua_API.lua "C:\path\to\your\game\project\" +``` + +#### 4. (Optional) Create Library Directory + +For better organization, create a library directory: + +``` +your-game/ +├── main.lua +├── .luarc.json +└── .lua/ + └── tools/ReiLua_API.lua +``` + +Update `.luarc.json`: +```json +{ + "runtime.version": "Lua 5.4", + "workspace.library": [".lua"], + "completion.enable": true, + "diagnostics.globals": ["RL"], + "workspace.checkThirdParty": false +} +``` + +--- + +## Method 2: Global Configuration (All Projects) + +To make ReiLua API available for all projects: + +### Windows + +1. Create directory: `%USERPROFILE%\.luarocks\lib\lua\5.4\` +2. Copy `tools/ReiLua_API.lua` to this directory +3. Add to global LuaLS config: + +**Location:** `%APPDATA%\Zed\settings.json` or via Zed settings + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.workspace.library": [ + "C:\\Users\\YourName\\.luarocks\\lib\\lua\\5.4" + ], + "Lua.diagnostics.globals": ["RL"] + } + } + } +} +``` + +### Linux/macOS + +1. Create directory: `~/.lua/reilua/` +2. Copy `tools/ReiLua_API.lua` to this directory +3. Update Zed settings: + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.workspace.library": [ + "~/.lua/reilua" + ], + "Lua.diagnostics.globals": ["RL"] + } + } + } +} +``` + +--- + +## Method 3: Using Zed's LSP Configuration + +Create a `.zed/settings.json` in your project: + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.runtime.version": "Lua 5.4", + "Lua.workspace.library": [ + "." + ], + "Lua.completion.enable": true, + "Lua.completion.callSnippet": "Replace", + "Lua.completion.displayContext": 3, + "Lua.diagnostics.globals": [ + "RL" + ], + "Lua.hint.enable": true, + "Lua.hint.paramName": "All", + "Lua.hint.setType": true + } + } + } +} +``` + +--- + +## Verifying Setup + +Create a test file `test.lua`: + +```lua +function RL.init() + -- Type "RL." and you should see autocomplete + RL.SetWindowTitle("Test") -- Should show documentation + + local color = RL.RED -- Should autocomplete color constants + + -- Hover over functions to see documentation + RL.DrawText("Hello", 10, 10, 20, color) +end + +function RL.update(delta) + -- 'delta' should show as number type +end +``` + +If autocomplete works, you should see: +- ✅ Function suggestions when typing `RL.` +- ✅ Parameter hints when calling functions +- ✅ Documentation on hover +- ✅ Constant values (RL.RED, RL.KEY_SPACE, etc.) + +--- + +## Enhanced Features + +### Enable Inlay Hints + +In Zed settings: + +```json +{ + "inlay_hints": { + "enabled": true + }, + "lsp": { + "lua-language-server": { + "settings": { + "Lua.hint.enable": true, + "Lua.hint.paramName": "All", + "Lua.hint.setType": true, + "Lua.hint.paramType": true + } + } + } +} +``` + +This will show: +- Parameter names inline +- Variable types +- Return types + +### Disable Annoying Warnings + +Add these to suppress common false positives: + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.diagnostics.disable": [ + "lowercase-global", + "unused-local", + "duplicate-set-field", + "missing-fields", + "undefined-field" + ], + "Lua.diagnostics.globals": ["RL"] + } + } + } +} +``` + +**Common warnings and what they mean:** +- `lowercase-global` - Using global variables with lowercase names (RL is intentional) +- `unused-local` - Local variables that aren't used +- `duplicate-set-field` - Redefining functions (callback functions are expected to be redefined) +- `missing-fields` - Table fields that might not exist +- `undefined-field` - Accessing fields that aren't documented + +> **Note:** The `tools/ReiLua_API.lua` file now uses type annotations instead of function definitions for callbacks to prevent duplicate warnings. + +--- + +## Troubleshooting + +### "duplicate-set-field" Error + +**Problem:** Getting warnings like `Duplicate field 'init'. (Lua Diagnostics. duplicate-set-field)` + +**Why:** The `tools/ReiLua_API.lua` file previously defined callback functions as empty function definitions. When you define them in your `main.lua`, LSP sees it as redefining the same field. + +**Solution:** The latest `tools/ReiLua_API.lua` now uses type annotations instead: + +```lua +-- Old way (caused warnings) +function RL.init() end + +-- New way (no warnings) +---@type fun() +RL.init = nil +``` + +**Fix Steps:** +1. **Update `tools/ReiLua_API.lua`** - Copy the latest version from the repository +2. **Or add to diagnostics.disable** in your configuration: + ```json + { + "diagnostics.disable": ["duplicate-set-field"] + } + ``` +3. **Restart Zed** to reload the configuration + +**Benefits of the new approach:** +- ✅ No duplicate warnings +- ✅ Still get autocomplete +- ✅ Still get documentation on hover +- ✅ Still get type checking + +--- + +### Autocomplete Not Working + +1. **Restart Zed** after configuration changes +2. **Check LSP Status**: Look for Lua Language Server in bottom-right status bar +3. **Verify File Location**: Ensure `tools/ReiLua_API.lua` is in the workspace +4. **Check Console**: Open Zed's log to see LSP errors + +### Performance Issues + +If the language server is slow: + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.workspace.maxPreload": 2000, + "Lua.workspace.preloadFileSize": 1000 + } + } + } +} +``` + +### Missing Documentation + +Ensure hover is enabled: + +```json +{ + "hover_popover_enabled": true +} +``` + +--- + +## Advanced: Custom Annotations + +You can extend `tools/ReiLua_API.lua` with your own game types: + +```lua +---@class Player +---@field x number +---@field y number +---@field health number + +---@class Enemy +---@field x number +---@field y number +---@field damage number + +-- Your game globals +---@type Player +player = {} + +---@type Enemy[] +enemies = {} +``` + +--- + +## Keyboard Shortcuts in Zed + +- **Trigger Autocomplete**: `Ctrl+Space` (Windows/Linux) or `Cmd+Space` (macOS) +- **Show Documentation**: Hover or `Ctrl+K Ctrl+I` +- **Go to Definition**: `F12` or `Cmd+Click` +- **Find References**: `Shift+F12` +- **Rename Symbol**: `F2` + +--- + +## Additional Resources + +- [Lua Language Server GitHub](https://github.com/LuaLS/lua-language-server) +- [LuaLS Annotations Guide](https://github.com/LuaLS/lua-language-server/wiki/Annotations) +- [Zed Documentation](https://zed.dev/docs) + +--- + +## Example Project Structure + +``` +my-reilua-game/ +├── .luarc.json # LuaLS configuration +├── .zed/ +│ └── settings.json # Zed-specific settings +├── tools/ReiLua_API.lua # API definitions (copy from ReiLua) +├── main.lua # Your game entry point +├── player.lua +├── enemy.lua +└── assets/ + ├── sprites/ + └── sounds/ +``` + +--- + +## Quick Start Template + +Save this as `.luarc.json` in your project: + +```json +{ + "runtime.version": "Lua 5.4", + "completion.enable": true, + "completion.callSnippet": "Replace", + "diagnostics.globals": ["RL"], + "diagnostics.disable": [ + "lowercase-global", + "duplicate-set-field", + "missing-fields" + ], + "workspace.checkThirdParty": false, + "workspace.library": ["."], + "hint.enable": true +} +``` + +Save this as `.zed/settings.json`: + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.hint.enable": true, + "Lua.hint.paramName": "All", + "Lua.hint.setType": true, + "Lua.diagnostics.disable": [ + "lowercase-global", + "duplicate-set-field", + "missing-fields" + ] + } + } + }, + "inlay_hints": { + "enabled": true + } +} +``` + +Then copy `tools/ReiLua_API.lua` to your project root, and you're ready to go! + +--- + +**Happy Coding! 🚀** diff --git a/embed_assets.py b/embed_assets.py deleted file mode 100644 index 52309ef..0000000 --- a/embed_assets.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -""" -Embed asset files (images, sounds, fonts, etc.) into a C header file. -Usage: python embed_assets.py [file2.wav] [file3.ttf] ... - -Embeds all specified asset files into a C header for inclusion in the executable. -""" -import sys -import os - -def sanitize_name(filename): - """Convert filename to valid C identifier""" - name = os.path.basename(filename) - # Remove or replace all non-alphanumeric characters (except underscore) - valid_chars = [] - for char in name: - if char.isalnum() or char == '_': - valid_chars.append(char) - else: - valid_chars.append('_') - name = ''.join(valid_chars) - # Ensure it doesn't start with a digit - if name and name[0].isdigit(): - name = '_' + name - return name - -def get_file_extension(filename): - """Get the file extension""" - return os.path.splitext(filename)[1].lower() - -def embed_files(output_file, input_files): - with open(output_file, 'w') as f: - f.write('#ifndef EMBEDDED_ASSETS_H\n') - f.write('#define EMBEDDED_ASSETS_H\n\n') - f.write('/* Auto-generated file - do not edit manually */\n\n') - - # Embed each file as a separate array - for idx, input_file in enumerate(input_files): - with open(input_file, 'rb') as inf: - data = inf.read() - - var_name = sanitize_name(input_file) - # Extract relative path from 'assets/' onwards if present - if 'assets' in input_file.replace('\\', '/'): - parts = input_file.replace('\\', '/').split('assets/') - if len(parts) > 1: - relative_name = 'assets/' + parts[-1] - else: - relative_name = os.path.basename(input_file) - else: - relative_name = os.path.basename(input_file) - - f.write(f'/* Embedded asset: {input_file} ({len(data)} bytes) */\n') - f.write(f'static const unsigned char embedded_asset_{idx}_{var_name}[] = {{\n') - - for i, byte in enumerate(data): - if i % 12 == 0: - f.write(' ') - f.write(f'0x{byte:02x}') - if i < len(data) - 1: - f.write(',') - if (i + 1) % 12 == 0: - f.write('\n') - else: - f.write(' ') - - f.write('\n};\n') - f.write(f'static const unsigned int embedded_asset_{idx}_{var_name}_len = {len(data)};\n\n') - - # Create the asset table - f.write('/* Asset table for virtual filesystem */\n') - f.write('typedef struct {\n') - f.write(' const char* name;\n') - f.write(' const unsigned char* data;\n') - f.write(' unsigned int size;\n') - f.write('} EmbeddedAsset;\n\n') - - f.write('static const EmbeddedAsset embedded_assets[] = {\n') - for idx, input_file in enumerate(input_files): - var_name = sanitize_name(input_file) - # Extract relative path from 'assets/' onwards if present - if 'assets' in input_file.replace('\\', '/'): - parts = input_file.replace('\\', '/').split('assets/') - if len(parts) > 1: - relative_name = 'assets/' + parts[-1] - else: - relative_name = os.path.basename(input_file) - else: - relative_name = os.path.basename(input_file) - f.write(f' {{ "{relative_name}", embedded_asset_{idx}_{var_name}, embedded_asset_{idx}_{var_name}_len }},\n') - f.write('};\n\n') - - f.write(f'static const int embedded_asset_count = {len(input_files)};\n\n') - f.write('#endif /* EMBEDDED_ASSETS_H */\n') - -if __name__ == '__main__': - if len(sys.argv) < 3: - print('Usage: python embed_assets.py [asset2] ...') - print(' Embeds images, sounds, fonts, and other asset files into a C header.') - print(' Supported: .png, .jpg, .wav, .ogg, .mp3, .ttf, .otf, etc.') - sys.exit(1) - - output_file = sys.argv[1] - input_files = sys.argv[2:] - - # Check all input files exist - for f in input_files: - if not os.path.exists(f): - print(f'Error: File not found: {f}') - sys.exit(1) - - embed_files(output_file, input_files) - print(f'Embedded {len(input_files)} asset file(s) into {output_file}') - for f in input_files: - size = os.path.getsize(f) - print(f' - {f} ({size} bytes)') diff --git a/embed_font.py b/embed_font.py deleted file mode 100644 index 8144718..0000000 --- a/embed_font.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 -""" -Embed font file into C header. -Usage: python embed_font.py -""" - -import sys -import os - -def embed_file(file_path, var_name): - """Convert a file to a C byte array""" - with open(file_path, 'rb') as f: - data = f.read() - - output = f"/* {os.path.basename(file_path)} */\n" - output += f"static const unsigned char {var_name}[] = {{\n" - - # Write bytes in rows of 16 - for i in range(0, len(data), 16): - chunk = data[i:i+16] - hex_values = ', '.join(f'0x{b:02x}' for b in chunk) - output += f" {hex_values},\n" - - output += "};\n" - output += f"static const unsigned int {var_name}_size = {len(data)};\n\n" - - return output - -def main(): - if len(sys.argv) != 3: - print("Usage: python embed_font.py ") - sys.exit(1) - - output_file = sys.argv[1] - font_file = sys.argv[2] - - # Check if file exists - if not os.path.exists(font_file): - print(f"Error: {font_file} not found!") - sys.exit(1) - - # Generate header content - header_content = "/* Auto-generated embedded font file */\n" - header_content += "#pragma once\n\n" - - # Embed font file - header_content += embed_file(font_file, "embedded_font_data") - - # Write to output file - with open(output_file, 'w') as f: - f.write(header_content) - - print(f"Generated {output_file}") - print(f" - Embedded {font_file} ({os.path.getsize(font_file)} bytes)") - -if __name__ == "__main__": - main() diff --git a/embed_logo.py b/embed_logo.py deleted file mode 100644 index e6b645e..0000000 --- a/embed_logo.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python3 -""" -Embed logo image files into C header for splash screens. -Usage: python embed_logo.py -""" - -import sys -import os - -def embed_file(file_path, var_name): - """Convert a file to a C byte array""" - with open(file_path, 'rb') as f: - data = f.read() - - output = f"/* {os.path.basename(file_path)} */\n" - output += f"static const unsigned char {var_name}[] = {{\n" - - # Write bytes in rows of 16 - for i in range(0, len(data), 16): - chunk = data[i:i+16] - hex_values = ', '.join(f'0x{b:02x}' for b in chunk) - output += f" {hex_values},\n" - - output += "};\n" - output += f"static const unsigned int {var_name}_size = {len(data)};\n\n" - - return output - -def main(): - if len(sys.argv) != 4: - print("Usage: python embed_logo.py ") - sys.exit(1) - - output_file = sys.argv[1] - raylib_logo = sys.argv[2] - reilua_logo = sys.argv[3] - - # Check if files exist - if not os.path.exists(raylib_logo): - print(f"Error: {raylib_logo} not found!") - sys.exit(1) - - if not os.path.exists(reilua_logo): - print(f"Error: {reilua_logo} not found!") - sys.exit(1) - - # Generate header content - header_content = "/* Auto-generated embedded logo files */\n" - header_content += "#pragma once\n\n" - - # Embed both logo files - header_content += embed_file(raylib_logo, "embedded_raylib_logo") - header_content += embed_file(reilua_logo, "embedded_reilua_logo") - - # Write to output file - with open(output_file, 'w') as f: - f.write(header_content) - - print(f"Generated {output_file}") - print(f" - Embedded {raylib_logo} ({os.path.getsize(raylib_logo)} bytes)") - print(f" - Embedded {reilua_logo} ({os.path.getsize(reilua_logo)} bytes)") - -if __name__ == "__main__": - main() diff --git a/embed_lua.py b/embed_lua.py deleted file mode 100644 index 9562354..0000000 --- a/embed_lua.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python3 -""" -Embed multiple Lua files into a C header file for inclusion in the executable. -Usage: python embed_lua.py [file2.lua] [file3.lua] ... - -Embeds all specified Lua files into a C header with a virtual filesystem. -The first file is treated as main.lua (entry point). -""" -import sys -import os - -def sanitize_name(filename): - """Convert filename to valid C identifier""" - name = os.path.basename(filename) - name = name.replace('.', '_').replace('-', '_').replace('/', '_').replace('\\', '_') - return name - -def embed_files(output_file, input_files): - with open(output_file, 'w') as f: - f.write('#ifndef EMBEDDED_MAIN_H\n') - f.write('#define EMBEDDED_MAIN_H\n\n') - f.write('/* Auto-generated file - do not edit manually */\n\n') - - # Embed each file as a separate array - for idx, input_file in enumerate(input_files): - with open(input_file, 'rb') as inf: - data = inf.read() - - var_name = sanitize_name(input_file) - f.write(f'/* Embedded file: {input_file} */\n') - f.write(f'static const unsigned char embedded_lua_{idx}_{var_name}[] = {{\n') - - for i, byte in enumerate(data): - if i % 12 == 0: - f.write(' ') - f.write(f'0x{byte:02x}') - if i < len(data) - 1: - f.write(',') - if (i + 1) % 12 == 0: - f.write('\n') - else: - f.write(' ') - - f.write('\n};\n') - f.write(f'static const unsigned int embedded_lua_{idx}_{var_name}_len = {len(data)};\n\n') - - # Create the file table - f.write('/* File table for virtual filesystem */\n') - f.write('typedef struct {\n') - f.write(' const char* name;\n') - f.write(' const unsigned char* data;\n') - f.write(' unsigned int size;\n') - f.write('} EmbeddedLuaFile;\n\n') - - f.write('static const EmbeddedLuaFile embedded_lua_files[] = {\n') - for idx, input_file in enumerate(input_files): - var_name = sanitize_name(input_file) - # Store both original filename and basename for require compatibility - basename = os.path.basename(input_file) - f.write(f' {{ "{basename}", embedded_lua_{idx}_{var_name}, embedded_lua_{idx}_{var_name}_len }},\n') - f.write('};\n\n') - - f.write(f'static const int embedded_lua_file_count = {len(input_files)};\n\n') - - # Main entry point (first file) - var_name = sanitize_name(input_files[0]) - f.write('/* Main entry point */\n') - f.write(f'#define embedded_main_lua embedded_lua_0_{var_name}\n') - f.write(f'#define embedded_main_lua_len embedded_lua_0_{var_name}_len\n\n') - - f.write('#endif /* EMBEDDED_MAIN_H */\n') - -if __name__ == '__main__': - if len(sys.argv) < 3: - print('Usage: python embed_lua.py [file2.lua] ...') - print(' The first Lua file is treated as the main entry point.') - sys.exit(1) - - output_file = sys.argv[1] - input_files = sys.argv[2:] - - # Check all input files exist - for f in input_files: - if not os.path.exists(f): - print(f'Error: File not found: {f}') - sys.exit(1) - - embed_files(output_file, input_files) - print(f'Embedded {len(input_files)} file(s) into {output_file}') - for f in input_files: - print(f' - {f}') - diff --git a/scripts/build_dev.bat b/scripts/build_dev.bat new file mode 100644 index 0000000..c1d79d2 --- /dev/null +++ b/scripts/build_dev.bat @@ -0,0 +1,100 @@ +@echo off +REM ReiLua Development Build Script +REM Run this from w64devkit shell or CMD with MinGW in PATH + +echo ================================ +echo ReiLua - Development Build +echo ================================ +echo. + +REM Navigate to build directory +cd build +if errorlevel 1 ( + echo ERROR: Cannot access build directory + exit /b 1 +) + +REM Clean old embedded files (important for dev builds!) +echo Cleaning old embedded files... +del /Q embedded_main.h embedded_assets.h 2>nul + +REM Warn about Lua files in build directory +dir /b *.lua >nul 2>&1 +if not errorlevel 1 ( + echo. + echo WARNING: Found Lua files in build directory! + echo Development builds should load from file system, not embed. + echo. + dir /b *.lua + echo. + set /p REMOVE="Remove these files from build directory? (Y/n): " + if /i not "%REMOVE%"=="n" ( + del /Q *.lua + echo Lua files removed. + ) + echo. +) + +REM Warn about assets folder in build directory +if exist "assets" ( + echo. + echo WARNING: Found assets folder in build directory! + echo Development builds should load from file system, not embed. + echo. + set /p REMOVE="Remove assets folder from build directory? (Y/n): " + if /i not "%REMOVE%"=="n" ( + rmdir /S /Q assets + echo Assets folder removed. + ) + echo. +) + +REM Clean old configuration if requested +if "%1"=="clean" ( + echo Cleaning build directory... + del /Q CMakeCache.txt *.o *.a 2>nul + rmdir /S /Q CMakeFiles 2>nul + echo Clean complete! + echo. +) + +REM Configure with MinGW +echo Configuring CMake for development... +cmake -G "MinGW Makefiles" .. + +if errorlevel 1 ( + echo. + echo ERROR: CMake configuration failed! + exit /b 1 +) + +echo. +echo Building ReiLua... +mingw32-make + +if errorlevel 1 ( + echo. + echo ERROR: Build failed! + exit /b 1 +) + +echo. +echo ================================ +echo Build Complete! +echo ================================ +echo. +echo Development build created successfully! +echo. +echo To run your game: +echo cd \path\to\your\game +echo \path\to\ReiLua\build\ReiLua.exe +echo. +echo To run with console logging: +echo \path\to\ReiLua\build\ReiLua.exe --log +echo. +echo Features: +echo - Lua files load from file system +echo - Assets load from file system +echo - Fast iteration - edit and reload +echo. +pause diff --git a/scripts/build_dev.sh b/scripts/build_dev.sh new file mode 100644 index 0000000..4383d36 --- /dev/null +++ b/scripts/build_dev.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# ReiLua Development Build Script +# Run this from w64devkit shell + +echo "================================" +echo "ReiLua - Development Build" +echo "================================" +echo "" + +# Navigate to build directory +cd build || exit 1 + +# Clean old embedded files (important for dev builds!) +echo "Cleaning old embedded files..." +rm -f embedded_main.h embedded_assets.h + +# Warn about Lua files in build directory +LUA_COUNT=$(ls *.lua 2>/dev/null | wc -l) +if [ "$LUA_COUNT" -gt 0 ]; then + echo "" + echo "WARNING: Found Lua files in build directory!" + echo "Development builds should load from file system, not embed." + echo "" + ls -1 *.lua + echo "" + read -p "Remove these files from build directory? (Y/n): " -n 1 -r + echo "" + if [[ ! $REPLY =~ ^[Nn]$ ]]; then + rm -f *.lua + echo "Lua files removed." + fi + echo "" +fi + +# Warn about assets folder in build directory +if [ -d "assets" ]; then + echo "" + echo "WARNING: Found assets folder in build directory!" + echo "Development builds should load from file system, not embed." + echo "" + read -p "Remove assets folder from build directory? (Y/n): " -n 1 -r + echo "" + if [[ ! $REPLY =~ ^[Nn]$ ]]; then + rm -rf assets + echo "Assets folder removed." + fi + echo "" +fi + +# Clean old configuration if requested +if [ "$1" == "clean" ]; then + echo "Cleaning build directory..." + rm -rf CMakeCache.txt CMakeFiles/ *.o *.a + echo "Clean complete!" + echo "" +fi + +# Configure with MinGW +echo "Configuring CMake for development..." +cmake -G "MinGW Makefiles" .. + +if [ $? -ne 0 ]; then + echo "" + echo "ERROR: CMake configuration failed!" + exit 1 +fi + +echo "" +echo "Building ReiLua..." +make + +if [ $? -ne 0 ]; then + echo "" + echo "ERROR: Build failed!" + exit 1 +fi + +echo "" +echo "================================" +echo "Build Complete!" +echo "================================" +echo "" +echo "Development build created successfully!" +echo "" +echo "To run your game:" +echo " cd /path/to/your/game" +echo " /path/to/ReiLua/build/ReiLua.exe" +echo "" +echo "To run with console logging:" +echo " /path/to/ReiLua/build/ReiLua.exe --log" +echo "" +echo "Features:" +echo " - Lua files load from file system" +echo " - Assets load from file system" +echo " - Fast iteration - edit and reload" +echo "" diff --git a/scripts/build_release.bat b/scripts/build_release.bat new file mode 100644 index 0000000..17b76c1 --- /dev/null +++ b/scripts/build_release.bat @@ -0,0 +1,144 @@ +@echo off +REM ReiLua Release Build Script +REM Run this from w64devkit shell or CMD with MinGW in PATH + +echo ================================ +echo ReiLua - Release Build +echo ================================ +echo. + +REM Check if we're in the right directory +if not exist "CMakeLists.txt" ( + echo ERROR: Please run this script from the ReiLua root directory + exit /b 1 +) + +REM Navigate to build directory +cd build +if errorlevel 1 ( + echo ERROR: Cannot access build directory + exit /b 1 +) + +REM Clean old embedded files +echo Cleaning old embedded files... +del /Q embedded_main.h embedded_assets.h 2>nul + +REM Check for Lua files +echo. +echo Checking for Lua files... +dir /b *.lua >nul 2>&1 +if errorlevel 1 ( + echo. + echo WARNING: No Lua files found in build directory! + echo. + echo Please copy your Lua files: + echo cd build + echo copy ..\your_game\*.lua . + echo. + set /p CONTINUE="Do you want to continue anyway? (y/N): " + if /i not "%CONTINUE%"=="y" exit /b 1 +) else ( + echo Found Lua files: + dir /b *.lua +) + +REM Check for assets folder +echo. +echo Checking for assets... +if not exist "assets" ( + echo. + echo WARNING: No assets folder found! + echo. + echo To embed assets, create the folder and copy files: + echo cd build + echo mkdir assets + echo copy ..\your_game\assets\* assets\ + echo. + set /p CONTINUE="Do you want to continue without assets? (y/N): " + if /i not "%CONTINUE%"=="y" exit /b 1 + set EMBED_ASSETS=OFF +) else ( + echo Found assets folder + set EMBED_ASSETS=ON +) + +echo. +echo ================================ +echo Build Configuration +echo ================================ +echo Lua Embedding: ON +echo Asset Embedding: %EMBED_ASSETS% +echo Build Type: Release +echo ================================ +echo. +pause + +REM Clean CMake cache +echo. +echo Cleaning CMake cache... +del /Q CMakeCache.txt 2>nul +rmdir /S /Q CMakeFiles 2>nul + +REM Configure with embedding enabled +echo. +echo Configuring CMake for release... +cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=%EMBED_ASSETS% -DCMAKE_BUILD_TYPE=Release + +if errorlevel 1 ( + echo. + echo ERROR: CMake configuration failed! + pause + exit /b 1 +) + +REM Build +echo. +echo Building ReiLua Release... +mingw32-make + +if errorlevel 1 ( + echo. + echo ERROR: Build failed! + pause + exit /b 1 +) + +REM Show summary +echo. +echo ================================ +echo Embedded Files Summary +echo ================================ + +if exist "embedded_main.h" ( + echo. + echo Embedded Lua files: + findstr /C:"Embedded file:" embedded_main.h +) + +if exist "embedded_assets.h" ( + echo. + echo Embedded assets: + findstr /C:"Embedded asset:" embedded_assets.h +) + +echo. +echo ================================ +echo Build Complete! +echo ================================ +echo. +echo Executable: ReiLua.exe +echo Location: %CD%\ReiLua.exe +echo. +echo Your game is ready for distribution! +echo. +echo To test the release build: +echo ReiLua.exe --log (with console) +echo ReiLua.exe (production mode) +echo. +echo To distribute: +echo - Copy ReiLua.exe to your distribution folder +echo - Rename it to your game name (optional) +echo - That's it! Single file distribution! +echo. +pause diff --git a/scripts/build_release.sh b/scripts/build_release.sh new file mode 100644 index 0000000..758ce34 --- /dev/null +++ b/scripts/build_release.sh @@ -0,0 +1,150 @@ +#!/bin/bash +# ReiLua Release Build Script +# Run this from w64devkit shell + +echo "================================" +echo "ReiLua - Release Build" +echo "================================" +echo "" + +# Check if we're in the right directory +if [ ! -f "CMakeLists.txt" ]; then + echo "ERROR: Please run this script from the ReiLua root directory" + exit 1 +fi + +# Navigate to build directory +cd build || exit 1 + +# Clean old embedded files +echo "Cleaning old embedded files..." +rm -f embedded_main.h embedded_assets.h + +# Check for Lua files +echo "" +echo "Checking for Lua files..." +LUA_FILES=$(ls *.lua 2>/dev/null | wc -l) + +if [ "$LUA_FILES" -eq 0 ]; then + echo "" + echo "WARNING: No Lua files found in build directory!" + echo "" + echo "Please copy your Lua files:" + echo " cd build" + echo " cp ../your_game/*.lua ." + echo "" + read -p "Do you want to continue anyway? (y/N): " -n 1 -r + echo "" + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + exit 1 + fi +else + echo "Found $LUA_FILES Lua file(s):" + ls -1 *.lua +fi + +# Check for assets folder +echo "" +echo "Checking for assets..." +if [ ! -d "assets" ]; then + echo "" + echo "WARNING: No assets folder found!" + echo "" + echo "To embed assets, create the folder and copy files:" + echo " cd build" + echo " mkdir assets" + echo " cp ../your_game/assets/* assets/" + echo "" + read -p "Do you want to continue without assets? (y/N): " -n 1 -r + echo "" + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + exit 1 + fi + EMBED_ASSETS="OFF" +else + ASSET_FILES=$(find assets -type f 2>/dev/null | wc -l) + echo "Found $ASSET_FILES asset file(s) in assets folder" + EMBED_ASSETS="ON" +fi + +echo "" +echo "================================" +echo "Build Configuration" +echo "================================" +echo "Lua Embedding: ON" +echo "Asset Embedding: $EMBED_ASSETS" +echo "Build Type: Release" +echo "================================" +echo "" +read -p "Press Enter to continue or Ctrl+C to cancel..." + +# Clean CMake cache to ensure fresh configuration +echo "" +echo "Cleaning CMake cache..." +rm -rf CMakeCache.txt CMakeFiles/ + +# Configure with embedding enabled +echo "" +echo "Configuring CMake for release..." +cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=$EMBED_ASSETS -DCMAKE_BUILD_TYPE=Release + +if [ $? -ne 0 ]; then + echo "" + echo "ERROR: CMake configuration failed!" + exit 1 +fi + +# Build +echo "" +echo "Building ReiLua Release..." +make + +if [ $? -ne 0 ]; then + echo "" + echo "ERROR: Build failed!" + exit 1 +fi + +# Show embedded file info +echo "" +echo "================================" +echo "Embedded Files Summary" +echo "================================" + +if [ -f "embedded_main.h" ]; then + echo "" + echo "Embedded Lua files:" + grep 'Embedded file:' embedded_main.h | sed 's/.*Embedded file: / - /' +else + echo "No Lua files embedded" +fi + +if [ -f "embedded_assets.h" ]; then + echo "" + echo "Embedded assets:" + grep 'Embedded asset:' embedded_assets.h | sed 's/.*Embedded asset: / - /' | sed 's/ (.*//' +else + echo "No assets embedded" +fi + +# Get executable size +echo "" +echo "================================" +echo "Build Complete!" +echo "================================" +EXESIZE=$(du -h ReiLua.exe | cut -f1) +echo "" +echo "Executable: ReiLua.exe ($EXESIZE)" +echo "Location: $(pwd)/ReiLua.exe" +echo "" +echo "Your game is ready for distribution!" +echo "" +echo "To test the release build:" +echo " ./ReiLua.exe --log (with console)" +echo " ./ReiLua.exe (production mode)" +echo "" +echo "To distribute:" +echo " - Copy ReiLua.exe to your distribution folder" +echo " - Rename it to your game name (optional)" +echo " - That's it! Single file distribution!" +echo "" diff --git a/scripts/embed_assets.py b/scripts/embed_assets.py new file mode 100644 index 0000000..52309ef --- /dev/null +++ b/scripts/embed_assets.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +""" +Embed asset files (images, sounds, fonts, etc.) into a C header file. +Usage: python embed_assets.py [file2.wav] [file3.ttf] ... + +Embeds all specified asset files into a C header for inclusion in the executable. +""" +import sys +import os + +def sanitize_name(filename): + """Convert filename to valid C identifier""" + name = os.path.basename(filename) + # Remove or replace all non-alphanumeric characters (except underscore) + valid_chars = [] + for char in name: + if char.isalnum() or char == '_': + valid_chars.append(char) + else: + valid_chars.append('_') + name = ''.join(valid_chars) + # Ensure it doesn't start with a digit + if name and name[0].isdigit(): + name = '_' + name + return name + +def get_file_extension(filename): + """Get the file extension""" + return os.path.splitext(filename)[1].lower() + +def embed_files(output_file, input_files): + with open(output_file, 'w') as f: + f.write('#ifndef EMBEDDED_ASSETS_H\n') + f.write('#define EMBEDDED_ASSETS_H\n\n') + f.write('/* Auto-generated file - do not edit manually */\n\n') + + # Embed each file as a separate array + for idx, input_file in enumerate(input_files): + with open(input_file, 'rb') as inf: + data = inf.read() + + var_name = sanitize_name(input_file) + # Extract relative path from 'assets/' onwards if present + if 'assets' in input_file.replace('\\', '/'): + parts = input_file.replace('\\', '/').split('assets/') + if len(parts) > 1: + relative_name = 'assets/' + parts[-1] + else: + relative_name = os.path.basename(input_file) + else: + relative_name = os.path.basename(input_file) + + f.write(f'/* Embedded asset: {input_file} ({len(data)} bytes) */\n') + f.write(f'static const unsigned char embedded_asset_{idx}_{var_name}[] = {{\n') + + for i, byte in enumerate(data): + if i % 12 == 0: + f.write(' ') + f.write(f'0x{byte:02x}') + if i < len(data) - 1: + f.write(',') + if (i + 1) % 12 == 0: + f.write('\n') + else: + f.write(' ') + + f.write('\n};\n') + f.write(f'static const unsigned int embedded_asset_{idx}_{var_name}_len = {len(data)};\n\n') + + # Create the asset table + f.write('/* Asset table for virtual filesystem */\n') + f.write('typedef struct {\n') + f.write(' const char* name;\n') + f.write(' const unsigned char* data;\n') + f.write(' unsigned int size;\n') + f.write('} EmbeddedAsset;\n\n') + + f.write('static const EmbeddedAsset embedded_assets[] = {\n') + for idx, input_file in enumerate(input_files): + var_name = sanitize_name(input_file) + # Extract relative path from 'assets/' onwards if present + if 'assets' in input_file.replace('\\', '/'): + parts = input_file.replace('\\', '/').split('assets/') + if len(parts) > 1: + relative_name = 'assets/' + parts[-1] + else: + relative_name = os.path.basename(input_file) + else: + relative_name = os.path.basename(input_file) + f.write(f' {{ "{relative_name}", embedded_asset_{idx}_{var_name}, embedded_asset_{idx}_{var_name}_len }},\n') + f.write('};\n\n') + + f.write(f'static const int embedded_asset_count = {len(input_files)};\n\n') + f.write('#endif /* EMBEDDED_ASSETS_H */\n') + +if __name__ == '__main__': + if len(sys.argv) < 3: + print('Usage: python embed_assets.py [asset2] ...') + print(' Embeds images, sounds, fonts, and other asset files into a C header.') + print(' Supported: .png, .jpg, .wav, .ogg, .mp3, .ttf, .otf, etc.') + sys.exit(1) + + output_file = sys.argv[1] + input_files = sys.argv[2:] + + # Check all input files exist + for f in input_files: + if not os.path.exists(f): + print(f'Error: File not found: {f}') + sys.exit(1) + + embed_files(output_file, input_files) + print(f'Embedded {len(input_files)} asset file(s) into {output_file}') + for f in input_files: + size = os.path.getsize(f) + print(f' - {f} ({size} bytes)') diff --git a/scripts/embed_font.py b/scripts/embed_font.py new file mode 100644 index 0000000..8144718 --- /dev/null +++ b/scripts/embed_font.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +""" +Embed font file into C header. +Usage: python embed_font.py +""" + +import sys +import os + +def embed_file(file_path, var_name): + """Convert a file to a C byte array""" + with open(file_path, 'rb') as f: + data = f.read() + + output = f"/* {os.path.basename(file_path)} */\n" + output += f"static const unsigned char {var_name}[] = {{\n" + + # Write bytes in rows of 16 + for i in range(0, len(data), 16): + chunk = data[i:i+16] + hex_values = ', '.join(f'0x{b:02x}' for b in chunk) + output += f" {hex_values},\n" + + output += "};\n" + output += f"static const unsigned int {var_name}_size = {len(data)};\n\n" + + return output + +def main(): + if len(sys.argv) != 3: + print("Usage: python embed_font.py ") + sys.exit(1) + + output_file = sys.argv[1] + font_file = sys.argv[2] + + # Check if file exists + if not os.path.exists(font_file): + print(f"Error: {font_file} not found!") + sys.exit(1) + + # Generate header content + header_content = "/* Auto-generated embedded font file */\n" + header_content += "#pragma once\n\n" + + # Embed font file + header_content += embed_file(font_file, "embedded_font_data") + + # Write to output file + with open(output_file, 'w') as f: + f.write(header_content) + + print(f"Generated {output_file}") + print(f" - Embedded {font_file} ({os.path.getsize(font_file)} bytes)") + +if __name__ == "__main__": + main() diff --git a/scripts/embed_logo.py b/scripts/embed_logo.py new file mode 100644 index 0000000..e6b645e --- /dev/null +++ b/scripts/embed_logo.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +""" +Embed logo image files into C header for splash screens. +Usage: python embed_logo.py +""" + +import sys +import os + +def embed_file(file_path, var_name): + """Convert a file to a C byte array""" + with open(file_path, 'rb') as f: + data = f.read() + + output = f"/* {os.path.basename(file_path)} */\n" + output += f"static const unsigned char {var_name}[] = {{\n" + + # Write bytes in rows of 16 + for i in range(0, len(data), 16): + chunk = data[i:i+16] + hex_values = ', '.join(f'0x{b:02x}' for b in chunk) + output += f" {hex_values},\n" + + output += "};\n" + output += f"static const unsigned int {var_name}_size = {len(data)};\n\n" + + return output + +def main(): + if len(sys.argv) != 4: + print("Usage: python embed_logo.py ") + sys.exit(1) + + output_file = sys.argv[1] + raylib_logo = sys.argv[2] + reilua_logo = sys.argv[3] + + # Check if files exist + if not os.path.exists(raylib_logo): + print(f"Error: {raylib_logo} not found!") + sys.exit(1) + + if not os.path.exists(reilua_logo): + print(f"Error: {reilua_logo} not found!") + sys.exit(1) + + # Generate header content + header_content = "/* Auto-generated embedded logo files */\n" + header_content += "#pragma once\n\n" + + # Embed both logo files + header_content += embed_file(raylib_logo, "embedded_raylib_logo") + header_content += embed_file(reilua_logo, "embedded_reilua_logo") + + # Write to output file + with open(output_file, 'w') as f: + f.write(header_content) + + print(f"Generated {output_file}") + print(f" - Embedded {raylib_logo} ({os.path.getsize(raylib_logo)} bytes)") + print(f" - Embedded {reilua_logo} ({os.path.getsize(reilua_logo)} bytes)") + +if __name__ == "__main__": + main() diff --git a/scripts/embed_lua.py b/scripts/embed_lua.py new file mode 100644 index 0000000..9562354 --- /dev/null +++ b/scripts/embed_lua.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +""" +Embed multiple Lua files into a C header file for inclusion in the executable. +Usage: python embed_lua.py [file2.lua] [file3.lua] ... + +Embeds all specified Lua files into a C header with a virtual filesystem. +The first file is treated as main.lua (entry point). +""" +import sys +import os + +def sanitize_name(filename): + """Convert filename to valid C identifier""" + name = os.path.basename(filename) + name = name.replace('.', '_').replace('-', '_').replace('/', '_').replace('\\', '_') + return name + +def embed_files(output_file, input_files): + with open(output_file, 'w') as f: + f.write('#ifndef EMBEDDED_MAIN_H\n') + f.write('#define EMBEDDED_MAIN_H\n\n') + f.write('/* Auto-generated file - do not edit manually */\n\n') + + # Embed each file as a separate array + for idx, input_file in enumerate(input_files): + with open(input_file, 'rb') as inf: + data = inf.read() + + var_name = sanitize_name(input_file) + f.write(f'/* Embedded file: {input_file} */\n') + f.write(f'static const unsigned char embedded_lua_{idx}_{var_name}[] = {{\n') + + for i, byte in enumerate(data): + if i % 12 == 0: + f.write(' ') + f.write(f'0x{byte:02x}') + if i < len(data) - 1: + f.write(',') + if (i + 1) % 12 == 0: + f.write('\n') + else: + f.write(' ') + + f.write('\n};\n') + f.write(f'static const unsigned int embedded_lua_{idx}_{var_name}_len = {len(data)};\n\n') + + # Create the file table + f.write('/* File table for virtual filesystem */\n') + f.write('typedef struct {\n') + f.write(' const char* name;\n') + f.write(' const unsigned char* data;\n') + f.write(' unsigned int size;\n') + f.write('} EmbeddedLuaFile;\n\n') + + f.write('static const EmbeddedLuaFile embedded_lua_files[] = {\n') + for idx, input_file in enumerate(input_files): + var_name = sanitize_name(input_file) + # Store both original filename and basename for require compatibility + basename = os.path.basename(input_file) + f.write(f' {{ "{basename}", embedded_lua_{idx}_{var_name}, embedded_lua_{idx}_{var_name}_len }},\n') + f.write('};\n\n') + + f.write(f'static const int embedded_lua_file_count = {len(input_files)};\n\n') + + # Main entry point (first file) + var_name = sanitize_name(input_files[0]) + f.write('/* Main entry point */\n') + f.write(f'#define embedded_main_lua embedded_lua_0_{var_name}\n') + f.write(f'#define embedded_main_lua_len embedded_lua_0_{var_name}_len\n\n') + + f.write('#endif /* EMBEDDED_MAIN_H */\n') + +if __name__ == '__main__': + if len(sys.argv) < 3: + print('Usage: python embed_lua.py [file2.lua] ...') + print(' The first Lua file is treated as the main entry point.') + sys.exit(1) + + output_file = sys.argv[1] + input_files = sys.argv[2:] + + # Check all input files exist + for f in input_files: + if not os.path.exists(f): + print(f'Error: File not found: {f}') + sys.exit(1) + + embed_files(output_file, input_files) + print(f'Embedded {len(input_files)} file(s) into {output_file}') + for f in input_files: + print(f' - {f}') + diff --git a/tools/ReiLua_API.lua b/tools/ReiLua_API.lua new file mode 100644 index 0000000..1ba8b71 --- /dev/null +++ b/tools/ReiLua_API.lua @@ -0,0 +1,9054 @@ +-- Put this file into your project folder to provide annotations when using Lua language server. + +RL={} + +-- Functions. + +---This function will be called after window has been initialized. Should be used as the main init point. +function RL.init() end +---This function will be called every frame during execution. It will get time duration from last frame on argument 'delta' +---@param delta number +function RL.update( delta ) end +---This function will be called every frame after update and it should have all rendering related functions. Note: Engine will call Raylib functions 'BeginDrawing()' before this function call and 'EndDrawing()' after it. You can still use RL.BeginDrawing() and RL.EndDrawing() manually from anywhere. +function RL.draw() end +---This function will be called on events input. Content of event table is determined by event type. +---@param event table +function RL.event( event ) end +---This function can be used for custom log message handling. +---@param logLevel integer +---@param message string +function RL.log( logLevel, message ) end +---This function will be called on program close. Cleanup could be done here. +function RL.exit() end +---This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point. +function RL.config() end + +-- Defines - System/Window config flags + +---Set to try enabling V-Sync on GPU +RL.FLAG_VSYNC_HINT=64 +---Set to run program in fullscreen +RL.FLAG_FULLSCREEN_MODE=2 +---Set to allow resizable window +RL.FLAG_WINDOW_RESIZABLE=4 +---Set to disable window decoration (frame and buttons) +RL.FLAG_WINDOW_UNDECORATED=8 +---Set to hide window +RL.FLAG_WINDOW_HIDDEN=128 +---Set to minimize window (iconify) +RL.FLAG_WINDOW_MINIMIZED=512 +---Set to maximize window (expanded to monitor) +RL.FLAG_WINDOW_MAXIMIZED=1024 +---Set to window non focused +RL.FLAG_WINDOW_UNFOCUSED=2048 +---Set to window always on top +RL.FLAG_WINDOW_TOPMOST=4096 +---Set to allow windows running while minimized +RL.FLAG_WINDOW_ALWAYS_RUN=256 +---Set to allow transparent framebuffer +RL.FLAG_WINDOW_TRANSPARENT=16 +---Set to support HighDPI +RL.FLAG_WINDOW_HIGHDPI=8192 +---Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED +RL.FLAG_WINDOW_MOUSE_PASSTHROUGH=16384 +---Set to try enabling MSAA 4X +RL.FLAG_MSAA_4X_HINT=32 +---Set to try enabling interlaced video format (for V3D) +RL.FLAG_INTERLACED_HINT=65536 + +-- Defines - Trace log level + +---Display all logs +RL.LOG_ALL=0 +---Trace logging, intended for internal use only +RL.LOG_TRACE=1 +---Debug logging, used for internal debugging, it should be disabled on release builds +RL.LOG_DEBUG=2 +---Info logging, used for program execution info +RL.LOG_INFO=3 +---Warning logging, used on recoverable failures +RL.LOG_WARNING=4 +---Error logging, used on unrecoverable failures +RL.LOG_ERROR=5 +---Fatal logging, used to abort program: exit(EXIT_FAILURE) +RL.LOG_FATAL=6 +---Disable logging +RL.LOG_NONE=7 + +-- Defines - Keyboard keys (US keyboard layout) + +---Key: NULL, used for no key pressed +RL.KEY_NULL=0 +---Key: ' +RL.KEY_APOSTROPHE=39 +---Key: , +RL.KEY_COMMA=44 +---Key: - +RL.KEY_MINUS=45 +---Key: . +RL.KEY_PERIOD=46 +---Key: / +RL.KEY_SLASH=47 +---Key: 0 +RL.KEY_ZERO=48 +---Key: 1 +RL.KEY_ONE=49 +---Key: 2 +RL.KEY_TWO=50 +---Key: 3 +RL.KEY_THREE=51 +---Key: 4 +RL.KEY_FOUR=52 +---Key: 5 +RL.KEY_FIVE=53 +---Key: 6 +RL.KEY_SIX=54 +---Key: 7 +RL.KEY_SEVEN=55 +---Key: 8 +RL.KEY_EIGHT=56 +---Key: 9 +RL.KEY_NINE=57 +---Key: ; +RL.KEY_SEMICOLON=59 +---Key: = +RL.KEY_EQUAL=61 +---Key: A | a +RL.KEY_A=65 +---Key: B | b +RL.KEY_B=66 +---Key: C | c +RL.KEY_C=67 +---Key: D | d +RL.KEY_D=68 +---Key: E | e +RL.KEY_E=69 +---Key: F | f +RL.KEY_F=70 +---Key: G | g +RL.KEY_G=71 +---Key: H | h +RL.KEY_H=72 +---Key: I | i +RL.KEY_I=73 +---Key: J | j +RL.KEY_J=74 +---Key: K | k +RL.KEY_K=75 +---Key: L | l +RL.KEY_L=76 +---Key: M | m +RL.KEY_M=77 +---Key: N | n +RL.KEY_N=78 +---Key: O | o +RL.KEY_O=79 +---Key: P | p +RL.KEY_P=80 +---Key: Q | q +RL.KEY_Q=81 +---Key: R | r +RL.KEY_R=82 +---Key: S | s +RL.KEY_S=83 +---Key: T | t +RL.KEY_T=84 +---Key: U | u +RL.KEY_U=85 +---Key: V | v +RL.KEY_V=86 +---Key: W | w +RL.KEY_W=87 +---Key: X | x +RL.KEY_X=88 +---Key: Y | y +RL.KEY_Y=89 +---Key: Z | z +RL.KEY_Z=90 +---Key: [ +RL.KEY_LEFT_BRACKET=91 +---Key: '\' +RL.KEY_BACKSLASH=92 +---Key: ] +RL.KEY_RIGHT_BRACKET=93 +---Key: ` +RL.KEY_GRAVE=96 +---Key: Space +RL.KEY_SPACE=32 +---Key: Esc +RL.KEY_ESCAPE=256 +---Key: Enter +RL.KEY_ENTER=257 +---Key: Tab +RL.KEY_TAB=258 +---Key: Backspace +RL.KEY_BACKSPACE=259 +---Key: Ins +RL.KEY_INSERT=260 +---Key: Del +RL.KEY_DELETE=261 +---Key: Cursor right +RL.KEY_RIGHT=262 +---Key: Cursor left +RL.KEY_LEFT=263 +---Key: Cursor down +RL.KEY_DOWN=264 +---Key: Cursor up +RL.KEY_UP=265 +---Key: Page up +RL.KEY_PAGE_UP=266 +---Key: Page down +RL.KEY_PAGE_DOWN=267 +---Key: Home +RL.KEY_HOME=268 +---Key: End +RL.KEY_END=269 +---Key: Caps lock +RL.KEY_CAPS_LOCK=280 +---Key: Scroll down +RL.KEY_SCROLL_LOCK=281 +---Key: Num lock +RL.KEY_NUM_LOCK=282 +---Key: Print screen +RL.KEY_PRINT_SCREEN=283 +---Key: Pause +RL.KEY_PAUSE=284 +---Key: F1 +RL.KEY_F1=290 +---Key: F2 +RL.KEY_F2=291 +---Key: F3 +RL.KEY_F3=292 +---Key: F4 +RL.KEY_F4=293 +---Key: F5 +RL.KEY_F5=294 +---Key: F6 +RL.KEY_F6=295 +---Key: F7 +RL.KEY_F7=296 +---Key: F8 +RL.KEY_F8=297 +---Key: F9 +RL.KEY_F9=298 +---Key: F10 +RL.KEY_F10=299 +---Key: F11 +RL.KEY_F11=300 +---Key: F12 +RL.KEY_F12=301 +---Key: Shift left +RL.KEY_LEFT_SHIFT=340 +---Key: Control left +RL.KEY_LEFT_CONTROL=341 +---Key: Alt left +RL.KEY_LEFT_ALT=342 +---Key: Super left +RL.KEY_LEFT_SUPER=343 +---Key: Shift right +RL.KEY_RIGHT_SHIFT=344 +---Key: Control right +RL.KEY_RIGHT_CONTROL=345 +---Key: Alt right +RL.KEY_RIGHT_ALT=346 +---Key: Super right +RL.KEY_RIGHT_SUPER=347 +---Key: KB menu +RL.KEY_KB_MENU=348 +---Key: Keypad 0 +RL.KEY_KP_0=320 +---Key: Keypad 1 +RL.KEY_KP_1=321 +---Key: Keypad 2 +RL.KEY_KP_2=322 +---Key: Keypad 3 +RL.KEY_KP_3=323 +---Key: Keypad 4 +RL.KEY_KP_4=324 +---Key: Keypad 5 +RL.KEY_KP_5=325 +---Key: Keypad 6 +RL.KEY_KP_6=326 +---Key: Keypad 7 +RL.KEY_KP_7=327 +---Key: Keypad 8 +RL.KEY_KP_8=328 +---Key: Keypad 9 +RL.KEY_KP_9=329 +---Key: Keypad . +RL.KEY_KP_DECIMAL=330 +---Key: Keypad / +RL.KEY_KP_DIVIDE=331 +---Key: Keypad * +RL.KEY_KP_MULTIPLY=332 +---Key: Keypad - +RL.KEY_KP_SUBTRACT=333 +---Key: Keypad + +RL.KEY_KP_ADD=334 +---Key: Keypad Enter +RL.KEY_KP_ENTER=335 +---Key: Keypad = +RL.KEY_KP_EQUAL=336 +---Key: Android back button +RL.KEY_BACK=4 +---Key: Android menu button +RL.KEY_MENU=5 +---Key: Android volume up button +RL.KEY_VOLUME_UP=24 +---Key: Android volume down button +RL.KEY_VOLUME_DOWN=25 + +-- Defines - Mouse buttons + +---Mouse button left +RL.MOUSE_BUTTON_LEFT=0 +---Mouse button right +RL.MOUSE_BUTTON_RIGHT=1 +---Mouse button middle (pressed wheel) +RL.MOUSE_BUTTON_MIDDLE=2 +---Mouse button side (advanced mouse device) +RL.MOUSE_BUTTON_SIDE=3 +---Mouse button extra (advanced mouse device) +RL.MOUSE_BUTTON_EXTRA=4 +---Mouse button forward (advanced mouse device) +RL.MOUSE_BUTTON_FORWARD=5 +---Mouse button back (advanced mouse device) +RL.MOUSE_BUTTON_BACK=6 + +-- Defines - Mouse cursor + +---Default pointer shape +RL.MOUSE_CURSOR_DEFAULT=0 +---Arrow shape +RL.MOUSE_CURSOR_ARROW=1 +---Text writing cursor shape +RL.MOUSE_CURSOR_IBEAM=2 +---Cross shape +RL.MOUSE_CURSOR_CROSSHAIR=3 +---Pointing hand cursor +RL.MOUSE_CURSOR_POINTING_HAND=4 +---Horizontal resize/move arrow shape +RL.MOUSE_CURSOR_RESIZE_EW=5 +---Vertical resize/move arrow shape +RL.MOUSE_CURSOR_RESIZE_NS=6 +---Top-left to bottom-right diagonal resize/move arrow shape +RL.MOUSE_CURSOR_RESIZE_NWSE=7 +---The top-right to bottom-left diagonal resize/move arrow shape +RL.MOUSE_CURSOR_RESIZE_NESW=8 +---The omnidirectional resize/move cursor shape +RL.MOUSE_CURSOR_RESIZE_ALL=9 +---The operation-not-allowed shape +RL.MOUSE_CURSOR_NOT_ALLOWED=10 + +-- Defines - Gamepad buttons + +---Unknown button, just for error checking +RL.GAMEPAD_BUTTON_UNKNOWN=0 +---Gamepad left DPAD up button +RL.GAMEPAD_BUTTON_LEFT_FACE_UP=1 +---Gamepad left DPAD right button +RL.GAMEPAD_BUTTON_LEFT_FACE_RIGHT=2 +---Gamepad left DPAD down button +RL.GAMEPAD_BUTTON_LEFT_FACE_DOWN=3 +---Gamepad left DPAD left button +RL.GAMEPAD_BUTTON_LEFT_FACE_LEFT=4 +---Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) +RL.GAMEPAD_BUTTON_RIGHT_FACE_UP=5 +---Gamepad right button right (i.e. PS3: Square, Xbox: X) +RL.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT=6 +---Gamepad right button down (i.e. PS3: Cross, Xbox: A) +RL.GAMEPAD_BUTTON_RIGHT_FACE_DOWN=7 +---Gamepad right button left (i.e. PS3: Circle, Xbox: B) +RL.GAMEPAD_BUTTON_RIGHT_FACE_LEFT=8 +---Gamepad top/back trigger left (first), it could be a trailing button +RL.GAMEPAD_BUTTON_LEFT_TRIGGER_1=9 +---Gamepad top/back trigger left (second), it could be a trailing button +RL.GAMEPAD_BUTTON_LEFT_TRIGGER_2=10 +---Gamepad top/back trigger right (one), it could be a trailing button +RL.GAMEPAD_BUTTON_RIGHT_TRIGGER_1=11 +---Gamepad top/back trigger right (second), it could be a trailing button +RL.GAMEPAD_BUTTON_RIGHT_TRIGGER_2=12 +---Gamepad center buttons, left one (i.e. PS3: Select) +RL.GAMEPAD_BUTTON_MIDDLE_LEFT=13 +---Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX) +RL.GAMEPAD_BUTTON_MIDDLE=14 +---Gamepad center buttons, right one (i.e. PS3: Start) +RL.GAMEPAD_BUTTON_MIDDLE_RIGHT=15 +---Gamepad joystick pressed button left +RL.GAMEPAD_BUTTON_LEFT_THUMB=16 +---Gamepad joystick pressed button right +RL.GAMEPAD_BUTTON_RIGHT_THUMB=17 + +-- Defines - Gamepad axis + +---Gamepad left stick X axis +RL.GAMEPAD_AXIS_LEFT_X=0 +---Gamepad left stick Y axis +RL.GAMEPAD_AXIS_LEFT_Y=1 +---Gamepad right stick X axis +RL.GAMEPAD_AXIS_RIGHT_X=2 +---Gamepad right stick Y axis +RL.GAMEPAD_AXIS_RIGHT_Y=3 +---Gamepad back trigger left, pressure level: [1..-1] +RL.GAMEPAD_AXIS_LEFT_TRIGGER=4 +---Gamepad back trigger right, pressure level: [1..-1] +RL.GAMEPAD_AXIS_RIGHT_TRIGGER=5 + +-- Defines - Material map index + +---Albedo material (same as: MATERIAL_MAP_DIFFUSE) +RL.MATERIAL_MAP_ALBEDO=0 +---Metalness material (same as: MATERIAL_MAP_SPECULAR) +RL.MATERIAL_MAP_METALNESS=1 +---Normal material +RL.MATERIAL_MAP_NORMAL=2 +---Roughness material +RL.MATERIAL_MAP_ROUGHNESS=3 +---Ambient occlusion material +RL.MATERIAL_MAP_OCCLUSION=4 +---Emission material +RL.MATERIAL_MAP_EMISSION=5 +---Heightmap material +RL.MATERIAL_MAP_HEIGHT=6 +---Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP) +RL.MATERIAL_MAP_CUBEMAP=7 +---Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP) +RL.MATERIAL_MAP_IRRADIANCE=8 +---Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP) +RL.MATERIAL_MAP_PREFILTER=9 +---Brdf material +RL.MATERIAL_MAP_BRDF=10 +---Diffuce material (same as: MATERIAL_MAP_ALBEDO) +RL.MATERIAL_MAP_DIFFUSE=0 +---Specular material (same as: MATERIAL_MAP_METALNESS) +RL.MATERIAL_MAP_SPECULAR=1 + +-- Defines - Shader location index + +---Shader location: vertex attribute: position +RL.SHADER_LOC_VERTEX_POSITION=0 +---Shader location: vertex attribute: texcoord01 +RL.SHADER_LOC_VERTEX_TEXCOORD01=1 +---Shader location: vertex attribute: texcoord02 +RL.SHADER_LOC_VERTEX_TEXCOORD02=2 +---Shader location: vertex attribute: normal +RL.SHADER_LOC_VERTEX_NORMAL=3 +---Shader location: vertex attribute: tangent +RL.SHADER_LOC_VERTEX_TANGENT=4 +---Shader location: vertex attribute: color +RL.SHADER_LOC_VERTEX_COLOR=5 +---Shader location: matrix uniform: model-view-projection +RL.SHADER_LOC_MATRIX_MVP=6 +---Shader location: matrix uniform: view (camera transform) +RL.SHADER_LOC_MATRIX_VIEW=7 +---Shader location: matrix uniform: projection +RL.SHADER_LOC_MATRIX_PROJECTION=8 +---Shader location: matrix uniform: model (transform) +RL.SHADER_LOC_MATRIX_MODEL=9 +---Shader location: matrix uniform: normal +RL.SHADER_LOC_MATRIX_NORMAL=10 +---Shader location: vector uniform: view +RL.SHADER_LOC_VECTOR_VIEW=11 +---Shader location: vector uniform: diffuse color +RL.SHADER_LOC_COLOR_DIFFUSE=12 +---Shader location: vector uniform: specular color +RL.SHADER_LOC_COLOR_SPECULAR=13 +---Shader location: vector uniform: ambient color +RL.SHADER_LOC_COLOR_AMBIENT=14 +---Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE) +RL.SHADER_LOC_MAP_ALBEDO=15 +---Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR) +RL.SHADER_LOC_MAP_METALNESS=16 +---Shader location: sampler2d texture: normal +RL.SHADER_LOC_MAP_NORMAL=17 +---Shader location: sampler2d texture: roughness +RL.SHADER_LOC_MAP_ROUGHNESS=18 +---Shader location: sampler2d texture: occlusion +RL.SHADER_LOC_MAP_OCCLUSION=19 +---Shader location: sampler2d texture: emission +RL.SHADER_LOC_MAP_EMISSION=20 +---Shader location: sampler2d texture: height +RL.SHADER_LOC_MAP_HEIGHT=21 +---Shader location: samplerCube texture: cubemap +RL.SHADER_LOC_MAP_CUBEMAP=22 +---Shader location: samplerCube texture: irradiance +RL.SHADER_LOC_MAP_IRRADIANCE=23 +---Shader location: samplerCube texture: prefilter +RL.SHADER_LOC_MAP_PREFILTER=24 +---Shader location: sampler2d texture: brdf +RL.SHADER_LOC_MAP_BRDF=25 +---Shader location: vertex attribute: boneIds +RL.SHADER_LOC_VERTEX_BONEIDS=26 +---Shader location: vertex attribute: boneWeights +RL.SHADER_LOC_VERTEX_BONEWEIGHTS=27 +---Shader location: array of matrices uniform: boneMatrices +RL.SHADER_LOC_BONE_MATRICES=28 +---Shader location: sampler2d texture: diffuce (same as: SHADER_LOC_MAP_ALBEDO) +RL.SHADER_LOC_MAP_DIFFUSE=15 +---Shader location: sampler2d texture: specular (same as: SHADER_LOC_MAP_METALNESS) +RL.SHADER_LOC_MAP_SPECULAR=16 + +-- Defines - Shader uniform data type + +---Shader uniform type: float +RL.SHADER_UNIFORM_FLOAT=0 +---Shader uniform type: vec2 (2 float) +RL.SHADER_UNIFORM_VEC2=1 +---Shader uniform type: vec3 (3 float) +RL.SHADER_UNIFORM_VEC3=2 +---Shader uniform type: vec4 (4 float) +RL.SHADER_UNIFORM_VEC4=3 +---Shader uniform type: int +RL.SHADER_UNIFORM_INT=4 +---Shader uniform type: ivec2 (2 int) +RL.SHADER_UNIFORM_IVEC2=5 +---Shader uniform type: ivec3 (3 int) +RL.SHADER_UNIFORM_IVEC3=6 +---Shader uniform type: ivec4 (4 int) +RL.SHADER_UNIFORM_IVEC4=7 +---Shader uniform type: sampler2d +RL.SHADER_UNIFORM_SAMPLER2D=8 + +-- Defines - Shader attribute data types + +---Shader attribute type: float +RL.SHADER_ATTRIB_FLOAT=0 +---Shader attribute type: vec2 (2 float) +RL.SHADER_ATTRIB_VEC2=1 +---Shader attribute type: vec3 (3 float) +RL.SHADER_ATTRIB_VEC3=2 +---Shader attribute type: vec4 (4 float) +RL.SHADER_ATTRIB_VEC4=3 + +-- Defines - Pixel formats + +---8 bit per pixel (no alpha) +RL.PIXELFORMAT_UNCOMPRESSED_GRAYSCALE=1 +---8*2 bpp (2 channels) +RL.PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA=2 +---16 bpp +RL.PIXELFORMAT_UNCOMPRESSED_R5G6B5=3 +---24 bpp +RL.PIXELFORMAT_UNCOMPRESSED_R8G8B8=4 +---16 bpp (1 bit alpha) +RL.PIXELFORMAT_UNCOMPRESSED_R5G5B5A1=5 +---16 bpp (4 bit alpha) +RL.PIXELFORMAT_UNCOMPRESSED_R4G4B4A4=6 +---32 bpp +RL.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8=7 +---32 bpp (1 channel - float) +RL.PIXELFORMAT_UNCOMPRESSED_R32=8 +---32*3 bpp (3 channels - float) +RL.PIXELFORMAT_UNCOMPRESSED_R32G32B32=9 +---32*4 bpp (4 channels - float) +RL.PIXELFORMAT_UNCOMPRESSED_R32G32B32A32=10 +---4 bpp (no alpha) +RL.PIXELFORMAT_COMPRESSED_DXT1_RGB=14 +---4 bpp (1 bit alpha) +RL.PIXELFORMAT_COMPRESSED_DXT1_RGBA=15 +---8 bpp +RL.PIXELFORMAT_COMPRESSED_DXT3_RGBA=16 +---8 bpp +RL.PIXELFORMAT_COMPRESSED_DXT5_RGBA=17 +---4 bpp +RL.PIXELFORMAT_COMPRESSED_ETC1_RGB=18 +---4 bpp +RL.PIXELFORMAT_COMPRESSED_ETC2_RGB=19 +---8 bpp +RL.PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA=20 +---4 bpp +RL.PIXELFORMAT_COMPRESSED_PVRT_RGB=21 +---4 bpp +RL.PIXELFORMAT_COMPRESSED_PVRT_RGBA=22 +---8 bpp +RL.PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA=23 +---2 bpp +RL.PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA=24 + +-- Defines - Texture parameters: filter mode + +---No filter, just pixel approximation +RL.TEXTURE_FILTER_POINT=0 +---Linear filtering +RL.TEXTURE_FILTER_BILINEAR=1 +---Trilinear filtering (linear with mipmaps) +RL.TEXTURE_FILTER_TRILINEAR=2 +---Anisotropic filtering 4x +RL.TEXTURE_FILTER_ANISOTROPIC_4X=3 +---Anisotropic filtering 8x +RL.TEXTURE_FILTER_ANISOTROPIC_8X=4 +---Anisotropic filtering 16x +RL.TEXTURE_FILTER_ANISOTROPIC_16X=5 + +-- Defines - Texture parameters: wrap mode + +---Repeats texture in tiled mode +RL.TEXTURE_WRAP_REPEAT=0 +---Clamps texture to edge pixel in tiled mode +RL.TEXTURE_WRAP_CLAMP=1 +---Mirrors and repeats the texture in tiled mode +RL.TEXTURE_WRAP_MIRROR_REPEAT=2 +---Mirrors and clamps to border the texture in tiled mode +RL.TEXTURE_WRAP_MIRROR_CLAMP=3 + +-- Defines - Cubemap layouts + +---Automatically detect layout type +RL.CUBEMAP_LAYOUT_AUTO_DETECT=0 +---Layout is defined by a vertical line with faces +RL.CUBEMAP_LAYOUT_LINE_VERTICAL=1 +---Layout is defined by a horizontal line with faces +RL.CUBEMAP_LAYOUT_LINE_HORIZONTAL=2 +---Layout is defined by a 3x4 cross with cubemap faces +RL.CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR=3 +---Layout is defined by a 4x3 cross with cubemap faces +RL.CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE=4 + +-- Defines - Font type, defines generation method + +---Default font generation, anti-aliased +RL.FONT_DEFAULT=0 +---Bitmap font generation, no anti-aliasing +RL.FONT_BITMAP=1 +---SDF font generation, requires external shader +RL.FONT_SDF=2 + +-- Defines - Color blending modes (pre-defined) + +---Blend textures considering alpha (default) +RL.BLEND_ALPHA=0 +---Blend textures adding colors +RL.BLEND_ADDITIVE=1 +---Blend textures multiplying colors +RL.BLEND_MULTIPLIED=2 +---Blend textures adding colors (alternative) +RL.BLEND_ADD_COLORS=3 +---Blend textures subtracting colors (alternative) +RL.BLEND_SUBTRACT_COLORS=4 +---Blend premultiplied textures considering alpha +RL.BLEND_ALPHA_PREMULTIPLY=5 +---Blend textures using custom src/dst factors (use rlSetBlendFactors()) +RL.BLEND_CUSTOM=6 +---Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) +RL.BLEND_CUSTOM_SEPARATE=7 + +-- Defines - Gesture + +---No gesture +RL.GESTURE_NONE=0 +---Tap gesture +RL.GESTURE_TAP=1 +---Double tap gesture +RL.GESTURE_DOUBLETAP=2 +---Hold gesture +RL.GESTURE_HOLD=4 +---Drag gesture +RL.GESTURE_DRAG=8 +---Swipe right gesture +RL.GESTURE_SWIPE_RIGHT=16 +---Swipe left gesture +RL.GESTURE_SWIPE_LEFT=32 +---Swipe up gesture +RL.GESTURE_SWIPE_UP=64 +---Swipe down gesture +RL.GESTURE_SWIPE_DOWN=128 +---Pinch in gesture +RL.GESTURE_PINCH_IN=256 +---Pinch out gesture +RL.GESTURE_PINCH_OUT=512 + +-- Defines - Camera system modes + +---Custom camera +RL.CAMERA_CUSTOM=0 +---Free camera +RL.CAMERA_FREE=1 +---Orbital camera +RL.CAMERA_ORBITAL=2 +---First person camera +RL.CAMERA_FIRST_PERSON=3 +---Third person camera +RL.CAMERA_THIRD_PERSON=4 + +-- Defines - Camera projection + +---Perspective projection +RL.CAMERA_PERSPECTIVE=0 +---Orthographic projection +RL.CAMERA_ORTHOGRAPHIC=1 + +-- Defines - N-patch layout + +---Npatch layout: 3x3 tiles +RL.NPATCH_NINE_PATCH=0 +---Npatch layout: 1x3 tiles +RL.NPATCH_THREE_PATCH_VERTICAL=1 +---Npatch layout: 3x1 tiles +RL.NPATCH_THREE_PATCH_HORIZONTAL=2 + +-- Defines - Colors + +---Light Gray +RL.LIGHTGRAY={200,200,200,255} +---Gray +RL.GRAY={130,130,130,255} +---Dark Gray +RL.DARKGRAY={80,80,80,255} +---Yellow +RL.YELLOW={253,249,0,255} +---Gold +RL.GOLD={255,203,0,255} +---Orange +RL.ORANGE={255,161,0,255} +---Pink +RL.PINK={255,109,194,255} +---Red +RL.RED={230,41,55,255} +---Maroon +RL.MAROON={190,33,55,255} +---Green +RL.GREEN={0,228,48,255} +---Lime +RL.LIME={0,158,47,255} +---Dark Green +RL.DARKGREEN={0,117,44,255} +---Sky Blue +RL.SKYBLUE={102,191,255,255} +---Blue +RL.BLUE={0,121,241,255} +---Dark Blue +RL.DARKBLUE={0,82,172,255} +---Purple +RL.PURPLE={200,122,255,255} +---Violet +RL.VIOLET={135,60,190,255} +---Dark Purple +RL.DARKPURPLE={112,31,126,255} +---Beige +RL.BEIGE={211,176,131,255} +---Brown +RL.BROWN={127,106,79,255} +---Dark Brown +RL.DARKBROWN={76,63,47,255} +---White +RL.WHITE={255,255,255,255} +---Black +RL.BLACK={0,0,0,255} +---Blank (Transparent) +RL.BLANK={0,0,0,0} +---Magenta +RL.MAGENTA={255,0,255,255} +---My own White (raylib logo) +RL.RAYWHITE={245,245,245,255} + +-- Defines - Math + +---Pi +RL.PI=3.1415927410126 +---Epsilon +RL.EPSILON=9.9999999747524e-07 +---Degrees to radians +RL.DEG2RAD=0.017453292384744 +---Radians to degrees +RL.RAD2DEG=57.295776367188 + +-- Defines - Gui control state + +RL.STATE_NORMAL=0 +RL.STATE_FOCUSED=1 +RL.STATE_PRESSED=2 +RL.STATE_DISABLED=3 + +-- Defines - Gui control text alignment + +RL.TEXT_ALIGN_LEFT=0 +RL.TEXT_ALIGN_CENTER=1 +RL.TEXT_ALIGN_RIGHT=2 + +-- Defines - Gui control text alignment vertical + +RL.TEXT_ALIGN_TOP=0 +RL.TEXT_ALIGN_MIDDLE=1 +RL.TEXT_ALIGN_BOTTOM=2 + +-- Defines - Gui control text wrap mode + +RL.TEXT_WRAP_NONE=0 +RL.TEXT_WRAP_CHAR=1 +RL.TEXT_WRAP_WORD=2 + +-- Defines - Gui controls + +RL.DEFAULT=0 +---Used also for: LABELBUTTON +RL.LABEL=1 +RL.BUTTON=2 +---Used also for: TOGGLEGROUP +RL.TOGGLE=3 +---Used also for: SLIDERBAR +RL.SLIDER=4 +RL.PROGRESSBAR=5 +RL.CHECKBOX=6 +RL.COMBOBOX=7 +RL.DROPDOWNBOX=8 +---Used also for: TEXTBOXMULTI +RL.TEXTBOX=9 +RL.VALUEBOX=10 +---Uses: BUTTON, VALUEBOX +RL.SPINNER=11 +RL.LISTVIEW=12 +RL.COLORPICKER=13 +RL.SCROLLBAR=14 +RL.STATUSBAR=15 + +-- Defines - Gui base properties for every control + +RL.BORDER_COLOR_NORMAL=0 +RL.BASE_COLOR_NORMAL=1 +RL.TEXT_COLOR_NORMAL=2 +RL.BORDER_COLOR_FOCUSED=3 +RL.BASE_COLOR_FOCUSED=4 +RL.TEXT_COLOR_FOCUSED=5 +RL.BORDER_COLOR_PRESSED=6 +RL.BASE_COLOR_PRESSED=7 +RL.TEXT_COLOR_PRESSED=8 +RL.BORDER_COLOR_DISABLED=9 +RL.BASE_COLOR_DISABLED=10 +RL.TEXT_COLOR_DISABLED=11 +RL.BORDER_WIDTH=12 +RL.TEXT_PADDING=13 +RL.TEXT_ALIGNMENT=14 + +-- Defines - Gui extended properties depend on control + +---Text size (glyphs max height) +RL.TEXT_SIZE=16 +---Text spacing between glyphs +RL.TEXT_SPACING=17 +---Line control color +RL.LINE_COLOR=18 +---Background color +RL.BACKGROUND_COLOR=19 +---Text spacing between lines +RL.TEXT_LINE_SPACING=20 +---Text vertical alignment inside text bounds (after border and padding) +RL.TEXT_ALIGNMENT_VERTICAL=21 +---Text wrap-mode inside text bounds +RL.TEXT_WRAP_MODE=22 + +-- Defines - Gui Toggle/ToggleGroup + +---ToggleGroup separation between toggles +RL.GROUP_PADDING=16 + +-- Defines - Gui Slider/SliderBar + +---Slider size of internal bar +RL.SLIDER_WIDTH=16 +---Slider/SliderBar internal bar padding +RL.SLIDER_PADDING=17 + +-- Defines - Gui ProgressBar + +---ProgressBar internal padding +RL.PROGRESS_PADDING=16 + +-- Defines - Gui ScrollBar + +RL.ARROWS_SIZE=16 +RL.ARROWS_VISIBLE=17 +---(SLIDERBAR, SLIDER_PADDING) +RL.SCROLL_SLIDER_PADDING=18 +RL.SCROLL_SLIDER_SIZE=19 +RL.SCROLL_PADDING=20 +RL.SCROLL_SPEED=21 + +-- Defines - Gui CheckBox + +---CheckBox internal check padding +RL.CHECK_PADDING=16 + +-- Defines - Gui ComboBox + +---ComboBox right button width +RL.COMBO_BUTTON_WIDTH=16 +---ComboBox button separation +RL.COMBO_BUTTON_SPACING=17 + +-- Defines - Gui DropdownBox + +---DropdownBox arrow separation from border and items +RL.ARROW_PADDING=16 +---DropdownBox items separation +RL.DROPDOWN_ITEMS_SPACING=17 + +-- Defines - Gui TextBox/TextBoxMulti/ValueBox/Spinner + +---TextBox in read-only mode: 0-text editable, 1-text no-editable +RL.TEXT_READONLY=16 + +-- Defines - Gui Spinner + +---Spinner left/right buttons width +RL.SPIN_BUTTON_WIDTH=16 +---Spinner buttons separation +RL.SPIN_BUTTON_SPACING=17 + +-- Defines - Gui ListView + +---ListView items height +RL.LIST_ITEMS_HEIGHT=16 +---ListView items separation +RL.LIST_ITEMS_SPACING=17 +---ListView scrollbar size (usually width) +RL.SCROLLBAR_WIDTH=18 +---ListView scrollbar side (0-left, 1-right) +RL.SCROLLBAR_SIDE=19 + +-- Defines - Gui ColorPicker + +RL.COLOR_SELECTOR_SIZE=16 +---ColorPicker right hue bar width +RL.HUEBAR_WIDTH=17 +---ColorPicker right hue bar separation from panel +RL.HUEBAR_PADDING=18 +---ColorPicker right hue bar selector height +RL.HUEBAR_SELECTOR_HEIGHT=19 +---ColorPicker right hue bar selector overflow +RL.HUEBAR_SELECTOR_OVERFLOW=20 + +-- Defines - Gui Icons enumeration + +RL.ICON_NONE=0 +RL.ICON_FOLDER_FILE_OPEN=1 +RL.ICON_FILE_SAVE_CLASSIC=2 +RL.ICON_FOLDER_OPEN=3 +RL.ICON_FOLDER_SAVE=4 +RL.ICON_FILE_OPEN=5 +RL.ICON_FILE_SAVE=6 +RL.ICON_FILE_EXPORT=7 +RL.ICON_FILE_ADD=8 +RL.ICON_FILE_DELETE=9 +RL.ICON_FILETYPE_TEXT=10 +RL.ICON_FILETYPE_AUDIO=11 +RL.ICON_FILETYPE_IMAGE=12 +RL.ICON_FILETYPE_PLAY=13 +RL.ICON_FILETYPE_VIDEO=14 +RL.ICON_FILETYPE_INFO=15 +RL.ICON_FILE_COPY=16 +RL.ICON_FILE_CUT=17 +RL.ICON_FILE_PASTE=18 +RL.ICON_CURSOR_HAND=19 +RL.ICON_CURSOR_POINTER=20 +RL.ICON_CURSOR_CLASSIC=21 +RL.ICON_PENCIL=22 +RL.ICON_PENCIL_BIG=23 +RL.ICON_BRUSH_CLASSIC=24 +RL.ICON_BRUSH_PAINTER=25 +RL.ICON_WATER_DROP=26 +RL.ICON_COLOR_PICKER=27 +RL.ICON_RUBBER=28 +RL.ICON_COLOR_BUCKET=29 +RL.ICON_TEXT_T=30 +RL.ICON_TEXT_A=31 +RL.ICON_SCALE=32 +RL.ICON_RESIZE=33 +RL.ICON_FILTER_POINT=34 +RL.ICON_FILTER_BILINEAR=35 +RL.ICON_CROP=36 +RL.ICON_CROP_ALPHA=37 +RL.ICON_SQUARE_TOGGLE=38 +RL.ICON_SYMMETRY=39 +RL.ICON_SYMMETRY_HORIZONTAL=40 +RL.ICON_SYMMETRY_VERTICAL=41 +RL.ICON_LENS=42 +RL.ICON_LENS_BIG=43 +RL.ICON_EYE_ON=44 +RL.ICON_EYE_OFF=45 +RL.ICON_FILTER_TOP=46 +RL.ICON_FILTER=47 +RL.ICON_TARGET_POINT=48 +RL.ICON_TARGET_SMALL=49 +RL.ICON_TARGET_BIG=50 +RL.ICON_TARGET_MOVE=51 +RL.ICON_CURSOR_MOVE=52 +RL.ICON_CURSOR_SCALE=53 +RL.ICON_CURSOR_SCALE_RIGHT=54 +RL.ICON_CURSOR_SCALE_LEFT=55 +RL.ICON_UNDO=56 +RL.ICON_REDO=57 +RL.ICON_REREDO=58 +RL.ICON_MUTATE=59 +RL.ICON_ROTATE=60 +RL.ICON_REPEAT=61 +RL.ICON_SHUFFLE=62 +RL.ICON_EMPTYBOX=63 +RL.ICON_TARGET=64 +RL.ICON_TARGET_SMALL_FILL=65 +RL.ICON_TARGET_BIG_FILL=66 +RL.ICON_TARGET_MOVE_FILL=67 +RL.ICON_CURSOR_MOVE_FILL=68 +RL.ICON_CURSOR_SCALE_FILL=69 +RL.ICON_CURSOR_SCALE_RIGHT_FILL=70 +RL.ICON_CURSOR_SCALE_LEFT_FILL=71 +RL.ICON_UNDO_FILL=72 +RL.ICON_REDO_FILL=73 +RL.ICON_REREDO_FILL=74 +RL.ICON_MUTATE_FILL=75 +RL.ICON_ROTATE_FILL=76 +RL.ICON_REPEAT_FILL=77 +RL.ICON_SHUFFLE_FILL=78 +RL.ICON_EMPTYBOX_SMALL=79 +RL.ICON_BOX=80 +RL.ICON_BOX_TOP=81 +RL.ICON_BOX_TOP_RIGHT=82 +RL.ICON_BOX_RIGHT=83 +RL.ICON_BOX_BOTTOM_RIGHT=84 +RL.ICON_BOX_BOTTOM=85 +RL.ICON_BOX_BOTTOM_LEFT=86 +RL.ICON_BOX_LEFT=87 +RL.ICON_BOX_TOP_LEFT=88 +RL.ICON_BOX_CENTER=89 +RL.ICON_BOX_CIRCLE_MASK=90 +RL.ICON_POT=91 +RL.ICON_ALPHA_MULTIPLY=92 +RL.ICON_ALPHA_CLEAR=93 +RL.ICON_DITHERING=94 +RL.ICON_MIPMAPS=95 +RL.ICON_BOX_GRID=96 +RL.ICON_GRID=97 +RL.ICON_BOX_CORNERS_SMALL=98 +RL.ICON_BOX_CORNERS_BIG=99 +RL.ICON_FOUR_BOXES=100 +RL.ICON_GRID_FILL=101 +RL.ICON_BOX_MULTISIZE=102 +RL.ICON_ZOOM_SMALL=103 +RL.ICON_ZOOM_MEDIUM=104 +RL.ICON_ZOOM_BIG=105 +RL.ICON_ZOOM_ALL=106 +RL.ICON_ZOOM_CENTER=107 +RL.ICON_BOX_DOTS_SMALL=108 +RL.ICON_BOX_DOTS_BIG=109 +RL.ICON_BOX_CONCENTRIC=110 +RL.ICON_BOX_GRID_BIG=111 +RL.ICON_OK_TICK=112 +RL.ICON_CROSS=113 +RL.ICON_ARROW_LEFT=114 +RL.ICON_ARROW_RIGHT=115 +RL.ICON_ARROW_DOWN=116 +RL.ICON_ARROW_UP=117 +RL.ICON_ARROW_LEFT_FILL=118 +RL.ICON_ARROW_RIGHT_FILL=119 +RL.ICON_ARROW_DOWN_FILL=120 +RL.ICON_ARROW_UP_FILL=121 +RL.ICON_AUDIO=122 +RL.ICON_FX=123 +RL.ICON_WAVE=124 +RL.ICON_WAVE_SINUS=125 +RL.ICON_WAVE_SQUARE=126 +RL.ICON_WAVE_TRIANGULAR=127 +RL.ICON_CROSS_SMALL=128 +RL.ICON_PLAYER_PREVIOUS=129 +RL.ICON_PLAYER_PLAY_BACK=130 +RL.ICON_PLAYER_PLAY=131 +RL.ICON_PLAYER_PAUSE=132 +RL.ICON_PLAYER_STOP=133 +RL.ICON_PLAYER_NEXT=134 +RL.ICON_PLAYER_RECORD=135 +RL.ICON_MAGNET=136 +RL.ICON_LOCK_CLOSE=137 +RL.ICON_LOCK_OPEN=138 +RL.ICON_CLOCK=139 +RL.ICON_TOOLS=140 +RL.ICON_GEAR=141 +RL.ICON_GEAR_BIG=142 +RL.ICON_BIN=143 +RL.ICON_HAND_POINTER=144 +RL.ICON_LASER=145 +RL.ICON_COIN=146 +RL.ICON_EXPLOSION=147 +RL.ICON_1UP=148 +RL.ICON_PLAYER=149 +RL.ICON_PLAYER_JUMP=150 +RL.ICON_KEY=151 +RL.ICON_DEMON=152 +RL.ICON_TEXT_POPUP=153 +RL.ICON_GEAR_EX=154 +RL.ICON_CRACK=155 +RL.ICON_CRACK_POINTS=156 +RL.ICON_STAR=157 +RL.ICON_DOOR=158 +RL.ICON_EXIT=159 +RL.ICON_MODE_2D=160 +RL.ICON_MODE_3D=161 +RL.ICON_CUBE=162 +RL.ICON_CUBE_FACE_TOP=163 +RL.ICON_CUBE_FACE_LEFT=164 +RL.ICON_CUBE_FACE_FRONT=165 +RL.ICON_CUBE_FACE_BOTTOM=166 +RL.ICON_CUBE_FACE_RIGHT=167 +RL.ICON_CUBE_FACE_BACK=168 +RL.ICON_CAMERA=169 +RL.ICON_SPECIAL=170 +RL.ICON_LINK_NET=171 +RL.ICON_LINK_BOXES=172 +RL.ICON_LINK_MULTI=173 +RL.ICON_LINK=174 +RL.ICON_LINK_BROKE=175 +RL.ICON_TEXT_NOTES=176 +RL.ICON_NOTEBOOK=177 +RL.ICON_SUITCASE=178 +RL.ICON_SUITCASE_ZIP=179 +RL.ICON_MAILBOX=180 +RL.ICON_MONITOR=181 +RL.ICON_PRINTER=182 +RL.ICON_PHOTO_CAMERA=183 +RL.ICON_PHOTO_CAMERA_FLASH=184 +RL.ICON_HOUSE=185 +RL.ICON_HEART=186 +RL.ICON_CORNER=187 +RL.ICON_VERTICAL_BARS=188 +RL.ICON_VERTICAL_BARS_FILL=189 +RL.ICON_LIFE_BARS=190 +RL.ICON_INFO=191 +RL.ICON_CROSSLINE=192 +RL.ICON_HELP=193 +RL.ICON_FILETYPE_ALPHA=194 +RL.ICON_FILETYPE_HOME=195 +RL.ICON_LAYERS_VISIBLE=196 +RL.ICON_LAYERS=197 +RL.ICON_WINDOW=198 +RL.ICON_HIDPI=199 +RL.ICON_FILETYPE_BINARY=200 +RL.ICON_HEX=201 +RL.ICON_SHIELD=202 +RL.ICON_FILE_NEW=203 +RL.ICON_FOLDER_ADD=204 +RL.ICON_ALARM=205 +RL.ICON_CPU=206 +RL.ICON_ROM=207 +RL.ICON_STEP_OVER=208 +RL.ICON_STEP_INTO=209 +RL.ICON_STEP_OUT=210 +RL.ICON_RESTART=211 +RL.ICON_BREAKPOINT_ON=212 +RL.ICON_BREAKPOINT_OFF=213 +RL.ICON_BURGER_MENU=214 +RL.ICON_CASE_SENSITIVE=215 +RL.ICON_REG_EXP=216 +RL.ICON_FOLDER=217 +RL.ICON_FILE=218 +RL.ICON_SAND_TIMER=219 + +-- Defines - Light type + +---Directional light +RL.LIGHT_DIRECTIONAL=0 +---Point light +RL.LIGHT_POINT=1 + +-- Defines - RLGL Default internal render batch elements limits + +---Default internal render batch elements limits +RL.RL_DEFAULT_BATCH_BUFFER_ELEMENTS=8192 +---Default number of batch buffers (multi-buffering) +RL.RL_DEFAULT_BATCH_BUFFERS=1 +---Default number of batch draw calls (by state changes: mode, texture) +RL.RL_DEFAULT_BATCH_DRAWCALLS=256 +---Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture()) +RL.RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS=4 + +-- Defines - RLGL Internal Matrix stack + +---Maximum size of internal Matrix stack +RL.RL_MAX_MATRIX_STACK_SIZE=32 + +-- Defines - RLGL Shader limits + +---Maximum number of shader locations supported +RL.RL_MAX_SHADER_LOCATIONS=32 + +-- Defines - RLGL Projection matrix culling + +---Default projection matrix near cull distance +RL.RL_CULL_DISTANCE_NEAR=0.01 +---Default projection matrix far cull distance +RL.RL_CULL_DISTANCE_FAR=1000 + +-- Defines - RLGL Texture parameters + +---GL_TEXTURE_WRAP_S +RL.RL_TEXTURE_WRAP_S=10242 +---GL_TEXTURE_WRAP_T +RL.RL_TEXTURE_WRAP_T=10243 +---GL_TEXTURE_MAG_FILTER +RL.RL_TEXTURE_MAG_FILTER=10240 +---GL_TEXTURE_MIN_FILTER +RL.RL_TEXTURE_MIN_FILTER=10241 +---GL_NEAREST +RL.RL_TEXTURE_FILTER_NEAREST=9728 +---GL_LINEAR +RL.RL_TEXTURE_FILTER_LINEAR=9729 +---GL_NEAREST_MIPMAP_NEAREST +RL.RL_TEXTURE_FILTER_MIP_NEAREST=9984 +---GL_NEAREST_MIPMAP_LINEAR +RL.RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR=9986 +---GL_LINEAR_MIPMAP_NEAREST +RL.RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST=9985 +---GL_LINEAR_MIPMAP_LINEAR +RL.RL_TEXTURE_FILTER_MIP_LINEAR=9987 +---Anisotropic filter (custom identifier) +RL.RL_TEXTURE_FILTER_ANISOTROPIC=12288 +---Texture mipmap bias, percentage ratio (custom identifier) +RL.RL_TEXTURE_MIPMAP_BIAS_RATIO=16384 +---GL_REPEAT +RL.RL_TEXTURE_WRAP_REPEAT=10497 +---GL_CLAMP_TO_EDGE +RL.RL_TEXTURE_WRAP_CLAMP=33071 +---GL_MIRRORED_REPEAT +RL.RL_TEXTURE_WRAP_MIRROR_REPEAT=33648 +---GL_MIRROR_CLAMP_EXT +RL.RL_TEXTURE_WRAP_MIRROR_CLAMP=34626 + +-- Defines - RLGL Matrix modes (equivalent to OpenGL) + +---GL_MODELVIEW +RL.RL_MODELVIEW=5888 +---GL_PROJECTION +RL.RL_PROJECTION=5889 +---GL_TEXTURE +RL.RL_TEXTURE=5890 + +-- Defines - RLGL Primitive assembly draw modes + +---GL_LINES +RL.RL_LINES=1 +---GL_TRIANGLES +RL.RL_TRIANGLES=4 +---GL_QUADS +RL.RL_QUADS=7 + +-- Defines - RLGL GL equivalent data types + +---GL_UNSIGNED_BYTE +RL.RL_UNSIGNED_BYTE=5121 +---GL_FLOAT +RL.RL_FLOAT=5126 + +-- Defines - RLGL GL buffer usage hint + +---GL_STREAM_DRAW +RL.RL_STREAM_DRAW=35040 +---GL_STREAM_READ +RL.RL_STREAM_READ=35041 +---GL_STREAM_COPY +RL.RL_STREAM_COPY=35042 +---GL_STATIC_DRAW +RL.RL_STATIC_DRAW=35044 +---GL_STATIC_READ +RL.RL_STATIC_READ=35045 +---GL_STATIC_COPY +RL.RL_STATIC_COPY=35046 +---GL_DYNAMIC_DRAW +RL.RL_DYNAMIC_DRAW=35048 +---GL_DYNAMIC_READ +RL.RL_DYNAMIC_READ=35049 +---GL_DYNAMIC_COPY +RL.RL_DYNAMIC_COPY=35050 + +-- Defines - RLGL Shader type + +---GL_FRAGMENT_SHADER +RL.RL_FRAGMENT_SHADER=35632 +---GL_VERTEX_SHADER +RL.RL_VERTEX_SHADER=35633 +---GL_COMPUTE_SHADER +RL.RL_COMPUTE_SHADER=37305 + +-- Defines - RLGL GL blending factors + +---GL_ZERO +RL.RL_ZERO=0 +---GL_ONE +RL.RL_ONE=1 +---GL_SRC_COLOR +RL.RL_SRC_COLOR=768 +---GL_ONE_MINUS_SRC_COLOR +RL.RL_ONE_MINUS_SRC_COLOR=769 +---GL_SRC_ALPHA +RL.RL_SRC_ALPHA=770 +---GL_ONE_MINUS_SRC_ALPHA +RL.RL_ONE_MINUS_SRC_ALPHA=771 +---GL_DST_ALPHA +RL.RL_DST_ALPHA=772 +---GL_ONE_MINUS_DST_ALPHA +RL.RL_ONE_MINUS_DST_ALPHA=773 +---GL_DST_COLOR +RL.RL_DST_COLOR=774 +---GL_ONE_MINUS_DST_COLOR +RL.RL_ONE_MINUS_DST_COLOR=775 +---GL_SRC_ALPHA_SATURATE +RL.RL_SRC_ALPHA_SATURATE=776 +---GL_CONSTANT_COLOR +RL.RL_CONSTANT_COLOR=32769 +---GL_ONE_MINUS_CONSTANT_COLOR +RL.RL_ONE_MINUS_CONSTANT_COLOR=32770 +---GL_CONSTANT_ALPHA +RL.RL_CONSTANT_ALPHA=32771 +---GL_ONE_MINUS_CONSTANT_ALPHA +RL.RL_ONE_MINUS_CONSTANT_ALPHA=32772 + +-- Defines - RLGL GL blending functions/equations + +---GL_FUNC_ADD +RL.RL_FUNC_ADD=32774 +---GL_MIN +RL.RL_MIN=32775 +---GL_MAX +RL.RL_MAX=32776 +---GL_FUNC_SUBTRACT +RL.RL_FUNC_SUBTRACT=32778 +---GL_FUNC_REVERSE_SUBTRACT +RL.RL_FUNC_REVERSE_SUBTRACT=32779 +---GL_BLEND_EQUATION +RL.RL_BLEND_EQUATION=32777 +---GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION) +RL.RL_BLEND_EQUATION_RGB=32777 +---GL_BLEND_EQUATION_ALPHA +RL.RL_BLEND_EQUATION_ALPHA=34877 +---GL_BLEND_DST_RGB +RL.RL_BLEND_DST_RGB=32968 +---GL_BLEND_SRC_RGB +RL.RL_BLEND_SRC_RGB=32969 +---GL_BLEND_DST_ALPHA +RL.RL_BLEND_DST_ALPHA=32970 +---GL_BLEND_SRC_ALPHA +RL.RL_BLEND_SRC_ALPHA=32971 +---GL_BLEND_COLOR +RL.RL_BLEND_COLOR=32773 +---GL_READ_FRAMEBUFFER +RL.RL_READ_FRAMEBUFFER=36008 +---GL_DRAW_FRAMEBUFFER +RL.RL_DRAW_FRAMEBUFFER=36009 + +-- Defines - RLGL Default shader vertex attribute locations + +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION=0 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD=1 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL=2 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR=3 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT=4 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2=5 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES=6 +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS=nil +RL.RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS=nil + +-- Defines - RLGL GlVersion + +---OpenGL 1.1 +RL.RL_OPENGL_11=1 +---OpenGL 2.1 (GLSL 120) +RL.RL_OPENGL_21=2 +---OpenGL 3.3 (GLSL 330) +RL.RL_OPENGL_33=3 +---OpenGL 4.3 (using GLSL 330) +RL.RL_OPENGL_43=4 +---OpenGL ES 2.0 (GLSL 100) +RL.RL_OPENGL_ES_20=5 + +-- Defines - RLGL Framebuffer attachment type + +---Framebuffer attachment type: color 0 +RL.RL_ATTACHMENT_COLOR_CHANNEL0=0 +---Framebuffer attachment type: color 1 +RL.RL_ATTACHMENT_COLOR_CHANNEL1=1 +---Framebuffer attachment type: color 2 +RL.RL_ATTACHMENT_COLOR_CHANNEL2=2 +---Framebuffer attachment type: color 3 +RL.RL_ATTACHMENT_COLOR_CHANNEL3=3 +---Framebuffer attachment type: color 4 +RL.RL_ATTACHMENT_COLOR_CHANNEL4=4 +---Framebuffer attachment type: color 5 +RL.RL_ATTACHMENT_COLOR_CHANNEL5=5 +---Framebuffer attachment type: color 6 +RL.RL_ATTACHMENT_COLOR_CHANNEL6=6 +---Framebuffer attachment type: color 7 +RL.RL_ATTACHMENT_COLOR_CHANNEL7=7 +---Framebuffer attachment type: depth +RL.RL_ATTACHMENT_DEPTH=100 +---Framebuffer attachment type: stencil +RL.RL_ATTACHMENT_STENCIL=200 + +-- Defines - RLGL Framebuffer texture attachment type + +---Framebuffer texture attachment type: cubemap, +X side +RL.RL_ATTACHMENT_CUBEMAP_POSITIVE_X=0 +---Framebuffer texture attachment type: cubemap, -X side +RL.RL_ATTACHMENT_CUBEMAP_NEGATIVE_X=1 +---Framebuffer texture attachment type: cubemap, +Y side +RL.RL_ATTACHMENT_CUBEMAP_POSITIVE_Y=2 +---Framebuffer texture attachment type: cubemap, -Y side +RL.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y=3 +---Framebuffer texture attachment type: cubemap, +Z side +RL.RL_ATTACHMENT_CUBEMAP_POSITIVE_Z=4 +---Framebuffer texture attachment type: cubemap, -Z side +RL.RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z=5 +---Framebuffer texture attachment type: texture2d +RL.RL_ATTACHMENT_TEXTURE2D=100 +---Framebuffer texture attachment type: renderbuffer +RL.RL_ATTACHMENT_RENDERBUFFER=200 + +-- Defines - RLGL CullMode + +RL.RL_CULL_FACE_FRONT=0 +RL.RL_CULL_FACE_BACK=1 + +-- Defines - OpenGL Bitfield mask + +RL.GL_COLOR_BUFFER_BIT=16384 +RL.GL_DEPTH_BUFFER_BIT=256 +RL.GL_STENCIL_BUFFER_BIT=1024 + +-- Defines - OpenGL Texture parameter + +RL.GL_NEAREST=9728 +RL.GL_LINEAR=9729 + +-- Defines - OpenGL Capability + +---If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc +RL.GL_BLEND=3042 +---If enabled, cull polygons based on their winding in window coordinates. See glCullFace +RL.GL_CULL_FACE=2884 +---If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRangef +RL.GL_DEPTH_TEST=2929 +---If enabled, dither color components or indices before they are written to the color buffer +RL.GL_DITHER=3024 +---If enabled, an offset is added to depth values of a polygon's fragments produced by rasterization. See glPolygonOffset +RL.GL_POLYGON_OFFSET_FILL=32823 +RL.GL_POLYGON_OFFSET_LINE=10754 +RL.GL_POLYGON_OFFSET_POINT=10753 +---If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value +RL.GL_SAMPLE_ALPHA_TO_COVERAGE=32926 +---If enabled, the fragment's coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE, invert the coverage value. See glSampleCoverage +RL.GL_SAMPLE_COVERAGE=32928 +---If enabled, discard fragments that are outside the scissor rectangle. See glScissor +RL.GL_SCISSOR_TEST=3089 +---If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp +RL.GL_STENCIL_TEST=2960 + +-- Defines - OpenGL Test function + +---Always fails +RL.GL_NEVER=512 +---Passes if ( ref & mask ) < ( stencil & mask ) +RL.GL_LESS=513 +---Passes if ( ref & mask ) <= ( stencil & mask ) +RL.GL_LEQUAL=515 +---Passes if ( ref & mask ) > ( stencil & mask ) +RL.GL_GREATER=516 +---Passes if ( ref & mask ) >= ( stencil & mask ) +RL.GL_GEQUAL=518 +---Passes if ( ref & mask ) = ( stencil & mask ) +RL.GL_EQUAL=514 +---Passes if ( ref & mask ) != ( stencil & mask ) +RL.GL_NOTEQUAL=517 +---Always passes +RL.GL_ALWAYS=519 + +-- Defines - OpenGL Face + +RL.GL_FRONT=1028 +RL.GL_BACK=1029 +RL.GL_FRONT_AND_BACK=1032 + +-- Defines - OpenGL Stencil test + +---Keeps the current value +RL.GL_KEEP=7680 +---Sets the stencil buffer value to 0 +RL.GL_ZERO=0 +---Sets the stencil buffer value to ref, as specified by glStencilFunc +RL.GL_REPLACE=7681 +---Increments the current stencil buffer value. Clamps to the maximum representable unsigned value +RL.GL_INCR=7682 +---Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value +RL.GL_INCR_WRAP=34055 +---Decrements the current stencil buffer value. Clamps to 0 +RL.GL_DECR=7683 +---Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero +RL.GL_DECR_WRAP=34056 +---Bitwise inverts the current stencil buffer value +RL.GL_INVERT=5386 + +-- Defines - OpenGL Connection + +---Returns the company responsible for this GL implementation. This name does not change from release to release +RL.GL_VENDOR=7936 +---Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release +RL.GL_RENDERER=7937 +---Returns a version or release number of the form OpenGLES +RL.GL_VERSION=7938 +---Returns a version or release number for the shading language of the form OpenGLESGLSLES +RL.GL_SHADING_LANGUAGE_VERSION=35724 +---Returns a space-separated list of supported extensions to GL +RL.GL_EXTENSIONS=7939 + +-- Defines - CBuffer Data type + +---C type unsigned char +RL.BUFFER_UNSIGNED_CHAR=0 +---C type unsigned short +RL.BUFFER_UNSIGNED_SHORT=1 +---C type unsigned int +RL.BUFFER_UNSIGNED_INT=2 +---C type unsigned long +RL.BUFFER_UNSIGNED_LONG=3 +---C type char +RL.BUFFER_CHAR=4 +---C type short +RL.BUFFER_SHORT=5 +---C type int +RL.BUFFER_INT=6 +---C type long +RL.BUFFER_LONG=7 +---C type float +RL.BUFFER_FLOAT=8 +---C type double +RL.BUFFER_DOUBLE=9 + +-- Defines - Keyboard keys (US keyboard layout) + +---Key: Unknown +RL.GLFW_KEY_UNKNOWN=-1 + +-- Defines - GLFW API tokens. + +---The key or mouse button was released +RL.GLFW_RELEASE=0 +---The key or mouse button was pressed +RL.GLFW_PRESS=1 +---The key was held down until it repeated +RL.GLFW_REPEAT=2 +---Joystick connected +RL.GLFW_CONNECTED=262145 +---Joystick disconnected +RL.GLFW_DISCONNECTED=262146 + +-- Defines - GLFW Window Events. + +---GLFW event window size changed +RL.GLFW_WINDOW_SIZE_EVENT=0 +---GLFW event window maximize +RL.GLFW_WINDOW_MAXIMIZE_EVENT=1 +---GLFW event window iconify +RL.GLFW_WINDOW_ICONYFY_EVENT=2 +---GLFW event window focus +RL.GLFW_WINDOW_FOCUS_EVENT=3 +---GLFW event window drop +RL.GLFW_WINDOW_DROP_EVENT=4 + +-- Defines - GLFW Input Events. + +---GLFW event keyboard key +RL.GLFW_KEY_EVENT=5 +---GLFW event Unicode character +RL.GLFW_CHAR_EVENT=6 +---GLFW event mouse button +RL.GLFW_MOUSE_BUTTON_EVENT=7 +---GLFW event cursor position +RL.GLFW_MOUSE_CURSOR_POS_EVENT=8 +---GLFW event mouse scroll +RL.GLFW_MOUSE_SCROLL_EVENT=9 +---GLFW event cursor enter/leave +RL.GLFW_CURSOR_ENTER_EVENT=10 +---GLFW event joystick +RL.GLFW_JOYSTICK_EVENT=11 + +-- Defines - GLFW Pen Tablet Events. NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445. + +---// GLFW event pen tablet data +RL.assignGlobalInt=nil +---// GLFW event pen tablet cursor +RL.assignGlobalInt=nil +---// GLFW event pen tablet proximity +RL.assignGlobalInt=nil +-- Core - Window-related functions + +---Initialize window and OpenGL context. Note! Should be called only in RL.config. +---InitWindow will still be called automatically before RL.init +---@param size table +---@param title string +---@return any RL.InitWindow +function RL.InitWindow( size, title ) end + +---Close window and unload OpenGL context and free all resources +---@return any RL.CloseWindow +function RL.CloseWindow() end + +---Check if application should close (KEY_ESCAPE pressed or windows close icon clicked). +---Note! Not needed unless you want to make custom main loop +---@return any RL.WindowShouldClose +function RL.WindowShouldClose() end + +---Check if window has been initialized successfully +---- Success return bool +---@return any state +function RL.IsWindowReady() end + +---Check if window is currently fullscreen +---- Success return bool +---@return any state +function RL.IsWindowFullscreen() end + +---Check if window is currently hidden (only PLATFORM_DESKTOP) +---- Success return bool +---@return any state +function RL.IsWindowHidden() end + +---Check if window is currently minimized (only PLATFORM_DESKTOP) +---- Success return bool +---@return any state +function RL.IsWindowMinimized() end + +---Check if window is currently maximized (only PLATFORM_DESKTOP) +---- Success return bool +---@return any state +function RL.IsWindowMaximized() end + +---Check if window is currently focused (only PLATFORM_DESKTOP) +---- Success return bool +---@return any state +function RL.IsWindowFocused() end + +---Check if window has been resized from last frame +---- Success return bool +---@return any resized +function RL.IsWindowResized() end + +---Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) +---- Success return bool +---@param flag integer +---@return any state +function RL.IsWindowState( flag ) end + +---Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) +---@param flag integer +---@return any RL.SetWindowState +function RL.SetWindowState( flag ) end + +---Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...) +---- Success return bool +---@param flag integer +---@return any resized +function RL.ClearWindowState( flag ) end + +---Toggle window state: fullscreen/windowed, resizes monitor to match window resolution +---@return any RL.ToggleFullscreen +function RL.ToggleFullscreen() end + +---Toggle window state: borderless windowed, resizes window to match monitor resolution +---@return any RL.ToggleBorderlessWindowed +function RL.ToggleBorderlessWindowed() end + +---Set window state: maximized, if resizable (only PLATFORM_DESKTOP) +---@return any RL.MaximizeWindow +function RL.MaximizeWindow() end + +---Set window state: minimized, if resizable (only PLATFORM_DESKTOP) +---@return any RL.MinimizeWindow +function RL.MinimizeWindow() end + +---Set window state: not minimized/maximized (only PLATFORM_DESKTOP) +---@return any RL.RestoreWindow +function RL.RestoreWindow() end + +---Set icon for window (Only PLATFORM_DESKTOP) +---@param image any +---@return any RL.SetWindowIcon +function RL.SetWindowIcon( image ) end + +---Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) +---@param images table +---@return any RL.SetWindowIcons +function RL.SetWindowIcons( images ) end + +---Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) +---@param title string +---@return any RL.SetWindowTitle +function RL.SetWindowTitle( title ) end + +---Set window position on screen +---@param pos table +---@return any RL.SetWindowPosition +function RL.SetWindowPosition( pos ) end + +---Set monitor for the current window +---@param monitor integer +---@return any RL.SetWindowMonitor +function RL.SetWindowMonitor( monitor ) end + +---Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) +---@param size table +---@return any RL.SetWindowMinSize +function RL.SetWindowMinSize( size ) end + +---Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) +---@param size table +---@return any RL.SetWindowMaxSize +function RL.SetWindowMaxSize( size ) end + +---Set window dimensions +---@param size table +---@return any RL.SetWindowSize +function RL.SetWindowSize( size ) end + +---Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) +---@param opacity number +---@return any RL.SetWindowOpacity +function RL.SetWindowOpacity( opacity ) end + +---Set window focused (only PLATFORM_DESKTOP) +---@return any RL.SetWindowFocused +function RL.SetWindowFocused() end + +---Get native window handle. Return as lightuserdata +---- Success return lightuserdata +---@return any windowHandle +function RL.GetWindowHandle() end + +---Get screen size +---- Success return Vector2 +---@return any size +function RL.GetScreenSize() end + +---Get render size +---- Success return Vector2 +---@return any size +function RL.GetRenderSize() end + +---Get number of connected monitors +---- Success return int +---@return any count +function RL.GetMonitorCount() end + +---Get current connected monitor +---- Success return int +---@return any monitor +function RL.GetCurrentMonitor() end + +---Get specified monitor position +---- Success return Vector2 +---@param monitor integer +---@return any position +function RL.GetMonitorPosition( monitor ) end + +---Get specified monitor size +---- Success return Vector2 +---@param monitor integer +---@return any size +function RL.GetMonitorSize( monitor ) end + +---Get specified monitor physical size in millimetres +---- Success return Vector2 +---@param monitor integer +---@return any size +function RL.GetMonitorPhysicalSize( monitor ) end + +---Get specified monitor refresh rate +---- Success return int +---@param monitor integer +---@return any refreshRate +function RL.GetMonitorRefreshRate( monitor ) end + +---Get window position on monitor +---- Success return Vector2 +---@return any position +function RL.GetWindowPosition() end + +---Get window scale DPI factor +---- Success return Vector2 +---@return any dpi +function RL.GetWindowScaleDPI() end + +---Get the human-readable, UTF-8 encoded name of the specified monitor +---- Success return string +---@param monitor integer +---@return any name +function RL.GetMonitorName( monitor ) end + +---Set clipboard text content +---@param text string +---@return any RL.SetClipboardText +function RL.SetClipboardText( text ) end + +---Get clipboard text content +---- Success return string +---@return any text +function RL.GetClipboardText() end + +---Get clipboard image content +---- Success return Image +---@return any image +function RL.GetClipboardImage() end + +---Enable waiting for events on EndDrawing(), no automatic event polling +---@return any RL.EnableEventWaiting +function RL.EnableEventWaiting() end + +---Disable waiting for events on EndDrawing(), automatic events polling +---@return any RL.DisableEventWaiting +function RL.DisableEventWaiting() end + +-- Core - Cursor-related functions + +---Shows cursor +---@return any RL.ShowCursor +function RL.ShowCursor() end + +---Hides cursor +---@return any RL.HideCursor +function RL.HideCursor() end + +---Check if cursor is not visible +---- Success return bool +---@return any hidden +function RL.IsCursorHidden() end + +---Enables cursor (unlock cursor) +---@return any RL.EnableCursor +function RL.EnableCursor() end + +---Disables cursor (lock cursor) +---@return any RL.DisableCursor +function RL.DisableCursor() end + +---Check if cursor is on the screen +---- Success return bool +---@return any onSreen +function RL.IsCursorOnScreen() end + +-- Core - Drawing-related functions + +---Set background color (framebuffer clear color) +---@param color table +---@return any RL.ClearBackground +function RL.ClearBackground( color ) end + +---Setup canvas (framebuffer) to start drawing +---@return any RL.BeginDrawing +function RL.BeginDrawing() end + +---End canvas drawing and swap buffers (double buffering) +---@return any RL.EndDrawing +function RL.EndDrawing() end + +---Begin 2D mode with custom camera (2D) +---@param camera any +---@return any RL.BeginMode2D +function RL.BeginMode2D( camera ) end + +---Ends 2D mode with custom camera +---@return any RL.EndMode2D +function RL.EndMode2D() end + +---Begin 3D mode with custom camera (3D) +---@param camera any +---@return any RL.BeginMode3D +function RL.BeginMode3D( camera ) end + +---Ends 3D mode and returns to default 2D orthographic mode +---@return any RL.EndMode3D +function RL.EndMode3D() end + +---Begin drawing to render texture +---@param target any +---@return any RL.BeginTextureMode +function RL.BeginTextureMode( target ) end + +---Ends drawing to render texture +---@return any RL.EndTextureMode +function RL.EndTextureMode() end + +---Begin custom shader drawing +---@param shader any +---@return any RL.BeginShaderMode +function RL.BeginShaderMode( shader ) end + +---End custom shader drawing (use default shader) +---@return any RL.EndShaderMode +function RL.EndShaderMode() end + +---Begin blending mode (BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED...) +---@param mode integer +---@return any RL.BeginBlendMode +function RL.BeginBlendMode( mode ) end + +---End blending mode (reset to default: BLEND_ALPHA) +---@return any RL.EndBlendMode +function RL.EndBlendMode() end + +---Begin scissor mode (define screen area for following drawing) +---@param rectange table +---@return any RL.BeginScissorMode +function RL.BeginScissorMode( rectange ) end + +---End scissor mode +---@return any RL.EndScissorMode +function RL.EndScissorMode() end + +-- Core - Shader management functions + +---Load shader from files and bind default locations. +---NOTE: Set nil if no shader +---- Failure return nil +---- Success return Shader +---@param vsFileName string|nil +---@param fsFileName string|nil +---@return any shader +function RL.LoadShader( vsFileName, fsFileName ) end + +---Load shader from code strings and bind default locations +---NOTE: Set nil if no shader +---- Failure return nil +---- Success return Shader +---@param vsCode string|nil +---@param fsCode string|nil +---@return any shader +function RL.LoadShaderFromMemory( vsCode, fsCode ) end + +---Check if a shader is valid (loaded on GPU) +---- Success return bool +---@param shader any +---@return any isValid +function RL.IsShaderValid( shader ) end + +---Get shader program id +---- Success return int +---@param shader any +---@return any shaderId +function RL.GetShaderId( shader ) end + +---Get shader uniform location +---- Success return int +---@param shader any +---@param uniformName string +---@return any location +function RL.GetShaderLocation( shader, uniformName ) end + +---Get shader attribute location +---- Success return int +---@param shader any +---@param attribName string +---@return any location +function RL.GetShaderLocationAttrib( shader, attribName ) end + +---Set shader location index +---@param shader any +---@param shaderLocationIndex integer +---@param location integer +---@return any RL.SetShaderLocationIndex +function RL.SetShaderLocationIndex( shader, shaderLocationIndex, location ) end + +---Get shader location index +---- Success return int +---@param shader any +---@param shaderLocationIndex integer +---@return any location +function RL.GetShaderLocationIndex( shader, shaderLocationIndex ) end + +---Set shader uniform value (matrix 4x4) +---@param shader any +---@param locIndex integer +---@param mat table +---@return any RL.SetShaderValueMatrix +function RL.SetShaderValueMatrix( shader, locIndex, mat ) end + +---Set shader uniform value for texture (sampler2d) +---@param shader any +---@param locIndex integer +---@param texture any +---@return any RL.SetShaderValueTexture +function RL.SetShaderValueTexture( shader, locIndex, texture ) end + +---Set shader uniform value +---NOTE: Even one value should be in table +---@param shader any +---@param locIndex integer +---@param values table +---@param uniformType integer +---@return any RL.SetShaderValue +function RL.SetShaderValue( shader, locIndex, values, uniformType ) end + +---Set shader uniform value vector +---NOTE: Even one value should be in table +---@param shader any +---@param locIndex integer +---@param values table +---@param uniformType integer +---@param count integer +---@return any RL.SetShaderValueV +function RL.SetShaderValueV( shader, locIndex, values, uniformType, count ) end + +---Set shader uniform value using Buffer object +---@param shader any +---@param locIndex integer +---@param values any +---@param uniformType integer +---@return any RL.SetShaderValueWithBuffer +function RL.SetShaderValueWithBuffer( shader, locIndex, values, uniformType ) end + +---Set shader uniform value vector using Buffer object +---@param shader any +---@param locIndex integer +---@param values any +---@param uniformType integer +---@param count integer +---@return any RL.SetShaderValueVWithBuffer +function RL.SetShaderValueVWithBuffer( shader, locIndex, values, uniformType, count ) end + +---Unload shader from GPU memory (VRAM) +---@param shader any +---@return any RL.UnloadShader +function RL.UnloadShader( shader ) end + +-- Core - Screen-space-related functions + +---Get a ray trace from screen position (i.e mouse) +---- Success return Ray +---@param mousePosition table +---@param camera any +---@return any ray +function RL.GetScreenToWorldRay( mousePosition, camera ) end + +---Get a ray trace from screen position (i.e mouse) in a viewport +---- Success return Ray +---@param mousePosition table +---@param camera any +---@param size table +---@return any ray +function RL.GetScreenToWorldRayEx( mousePosition, camera, size ) end + +---Get the screen space position for a 3d world space position +---- Success return Vector2 +---@param position table +---@param camera any +---@return any position +function RL.GetWorldToScreen( position, camera ) end + +---Get size position for a 3d world space position +---- Success return Vector2 +---@param position table +---@param camera any +---@param size table +---@return any position +function RL.GetWorldToScreenEx( position, camera, size ) end + +---Get the screen space position for a 2d camera world space position +---- Success return Vector2 +---@param position table +---@param camera any +---@return any position +function RL.GetWorldToScreen2D( position, camera ) end + +---Get the world space position for a 2d camera screen space position +---- Success return Vector2 +---@param position table +---@param camera any +---@return any position +function RL.GetScreenToWorld2D( position, camera ) end + +---Get camera transform matrix (view matrix) +---- Success return Matrix +---@param camera any +---@return any matrix +function RL.GetCameraMatrix( camera ) end + +---Get camera 2d transform matrix +---- Success return Matrix +---@param camera any +---@return any matrix +function RL.GetCameraMatrix2D( camera ) end + +-- Core - Timing-related functions + +---Set target FPS (maximum) +---@param fps integer +---@return any RL.SetTargetFPS +function RL.SetTargetFPS( fps ) end + +---Get time in seconds for last frame drawn (Delta time) +---- Success return float +---@return any delta +function RL.GetFrameTime() end + +---Get elapsed time in seconds since InitWindow() +---- Success return float +---@return any time +function RL.GetTime() end + +---Get current FPS +---- Success return int +---@return any FPS +function RL.GetFPS() end + +-- Core - Custom frame control functions + +---Swap back buffer with front buffer (screen drawing) +---@return any RL.SwapScreenBuffer +function RL.SwapScreenBuffer() end + +---Register all input events +---@return any RL.PollInputEvents +function RL.PollInputEvents() end + +---Wait for some time (halt program execution) +---@param seconds any +---@return any RL.WaitTime +function RL.WaitTime( seconds ) end + +-- Core - Random values generation functions + +---Set the seed for the random number generator +---@param seed integer +---@return any RL.SetRandomSeed +function RL.SetRandomSeed( seed ) end + +---Get a random value between min and max (both included) +---- Success return int +---@param min integer +---@param max integer +---@return any time +function RL.GetRandomValue( min, max ) end + +---Load random values sequence, no values repeated +---- Success return int{} +---@param count integer +---@param min integer +---@param max integer +---@return any sequence +function RL.LoadRandomSequence( count, min, max ) end + +-- Core - Misc + +---Takes a screenshot of current screen (filename extension defines format) +---@param fileName string +---@return any RL.TakeScreenshot +function RL.TakeScreenshot( fileName ) end + +---Setup init configuration flags (view FLAGS) +---@param flags integer +---@return any RL.SetConfigFlags +function RL.SetConfigFlags( flags ) end + +---Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) +---@param logLevel integer +---@param text string +---@return any RL.TraceLog +function RL.TraceLog( logLevel, text ) end + +---Set the current threshold (minimum) log level +---@param logLevel integer +---@return any RL.SetTraceLogLevel +function RL.SetTraceLogLevel( logLevel ) end + +---Set the log level for bad function calls and invalid data formats. +---@param logLevel integer +---@return any RL.SetLogLevelInvalid +function RL.SetLogLevelInvalid( logLevel ) end + +---Get the log level for bad function calls and invalid data formats. +---- Success return int +---@return any logLevel +function RL.GetLogLevelInvalid() end + +---Open URL with default system browser (if available) +---@param url string +---@return any RL.OpenURL +function RL.OpenURL( url ) end + +---Check if Lua garbage collection is set to unload object data +---- Success return bool +---@return any enabled +function RL.IsGCUnloadEnabled() end + +---Set Lua garbage collection to unload object data +---@param enabled boolean +---@return any RL.SetGCUnload +function RL.SetGCUnload( enabled ) end + +---Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten" +---- Success return string +---@return any platform +function RL.GetPlatform() end + +-- Core - Files management functions + +---Load file data as byte array (read). Buffer type is BUFFER_UNSIGNED_CHAR +---- Success return Buffer +---@param fileName string +---@return any buffer +function RL.LoadFileData( fileName ) end + +---Save data to file from byte array (write), returns true on success +---- Success return bool +---@param fileName string +---@param Buffer any +---@return any success +function RL.SaveFileData( fileName, Buffer ) end + +---Export data to code (.h), returns true on success +---- Success return bool +---@param buffer any +---@param fileName string +---@return any success +function RL.ExportDataAsCode( buffer, fileName ) end + +---Load text data from file (read) +---- Success return string +---@param fileName string +---@return any text +function RL.LoadFileText( fileName ) end + +---Save text data to file (write), returns true on success +---- Success return bool +---@param fileName string +---@param text string +---@return any success +function RL.SaveFileText( fileName, text ) end + +-- Core - Files system functions + +---Return game directory (where main.lua is located) +---- Success return string +---@return any path +function RL.GetBasePath() end + +---Check if file exists +---- Success return bool +---@param fileName string +---@return any fileExists +function RL.FileExists( fileName ) end + +---Check if a directory path exists +---- Success return bool +---@param dirPath string +---@return any dirExists +function RL.DirectoryExists( dirPath ) end + +---Check file extension (Including point: .png, .wav) +---- Success return bool +---@param fileName string +---@param ext string +---@return any hasFileExtension +function RL.IsFileExtension( fileName, ext ) end + +---Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) +---- Success return int +---@param fileName string +---@return any length +function RL.GetFileLength( fileName ) end + +---Get pointer to extension for a filename string (Includes dot: '.png') +---- Success return string +---@param fileName string +---@return any extension +function RL.GetFileExtension( fileName ) end + +---Get pointer to filename for a path string +---- Success return string +---@param filePath string +---@return any fileName +function RL.GetFileName( filePath ) end + +---Get filename string without extension (Uses static string) +---- Success return string +---@param filePath string +---@return any fileName +function RL.GetFileNameWithoutExt( filePath ) end + +---Get full path for a given fileName with path (Uses static string) +---- Success return string +---@param filePath string +---@return any filePath +function RL.GetDirectoryPath( filePath ) end + +---Get previous directory path for a given path (Uses static string) +---- Success return string +---@param dirPath string +---@return any directory +function RL.GetPrevDirectoryPath( dirPath ) end + +---Get current working directory (Uses static string) +---- Success return string +---@return any directory +function RL.GetWorkingDirectory() end + +---Get the directory of the running application (uses static string) +---- Success return string +---@return any directory +function RL.GetApplicationDirectory() end + +---Create directories (including full path requested), returns 0 on success +---- Success return int +---@param dirPath string +---@return any success +function RL.MakeDirectory( dirPath ) end + +---Change working directory, return true on success +---- Success return bool +---@param directory string +---@return any success +function RL.ChangeDirectory( directory ) end + +---Check if a given path is a file or a directory +---- Success return bool +---@param path string +---@return any isFile +function RL.IsPathFile( path ) end + +---Check if fileName is valid for the platform/OS +---- Success return bool +---@param fileName string +---@return any isValid +function RL.IsFileNameValid( fileName ) end + +---Load directory filepaths +---- Success return string{} +---@param dirPath string +---@return any fileNames +function RL.LoadDirectoryFiles( dirPath ) end + +---Load directory filepaths with extension filtering and recursive directory scan +---- Success return string{} +---@param basePath string +---@param filter string|nil +---@param scanSubdirs boolean +---@return any fileNames +function RL.LoadDirectoryFilesEx( basePath, filter, scanSubdirs ) end + +---Check if a file has been dropped into window +---- Success return bool +---@return any iSFileDropped +function RL.IsFileDropped() end + +---Load dropped filepaths +---- Success return string{} +---@return any files +function RL.LoadDroppedFiles() end + +---Get file modification time (Last write time) +---- Success return int +---@param fileName string +---@return any time +function RL.GetFileModTime( fileName ) end + +-- Core - Compression/Encoding functionality + +---Compress data (DEFLATE algorithm) +---- Success return Buffer +---@param buffer any +---@return any compData +function RL.CompressData( buffer ) end + +---Decompress data (DEFLATE algorithm). +---- Success Buffer +---@param compData any +---@return any decompData +function RL.DecompressData( compData ) end + +---Encode data to Base64 string +---- Success return string, int +---@param data string +---@return any encodedData +---@return any outputSize +function RL.EncodeDataBase64( data ) end + +---Decode Base64 string data +---- Success return string, int +---@param data string +---@return any decodedData +---@return any outputSize +function RL.DecodeDataBase64( data ) end + +---Compute CRC32 hash code. +---- Failure return false +---- Success return int +---@param data any +---@return any code +function RL.ComputeCRC32( data ) end + +---Compute MD5 hash code, returns static int[4] (16 bytes). +---- Failure return false +---- Success return int{4} +---@param data any +---@return any code +function RL.ComputeMD5( data ) end + +---Compute SHA1 hash code, returns static int[5] (20 bytes). +---- Failure return false +---- Success return int{5} +---@param data any +---@return any code +function RL.ComputeSHA1( data ) end + +-- Core - Automation events functionality + +---Load automation events list from file, nil for empty list, capacity = MAX_AUTOMATION_EVENTS +---- Success return AutomationEventList +---@param fileName string|nil +---@return any eventList +function RL.LoadAutomationEventList( fileName ) end + +---Unload automation events list from file +---@param list any +---@return any RL.UnloadAutomationEventList +function RL.UnloadAutomationEventList( list ) end + +---Export automation events list as text file +---- Failure return false +---- Success return true +---@param fileName string +---@return any success +function RL.ExportAutomationEventList( fileName ) end + +---Set automation event list to record to +---@param list any +---@return any RL.SetAutomationEventList +function RL.SetAutomationEventList( list ) end + +---Set automation event internal base frame to start recording +---@param frame integer +---@return any RL.SetAutomationEventBaseFrame +function RL.SetAutomationEventBaseFrame( frame ) end + +---Start recording automation events (AutomationEventList must be set) +---@return any RL.StartAutomationEventRecording +function RL.StartAutomationEventRecording() end + +---Stop recording automation events +---@return any RL.StopAutomationEventRecording +function RL.StopAutomationEventRecording() end + +---Play a recorded automation event +---@param event any +---@return any RL.PlayAutomationEvent +function RL.PlayAutomationEvent( event ) end + +---Get automation event list capacity +---- Success return int +---@param list any +---@return any capacity +function RL.GetAutomationEventListCapacity( list ) end + +---Get automation event list count +---- Success return int +---@param list any +---@return any count +function RL.GetAutomationEventListCount( list ) end + +---Get automation event from automation event list. Return as lightuserdata +---- Failure return nil +---- Success return AutomationEvent +---@param list any +---@param index integer +---@return any event +function RL.GetAutomationEvent( list, index ) end + +---Get automation event frame +---- Success return int +---@param event any +---@return any frame +function RL.GetAutomationEventFrame( event ) end + +---Get automation event type +---- Success return int +---@param event any +---@return any type +function RL.GetAutomationEventType( event ) end + +---Get automation event params +---- Success return int{} +---@param event any +---@return any params +function RL.GetAutomationEventParams( event ) end + +-- Core - Input-related functions: keyboard + +---Detect if a key has been pressed once +---- Success return bool +---@param key integer +---@return any pressed +function RL.IsKeyPressed( key ) end + +---Check if a key has been pressed again (Only PLATFORM_DESKTOP) +---- Success return bool +---@param key integer +---@return any pressed +function RL.IsKeyPressedRepeat( key ) end + +---Detect if a key is being pressed +---- Success return bool +---@param key integer +---@return any pressed +function RL.IsKeyDown( key ) end + +---Detect if a key has been released once +---- Success return bool +---@param key integer +---@return any released +function RL.IsKeyReleased( key ) end + +---Check if a key is NOT being pressed +---- Success return bool +---@param key integer +---@return any released +function RL.IsKeyUp( key ) end + +---Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty +---- Success return int +---@return any keycode +function RL.GetKeyPressed() end + +---Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty +---- Success return int +---@return any unicode +function RL.GetCharPressed() end + +---Set a custom key to exit program (default is ESC) +---@param key integer +---@return any RL.SetExitKey +function RL.SetExitKey( key ) end + +-- Core - Input-related functions: gamepads + +---Detect if a gamepad is available +---- Success return bool +---@param gamepad integer +---@return any available +function RL.IsGamepadAvailable( gamepad ) end + +---Return gamepad internal name id +---- Success return string +---@param gamepad integer +---@return any name +function RL.GetGamepadName( gamepad ) end + +---Detect if a gamepad button has been pressed once +---- Success return bool +---@param gamepad integer +---@param button integer +---@return any pressed +function RL.IsGamepadButtonPressed( gamepad, button ) end + +---Detect if a gamepad button is being pressed +---- Success return bool +---@param gamepad integer +---@param button integer +---@return any pressed +function RL.IsGamepadButtonDown( gamepad, button ) end + +---Detect if a gamepad button has been released once +---- Success return bool +---@param gamepad integer +---@param button integer +---@return any released +function RL.IsGamepadButtonReleased( gamepad, button ) end + +---Check if a gamepad button is NOT being pressed +---- Success return bool +---@param gamepad integer +---@param button integer +---@return any notPressed +function RL.IsGamepadButtonUp( gamepad, button ) end + +---Get the last gamepad button pressed +---- Success return int +---@return any button +function RL.GetGamepadButtonPressed() end + +---Return gamepad axis count for a gamepad +---- Success return int +---@param gamepad integer +---@return any count +function RL.GetGamepadAxisCount( gamepad ) end + +---Return axis movement value for a gamepad axis +---- Success return float +---@param gamepad integer +---@param axis integer +---@return any value +function RL.GetGamepadAxisMovement( gamepad, axis ) end + +---Set internal gamepad mappings (SDL_GameControllerDB) +---- Success return int +---@param mappings string +---@return any result +function RL.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 any RL.SetGamepadVibration +function RL.SetGamepadVibration( gamepad, leftMotor, rightMotor, duration ) end + +-- Core - Input-related functions: mouse + +---Detect if a mouse button has been pressed once +---- Success return bool +---@param button integer +---@return any pressed +function RL.IsMouseButtonPressed( button ) end + +---Detect if a mouse button is being pressed +---- Success return bool +---@param button integer +---@return any pressed +function RL.IsMouseButtonDown( button ) end + +---Detect if a mouse button has been released once +---- Success return bool +---@param button integer +---@return any released +function RL.IsMouseButtonReleased( button ) end + +---Check if a mouse button is NOT being pressed +---- Success return bool +---@param button integer +---@return any released +function RL.IsMouseButtonUp( button ) end + +---Returns mouse position +---- Success return Vector2 +---@return any position +function RL.GetMousePosition() end + +---Get mouse delta between frames +---- Success return Vector2 +---@return any position +function RL.GetMouseDelta() end + +---Set mouse position XY +---@param position table +---@return any RL.SetMousePosition +function RL.SetMousePosition( position ) end + +---Set mouse offset +---@param offset table +---@return any RL.SetMouseOffset +function RL.SetMouseOffset( offset ) end + +---Set mouse scaling +---@param scale table +---@return any RL.SetMouseScale +function RL.SetMouseScale( scale ) end + +---Get mouse offset +---- Success return Vector2 +---@return any offset +function RL.GetMouseOffset() end + +---Get mouse scale +---- Success return Vector2 +---@return any scale +function RL.GetMouseScale() end + +---Get mouse wheel movement for X or Y, whichever is larger +---- Success return float +---@return any movement +function RL.GetMouseWheelMove() end + +---Get mouse wheel movement for both X and Y +---- Success return Vector2 +---@return any movement +function RL.GetMouseWheelMoveV() end + +---Set mouse cursor +---@param cursor integer +---@return any RL.SetMouseCursor +function RL.SetMouseCursor( cursor ) end + +-- Core - Input-related functions: touch + +---Get touch position XY for a touch point index (relative to screen size) +---- Success return Vector2 +---@param index integer +---@return any position +function RL.GetTouchPosition( index ) end + +---Get touch point identifier for given index +---- Success return int +---@param index integer +---@return any id +function RL.GetTouchPointId( index ) end + +---Get touch point identifier for given index +---- Success return int +---@return any count +function RL.GetTouchPointCount() end + +-- Core - Input-related functions: gestures + +---Enable a set of gestures using flags +---@param int any +---@return any RL.SetGesturesEnabled +function RL.SetGesturesEnabled( int ) end + +---Check if a gesture have been detected +---- Success return bool +---@param gesture integer +---@return any detected +function RL.IsGestureDetected( gesture ) end + +---Get latest detected gesture +---- Success return int +---@return any gesture +function RL.GetGestureDetected() end + +---Get gesture hold time in milliseconds +---- Success return float +---@return any time +function RL.GetGestureHoldDuration() end + +---Get gesture drag vector +---- Success return Vector2 +---@return any vector +function RL.GetGestureDragVector() end + +---Get gesture drag angle +---- Success return float +---@return any angle +function RL.GetGestureDragAngle() end + +---Get gesture pinch delta +---- Success return Vector2 +---@return any vector +function RL.GetGesturePinchVector() end + +---Get gesture pinch angle +---- Success return float +---@return any angle +function RL.GetGesturePinchAngle() end + +-- Core - Camera2D System functions + +---Return camera2D set to default configuration +---- Success return Camera2D +---@return any camera2D +function RL.CreateCamera2D() end + +---Set camera target (rotation and zoom origin) +---@param camera any +---@param target table +---@return any RL.SetCamera2DTarget +function RL.SetCamera2DTarget( camera, target ) end + +---Set camera offset (displacement from target) +---@param camera any +---@param offset table +---@return any RL.SetCamera2DOffset +function RL.SetCamera2DOffset( camera, offset ) end + +---Set camera rotation in degrees +---@param camera any +---@param rotation number +---@return any RL.SetCamera2DRotation +function RL.SetCamera2DRotation( camera, rotation ) end + +---Set camera zoom (scaling), should be 1.0f by default +---@param camera any +---@param zoom number +---@return any RL.SetCamera2DZoom +function RL.SetCamera2DZoom( camera, zoom ) end + +---Get camera2D target +---- Success return Vector2 +---@param camera any +---@return any target +function RL.GetCamera2DTarget( camera ) end + +---Get camera2D offset +---- Success return Vector2 +---@param camera any +---@return any offset +function RL.GetCamera2DOffset( camera ) end + +---Get camera2D rotation +---- Success return float +---@param camera any +---@return any rotation +function RL.GetCamera2DRotation( camera ) end + +---Get camera2D zoom +---- Success return float +---@param camera any +---@return any zoom +function RL.GetCamera2DZoom( camera ) end + +-- Core - Camera3D System functions + +---Return camera3D id set to default configuration +---- Success return int +---@return any camera +function RL.CreateCamera3D() end + +---Set camera position (Remember to call "RL.UpdateCamera3D()" to apply changes) +---@param camera any +---@param position table +---@return any RL.SetCamera3DPosition +function RL.SetCamera3DPosition( camera, position ) end + +---Set camera target it looks-at +---@param camera any +---@param target table +---@return any RL.SetCamera3DTarget +function RL.SetCamera3DTarget( camera, target ) end + +---Set camera up vector (Rotation over it's axis) +---@param camera any +---@param up table +---@return any RL.SetCamera3DUp +function RL.SetCamera3DUp( camera, up ) end + +---Set camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic +---@param camera any +---@param fovy number +---@return any RL.SetCamera3DFovy +function RL.SetCamera3DFovy( camera, fovy ) end + +---Set camera projection mode (CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC) +---@param camera any +---@param projection integer +---@return any RL.SetCamera3DProjection +function RL.SetCamera3DProjection( camera, projection ) end + +---Get camera position +---- Success return Vector3 +---@param camera any +---@return any position +function RL.GetCamera3DPosition( camera ) end + +---Get camera target it looks-at +---- Success return Vector3 +---@param camera any +---@return any target +function RL.GetCamera3DTarget( camera ) end + +---Get camera up vector (Rotation over it's axis) +---- Success return Vector3 +---@param camera any +---@return any up +function RL.GetCamera3DUp( camera ) end + +---Get camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic +---- Success return float +---@param camera any +---@return any fovy +function RL.GetCamera3DFovy( camera ) end + +---Get camera projection mode +---- Success return int +---@param camera any +---@return any projection +function RL.GetCamera3DProjection( camera ) end + +---Returns the cameras forward vector (normalized) +---- Success return Vector3 +---@param camera any +---@return any forward +function RL.GetCamera3DForward( camera ) end + +---Returns the cameras up vector (normalized) +---Note: The up vector might not be perpendicular to the forward vector +---- Success return Vector3 +---@param camera any +---@return any up +function RL.GetCamera3DUpNormalized( camera ) end + +---Returns the cameras right vector (normalized) +---- Success return Vector3 +---@param camera any +---@return any right +function RL.GetCamera3DRight( camera ) end + +---Moves the camera in it's forward direction +---@param camera any +---@param distance number +---@param moveInWorldPlane boolean +---@return any RL.Camera3DMoveForward +function RL.Camera3DMoveForward( camera, distance, moveInWorldPlane ) end + +---Moves the camera in it's up direction +---@param camera any +---@param distance number +---@return any RL.Camera3DMoveUp +function RL.Camera3DMoveUp( camera, distance ) end + +---Moves the camera target in it's current right direction +---@param camera any +---@param distance number +---@param moveInWorldPlane boolean +---@return any RL.Camera3DMoveRight +function RL.Camera3DMoveRight( camera, distance, moveInWorldPlane ) end + +---Moves the camera position closer/farther to/from the camera target +---@param camera any +---@param delta number +---@return any RL.Camera3DMoveToTarget +function RL.Camera3DMoveToTarget( camera, delta ) end + +---Rotates the camera around it's up vector +---Yaw is "looking left and right" +---If rotateAroundTarget is false, the camera rotates around it's position +---Note: angle must be provided in radians +---@param camera any +---@param angle number +---@param rotateAroundTarget boolean +---@return any RL.Camera3DYaw +function RL.Camera3DYaw( camera, angle, rotateAroundTarget ) end + +---Rotates the camera around it's right vector, pitch is "looking up and down" +---- lockView prevents camera overrotation (aka "somersaults") +---- rotateAroundTarget defines if rotation is around target or around it's position +---- rotateUp rotates the up direction as well (typically only usefull in CAMERA_FREE) +---NOTE: angle must be provided in radians +---@param camera any +---@param angle number +---@param lockView boolean +---@param rotateAroundTarget boolean +---@param rotateUp boolean +---@return any RL.Camera3DPitch +function RL.Camera3DPitch( camera, angle, lockView, rotateAroundTarget, rotateUp ) end + +---Rotates the camera around it's forward vector +---Roll is "turning your head sideways to the left or right" +---Note: angle must be provided in radians +---@param camera any +---@param angle number +---@return any RL.Camera3DRoll +function RL.Camera3DRoll( camera, angle ) end + +---Returns the camera view matrix +---- Success return Matrix +---@param camera any +---@return any view +function RL.GetCamera3DViewMatrix( camera ) end + +---Returns the camera projection matrix +---- Success return Matrix +---@param camera any +---@param aspect number +---@return any projection +function RL.GetCamera3DProjectionMatrix( camera, aspect ) end + +---Update camera position for selected mode +---@param camera any +---@param mode integer +---@return any RL.UpdateCamera3D +function RL.UpdateCamera3D( camera, mode ) end + +---Update camera movement, movement/rotation values should be provided by user +---@param camera any +---@param movement table +---@param rotation table +---@param zoom number +---@return any RL.UpdateCamera3DPro +function RL.UpdateCamera3DPro( camera, movement, rotation, zoom ) end + +-- Core - Buffer management functions + +---Load Buffer. Type should be one of the Buffer types. Empty buffer will set data to NULL. +---- Success return Buffer +---@param buffer table +---@param type integer +---@return any buffer +function RL.LoadBuffer( buffer, type ) end + +---Load formatted buffer with all values set to 'value' +---- Success return Buffer +---@param length integer +---@param type integer +---@param value integer +---@return any buffer +function RL.LoadBufferFormatted( length, type, value ) end + +---Read buffer data from binary file +---- Failure return nil +---- Success return Buffer +---@param path string +---@param type integer +---@return any buffer +function RL.LoadBufferFromFile( path, type ) end + +---Read buffer data from string +---- Failure return nil +---- Success return Buffer +---@param buffer string +---@return any buffer +function RL.LoadBufferFromString( buffer ) end + +---Unload buffer data +---@param buffer any +---@return any RL.UnloadBuffer +function RL.UnloadBuffer( buffer ) end + +---Copy buffer data to another buffer. Size is in bytes +---@param dst any +---@param src any +---@param posDst integer +---@param posSrc integer +---@param size integer +---@return any RL.CopyBufferData +function RL.CopyBufferData( dst, src, posDst, posSrc, size ) end + +---Set buffer data value +---@param buffer any +---@param position integer +---@param values table +---@return any RL.SetBufferData +function RL.SetBufferData( buffer, position, values ) end + +---Swap buffer endianness from big endian to little endian and vice versa +---@param buffer any +---@return any RL.SwapBufferEndianness +function RL.SwapBufferEndianness( buffer ) end + +---Get buffer data as table in the format it was stored +---- Success return data{} +---@param buffer any +---@param position integer +---@param length integer +---@return any data +function RL.GetBufferData( buffer, position, length ) end + +---Get buffer as string +---- Success return string +---@param buffer any +---@return any string +function RL.GetBufferAsString( buffer ) end + +---Get buffer type +---- Success return int +---@param buffer any +---@return any type +function RL.GetBufferType( buffer ) end + +---Get buffer size in bytes +---- Success return int +---@param buffer any +---@return any size +function RL.GetBufferSize( buffer ) end + +---Get buffer element size in bytes +---- Success return int +---@param buffer any +---@return any size +function RL.GetBufferElementSize( buffer ) end + +---Get buffer element count +---- Success return int +---@param buffer any +---@return any length +function RL.GetBufferLength( buffer ) end + +---Write buffer data to binary file +---@param buffer any +---@param path string +---@return any RL.ExportBuffer +function RL.ExportBuffer( buffer, path ) end + +-- Shapes - Basic shapes drawing functions + +---Set texture and rectangle to be used on shapes drawing +---NOTE: It can be useful when using basic shapes and one single font, +---defining a font char white rectangle would allow drawing everything in a single draw call +---@param texture any +---@param source table +---@return any RL.SetShapesTexture +function RL.SetShapesTexture( texture, source ) end + +---Get texture that is used for shapes drawing. Return as lightuserdata +---- Success return Texture +---@return any texture +function RL.GetShapesTexture() end + +---Get texture source rectangle that is used for shapes drawing +---- Success return Rectangle +---@return any source +function RL.GetShapesTextureRectangle() end + +---Draw a pixel +---@param pos table +---@param color table +---@return any RL.DrawPixel +function RL.DrawPixel( pos, color ) end + +---Draw a line defining thickness +---@param startPos table +---@param endPos table +---@param thickness number +---@param color table +---@return any RL.DrawLine +function RL.DrawLine( startPos, endPos, thickness, color ) end + +---Draw lines sequence +---@param points table +---@param color table +---@return any RL.DrawLineStrip +function RL.DrawLineStrip( points, color ) end + +---Draw a line using cubic-bezier curves in-out +---@param startPos table +---@param endPos table +---@param thickness number +---@param color table +---@return any RL.DrawLineBezier +function RL.DrawLineBezier( startPos, endPos, thickness, color ) end + +---Draw a color-filled circle +---@param center table +---@param radius number +---@param color table +---@return any RL.DrawCircle +function RL.DrawCircle( center, radius, color ) end + +---Draw a piece of a circle +---@param center table +---@param radius number +---@param startAngle number +---@param endAngle number +---@param segments integer +---@param color table +---@return any RL.DrawCircleSector +function RL.DrawCircleSector( center, radius, startAngle, endAngle, segments, color ) end + +---Draw circle sector outline +---@param center table +---@param radius number +---@param startAngle number +---@param endAngle number +---@param segments integer +---@param color table +---@return any RL.DrawCircleSectorLines +function RL.DrawCircleSectorLines( center, radius, startAngle, endAngle, segments, color ) end + +---Draw a gradient-filled circle +---@param center table +---@param radius number +---@param color1 table +---@param color2 table +---@return any RL.DrawCircleGradient +function RL.DrawCircleGradient( center, radius, color1, color2 ) end + +---Draw circle outline +---@param center table +---@param radius number +---@param color table +---@return any RL.DrawCircleLines +function RL.DrawCircleLines( center, radius, color ) end + +---Draw ellipse +---@param center table +---@param radiusH number +---@param radiusV number +---@param color table +---@return any RL.DrawEllipse +function RL.DrawEllipse( center, radiusH, radiusV, color ) end + +---Draw ellipse outline +---@param center table +---@param radiusH number +---@param radiusV number +---@param color table +---@return any RL.DrawEllipseLines +function RL.DrawEllipseLines( center, radiusH, radiusV, color ) end + +---Draw ring +---@param center table +---@param innerRadius number +---@param outerRadius number +---@param startAngle number +---@param endAngle number +---@param segments integer +---@param color table +---@return any RL.DrawRing +function RL.DrawRing( center, innerRadius, outerRadius, startAngle, endAngle, segments, color ) end + +---Draw ring outline +---@param center table +---@param innerRadius number +---@param outerRadius number +---@param startAngle number +---@param endAngle number +---@param segments integer +---@param color table +---@return any RL.DrawRingLines +function RL.DrawRingLines( center, innerRadius, outerRadius, startAngle, endAngle, segments, color ) end + +---Draw a color-filled rectangle +---@param rec table +---@param color table +---@return any RL.DrawRectangle +function RL.DrawRectangle( rec, color ) end + +---Draw a color-filled rectangle with pro parameters +---@param rec table +---@param origin table +---@param rotation number +---@param color table +---@return any RL.DrawRectanglePro +function RL.DrawRectanglePro( rec, origin, rotation, color ) end + +---Draw a vertical-gradient-filled rectangle +---@param rectangle table +---@param color1 table +---@param color2 table +---@return any RL.DrawRectangleGradientV +function RL.DrawRectangleGradientV( rectangle, color1, color2 ) end + +---Draw a horizontal-gradient-filled rectangle +---@param rectangle table +---@param color1 table +---@param color2 table +---@return any RL.DrawRectangleGradientH +function RL.DrawRectangleGradientH( rectangle, color1, color2 ) end + +---Draw a gradient-filled rectangle with custom vertex colors +---@param rectangle table +---@param col1 table +---@param col2 table +---@param col3 table +---@param col4 table +---@return any RL.DrawRectangleGradientEx +function RL.DrawRectangleGradientEx( rectangle, col1, col2, col3, col4 ) end + +---Draw rectangle outline +---@param rec table +---@param color table +---@return any RL.DrawRectangleLines +function RL.DrawRectangleLines( rec, color ) end + +---Draw rectangle outline with extended parameters +---@param rec table +---@param lineThick integer +---@param color table +---@return any RL.DrawRectangleLinesEx +function RL.DrawRectangleLinesEx( rec, lineThick, color ) end + +---Draw rectangle with rounded edges +---@param rec table +---@param roundness number +---@param segments integer +---@param color table +---@return any RL.DrawRectangleRounded +function RL.DrawRectangleRounded( rec, roundness, segments, color ) end + +---Draw rectangle lines with rounded edges +---@param rec table +---@param roundness number +---@param segments integer +---@param color table +---@return any RL.DrawRectangleRoundedLines +function RL.DrawRectangleRoundedLines( rec, roundness, segments, color ) end + +---Draw rectangle with rounded edges outline +---@param rec table +---@param roundness number +---@param segments integer +---@param lineThick number +---@param color table +---@return any RL.DrawRectangleRoundedLinesEx +function RL.DrawRectangleRoundedLinesEx( rec, roundness, segments, lineThick, color ) end + +---Draw a color-filled triangle (Vertex in counter-clockwise order!) +---@param v1 table +---@param v2 table +---@param v3 table +---@param color table +---@return any RL.DrawTriangle +function RL.DrawTriangle( v1, v2, v3, color ) end + +---Draw triangle outline (Vertex in counter-clockwise order!) +---@param v1 table +---@param v2 table +---@param v3 table +---@param color table +---@return any RL.DrawTriangleLines +function RL.DrawTriangleLines( v1, v2, v3, color ) end + +---Draw a triangle fan defined by points (first vertex is the center) +---@param points table +---@param color table +---@return any RL.DrawTriangleFan +function RL.DrawTriangleFan( points, color ) end + +---Draw a triangle strip defined by points +---@param points table +---@param color table +---@return any RL.DrawTriangleStrip +function RL.DrawTriangleStrip( points, color ) end + +---Draw a regular polygon (Vector version) +---@param center table +---@param sides integer +---@param radius number +---@param rotation number +---@param color table +---@return any RL.DrawPoly +function RL.DrawPoly( center, sides, radius, rotation, color ) end + +---Draw a polygon outline of n sides +---@param center table +---@param sides integer +---@param radius number +---@param rotation number +---@param color table +---@return any RL.DrawPolyLines +function RL.DrawPolyLines( center, sides, radius, rotation, color ) end + +---Draw a polygon outline of n sides with extended parameters +---@param center table +---@param sides integer +---@param radius number +---@param rotation number +---@param lineThick number +---@param color table +---@return any RL.DrawPolyLinesEx +function RL.DrawPolyLinesEx( center, sides, radius, rotation, lineThick, color ) end + +-- Shapes - Splines drawing functions + +---Draw spline: Linear, minimum 2 points +---@param points table +---@param thick number +---@param color table +---@return any RL.DrawSplineLinear +function RL.DrawSplineLinear( points, thick, color ) end + +---Draw spline: B-Spline, minimum 4 points +---@param points table +---@param thick number +---@param color table +---@return any RL.DrawSplineBasis +function RL.DrawSplineBasis( points, thick, color ) end + +---Draw spline: Catmull-Rom, minimum 4 points +---@param points table +---@param thick number +---@param color table +---@return any RL.DrawSplineCatmullRom +function RL.DrawSplineCatmullRom( points, thick, color ) end + +---Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] +---@param points table +---@param thick number +---@param color table +---@return any RL.DrawSplineBezierQuadratic +function RL.DrawSplineBezierQuadratic( points, thick, color ) end + +---Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] +---@param points table +---@param thick number +---@param color table +---@return any RL.DrawSplineBezierCubic +function RL.DrawSplineBezierCubic( points, thick, color ) end + +---Draw spline segment: Linear, 2 points +---@param p1 table +---@param p2 table +---@param thick number +---@param color table +---@return any RL.DrawSplineSegmentLinear +function RL.DrawSplineSegmentLinear( p1, p2, thick, color ) end + +---Draw spline segment: B-Spline, 4 points +---@param p1 table +---@param p2 table +---@param p3 table +---@param p4 table +---@param thick number +---@param color table +---@return any RL.DrawSplineSegmentBasis +function RL.DrawSplineSegmentBasis( p1, p2, p3, p4, thick, color ) end + +---Draw spline segment: Catmull-Rom, 4 points +---@param p1 table +---@param p2 table +---@param p3 table +---@param p4 table +---@param thick number +---@param color table +---@return any RL.DrawSplineSegmentCatmullRom +function RL.DrawSplineSegmentCatmullRom( p1, p2, p3, p4, thick, color ) end + +---Draw spline segment: Quadratic Bezier, 2 points, 1 control point +---@param p1 table +---@param c2 table +---@param p3 table +---@param thick number +---@param color table +---@return any RL.DrawSplineSegmentBezierQuadratic +function RL.DrawSplineSegmentBezierQuadratic( p1, c2, p3, thick, color ) end + +---Draw spline segment: Cubic Bezier, 2 points, 2 control points +---@param p1 table +---@param c2 table +---@param c3 table +---@param p4 table +---@param thick number +---@param color table +---@return any RL.DrawSplineSegmentBezierCubic +function RL.DrawSplineSegmentBezierCubic( p1, c2, c3, p4, thick, color ) end + +-- Shapes - Spline segment point evaluation functions, for a given t [0.0f .. 1.0f] + +---Get (evaluate) spline point: Linear +---- Success return Vector2 +---@param startPos table +---@param endPos table +---@param t number +---@return any point +function RL.GetSplinePointLinear( startPos, endPos, t ) end + +---Get (evaluate) spline point: B-Spline +---- Success return Vector2 +---@param p1 table +---@param p2 table +---@param p3 table +---@param p4 table +---@param t number +---@return any point +function RL.GetSplinePointBasis( p1, p2, p3, p4, t ) end + +---Get (evaluate) spline point: Catmull-Rom +---- Success return Vector2 +---@param p1 table +---@param p2 table +---@param p3 table +---@param p4 table +---@param t number +---@return any point +function RL.GetSplinePointCatmullRom( p1, p2, p3, p4, t ) end + +---Get (evaluate) spline point: Quadratic Bezier +---- Success return Vector2 +---@param p1 table +---@param c2 table +---@param p3 table +---@param t number +---@return any point +function RL.GetSplinePointBezierQuad( p1, c2, p3, t ) end + +---Get (evaluate) spline point: Cubic Bezier +---- Success return Vector2 +---@param p1 table +---@param c2 table +---@param c3 table +---@param p4 table +---@param t number +---@return any point +function RL.GetSplinePointBezierCubic( p1, c2, c3, p4, t ) end + +-- Shapes - Basic shapes collision detection functions + +---Check collision between two rectangles +---- Success return bool +---@param rec1 table +---@param rec2 table +---@return any collision +function RL.CheckCollisionRecs( rec1, rec2 ) end + +---Check collision between two circles +---- Success return bool +---@param center1 table +---@param radius1 number +---@param center2 table +---@param radius2 number +---@return any collision +function RL.CheckCollisionCircles( center1, radius1, center2, radius2 ) end + +---Check collision between circle and rectangle +---- Success return bool +---@param center table +---@param radius number +---@param rec table +---@return any collision +function RL.CheckCollisionCircleRec( center, radius, rec ) end + +---Check if circle collides with a line created betweeen two points [p1] and [p2] +---- Success return bool +---@param center table +---@param radius number +---@param p1 table +---@param p2 table +---@return any collision +function RL.CheckCollisionCircleLine( center, radius, p1, p2 ) end + +---Check if point is inside rectangle +---- Success return bool +---@param point table +---@param rec table +---@return any collision +function RL.CheckCollisionPointRec( point, rec ) end + +---Check if point is inside circle +---- Success return bool +---@param point table +---@param center table +---@param radius number +---@return any collision +function RL.CheckCollisionPointCircle( point, center, radius ) end + +---Check if point is inside a triangle +---- Success return bool +---@param point table +---@param p1 table +---@param p2 table +---@param p3 table +---@return any collision +function RL.CheckCollisionPointTriangle( point, p1, p2, p3 ) end + +---Check if point is within a polygon described by array of vertices +---- Success return bool +---@param point table +---@param points table +---@return any collision +function RL.CheckCollisionPointPoly( point, points ) end + +---Check the collision between two lines defined by two points each, returns collision point by reference +---- Success return bool, Vector2 +---@param startPos1 table +---@param endPos1 table +---@param startPos2 table +---@param endPos2 table +---@return any collision +---@return any position +function RL.CheckCollisionLines( startPos1, endPos1, startPos2, endPos2 ) end + +---Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +---- Success return bool +---@param point table +---@param p1 table +---@param p2 table +---@param threshold integer +---@return any collision +function RL.CheckCollisionPointLine( point, p1, p2, threshold ) end + +---Get collision rectangle for two rectangles collision +---- Success return Rectangle +---@param rec1 table +---@param rec2 table +---@return any rectangle +function RL.GetCollisionRec( rec1, rec2 ) end + +---Useful for e.g. packing rectangular textures into an atlas. stbrp_pack_rects +---- Success return Rectangle{} +---@param rects table +---@param size table +---@param padding integer +---@return any rects{} +function RL.RectPack( rects, size, padding ) end + +-- Textures - Image loading functions + +---Load image from file into CPU memory (RAM) +---- Failure return nil +---- Success return Image +---@param fileName string +---@return any image +function RL.LoadImage( fileName ) end + +---Load image from RAW file data +---- Failure return nil +---- Success return Image +---@param fileName string +---@param size table +---@param format integer +---@param headerSize integer +---@return any image +function RL.LoadImageRaw( fileName, size, format, headerSize ) end + +---Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format +---- Failure return nil +---- Success return Image, int +---@param fileName string +---@return any image +---@return any frameCount +function RL.LoadImageAnim( fileName ) end + +---Load image sequence from memory buffer. All frames are returned in RGBA format +---- Success return Image, int +---@param fileType string +---@param fileData any +---@return any image +---@return any frameCount +function RL.LoadImageAnimFromMemory( fileType, fileData ) end + +---Load image from memory buffer, fileType refers to extension: i.e. '.png' +---- Success return Image +---@param fileType string +---@param data any +---@return any image +---@return any frameCount +function RL.LoadImageFromMemory( fileType, data ) end + +---Load image from data +---- Success return Image +---@param data any +---@param size table +---@param mipmaps integer +---@param format integer +---@return any image +---@return any frameCount +function RL.LoadImageFromData( data, size, mipmaps, format ) end + +---Load image from GPU texture data +---- Success return Image +---@param texture any +---@return any image +function RL.LoadImageFromTexture( texture ) end + +---Load image from screen buffer and (screenshot) +---- Success return Image +---@return any image +function RL.LoadImageFromScreen() end + +---Check if an image is valid (data and parameters) +---- Success return bool +---@param image any +---@return any isValid +function RL.IsImageValid( image ) end + +---Unload image from CPU memory (RAM) +---@param image any +---@return any RL.UnloadImage +function RL.UnloadImage( image ) end + +---Export image data to file, returns true on success +---- Success return bool +---@param image any +---@param fileName string +---@return any success +function RL.ExportImage( image, fileName ) end + +---Export image to memory buffer +---- Success return Buffer +---@param image any +---@param fileType string +---@return any buffer +function RL.ExportImageToMemory( image, fileType ) end + +---Export image as code file defining an array of bytes, returns true on success +---- Success return bool +---@param image any +---@param fileName string +---@return any success +function RL.ExportImageAsCode( image, fileName ) end + +-- Textures - Image generation functions + +---Generate image: plain color +---- Success return Image +---@param size table +---@param color table +---@return any image +function RL.GenImageColor( size, color ) end + +---Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient +---- Success return Image +---@param size table +---@param direction integer +---@param a table +---@param b table +---@return any image +function RL.GenImageGradientLinear( size, direction, a, b ) end + +---Generate image: radial gradient +---- Success return Image +---@param size table +---@param density number +---@param inner table +---@param outer table +---@return any image +function RL.GenImageGradientRadial( size, density, inner, outer ) end + +---Generate image: square gradient +---- Success return Image +---@param size table +---@param density number +---@param inner table +---@param outer table +---@return any image +function RL.GenImageGradientSquare( size, density, inner, outer ) end + +---Generate image: checked +---- Success return Image +---@param size table +---@param checks table +---@param col1 table +---@param col2 table +---@return any image +function RL.GenImageChecked( size, checks, col1, col2 ) end + +---Generate image: white noise +---- Success return Image +---@param size table +---@param factor number +---@return any image +function RL.GenImageWhiteNoise( size, factor ) end + +---Generate image: perlin noise +---- Success return Image +---@param size table +---@param offset table +---@param factor number +---@return any image +function RL.GenImagePerlinNoise( size, offset, factor ) end + +---Generate image: cellular algorithm. Bigger tileSize means bigger cells +---- Success return Image +---@param size table +---@param tileSize integer +---@return any image +function RL.GenImageCellular( size, tileSize ) end + +---Generate image: grayscale image from text data +---- Success return Image +---@param size table +---@param text string +---@return any image +function RL.GenImageText( size, text ) end + +-- Textures - Image manipulation functions + +---Create an image duplicate (useful for transformations) +---- Success return Image +---@param image any +---@return any image +function RL.ImageCopy( image ) end + +---Create an image from another image piece +---- Success return Image +---@param image any +---@param rec table +---@return any image +function RL.ImageFromImage( image, rec ) end + +---Create an image from a selected channel of another image (GRAYSCALE) +---- Success return Image +---@param image any +---@param selectedChannel integer +---@return any image +function RL.ImageFromChannel( image, selectedChannel ) end + +---Create an image from text (default font) +---- Success return Image +---@param text string +---@param fontSize integer +---@param tint table +---@return any image +function RL.ImageText( text, fontSize, tint ) end + +---Create an image from text (custom sprite font) +---- Success return Image +---@param font any +---@param text string +---@param fontSize number +---@param spacing number +---@param tint table +---@return any image +function RL.ImageTextEx( font, text, fontSize, spacing, tint ) end + +---Convert image data to desired format +---@param image any +---@param newFormat integer +---@return any RL.ImageFormat +function RL.ImageFormat( image, newFormat ) end + +---Convert image to POT (power-of-two) +---@param image any +---@param fill table +---@return any RL.ImageToPOT +function RL.ImageToPOT( image, fill ) end + +---Crop an image to a defined rectangle +---@param image any +---@param crop table +---@return any RL.ImageCrop +function RL.ImageCrop( image, crop ) end + +---Crop image depending on alpha value +---@param image any +---@param threshold number +---@return any RL.ImageAlphaCrop +function RL.ImageAlphaCrop( image, threshold ) end + +---Clear alpha channel to desired color +---@param image any +---@param color table +---@param threshold number +---@return any RL.ImageAlphaClear +function RL.ImageAlphaClear( image, color, threshold ) end + +---Apply alpha mask to image +---@param image any +---@param alphaMask any +---@return any RL.ImageAlphaMask +function RL.ImageAlphaMask( image, alphaMask ) end + +---Premultiply alpha channel +---@param image any +---@return any RL.ImageAlphaPremultiply +function RL.ImageAlphaPremultiply( image ) end + +---Apply Gaussian blur using a box blur approximation +---@param image any +---@param blurSize integer +---@return any RL.ImageBlurGaussian +function RL.ImageBlurGaussian( image, blurSize ) end + +---Apply custom square convolution kernel to image +---@param image any +---@param kernel table +---@return any RL.ImageKernelConvolution +function RL.ImageKernelConvolution( image, kernel ) end + +---Resize image (Bicubic scaling algorithm) +---@param image any +---@param size table +---@return any RL.ImageResize +function RL.ImageResize( image, size ) end + +---Resize image (Nearest-Neighbor scaling algorithm) +---@param image any +---@param size table +---@return any RL.ImageResizeNN +function RL.ImageResizeNN( image, size ) end + +---Resize canvas and fill with color +---@param image any +---@param size table +---@param offset table +---@param fill table +---@return any RL.ImageResizeCanvas +function RL.ImageResizeCanvas( image, size, offset, fill ) end + +---Generate all mipmap levels for a provided image +---@param image any +---@return any RL.ImageMipmaps +function RL.ImageMipmaps( image ) end + +---Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +---@param image any +---@param bpp table +---@return any RL.ImageDither +function RL.ImageDither( image, bpp ) end + +---Flip image vertically +---@param image any +---@return any RL.ImageFlipVertical +function RL.ImageFlipVertical( image ) end + +---Flip image horizontally +---@param image any +---@return any RL.ImageFlipHorizontal +function RL.ImageFlipHorizontal( image ) end + +---Rotate image by input angle in degrees (-359 to 359) +---@param image any +---@param degrees integer +---@return any RL.ImageRotate +function RL.ImageRotate( image, degrees ) end + +---Rotate image clockwise 90deg +---@param image any +---@return any RL.ImageRotateCW +function RL.ImageRotateCW( image ) end + +---Rotate image counter-clockwise 90deg +---@param image any +---@return any RL.ImageRotateCCW +function RL.ImageRotateCCW( image ) end + +---Modify image color: tint +---@param image any +---@param color table +---@return any RL.ImageColorTint +function RL.ImageColorTint( image, color ) end + +---Modify image color: invert +---@param image any +---@return any RL.ImageColorInvert +function RL.ImageColorInvert( image ) end + +---Modify image color: grayscale +---@param image any +---@return any RL.ImageColorGrayscale +function RL.ImageColorGrayscale( image ) end + +---Modify image color: contrast (-100 to 100) +---@param image any +---@param contrast number +---@return any RL.ImageColorContrast +function RL.ImageColorContrast( image, contrast ) end + +---Modify image color: brightness (-255 to 255) +---@param image any +---@param brightness integer +---@return any RL.ImageColorBrightness +function RL.ImageColorBrightness( image, brightness ) end + +---Modify image color: replace color +---@param image any +---@param color table +---@param replace table +---@return any RL.ImageColorReplace +function RL.ImageColorReplace( image, color, replace ) end + +---Load color data from image as a Color array (RGBA - 32bit) +---- Success return Color{} +---@param image any +---@return any colors +function RL.LoadImageColors( image ) end + +---Load colors palette from image as a Color array (RGBA - 32bit) +---- Success return Color{} +---@param image any +---@param maxPaletteSize integer +---@return any colors +function RL.LoadImagePalette( image, maxPaletteSize ) end + +---Get image alpha border rectangle +---- Success return Rectangle +---@param image any +---@param threshold number +---@return any rectangle +function RL.GetImageAlphaBorder( image, threshold ) end + +---Get image pixel color at (x, y) position +---- Success return Color +---@param image any +---@param pixelPos table +---@return any color +function RL.GetImageColor( image, pixelPos ) end + +-- Textures - Image configuration functions + +---Set image data from Buffer +---@param image any +---@param data any +---@return any RL.SetImageData +function RL.SetImageData( image, data ) end + +---Get image data as Buffer +---- Success return Buffer +---@param image any +---@return any imageData +function RL.GetImageData( image ) end + +---Get image size +---- Success return Vector2 +---@param image any +---@return any size +function RL.GetImageSize( image ) end + +---Get image mipmaps. Mipmap levels, 1 by default +---- Success return int +---@param image any +---@return any mipmaps +function RL.GetImageMipmaps( image ) end + +---Get image data format (PixelFormat type) +---- Success return int +---@param image any +---@return any format +function RL.GetImageFormat( image ) end + +-- Textures - Image drawing functions + +---Clear image background with given color +---@param dst any +---@param color table +---@return any RL.ImageClearBackground +function RL.ImageClearBackground( dst, color ) end + +---Draw pixel within an image +---@param dst any +---@param position table +---@param color table +---@return any RL.ImageDrawPixel +function RL.ImageDrawPixel( dst, position, color ) end + +---Draw line within an image +---@param dst any +---@param start table +---@param end table +---@param color table +---@return any RL.ImageDrawLine +function RL.ImageDrawLine( dst, start, end, color ) end + +---Draw a line defining thickness within an image +---@param dst any +---@param start table +---@param end table +---@param thick integer +---@param color table +---@return any RL.ImageDrawLineEx +function RL.ImageDrawLineEx( dst, start, end, thick, color ) end + +---Draw circle within an image +---@param dst any +---@param center table +---@param radius integer +---@param color table +---@return any RL.ImageDrawCircle +function RL.ImageDrawCircle( dst, center, radius, color ) end + +---Draw circle outline within an image +---@param dst any +---@param center table +---@param radius integer +---@param color table +---@return any RL.ImageDrawCircleLines +function RL.ImageDrawCircleLines( dst, center, radius, color ) end + +---Draw rectangle within an image +---@param dst any +---@param rec table +---@param color table +---@return any RL.ImageDrawRectangle +function RL.ImageDrawRectangle( dst, rec, color ) end + +---Draw rectangle lines within an image +---@param dst any +---@param rec table +---@param thick integer +---@param color table +---@return any RL.ImageDrawRectangleLines +function RL.ImageDrawRectangleLines( dst, rec, thick, color ) end + +---Draw triangle within an image +---@param dst any +---@param v1 table +---@param v2 table +---@param v3 table +---@param color table +---@return any RL.ImageDrawTriangle +function RL.ImageDrawTriangle( dst, v1, v2, v3, color ) end + +---Draw triangle with interpolated colors within an image +---@param dst any +---@param v1 table +---@param v2 table +---@param v3 table +---@param c1 table +---@param c2 table +---@param c3 table +---@return any RL.ImageDrawTriangleEx +function RL.ImageDrawTriangleEx( dst, v1, v2, v3, c1, c2, c3 ) end + +---Draw triangle outline within an image +---@param dst any +---@param v1 table +---@param v2 table +---@param v3 table +---@param color table +---@return any RL.ImageDrawTriangleLines +function RL.ImageDrawTriangleLines( dst, v1, v2, v3, color ) end + +---Draw a triangle fan defined by points within an image (first vertex is the center) +---@param dst any +---@param points table +---@param color table +---@return any RL.ImageDrawTriangleFan +function RL.ImageDrawTriangleFan( dst, points, color ) end + +---Draw a triangle strip defined by points within an image +---@param dst any +---@param points table +---@param color table +---@return any RL.ImageDrawTriangleStrip +function RL.ImageDrawTriangleStrip( dst, points, color ) end + +---Draw a source image within a destination image (Tint applied to source) +---@param dst any +---@param src any +---@param srcRec table +---@param dstRec table +---@param tint table +---@return any RL.ImageDraw +function RL.ImageDraw( dst, src, srcRec, dstRec, tint ) end + +---Draw text (using default font) within an image (destination) +---@param dst any +---@param text string +---@param position table +---@param fontSize number +---@param tint table +---@return any RL.ImageDrawText +function RL.ImageDrawText( dst, text, position, fontSize, tint ) end + +---Draw text (Custom sprite font) within an image (Destination) +---@param dst any +---@param font any +---@param text string +---@param position table +---@param fontSize number +---@param spacing number +---@param tint table +---@return any RL.ImageDrawTextEx +function RL.ImageDrawTextEx( dst, font, text, position, fontSize, spacing, tint ) end + +-- Textures - Texture loading functions + +---Get default texture. Return as lightuserdata +---- Success return Texture +---@return any texture +function RL.GetTextureDefault() end + +---Load texture from file into GPU memory ( VRAM ) +---- Failure return nil +---- Success return Texture +---@param fileName string +---@return any texture +function RL.LoadTexture( fileName ) end + +---Load texture from image data +---- Success return Texture +---@param image any +---@return any texture +function RL.LoadTextureFromImage( image ) end + +---Load cubemap from image, multiple image cubemap layouts supported +---- Success return Texture +---@param image any +---@param layout integer +---@return any texture +function RL.LoadTextureCubemap( image, layout ) end + +---Load Texture from data +---- Success return Texture +---@param textureData table +---@return any texture +function RL.LoadTextureFromData( textureData ) end + +---Load texture for rendering (framebuffer) +---- Success return RenderTexture +---@param size table +---@return any renderTexture +function RL.LoadRenderTexture( size ) end + +---Load RenderTexture from data (framebuffer) +---- Success return RenderTexture +---@param renderTextureData table +---@return any renderTexture +function RL.LoadRenderTextureFromData( renderTextureData ) end + +---Check if a texture is valid (loaded in GPU) +---- Success return bool +---@param texture any +---@return any isValid +function RL.IsTextureValid( texture ) end + +---Unload texture from GPU memory (VRAM) +---@param texture any +---@return any RL.UnloadTexture +function RL.UnloadTexture( texture ) end + +---Check if a render texture is valid (loaded in GPU) +---- Success return bool +---@param target any +---@return any isValid +function RL.IsRenderTextureValid( target ) end + +---Unload render texture from GPU memory (VRAM) +---@param target any +---@return any RL.UnloadRenderTexture +function RL.UnloadRenderTexture( target ) end + +---Update GPU texture with new data +---@param texture any +---@param pixels any +---@return any RL.UpdateTexture +function RL.UpdateTexture( texture, pixels ) end + +---Update GPU texture rectangle with new data. +---@param texture any +---@param rec table +---@param pixels any +---@return any RL.UpdateTextureRec +function RL.UpdateTextureRec( texture, rec, pixels ) end + +-- Textures - Texture configuration functions + +---Generate GPU mipmaps for a texture +---@param texture any +---@return any RL.GenTextureMipmaps +function RL.GenTextureMipmaps( texture ) end + +---Set texture scaling filter mode (TEXTURE_FILTER_POINT, TEXTURE_FILTER_BILINEAR...) +---@param texture any +---@param filter integer +---@return any RL.SetTextureFilter +function RL.SetTextureFilter( texture, filter ) end + +---Set texture wrapping mode (TEXTURE_WRAP_REPEAT, TEXTURE_WRAP_CLAMP...) +---@param texture any +---@param wrap integer +---@return any RL.SetTextureWrap +function RL.SetTextureWrap( texture, wrap ) end + +---Get OpenGL texture id +---- Success return int +---@param texture any +---@return any id +function RL.GetTextureId( texture ) end + +---Get texture size +---- Success return Vector2 +---@param texture any +---@return any size +function RL.GetTextureSize( texture ) end + +---Get texture mipmaps. Mipmap levels, 1 by default +---- Success return int +---@param texture any +---@return any mipmaps +function RL.GetTextureMipmaps( texture ) end + +---Get texture data format (PixelFormat type) +---- Success return int +---@param texture any +---@return any format +function RL.GetTextureFormat( texture ) end + +-- Textures - Texture drawing functions + +---Draw a Texture2D +---@param texture any +---@param position table +---@param tint table +---@return any RL.DrawTexture +function RL.DrawTexture( texture, position, tint ) end + +---Draw a Texture2D with extended parameters +---@param texture any +---@param position table +---@param rotation number +---@param scale number +---@param tint table +---@return any RL.DrawTextureEx +function RL.DrawTextureEx( texture, position, rotation, scale, tint ) end + +---Draw a part of a texture defined by a rectangle +---@param texture any +---@param source table +---@param position table +---@param tint table +---@return any RL.DrawTextureRec +function RL.DrawTextureRec( texture, source, position, tint ) end + +---Draw a part of a texture defined by a rectangle with "pro" parameters +---@param texture any +---@param source table +---@param dest table +---@param origin table +---@param rotation number +---@param tint table +---@return any RL.DrawTexturePro +function RL.DrawTexturePro( texture, source, dest, origin, rotation, tint ) end + +---Draws a texture (or part of it) that stretches or shrinks nicely +---@param texture any +---@param nPatchInfo any +---@param dest table +---@param origin table +---@param rotation number +---@param tint table +---@return any RL.DrawTextureNPatch +function RL.DrawTextureNPatch( texture, nPatchInfo, dest, origin, rotation, tint ) end + +---Draws a texture (or part of it) that repeats nicely +---@param texture any +---@param nPatchInfo any +---@param dest table +---@param origin table +---@param rotation number +---@param tint table +---@return any RL.DrawTextureNPatchRepeat +function RL.DrawTextureNPatchRepeat( texture, nPatchInfo, dest, origin, rotation, tint ) end + +-- Textures - RenderTexture configuration functions + +---Get OpenGL framebuffer object id +---- Success return int +---@param renderTexture any +---@return any id +function RL.GetRenderTextureId( renderTexture ) end + +---Get color buffer attachment texture. Returns as lightuserdata +---- Success return Texture +---@param renderTexture any +---@return any texture +function RL.GetRenderTextureTexture( renderTexture ) end + +---Get depth buffer attachment texture. Returns as lightuserdata +---- Success return Texture +---@param renderTexture any +---@return any texture +function RL.GetRenderTextureDepthTexture( renderTexture ) end + +-- Textures - Color/pixel related functions + +---Check if two colors are equal +---- Success return bool +---@param col1 table +---@param col2 table +---@return any isEqual +function RL.ColorIsEqual( col1, col2 ) end + +---Returns color with alpha applied, alpha goes from 0.0f to 1.0f +---- Success return Color +---@param color table +---@param alpha number +---@return any color +function RL.Fade( color, alpha ) end + +---Returns hexadecimal value for a Color +---- Success return int +---@param color table +---@return any value +function RL.ColorToInt( color ) end + +---Returns Color normalized as float [0..1] +---- Success return Vector4 +---@param color table +---@return any color +function RL.ColorNormalize( color ) end + +---Color from normalized values [0..1] +---- Success return Color +---@param normalized table +---@return any color +function RL.ColorFromNormalized( normalized ) end + +---Returns HSV values for a Color, hue [0..360], saturation/value [0..1] +---- Success return Vector3 +---@param color table +---@return any HSV +function RL.ColorToHSV( color ) end + +---Returns a Color from HSV values, hue [0..360], saturation/value [0..1] +---- Success return Color +---@param hue number +---@param saturation number +---@param value number +---@return any color +function RL.ColorFromHSV( hue, saturation, value ) end + +---Get color multiplied with another color +---- Success return Color +---@param color table +---@param tint table +---@return any color +function RL.ColorTint( color, tint ) end + +---Get color with brightness correction, brightness factor goes from -1.0f to 1.0f +---- Success return Color +---@param color table +---@param factor number +---@return any color +function RL.ColorBrightness( color, factor ) end + +---Get color with contrast correction, contrast values between -1.0f and 1.0f +---- Success return Color +---@param color table +---@param contrast number +---@return any color +function RL.ColorContrast( color, contrast ) end + +---Returns color with alpha applied, alpha goes from 0.0f to 1.0f +---- Success return Color +---@param color table +---@param alpha number +---@return any color +function RL.ColorAlpha( color, alpha ) end + +---Returns src alpha-blended into dst color with tint +---- Success return Color +---@param dst table +---@param src table +---@param tint table +---@return any color +function RL.ColorAlphaBlend( dst, src, tint ) end + +---Get color lerp interpolation between two colors, factor [0.0f..1.0f] +---- Success return Color +---@param color1 table +---@param color2 table +---@param factor number +---@return any color +function RL.ColorLerp( color1, color2, factor ) end + +---Get Color structure from hexadecimal value +---- Success return Color +---@param hexValue integer +---@return any color +function RL.GetColor( hexValue ) end + +---Get pixel data size in bytes for certain format +---- Success return int +---@param size table +---@param format integer +---@return any size +function RL.GetPixelDataSize( size, format ) end + +-- Text - Font loading/unloading functions + +---Get the default Font. Return as lightuserdata +---- Success return Font +---@return any font +function RL.GetFontDefault() end + +---Load font from file into GPU memory (VRAM) +---- Failure return nil +---- Success return Font +---@param fileName string +---@return any font +function RL.LoadFont( fileName ) end + +---Load font from file with extended parameters, use NULL for codepoints to load the default character set +---- Failure return nil +---- Success return Font +---@param fileName string +---@param fontSize integer +---@param codepoints table|nil +---@return any font +function RL.LoadFontEx( fileName, fontSize, codepoints ) end + +---Load font from Image (XNA style) +---- Success return Font +---@param image any +---@param key table +---@param firstChar integer +---@return any font +function RL.LoadFontFromImage( image, key, firstChar ) end + +---Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. NOTE: fileData type should be unsigned char +---- Success return Font +---@param fileType string +---@param fileData any +---@param fontSize integer +---@param codepoints table +---@return any font +function RL.LoadFontFromMemory( fileType, fileData, fontSize, codepoints ) end + +---Load Font from data +---- Success return Font +---@param fontData table +---@return any font +function RL.LoadFontFromData( fontData ) end + +---Load font copy as new userdata +---- Success return Font +---@param font any +---@return any font +function RL.FontCopy( font ) end + +---Check if a font is valid (font data loaded, WARNING: GPU texture not checked) +---- Success return bool +---@param font any +---@return any isValid +function RL.IsFontValid( font ) end + +---Load font data for further use. NOTE: fileData type should be unsigned char +---- Success return GlyphInfo{} +---@param fileData any +---@param fontSize integer +---@param codepoints table +---@param type integer +---@return any glyphs +function RL.LoadFontData( fileData, fontSize, codepoints, type ) end + +---Generate image font atlas using chars info. NOTE: Packing method: 0-Default, 1-Skyline +---- Success Image, Rectangle{} +---@param glyphs table +---@param fontSize integer +---@param padding integer +---@param packMethod integer +---@return any image +---@return any rectangles +function RL.GenImageFontAtlas( glyphs, fontSize, padding, packMethod ) end + +---Unload font from GPU memory (VRAM) +---@param font any +---@return any RL.UnloadFont +function RL.UnloadFont( font ) end + +---Export font as code file, returns true on success +---- Success return bool +---@param font any +---@param fileName string +---@return any RL.ExportFontAsCode +function RL.ExportFontAsCode( font, fileName ) end + +-- Text - Text drawing functions + +---Draw current FPS +---@param pos table +---@return any RL.DrawFPS +function RL.DrawFPS( pos ) end + +---Draw text (using default font) +---@param text string +---@param position table +---@param fontSize number +---@param tint table +---@return any RL.DrawText +function RL.DrawText( text, position, fontSize, tint ) end + +---Draw text using font and additional parameters +---@param font any +---@param text string +---@param position table +---@param fontSize number +---@param spacing number +---@param tint table +---@return any RL.DrawTextEx +function RL.DrawTextEx( font, text, position, fontSize, spacing, tint ) end + +---Draw text using Font and pro parameters (rotation) +---@param font any +---@param text string +---@param position table +---@param origin table +---@param rotation number +---@param fontSize number +---@param spacing number +---@param tint table +---@return any RL.DrawTextPro +function RL.DrawTextPro( font, text, position, origin, rotation, fontSize, spacing, tint ) end + +---Draw one character (codepoint) +---@param font any +---@param codepoint integer +---@param position table +---@param fontSize number +---@param tint table +---@return any RL.DrawTextCodepoint +function RL.DrawTextCodepoint( font, codepoint, position, fontSize, tint ) end + +---Draw multiple character (codepoint) +---@param font any +---@param codepoints table +---@param position table +---@param fontSize number +---@param spacing number +---@param tint table +---@return any RL.DrawTextCodepoints +function RL.DrawTextCodepoints( font, codepoints, position, fontSize, spacing, tint ) end + +---Draw text inside rectangle limits. Return character id from mouse position (default 0). +---textOffset can be used to set start position inside rectangle. Usefull to pass from previous +---DrawTextBoxed for continuous text. +---Support for tint change with "\a#FFFFFFFF" +---- Success return int, Vector2 +---@param font any +---@param text string +---@param rec table +---@param fontSize number +---@param spacing number +---@param wordWrap boolean +---@param tint table +---@param limitHeight boolean +---@param textOffset table|nil +---@param tabSize integer|nil +---@return any mouseCharId +---@return any textOffset +function RL.DrawTextBoxed( font, text, rec, fontSize, spacing, wordWrap, tint, limitHeight, textOffset, tabSize ) end + +-- Text - Text font info functions + +---Set vertical line spacing when drawing with line-breaks +---@param spacing integer +---@return any RL.SetTextLineSpacing +function RL.SetTextLineSpacing( spacing ) end + +---Get vertical line spacing when drawing with line-breaks +---- Success return int +---@return any spacing +function RL.GetTextLineSpacing() end + +---Measure string width for default font +---- Success return int +---@param text string +---@param fontSize integer +---@return any width +function RL.MeasureText( text, fontSize ) end + +---Measure string size for Font +---- Success return Vector2 +---@param font any +---@param text string +---@param fontSize number +---@param spacing number +---@return any size +function RL.MeasureTextEx( font, text, fontSize, spacing ) end + +---Measure text inside rectangle limits. +---- Success return Vector2, Vector2 +---@param font any +---@param text string +---@param rec table +---@param fontSize number +---@param spacing number +---@param wordWrap boolean +---@param tint table +---@param limitHeight boolean +---@param textOffset table +---@param tabSize integer|nil +---@return any size +---@return any textOffset +function RL.MeasureTextBoxed( font, text, rec, fontSize, spacing, wordWrap, tint, limitHeight, textOffset, tabSize ) end + +---Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found +---- Success return int +---@param font any +---@param codepoint integer +---@return any index +function RL.GetGlyphIndex( font, codepoint ) end + +---Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found. Return as lightuserdata +---- Success return GlyphInfo +---@param font any +---@param codepoint integer +---@return any glyphInfo +function RL.GetGlyphInfo( font, codepoint ) end + +---Get glyph font info data by index. Return as lightuserdata +---- Failure return nil +---- Success return GlyphInfo +---@param font any +---@param index integer +---@return any glyphInfo +function RL.GetGlyphInfoByIndex( font, index ) end + +---Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found +---- Success return Rectangle +---@param font any +---@param codepoint integer +---@return any rect +function RL.GetGlyphAtlasRec( font, codepoint ) end + +---Get glyph rectangle in font atlas by index +---- Failure return nil +---- Success return Rectangle +---@param font any +---@param index integer +---@return any rect +function RL.GetGlyphAtlasRecByIndex( font, index ) end + +---Get font base size (default chars height) +---- Success return int +---@param font any +---@return any baseSize +function RL.GetFontBaseSize( font ) end + +---Get font number of glyph characters +---- Success return int +---@param font any +---@return any glyphCount +function RL.GetFontGlyphCount( font ) end + +---Get font padding around the glyph characters +---- Success return int +---@param font any +---@return any glyphPadding +function RL.GetFontGlyphPadding( font ) end + +---Get font texture atlas containing the glyphs. Return as lightuserdata +---- Success return Texture +---@param font any +---@return any texture +function RL.GetFontTexture( font ) end + +-- Text - GlyphInfo management functions + +---Load GlyphInfo from data +---- Success return GlyphInfo +---@param glyphInfoData table +---@return any glyphInfo +function RL.LoadGlyphInfo( glyphInfoData ) end + +---Unload glyphInfo image from CPU memory (RAM) +---@param glyphInfo any +---@return any RL.UnloadGlyphInfo +function RL.UnloadGlyphInfo( glyphInfo ) end + +---Set glyphInfo character value (Unicode) +---@param glyphInfo any +---@param value integer +---@return any RL.SetGlyphInfoValue +function RL.SetGlyphInfoValue( glyphInfo, value ) end + +---Set glyphInfo character offset when drawing +---@param glyphInfo any +---@param offset table +---@return any RL.SetGlyphInfoOffset +function RL.SetGlyphInfoOffset( glyphInfo, offset ) end + +---Set glyphInfo character advance position X +---@param glyphInfo any +---@param advanceX integer +---@return any RL.SetGlyphInfoAdvanceX +function RL.SetGlyphInfoAdvanceX( glyphInfo, advanceX ) end + +---Set glyphInfo character image data +---@param glyphInfo any +---@param image any +---@return any RL.SetGlyphInfoImage +function RL.SetGlyphInfoImage( glyphInfo, image ) end + +---Get glyphInfo character value (Unicode) +---- Success return int +---@param glyphInfo any +---@return any value +function RL.GetGlyphInfoValue( glyphInfo ) end + +---Get glyphInfo character offset when drawing +---- Success return Vector2 +---@param glyphInfo any +---@return any offset +function RL.GetGlyphInfoOffset( glyphInfo ) end + +---Get glyphInfo character advance position X +---- Success return int +---@param glyphInfo any +---@return any advanceX +function RL.GetGlyphInfoAdvanceX( glyphInfo ) end + +---Get glyphInfo character image data. Return as lightuserdata +---- Success return Image +---@param glyphInfo any +---@return any image +function RL.GetGlyphInfoImage( glyphInfo ) end + +-- Text - Text codepoints management functions (unicode characters) + +---Load UTF-8 text encoded from codepoints array +---- Success return string +---@param codepoints table +---@return any string +function RL.LoadUTF8( codepoints ) end + +---Load all codepoints from a UTF-8 text string +---- Success return int{} +---@param text string +---@return any codepoints +function RL.LoadCodepoints( text ) end + +---Get total number of codepoints in a UTF-8 encoded string +---- Success return int +---@param text string +---@return any count +function RL.GetCodepointCount( text ) end + +---Get codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +---- Success return int, int +---@param text string +---@param position integer +---@return any codepoint +---@return any codepointSize +function RL.GetCodepoint( text, position ) end + +---Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +---- Success return int, int +---@param text string +---@param position integer +---@return any codepoint +---@return any codepointSize +function RL.GetCodepointNext( text, position ) end + +---Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure +---- Success return int, int +---@param text string +---@param position integer +---@return any codepoint +---@return any codepointSize +function RL.GetCodepointPrevious( text, position ) end + +---Encode one codepoint into UTF-8 byte array +---- Success return string +---@param codepoint integer +---@return any string +function RL.CodepointToUTF8( codepoint ) end + +-- Text - Text strings management functions (no UTF-8 strings, only byte chars) + +---Get a piece of a text string +---- Success return string +---@param text string +---@param position integer +---@param length integer +---@return any text +function RL.TextSubtext( text, position, length ) end + +---Replace text string +---- Success return string +---@param text string +---@param replace string +---@param by string +---@return any text +function RL.TextReplace( text, replace, by ) end + +---Insert text in a specific position, moves all text forward +---- Success return string +---@param text string +---@param insert string +---@param position integer +---@return any text +function RL.TextInsert( text, insert, position ) end + +---Split text into multiple strings +---- Success return string{} +---@param text string +---@param delimiter any +---@return any splits +function RL.TextSplit( text, delimiter ) end + +---Find first text occurrence within a string +---- Success return int +---@param text string +---@param find string +---@return any index +function RL.TextFindIndex( text, find ) end + +---Get Pascal case notation version of provided string +---- Success return string +---@param text string +---@return any text +function RL.TextToPascal( text ) end + +---Get Snake case notation version of provided string +---- Success return string +---@param text string +---@return any text +function RL.TextToSnake( text ) end + +---Get Camel case notation version of provided string +---- Success return string +---@param text string +---@return any text +function RL.TextToCamel( text ) end + +-- Models - Basic geometric 3D shapes drawing functions + +---Draw a line in 3D world space +---@param startPos table +---@param endPos table +---@param color table +---@return any RL.DrawLine3D +function RL.DrawLine3D( startPos, endPos, color ) end + +---Draw a point in 3D space, actually a small line +---@param position table +---@param color table +---@return any RL.DrawPoint3D +function RL.DrawPoint3D( position, color ) end + +---Draw a circle in 3D world space +---@param center table +---@param radius number +---@param rotationAxis table +---@param rotationAngle number +---@param color table +---@return any RL.DrawCircle3D +function RL.DrawCircle3D( center, radius, rotationAxis, rotationAngle, color ) end + +---Draw a color-filled triangle (Vertex in counter-clockwise order!) +---@param v1 table +---@param v2 table +---@param v3 table +---@param color table +---@return any RL.DrawTriangle3D +function RL.DrawTriangle3D( v1, v2, v3, color ) end + +---Draw a triangle strip defined by points +---@param points table +---@param color table +---@return any RL.DrawTriangleStrip3D +function RL.DrawTriangleStrip3D( points, color ) end + +---Draw cube +---@param position table +---@param size table +---@param color table +---@return any RL.DrawCube +function RL.DrawCube( position, size, color ) end + +---Draw cube wires +---@param position table +---@param size table +---@param color table +---@return any RL.DrawCubeWires +function RL.DrawCubeWires( position, size, color ) end + +---Draw sphere +---@param centerPos table +---@param radius number +---@param color table +---@return any RL.DrawSphere +function RL.DrawSphere( centerPos, radius, color ) end + +---Draw sphere with extended parameters +---@param centerPos table +---@param radius number +---@param rings integer +---@param slices integer +---@param color table +---@return any RL.DrawSphereEx +function RL.DrawSphereEx( centerPos, radius, rings, slices, color ) end + +---Draw sphere wires +---@param centerPos table +---@param radius number +---@param rings integer +---@param slices integer +---@param color table +---@return any RL.DrawSphereWires +function RL.DrawSphereWires( centerPos, radius, rings, slices, color ) end + +---Draw a cylinder/cone +---@param position table +---@param radiusTop number +---@param radiusBottom number +---@param height number +---@param slices integer +---@param color table +---@return any RL.DrawCylinder +function RL.DrawCylinder( position, radiusTop, radiusBottom, height, slices, color ) end + +---Draw a cylinder with base at startPos and top at endPos +---@param startPos table +---@param endPos table +---@param startRadius number +---@param endRadius number +---@param sides integer +---@param color table +---@return any RL.DrawCylinderEx +function RL.DrawCylinderEx( startPos, endPos, startRadius, endRadius, sides, color ) end + +---Draw a cylinder/cone wires +---@param position table +---@param radiusTop number +---@param radiusBottom number +---@param height number +---@param slices integer +---@param color table +---@return any RL.DrawCylinderWires +function RL.DrawCylinderWires( position, radiusTop, radiusBottom, height, slices, color ) end + +---Draw a cylinder wires with base at startPos and top at endPos +---@param startPos table +---@param endPos table +---@param startRadius number +---@param endRadius number +---@param sides integer +---@param color table +---@return any RL.DrawCylinderWiresEx +function RL.DrawCylinderWiresEx( startPos, endPos, startRadius, endRadius, sides, color ) end + +---Draw a capsule with the center of its sphere caps at startPos and endPos +---@param startPos table +---@param endPos table +---@param radius number +---@param slices integer +---@param rings integer +---@param color table +---@return any RL.DrawCapsule +function RL.DrawCapsule( startPos, endPos, radius, slices, rings, color ) end + +---Draw capsule wireframe with the center of its sphere caps at startPos and endPos +---@param startPos table +---@param endPos table +---@param radius number +---@param slices integer +---@param rings integer +---@param color table +---@return any RL.DrawCapsuleWires +function RL.DrawCapsuleWires( startPos, endPos, radius, slices, rings, color ) end + +---Draw a plane XZ +---@param centerPos table +---@param size table +---@param color table +---@return any RL.DrawPlane +function RL.DrawPlane( centerPos, size, color ) end + +---Draw 3D textured quad. (Texture coordinates opengl style 0.0 - 1.0) +---@param texture any +---@param vertices table +---@param texCoords table +---@param colors table +---@return any RL.DrawQuad3DTexture +function RL.DrawQuad3DTexture( texture, vertices, texCoords, colors ) end + +---Draw a ray line +---@param ray any +---@param color table +---@return any RL.DrawRay +function RL.DrawRay( ray, color ) end + +---Draw a grid (Centered at ( 0, 0, 0 )) +---@param slices integer +---@param spacing number +---@return any RL.DrawGrid +function RL.DrawGrid( slices, spacing ) end + +---Draw a grid with extended parameters. Optionally you can define divider with different color for every n slices +---@param slices table +---@param spacing table +---@param transform table +---@param color table +---@param divider table|nil +---@param dividerColor table|nil +---@return any RL.DrawGridEx +function RL.DrawGridEx( slices, spacing, transform, color, divider, dividerColor ) end + +-- Models - Model management functions + +---Load model from files (Meshes and materials) +---- Failure return nil +---- Success return Model +---@param fileName string +---@return any model +function RL.LoadModel( fileName ) end + +---Load model from generated mesh (Default material) +---- Success return Model +---@param mesh any +---@return any model +function RL.LoadModelFromMesh( mesh ) end + +---Check if a model is valid (loaded in GPU, VAO/VBOs) +---- Success return bool +---@param model any +---@return any isValid +function RL.IsModelValid( model ) end + +---Unload model (meshes/materials) from memory (RAM and/or VRAM) +---@param model any +---@return any RL.UnloadModel +function RL.UnloadModel( model ) end + +---Compute model bounding box limits (considers all meshes) +---- Success return BoundingBox +---@param model any +---@return any boundingBox +function RL.GetModelBoundingBox( model ) end + +---Set model transform matrix +---@param model any +---@param transform table +---@return any RL.SetModelTransform +function RL.SetModelTransform( model, transform ) end + +---Set model mesh. +---- Failure return false +---- Success return true +---@param model any +---@param meshId integer +---@param mesh any +---@return any success +function RL.SetModelMesh( model, meshId, mesh ) end + +---Set material to model material +---- Failure return false +---- Success return true +---@param model any +---@param materialId integer +---@param material any +---@return any success +function RL.SetModelMaterial( model, materialId, material ) end + +---Set material for a mesh (Mesh and material on this model) +---@param model any +---@param meshId integer +---@param materialId integer +---@return any RL.SetModelMeshMaterial +function RL.SetModelMeshMaterial( model, meshId, materialId ) end + +---Set model bone information (skeleton) +---- Failure return false +---- Success return true +---@param model any +---@param boneId integer +---@param bone any +---@return any success +function RL.SetModelBone( model, boneId, bone ) end + +---Set model bones base transformation (pose) +---- Failure return false +---- Success return true +---@param model any +---@param boneId integer +---@param pose any +---@return any success +function RL.SetModelBindPose( model, boneId, pose ) end + +---Get model transform matrix +---- Success return Matrix +---@param model any +---@return any transform +function RL.GetModelTransform( model ) end + +---Get model number of meshes +---- Success return int +---@param model any +---@return any meshCount +function RL.GetModelMeshCount( model ) end + +---Get model number of materials +---- Success return int +---@param model any +---@return any meshCount +function RL.GetModelMaterialCount( model ) end + +---Get model mesh. Return as lightuserdata +---- Failure return nil +---- Success return Mesh +---@param model any +---@param meshId integer +---@return any mesh +function RL.GetModelMesh( model, meshId ) end + +---Get model material. Return as lightuserdata +---- Failure return nil +---- Success return Material +---@param model any +---@param materialId integer +---@return any material +function RL.GetModelMaterial( model, materialId ) end + +---Get model number of bones +---- Success return int +---@param model any +---@return any boneCount +function RL.GetModelBoneCount( model ) end + +---Get model bones information (skeleton) +---- Failure return nil +---- Success return BoneInfo +---@param model any +---@param boneId integer +---@return any bone +function RL.GetModelBone( model, boneId ) end + +---Get models bones base transformation (pose) +---- Failure return nil +---- Success return Transform +---@param model any +---@param boneId integer +---@return any pose +function RL.GetModelBindPose( model, boneId ) end + +-- Models - Model drawing functions + +---Draw a model (With texture if set) +---@param model any +---@param position table +---@param scale number +---@param tint table +---@return any RL.DrawModel +function RL.DrawModel( model, position, scale, tint ) end + +---Draw a model with extended parameters +---@param model any +---@param position table +---@param rotationAxis table +---@param rotationAngle number +---@param scale table +---@param tint table +---@return any RL.DrawModelEx +function RL.DrawModelEx( model, position, rotationAxis, rotationAngle, scale, tint ) end + +---Draw a model wires (with texture if set) +---@param model any +---@param position table +---@param scale number +---@param tint table +---@return any RL.DrawModelWires +function RL.DrawModelWires( model, position, scale, tint ) end + +---Draw a model wires (with texture if set) with extended parameters +---@param model any +---@param position table +---@param rotationAxis table +---@param rotationAngle number +---@param scale table +---@param tint table +---@return any RL.DrawModelWiresEx +function RL.DrawModelWiresEx( model, position, rotationAxis, rotationAngle, scale, tint ) end + +---Draw a model as points +---@param model any +---@param position table +---@param scale number +---@param tint table +---@return any RL.DrawModelPoints +function RL.DrawModelPoints( model, position, scale, tint ) end + +---Draw a model as points with extended parameters +---@param model any +---@param position table +---@param rotationAxis table +---@param rotationAngle number +---@param scale table +---@param tint table +---@return any RL.DrawModelPointsEx +function RL.DrawModelPointsEx( model, position, rotationAxis, rotationAngle, scale, tint ) end + +---Draw bounding box (wires) +---@param box any +---@param color table +---@return any RL.DrawBoundingBox +function RL.DrawBoundingBox( box, color ) end + +---Draw a billboard texture +---@param camera any +---@param texture any +---@param position table +---@param size number +---@param tint table +---@return any RL.DrawBillboard +function RL.DrawBillboard( camera, texture, position, size, tint ) end + +---Draw a billboard texture defined by source +---@param camera any +---@param texture any +---@param source table +---@param position table +---@param size table +---@param tint table +---@return any RL.DrawBillboardRec +function RL.DrawBillboardRec( camera, texture, source, position, size, tint ) end + +---Draw a billboard texture defined by source and rotation +---@param camera any +---@param texture any +---@param source table +---@param position table +---@param up table +---@param size table +---@param origin table +---@param rotation number +---@param tint table +---@return any RL.DrawBillboardPro +function RL.DrawBillboardPro( camera, texture, source, position, up, size, origin, rotation, tint ) end + +-- Models - Mesh management functions + +---Update mesh vertex data in GPU. +---NOTE: Mainly intented to be used with custom meshes. +---@param mesh any +---@param meshData table +---@return any RL.UpdateMesh +function RL.UpdateMesh( mesh, meshData ) end + +---Unload mesh data from CPU and GPU +---@param mesh any +---@return any RL.UnloadMesh +function RL.UnloadMesh( mesh ) end + +---Draw a 3d mesh with material and transform +---@param mesh any +---@param material any +---@param transform table +---@return any RL.DrawMesh +function RL.DrawMesh( mesh, material, transform ) end + +---Draw multiple mesh instances with material and different transforms +---@param mesh any +---@param material any +---@param transforms any +---@param instances integer +---@return any RL.DrawMeshInstanced +function RL.DrawMeshInstanced( mesh, material, transforms, instances ) end + +---Updades mesh color vertex attribute buffer +---NOTE: Currently only works on custom mesh +---- Failure return false +---- Success return true +---@param mesh any +---@param color table +---@return any success +function RL.SetMeshColor( mesh, color ) end + +---Export mesh data to file, returns true on success +---- Success return bool +---@param mesh any +---@param fileName string +---@return any success +function RL.ExportMesh( mesh, fileName ) end + +---Export mesh as code file (.h) defining multiple arrays of vertex attributes +---- Success return bool +---@param mesh any +---@param fileName string +---@return any success +function RL.ExportMeshAsCode( mesh, fileName ) end + +---Compute mesh bounding box limits +---- Success return BoundingBox +---@param mesh any +---@return any boundingBox +function RL.GetMeshBoundingBox( mesh ) end + +---Compute mesh tangents +---@param mesh any +---@return any RL.GenMeshTangents +function RL.GenMeshTangents( mesh ) end + +---Get mesh vertex attributes data as table. +---- Success return Mesh{} +---@param mesh any +---@return any meshData +function RL.GetMeshData( mesh ) end + +-- Models - Mesh generation functions + +---Generate polygonal mesh +---- Success return Mesh +---@param sides integer +---@param radius number +---@return any mesh +function RL.GenMeshPoly( sides, radius ) end + +---Generate plane mesh (With subdivisions) +---- Success return Mesh +---@param width number +---@param length number +---@param resX integer +---@param resZ integer +---@return any mesh +function RL.GenMeshPlane( width, length, resX, resZ ) end + +---Generate cuboid mesh +---- Success return Mesh +---@param size table +---@return any mesh +function RL.GenMeshCube( size ) end + +---Generate sphere mesh (Standard sphere) +---- Success return Mesh +---@param radius number +---@param rings integer +---@param slices integer +---@return any mesh +function RL.GenMeshSphere( radius, rings, slices ) end + +---Generate half-sphere mesh (no bottom cap) +---- Success return Mesh +---@param radius number +---@param rings integer +---@param slices integer +---@return any mesh +function RL.GenMeshHemiSphere( radius, rings, slices ) end + +---Generate cylinder mesh +---- Success return Mesh +---@param radius number +---@param height number +---@param slices integer +---@return any mesh +function RL.GenMeshCylinder( radius, height, slices ) end + +---Generate cone/pyramid mesh +---- Success return Mesh +---@param radius number +---@param height number +---@param slices integer +---@return any mesh +function RL.GenMeshCone( radius, height, slices ) end + +---Generate torus mesh +---- Success return Mesh +---@param radius number +---@param size number +---@param radSeg integer +---@param sides integer +---@return any mesh +function RL.GenMeshTorus( radius, size, radSeg, sides ) end + +---Generate torus mesh +---- Success return Mesh +---@param radius number +---@param size number +---@param radSeg integer +---@param sides integer +---@return any mesh +function RL.GenMeshKnot( radius, size, radSeg, sides ) end + +---Generate heightmap mesh from image data +---- Success return Mesh +---@param heightmap any +---@param size table +---@return any mesh +function RL.GenMeshHeightmap( heightmap, size ) end + +---Generate cubes-based map mesh from image data +---- Success return Mesh +---@param cubicmap any +---@param cubeSize table +---@return any mesh +function RL.GenMeshCubicmap( cubicmap, cubeSize ) end + +---Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO +---- Success return Mesh +---@param meshData table +---@param dynamic boolean +---@return any mesh +function RL.GenMeshCustom( meshData, dynamic ) end + +-- Models - Material management functions + +---Load materials from model file +---- Success return Material{} +---@param fileName string +---@return any materials +function RL.LoadMaterials( fileName ) end + +---Default material for reference. Return as lightuserdata +---- Success return Material +---@return any material +function RL.GetMaterialDefault() end + +---Load default material as new object +---- Success return Material +---@return any material +function RL.LoadMaterialDefault() end + +---Load material from table. See material table definition +---- Success return Material +---@param materialData table +---@return any material +function RL.CreateMaterial( materialData ) end + +---Check if a material is valid (shader assigned, map textures loaded in GPU) +---- Success return bool +---@param material any +---@return any isValid +function RL.IsMaterialValid( material ) end + +---Unload material from GPU memory (VRAM). Note! Use freeAll to unload shaders and textures +---@param material any +---@param freeAll boolean +---@return any RL.UnloadMaterial +function RL.UnloadMaterial( material, freeAll ) end + +---Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...) +---@param material any +---@param mapType integer +---@param texture any +---@return any RL.SetMaterialTexture +function RL.SetMaterialTexture( material, mapType, texture ) end + +---Set color for a material map type +---@param material any +---@param mapType integer +---@param color table +---@return any RL.SetMaterialColor +function RL.SetMaterialColor( material, mapType, color ) end + +---Set value for a material map type +---@param material any +---@param mapType integer +---@param value number +---@return any RL.SetMaterialValue +function RL.SetMaterialValue( material, mapType, value ) end + +---Set shader for material +---@param material any +---@param shader any +---@return any RL.SetMaterialShader +function RL.SetMaterialShader( material, shader ) end + +---Set material generic parameters (if required) +---@param material any +---@param params table +---@return any RL.SetMaterialParams +function RL.SetMaterialParams( material, params ) end + +---Get texture from material map type. Return as lightuserdata +---- Success return Texture +---@param material any +---@param mapType integer +---@return any texture +function RL.GetMaterialTexture( material, mapType ) end + +---Get color from material map type +---- Success return Color +---@param material any +---@param mapType integer +---@return any color +function RL.GetMaterialColor( material, mapType ) end + +---Get color from material map type +---- Success return float +---@param material any +---@param mapType integer +---@return any value +function RL.GetMaterialValue( material, mapType ) end + +---Get material shader. Return as lightuserdata +---- Success return Shader +---@param material any +---@return any shader +function RL.GetMaterialShader( material ) end + +---Get material parameters +---- Success return float{} +---@param material any +---@return any params +function RL.GetMaterialParams( material ) end + +-- Model - Model animations management functions + +---Load model animations from file +---- Failure return nil +---- Success return ModelAnimations{} +---@param fileName string +---@return any animations +function RL.LoadModelAnimations( fileName ) end + +---Update model animation pose +---@param model any +---@param animation any +---@param frame integer +---@return any RL.UpdateModelAnimation +function RL.UpdateModelAnimation( model, animation, frame ) end + +---Update model animation mesh bone matrices (GPU skinning) +---@param model any +---@param animation any +---@param frame integer +---@return any RL.UpdateModelAnimationBones +function RL.UpdateModelAnimationBones( model, animation, frame ) end + +---Unload animation data +---@param animation any +---@return any RL.UnloadModelAnimation +function RL.UnloadModelAnimation( animation ) end + +---Unload animation table data +---@param animations table +---@return any RL.UnloadModelAnimations +function RL.UnloadModelAnimations( animations ) end + +---Check model animation skeleton match +---- Success return bool +---@param model any +---@param animation any +---@return any valid +function RL.IsModelAnimationValid( model, animation ) end + +---Set modelAnimation bones information (skeleton) +---- Failure return false +---- Success return true +---@param animation any +---@param boneId integer +---@param bone any +---@return any success +function RL.SetModelAnimationBone( animation, boneId, bone ) end + +---Set modelAnimation bones base transformation (pose) +---- Failure return false +---- Success return true +---@param animation any +---@param frame integer +---@param boneId integer +---@param pose any +---@return any success +function RL.SetModelAnimationFramePose( animation, frame, boneId, pose ) end + +---Set modelAnimation name +---@param animation any +---@param name string +---@return any RL.SetModelAnimationName +function RL.SetModelAnimationName( animation, name ) end + +---Return modelAnimation bone count +---- Success return int +---@param animation any +---@return any boneCount +function RL.GetModelAnimationBoneCount( animation ) end + +---Return modelAnimation frame count +---- Success return int +---@param animation any +---@return any frameCount +function RL.GetModelAnimationFrameCount( animation ) end + +---Get modelAnimation bones information (skeleton) +---- Failure return nil +---- Success return BoneInfo +---@param animation any +---@param boneId integer +---@return any bone +function RL.GetModelAnimationBone( animation, boneId ) end + +---Get modelAnimation bones base transformation (pose) +---- Failure return nil +---- Success return Transform +---@param animation any +---@param frame integer +---@param boneId integer +---@return any pose +function RL.GetModelAnimationFramePose( animation, frame, boneId ) end + +---Get modelAnimation name +---- Success return string +---@param animation any +---@return any name +function RL.GetModelAnimationName( animation ) end + +-- Model - Collision detection functions + +---Check collision between two spheres +---- Success return bool +---@param center1 table +---@param radius1 number +---@param center2 table +---@param radius2 number +---@return any collision +function RL.CheckCollisionSpheres( center1, radius1, center2, radius2 ) end + +---Check collision between two bounding boxes +---- Success return bool +---@param box1 any +---@param box2 any +---@return any collision +function RL.CheckCollisionBoxes( box1, box2 ) end + +---Check collision between box and sphere +---- Success return bool +---@param box any +---@param center table +---@param radius number +---@return any collision +function RL.CheckCollisionBoxSphere( box, center, radius ) end + +---Get collision info between ray and sphere. ( RayCollision is Lua table of { hit, distance, point, normal } ) +---- Success return RayCollision +---@param ray any +---@param center table +---@param radius number +---@return any rayCollision +function RL.GetRayCollisionSphere( ray, center, radius ) end + +---Get collision info between ray and box +---- Success return RayCollision +---@param ray any +---@param box any +---@return any rayCollision +function RL.GetRayCollisionBox( ray, box ) end + +---Get collision info between ray and mesh +---- Success return RayCollision +---@param ray any +---@param mesh any +---@param transform table +---@return any rayCollision +function RL.GetRayCollisionMesh( ray, mesh, transform ) end + +---Get collision info between ray and triangle +---- Success return RayCollision +---@param ray any +---@param p1 table +---@param p2 table +---@param p3 table +---@return any rayCollision +function RL.GetRayCollisionTriangle( ray, p1, p2, p3 ) end + +---Get collision info between ray and quad. NOTE: The points are expected to be in counter-clockwise winding +---- Success return RayCollision +---@param ray any +---@param p1 table +---@param p2 table +---@param p3 table +---@param p4 table +---@return any rayCollision +function RL.GetRayCollisionQuad( ray, p1, p2, p3, p4 ) end + +---Get cell positions inside box that intersect with the ray. Also returns ray exit point. Returns empty table if ray misses the box +---- Success return Vector3{}, RayCollision|nil +---@param ray any +---@param box any +---@param cellSize table +---@return any cells +---@return any exitPoint +function RL.GetRayBoxCells( ray, box, cellSize ) end + +-- Audio - Audio device management functions + +---Initialize audio device and context +---@return any RL.InitAudioDevice +function RL.InitAudioDevice() end + +---Close the audio device and context +---@return any RL.CloseAudioDevice +function RL.CloseAudioDevice() end + +---Check if audio device has been initialized successfully +---- Success return bool +---@return any isReady +function RL.IsAudioDeviceReady() end + +---Set master volume (listener) +---@param volume number +---@return any RL.SetMasterVolume +function RL.SetMasterVolume( volume ) end + +---Get master volume (listener) +---- Success return float +---@return any volume +function RL.GetMasterVolume() end + +-- Audio - Wave/Sound loading/unloading functions + +---Load sound from file +---- Failure return nil +---- Success return Sound +---@param fileName string +---@return any sound +function RL.LoadSound( fileName ) end + +---Load wave data from file +---- Failure return nil +---- Success return Wave +---@param fileName string +---@return any wave +function RL.LoadWave( fileName ) end + +---Load wave from memory buffer, fileType refers to extension: i.e. '.wav' +---- Success return Wave +---@param fileType string +---@param data any +---@return any wave +function RL.LoadWaveFromMemory( fileType, data ) end + +---Checks if wave data is valid (data loaded and parameters) +---- Success return bool +---@param wave any +---@return any isValid +function RL.IsWaveValid( wave ) end + +---Load sound from wave data +---- Success return Sound +---@param wave any +---@return any sound +function RL.LoadSoundFromWave( wave ) end + +---Create a new sound that shares the same sample data as the source sound, does not own the sound data +---- Success return Sound +---@param source any +---@return any sound +function RL.LoadSoundAlias( source ) end + +---Checks if a sound is valid (data loaded and buffers initialized) +---- Success return bool +---@param sound any +---@return any isValid +function RL.IsSoundValid( sound ) end + +---Update sound buffer with new data +---@param sound any +---@param data any +---@param sampleCount integer +---@return any RL.UpdateSound +function RL.UpdateSound( sound, data, sampleCount ) end + +---Unload wave data +---@param wave any +---@return any RL.UnloadWave +function RL.UnloadWave( wave ) end + +---Unload sound +---@param sound any +---@return any RL.UnloadSound +function RL.UnloadSound( sound ) end + +---Unload a sound alias (does not deallocate sample data) +---@param alias any +---@return any RL.UnloadSoundAlias +function RL.UnloadSoundAlias( alias ) end + +---Export wave data to file, returns true on success +---- Success return bool +---@param wave any +---@param fileName string +---@return any success +function RL.ExportWave( wave, fileName ) end + +---Export wave sample data to code (.h), returns true on success +---- Success return true +---@param wave any +---@param fileName string +---@return any success +function RL.ExportWaveAsCode( wave, fileName ) end + +-- Audio - Wave/Sound management functions + +---Play a sound +---@param sound any +---@return any RL.PlaySound +function RL.PlaySound( sound ) end + +---Stop playing a sound +---@param sound any +---@return any RL.StopSound +function RL.StopSound( sound ) end + +---Pause a sound +---@param sound any +---@return any RL.PauseSound +function RL.PauseSound( sound ) end + +---Resume a paused sound +---@param sound any +---@return any RL.ResumeSound +function RL.ResumeSound( sound ) end + +---Check if a sound is currently playing +---- Success return bool +---@param sound any +---@return any playing +function RL.IsSoundPlaying( sound ) end + +---Set volume for a sound (1.0 is max level) +---@param sound any +---@param volume number +---@return any RL.SetSoundVolume +function RL.SetSoundVolume( sound, volume ) end + +---Set pitch for a sound (1.0 is base level) +---@param sound any +---@param pitch number +---@return any RL.SetSoundPitch +function RL.SetSoundPitch( sound, pitch ) end + +---Set pan for a sound (0.5 is center) +---@param sound any +---@param pan number +---@return any RL.SetSoundPan +function RL.SetSoundPan( sound, pan ) end + +---Get sound audio stream. Return as lightuserdata +---- Success return AudioStream +---@param sound any +---@return any stream +function RL.GetSoundStream( sound ) end + +---Convert wave data to desired format +---@param wave any +---@param sampleRate integer +---@param sampleSize integer +---@param channels integer +---@return any RL.WaveFormat +function RL.WaveFormat( wave, sampleRate, sampleSize, channels ) end + +---Load samples data from wave as a 32bit float data array +---- Success return float{} +---@param wave any +---@return any samples +function RL.LoadWaveSamples( wave ) end + +---Copy a wave to a new wave +---- Success return Wave +---@param wave any +---@return any wave +function RL.WaveCopy( wave ) end + +---Crop a wave to defined samples range +---@param wave any +---@param initSample integer +---@param finalSample integer +---@return any RL.WaveCrop +function RL.WaveCrop( wave, initSample, finalSample ) end + +-- Audio - Music management functions + +---Load music stream from file +---- Success return Music +---@param fileName string +---@return any music +function RL.LoadMusicStream( fileName ) end + +---Load music stream from data +---- Success return Music +---@param fileType string +---@param data any +---@return any music +function RL.LoadMusicStreamFromMemory( fileType, data ) end + +---Checks if a music stream is valid (context and buffers initialized) +---- Success return bool +---@param music any +---@return any isValid +function RL.IsMusicValid( music ) end + +---Unload music stream +---@param music any +---@return any RL.UnloadMusicStream +function RL.UnloadMusicStream( music ) end + +---Start music playing +---@param music any +---@return any RL.PlayMusicStream +function RL.PlayMusicStream( music ) end + +---Check if music is playing +---- Success return bool +---@param music any +---@return any playing +function RL.IsMusicStreamPlaying( music ) end + +---Updates buffers for music streaming +---@param music any +---@return any RL.UpdateMusicStream +function RL.UpdateMusicStream( music ) end + +---Stop music playing +---@param music any +---@return any RL.StopMusicStream +function RL.StopMusicStream( music ) end + +---Pause music playing +---@param music any +---@return any RL.PauseMusicStream +function RL.PauseMusicStream( music ) end + +---Resume playing paused music +---@param music any +---@return any RL.ResumeMusicStream +function RL.ResumeMusicStream( music ) end + +---Seek music to a position (in seconds) +---@param music any +---@param position number +---@return any RL.SeekMusicStream +function RL.SeekMusicStream( music, position ) end + +---Set volume for music (1.0 is max level) +---@param music any +---@param volume number +---@return any RL.SetMusicVolume +function RL.SetMusicVolume( music, volume ) end + +---Set pitch for a music (1.0 is base level) +---@param music any +---@param pitch number +---@return any RL.SetMusicPitch +function RL.SetMusicPitch( music, pitch ) end + +---Set pan for a music (0.5 is center) +---@param music any +---@param pan number +---@return any RL.SetMusicPan +function RL.SetMusicPan( music, pan ) end + +---Set looping for a music +---@param music any +---@param looping boolean +---@return any RL.SetMusicLooping +function RL.SetMusicLooping( music, looping ) end + +---Get looping of a music +---- Success return bool +---@param music any +---@return any looping +function RL.GetMusicLooping( music ) end + +---Get music time length (in seconds) +---- Success return float +---@param music any +---@return any length +function RL.GetMusicTimeLength( music ) end + +---Get current music time played (in seconds) +---- Success return float +---@param music any +---@return any timePlayed +function RL.GetMusicTimePlayed( music ) end + +---Get music audio stream. Return as lightuserdata +---- Success return AudioStream +---@param music any +---@return any stream +function RL.GetMusicStream( music ) end + +-- Audio - AudioStream management functions + +---Load audio stream (to stream raw audio pcm data) +---- Success return AudioStream +---@param sampleRate integer +---@param sampleSize integer +---@param channels integer +---@return any audioStream +function RL.LoadAudioStream( sampleRate, sampleSize, channels ) end + +---Checks if an audio stream is valid (buffers initialized) +---- Success return bool +---@param stream any +---@return any isValid +function RL.IsAudioStreamValid( stream ) end + +---Unload audio stream and free memory +---@param stream any +---@return any RL.UnloadAudioStream +function RL.UnloadAudioStream( stream ) end + +---Update audio stream buffers with data +---@param stream any +---@param data any +---@param frameCount integer +---@return any RL.UpdateAudioStream +function RL.UpdateAudioStream( stream, data, frameCount ) end + +---Check if any audio stream buffers requires refill +---- Success return bool +---@param stream any +---@return any isProcessed +function RL.IsAudioStreamProcessed( stream ) end + +---Play audio stream +---@param stream any +---@return any RL.PlayAudioStream +function RL.PlayAudioStream( stream ) end + +---Pause audio stream +---@param stream any +---@return any RL.PauseAudioStream +function RL.PauseAudioStream( stream ) end + +---Resume audio stream +---@param stream any +---@return any RL.ResumeAudioStream +function RL.ResumeAudioStream( stream ) end + +---Check if audio stream is playing +---- Success return bool +---@param stream any +---@return any isPlaying +function RL.IsAudioStreamPlaying( stream ) end + +---Stop audio stream +---@param stream any +---@return any RL.StopAudioStream +function RL.StopAudioStream( stream ) end + +---Set volume for audio stream (1.0 is max level) +---@param stream any +---@param volume number +---@return any RL.SetAudioStreamVolume +function RL.SetAudioStreamVolume( stream, volume ) end + +---Set pitch for audio stream (1.0 is base level) +---@param stream any +---@param pitch number +---@return any RL.SetAudioStreamPitch +function RL.SetAudioStreamPitch( stream, pitch ) end + +---Set pan for audio stream (0.5 is centered) +---@param stream any +---@param pan number +---@return any RL.SetAudioStreamPan +function RL.SetAudioStreamPan( stream, pan ) end + +---Default size for new audio streams +---@param size integer +---@return any RL.SetAudioStreamBufferSizeDefault +function RL.SetAudioStreamBufferSizeDefault( size ) end + +---Audio thread callback to request new data. +---AudioCallback should be lightuserdata function pointer +---@param stream any +---@param callback any +---@return any RL.SetAudioStreamCallback +function RL.SetAudioStreamCallback( stream, callback ) end + +---Attach audio stream processor to stream, receives the samples as 'float'. +---AudioCallback should be lightuserdata function pointer +---@param stream any +---@param processor any +---@return any RL.AttachAudioStreamProcessor +function RL.AttachAudioStreamProcessor( stream, processor ) end + +---Detach audio stream processor from stream. +---AudioCallback should be lightuserdata function pointer +---@param stream any +---@param processor any +---@return any RL.DetachAudioStreamProcessor +function RL.DetachAudioStreamProcessor( stream, processor ) end + +---Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'. +---AudioCallback should be lightuserdata function pointer +---@param processor any +---@return any RL.AttachAudioMixedProcessor +function RL.AttachAudioMixedProcessor( processor ) end + +---Detach audio stream processor from the entire audio pipeline. +---AudioCallback should be lightuserdata function pointer +---@param processor any +---@return any RL.DetachAudioMixedProcessor +function RL.DetachAudioMixedProcessor( processor ) end + +-- Math - Utils + +---Round float value +---- Success return int +---@param value number +---@return any result +function RL.Round( value ) end + +---Sign of value +---- Success return int +---@param value number +---@return any result +function RL.Sign( value ) end + +---Clamp float value +---- Success return float +---@param value number +---@param min number +---@param max number +---@return any result +function RL.Clamp( value, min, max ) end + +---Calculate linear interpolation between two floats +---- Success return float +---@param a number +---@param b number +---@param amount number +---@return any result +function RL.Lerp( a, b, amount ) end + +---Normalize input value within input range +---- Success return float +---@param value number +---@param a number +---@param b number +---@return any result +function RL.Normalize( value, a, b ) end + +---Remap input value within input range to output range +---- Success return float +---@param value number +---@param inputStart number +---@param inputEnd number +---@param outputStart number +---@param outputEnd number +---@return any result +function RL.Remap( value, inputStart, inputEnd, outputStart, outputEnd ) end + +---Wrap input value from min to max +---- Success return float +---@param value number +---@param min number +---@param max number +---@return any result +function RL.Wrap( value, min, max ) end + +---Check whether two given floats are almost equal +---- Success return bool +---@param x number +---@param y number +---@return any result +function RL.FloatEquals( x, y ) end + +-- Math - Vector2 + +---Vector with components value 0.0f +---- Success return Vector2 +---@return any result +function RL.Vector2Zero() end + +---Vector with components value 1.0f +---- Success return Vector2 +---@return any result +function RL.Vector2One() end + +---Add two vectors (v1 + v2) +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Add( v1, v2 ) end + +---Add vector and float value +---- Success return Vector2 +---@param v table +---@param add number +---@return any result +function RL.Vector2AddValue( v, add ) end + +---Subtract two vectors (v1 - v2) +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Subtract( v1, v2 ) end + +---Subtract vector by float value +---- Success return Vector2 +---@param v table +---@param sub number +---@return any result +function RL.Vector2SubtractValue( v, sub ) end + +---Calculate vector length +---- Success return float +---@param v any +---@return any result +function RL.Vector2Length( v ) end + +---Calculate vector square length +---- Success return float +---@param v any +---@return any result +function RL.Vector2LengthSqr( v ) end + +---Calculate two vectors dot product +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2DotProduct( v1, v2 ) end + +---Calculate distance between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Distance( v1, v2 ) end + +---Calculate square distance between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2DistanceSqr( v1, v2 ) end + +---Calculate angle between two vectors +---NOTE: Angle is calculated from origin point (0, 0) +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Angle( v1, v2 ) end + +---Calculate angle defined by a two vectors line +---NOTE: Parameters need to be normalized +---Current implementation should be aligned with glm::angle +---- Success return float +---@param a table +---@param b table +---@return any result +function RL.Vector2LineAngle( a, b ) end + +---Scale vector (multiply by value) +---- Success return Vector2 +---@param v table +---@param scale number +---@return any result +function RL.Vector2Scale( v, scale ) end + +---Multiply vector by vector +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Multiply( v1, v2 ) end + +---Negate vector +---- Success return Vector2 +---@param v table +---@return any result +function RL.Vector2Negate( v ) end + +---Divide vector by vector +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Divide( v1, v2 ) end + +---Normalize provided vector +---- Success return Vector2 +---@param v table +---@return any result +function RL.Vector2Normalize( v ) end + +---Transforms a Vector2 by a given Matrix +---- Success return Vector2 +---@param v table +---@param mat table +---@return any result +function RL.Vector2Transform( v, mat ) end + +---Calculate linear interpolation between two vectors +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@param amount number +---@return any result +function RL.Vector2Lerp( v1, v2, amount ) end + +---Calculate reflected vector to normal +---- Success return Vector2 +---@param v table +---@param normal table +---@return any result +function RL.Vector2Reflect( v, normal ) end + +---Get min value for each pair of components +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Min( v1, v2 ) end + +---Get max value for each pair of components +---- Success return Vector2 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Max( v1, v2 ) end + +---Rotate vector by angle +---- Success return Vector2 +---@param v table +---@param angle number +---@return any result +function RL.Vector2Rotate( v, angle ) end + +---Move Vector towards target +---- Success return Vector2 +---@param v table +---@param target table +---@param maxDistance number +---@return any result +function RL.Vector2MoveTowards( v, target, maxDistance ) end + +---Invert the given vector +---- Success return Vector2 +---@param v table +---@return any result +function RL.Vector2Invert( v ) end + +---Clamp the components of the vector between +---min and max values specified by the given vectors +---- Success return Vector2 +---@param v table +---@param min table +---@param max table +---@return any result +function RL.Vector2Clamp( v, min, max ) end + +---Clamp the magnitude of the vector between two min and max values +---- Success return Vector2 +---@param v table +---@param min number +---@param max number +---@return any result +function RL.Vector2ClampValue( v, min, max ) end + +---Check whether two given vectors are almost equal +---- Success return bool +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector2Equals( v1, v2 ) end + +---Compute the direction of a refracted ray +---v: normalized direction of the incoming ray +---n: normalized normal vector of the interface of two optical media +---r: ratio of the refractive index of the medium from where the ray comes +--- to the refractive index of the medium on the other side of the surface +---- Success return Vector2 +---@param v table +---@param n table +---@param r number +---@return any result +function RL.Vector2Refract( v, n, r ) end + +-- Math - Vector 3 + +---Vector with components value 0.0f +---- Success return Vector3 +---@return any result +function RL.Vector3Zero() end + +---Vector with components value 1.0f +---- Success return Vector3 +---@return any result +function RL.Vector3One() end + +---Add two vectors +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Add( v1, v2 ) end + +---Add vector and float value +---- Success return Vector3 +---@param v table +---@param add number +---@return any result +function RL.Vector3AddValue( v, add ) end + +---Subtract two vectors +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Subtract( v1, v2 ) end + +---Subtract vector by float value +---- Success return Vector3 +---@param v table +---@param sub number +---@return any result +function RL.Vector3SubtractValue( v, sub ) end + +---Multiply vector by scalar +---- Success return Vector3 +---@param v table +---@param scalar number +---@return any result +function RL.Vector3Scale( v, scalar ) end + +---Multiply vector by vector +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Multiply( v1, v2 ) end + +---Calculate two vectors cross product +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3CrossProduct( v1, v2 ) end + +---Calculate one vector perpendicular vector +---- Success return Vector3 +---@param v table +---@return any result +function RL.Vector3Perpendicular( v ) end + +---Calculate vector length +---- Success return float +---@param v table +---@return any result +function RL.Vector3Length( v ) end + +---Calculate vector square length +---- Success return float +---@param v table +---@return any result +function RL.Vector3LengthSqr( v ) end + +---Calculate two vectors dot product +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3DotProduct( v1, v2 ) end + +---Calculate distance between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Distance( v1, v2 ) end + +---Calculate square distance between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3DistanceSqr( v1, v2 ) end + +---Calculate angle between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Angle( v1, v2 ) end + +---Negate provided vector (invert direction) +---- Success return Vector3 +---@param v table +---@return any result +function RL.Vector3Negate( v ) end + +---Divide vector by vector +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Divide( v1, v2 ) end + +---Normalize provided vector +---- Success return Vector3 +---@param v table +---@return any result +function RL.Vector3Normalize( v ) end + +---Calculate the projection of the vector v1 on to v2 +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Project( v1, v2 ) end + +---Calculate the rejection of the vector v1 on to v2 +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Reject( v1, v2 ) end + +---Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other. +---Gram-Schmidt function implementation +---- Success return Vector3, Vector3 +---@param v1 table +---@param v2 table +---@return any v1 +---@return any v2 +function RL.Vector3OrthoNormalize( v1, v2 ) end + +---Transforms a Vector3 by a given Matrix +---- Success return Vector3 +---@param v table +---@param mat table +---@return any result +function RL.Vector3Transform( v, mat ) end + +---Transform a vector by quaternion rotation +---- Success return Vector3 +---@param v table +---@param q table +---@return any result +function RL.Vector3RotateByQuaternion( v, q ) end + +---Rotates a vector around an axis +---- Success return Vector3 +---@param v table +---@param axis table +---@param angle number +---@return any result +function RL.Vector3RotateByAxisAngle( v, axis, angle ) end + +---Move Vector towards target +---- Success return Vector3 +---@param v table +---@param target table +---@param maxDistance number +---@return any result +function RL.Vector3MoveTowards( v, target, maxDistance ) end + +---Calculate linear interpolation between two vectors +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@param amount number +---@return any result +function RL.Vector3Lerp( v1, v2, amount ) end + +---Calculate cubic hermite interpolation between two vectors and their tangents +---as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic +---- Success return Vector3 +---@param v1 table +---@param tangent1 table +---@param v2 table +---@param tangent2 table +---@param amount number +---@return any result +function RL.Vector3CubicHermite( v1, tangent1, v2, tangent2, amount ) end + +---Calculate reflected vector to normal +---- Success return Vector3 +---@param v table +---@param normal table +---@return any result +function RL.Vector3Reflect( v, normal ) end + +---Get min value for each pair of components +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Min( v1, v2 ) end + +---Get max value for each pair of components +---- Success return Vector3 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Max( v1, v2 ) end + +---Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) +---NOTE: Assumes P is on the plane of the triangle +---- Success return Vector3 +---@param p table +---@param a table +---@param b table +---@param c table +---@return any result +function RL.Vector3Barycenter( p, a, b, c ) end + +---Projects a Vector3 from screen space into object space +---NOTE: We are avoiding calling other raymath functions despite available +---- Success return Vector3 +---@param source table +---@param projection table +---@param view table +---@return any result +function RL.Vector3Unproject( source, projection, view ) end + +---Invert the given vector +---- Success return Vector3 +---@param v table +---@return any result +function RL.Vector3Invert( v ) end + +---Clamp the components of the vector between +---min and max values specified by the given vectors +---- Success return Vector3 +---@param v table +---@param min table +---@param max table +---@return any result +function RL.Vector3Clamp( v, min, max ) end + +---Clamp the magnitude of the vector between two values +---- Success return Vector3 +---@param v table +---@param min number +---@param max number +---@return any result +function RL.Vector3ClampValue( v, min, max ) end + +---Check whether two given vectors are almost equal +---- Success return bool +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector3Equals( v1, v2 ) end + +---Compute the direction of a refracted ray where v specifies the +---normalized direction of the incoming ray, n specifies the +---normalized normal vector of the interface of two optical media, +---and r specifies the ratio of the refractive index of the medium +---from where the ray comes to the refractive index of the medium +---on the other side of the surface +---- Success return Vector3 +---@param v table +---@param n table +---@param r number +---@return any result +function RL.Vector3Refract( v, n, r ) end + +-- Math - Vector4 + +---Vector with components value 0.0f +---- Success return Vector4 +---@return any result +function RL.Vector4Zero() end + +---Vector with components value 1.0f +---- Success return Vector4 +---@return any result +function RL.Vector4One() end + +---Add two vectors +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Add( v1, v2 ) end + +---Add vector and float value +---- Success return Vector4 +---@param v table +---@param add number +---@return any result +function RL.Vector4AddValue( v, add ) end + +---Subtract two vectors +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Subtract( v1, v2 ) end + +---Subtract vector by float value +---- Success return Vector4 +---@param v table +---@param sub number +---@return any result +function RL.Vector4SubtractValue( v, sub ) end + +---Calculate vector length +---- Success return float +---@param v table +---@return any result +function RL.Vector4Length( v ) end + +---Calculate vector square length +---- Success return float +---@param v table +---@return any result +function RL.Vector4LengthSqr( v ) end + +---Calculate two vectors dot product +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4DotProduct( v1, v2 ) end + +---Calculate distance between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Distance( v1, v2 ) end + +---Calculate square distance between two vectors +---- Success return float +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4DistanceSqr( v1, v2 ) end + +---Multiply vector by scalar +---- Success return Vector4 +---@param v table +---@param scalar number +---@return any result +function RL.Vector4Scale( v, scalar ) end + +---Multiply vector by vector +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Multiply( v1, v2 ) end + +---Negate provided vector (invert direction) +---- Success return Vector4 +---@param v table +---@return any result +function RL.Vector4Negate( v ) end + +---Divide vector by vector +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Divide( v1, v2 ) end + +---Normalize provided vector +---- Success return Vector4 +---@param v table +---@return any result +function RL.Vector4Normalize( v ) end + +---Get min value for each pair of components +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Min( v1, v2 ) end + +---Get max value for each pair of components +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Max( v1, v2 ) end + +---Calculate linear interpolation between two vectors +---- Success return Vector4 +---@param v1 table +---@param v2 table +---@param amount number +---@return any result +function RL.Vector4Lerp( v1, v2, amount ) end + +---Move Vector towards target +---- Success return Vector4 +---@param v table +---@param target table +---@param maxDistance number +---@return any result +function RL.Vector4MoveTowards( v, target, maxDistance ) end + +---Invert the given vector +---- Success return Vector4 +---@param v table +---@return any result +function RL.Vector4Invert( v ) end + +---Check whether two given vectors are almost equal +---- Success return bool +---@param v1 table +---@param v2 table +---@return any result +function RL.Vector4Equals( v1, v2 ) end + +-- Math - Matrix + +---Compute matrix determinant +---- Success return float +---@param mat table +---@return any result +function RL.MatrixDeterminant( mat ) end + +---Get the trace of the matrix (sum of the values along the diagonal) +---- Success return float +---@param mat table +---@return any result +function RL.MatrixTrace( mat ) end + +---Transposes provided matrix +---- Success return Matrix +---@param mat table +---@return any result +function RL.MatrixTranspose( mat ) end + +---Invert provided matrix +---- Success return Matrix +---@param mat table +---@return any result +function RL.MatrixInvert( mat ) end + +---Get identity matrix +---- Success return Matrix +---@return any result +function RL.MatrixIdentity() end + +---Add two matrices +---- Success return Matrix +---@param left table +---@param right table +---@return any result +function RL.MatrixAdd( left, right ) end + +---Subtract two matrices (left - right) +---- Success return Matrix +---@param left table +---@param right table +---@return any result +function RL.MatrixSubtract( left, right ) end + +---Get two matrix multiplication +---- Success return Matrix +---@param left table +---@param right table +---@return any result +function RL.MatrixMultiply( left, right ) end + +---Get translation matrix +---- Success return Matrix +---@param translate table +---@return any result +function RL.MatrixTranslate( translate ) end + +---Create rotation matrix from axis and angle. NOTE: Angle should be provided in radians +---- Success return Matrix +---@param axis table +---@param angle number +---@return any result +function RL.MatrixRotate( axis, angle ) end + +---Get x-rotation matrix (angle in radians) +---- Success return Matrix +---@param angle number +---@return any result +function RL.MatrixRotateX( angle ) end + +---Get y-rotation matrix (angle in radians) +---- Success return Matrix +---@param angle number +---@return any result +function RL.MatrixRotateY( angle ) end + +---Get z-rotation matrix (angle in radians) +---- Success return Matrix +---@param angle number +---@return any result +function RL.MatrixRotateZ( angle ) end + +---Get xyz-rotation matrix (angles in radians) +---- Success return Matrix +---@param angles table +---@return any result +function RL.MatrixRotateXYZ( angles ) end + +---Get zyx-rotation matrix (angles in radians) +---- Success return Matrix +---@param angles table +---@return any result +function RL.MatrixRotateZYX( angles ) end + +---Get scaling matrix +---- Success return Matrix +---@param scale table +---@return any result +function RL.MatrixScale( scale ) end + +---Get perspective projection matrix +---- Success return Matrix +---@param left any +---@param right any +---@param bottom any +---@param top any +---@param near any +---@param far any +---@return any result +function RL.MatrixFrustum( left, right, bottom, top, near, far ) end + +---Get perspective projection matrix +---- Success return Matrix +---@param fovy any +---@param aspect any +---@param near any +---@param far any +---@return any result +function RL.MatrixPerspective( fovy, aspect, near, far ) end + +---Get orthographic projection matrix +---- Success return Matrix +---@param left any +---@param right any +---@param bottom any +---@param top any +---@param near any +---@param far any +---@return any result +function RL.MatrixOrtho( left, right, bottom, top, near, far ) end + +---Get camera look-at matrix (View matrix) +---- Success return Matrix +---@param eye table +---@param target table +---@param up table +---@return any result +function RL.MatrixLookAt( eye, target, up ) end + +---Decompose a transformation matrix into its rotational, translational and scaling components +---- Success return Vector3, Quaternion, Vector3 +---@param mat table +---@return any translation +---@return any rotation +---@return any scale +function RL.MatrixDecompose( mat ) end + +-- Math - Quaternion + +---Add two quaternions +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@return any result +function RL.QuaternionAdd( q1, q2 ) end + +---Add quaternion and float value +---- Success return Quaternion +---@param q table +---@param add number +---@return any result +function RL.QuaternionAddValue( q, add ) end + +---Subtract two quaternions +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@return any result +function RL.QuaternionSubtract( q1, q2 ) end + +---Subtract quaternion and float value +---- Success return Quaternion +---@param q table +---@param sub number +---@return any result +function RL.QuaternionSubtractValue( q, sub ) end + +---Get identity quaternion +---- Success return Quaternion +---@return any result +function RL.QuaternionIdentity() end + +---Computes the length of a quaternion +---- Success return float +---@param q table +---@return any result +function RL.QuaternionLength( q ) end + +---Normalize provided quaternion +---- Success return Quaternion +---@param q table +---@return any result +function RL.QuaternionNormalize( q ) end + +---Invert provided quaternion +---- Success return Quaternion +---@param q table +---@return any result +function RL.QuaternionInvert( q ) end + +---Calculate two quaternion multiplication +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@return any result +function RL.QuaternionMultiply( q1, q2 ) end + +---Scale quaternion by float value +---- Success return Quaternion +---@param q table +---@param mul number +---@return any result +function RL.QuaternionScale( q, mul ) end + +---Divide two quaternions +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@return any result +function RL.QuaternionDivide( q1, q2 ) end + +---Calculate linear interpolation between two quaternions +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@param amount number +---@return any result +function RL.QuaternionLerp( q1, q2, amount ) end + +---Calculate slerp-optimized interpolation between two quaternions +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@param amount number +---@return any result +function RL.QuaternionNlerp( q1, q2, amount ) end + +---Calculates spherical linear interpolation between two quaternions +---- Success return Quaternion +---@param q1 table +---@param q2 table +---@param amount number +---@return any result +function RL.QuaternionSlerp( q1, q2, amount ) end + +---Calculate quaternion cubic spline interpolation using Cubic Hermite Spline algorithm +---as described in the GLTF 2.0 specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#interpolation-cubic +---- Success return Quaternion +---@param q1 table +---@param outTangent1 table +---@param q2 table +---@param inTangent2 table +---@param t number +---@return any result +function RL.QuaternionCubicHermiteSpline( q1, outTangent1, q2, inTangent2, t ) end + +---Calculate quaternion based on the rotation from one vector to another +---- Success return Quaternion +---@param from table +---@param to table +---@return any result +function RL.QuaternionFromVector3ToVector3( from, to ) end + +---Get a quaternion for a given rotation matrix +---- Success return Quaternion +---@param mat table +---@return any result +function RL.QuaternionFromMatrix( mat ) end + +---Get a matrix for a given quaternion +---- Success return Matrix +---@param q table +---@return any result +function RL.QuaternionToMatrix( q ) end + +---Get rotation quaternion for an angle and axis +---NOTE: angle must be provided in radians +---- Success return Quaternion +---@param axis table +---@param angle number +---@return any result +function RL.QuaternionFromAxisAngle( axis, angle ) end + +---Get the rotation angle and axis for a given quaternion +---- Success return Vector3, float +---@param q table +---@return any axis +---@return any angle +function RL.QuaternionToAxisAngle( q ) end + +---Get the quaternion equivalent to Euler angles +---NOTE: Rotation order is ZYX +---- Success return Quaternion +---@param pitch number +---@param yaw number +---@param roll number +---@return any result +function RL.QuaternionFromEuler( pitch, yaw, roll ) end + +---Get the Euler angles equivalent to quaternion (roll, pitch, yaw) +---NOTE: Angles are returned in a Vector3 struct in radians +---- Success return Vector3 +---@param q table +---@return any result +function RL.QuaternionToEuler( q ) end + +---Transform a quaternion given a transformation matrix +---- Success return Quaternion +---@param q table +---@param mat table +---@return any result +function RL.QuaternionTransform( q, mat ) end + +---Check whether two given quaternions are almost equal +---- Success return bool +---@param q1 table +---@param q2 table +---@return any result +function RL.QuaternionEquals( q1, q2 ) end + +-- Math - Frustum + +---Extract frustum from projection and modelView matrices. +---- Success return Vector4{} +---@param projection table +---@param modelview table +---@return any frustum +function RL.ExtractFrustum( projection, modelview ) end + +---Check if point inside frustum +---- Success return bool +---@param frustum table +---@param position table +---@return any inFrustum +function RL.PointInFrustum( frustum, position ) end + +---Check if sphere inside frustum +---- Success return bool +---@param frustum table +---@param position table +---@return any inFrustum +function RL.SphereInFrustum( frustum, position ) end + +---Check if AABB inside frustum +---- Success return bool +---@param frustum table +---@param min table +---@param max table +---@return any inFrustum +function RL.AABBInFrustum( frustum, min, max ) end + +-- Gui - Global gui state control functions + +---Enable gui controls (global state) +---@return any RL.GuiEnable +function RL.GuiEnable() end + +---Disable gui controls (global state) +---@return any RL.GuiDisable +function RL.GuiDisable() end + +---Lock gui controls (global state) +---@return any RL.GuiLock +function RL.GuiLock() end + +---Unlock gui controls (global state) +---@return any RL.GuiUnlock +function RL.GuiUnlock() end + +---Check if gui is locked (global state) +---- Success return bool +---@return any locked +function RL.GuiIsLocked() end + +---Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f +---@param alpha number +---@return any RL.GuiSetAlpha +function RL.GuiSetAlpha( alpha ) end + +---Set gui state (global state) +---@param state integer +---@return any RL.GuiSetState +function RL.GuiSetState( state ) end + +---Get gui state (global state) +---- Success return int +---@return any state +function RL.GuiGetState() end + +---Set guiSliderDragging +---@param dragging boolean +---@return any RL.GuiSetSliderDragging +function RL.GuiSetSliderDragging( dragging ) end + +---Get guiSliderDragging +---- Success return bool +---@return any isSliderDragging +function RL.GuiGetSliderDragging() end + +---Set guiSliderActive +---@param rect any +---@return any RL.GuiSetSliderActive +function RL.GuiSetSliderActive( rect ) end + +---Get guiSliderActive +---- Success return Rectangle +---@return any isSliderDragging +function RL.GuiGetSliderActive() end + +-- Gui - Font set/get functions + +---Set gui custom font (global state) +---@param font any +---@return any RL.GuiSetFont +function RL.GuiSetFont( font ) end + +---Get gui font (global state). Return as lightuserdata +---- Success return Font +---@return any font +function RL.GuiGetFont() end + +-- Gui - Style set/get functions + +---Set one style property +---@param control integer +---@param property integer +---@param value integer +---@return any RL.GuiSetStyle +function RL.GuiSetStyle( control, property, value ) end + +---Get one style property +---- Success return int +---@param control integer +---@param property integer +---@return any value +function RL.GuiGetStyle( control, property ) end + +-- Gui - Styles loading functions + +---Load style file over global style variable (.rgs) +---- Failure return nil +---- Success return true +---@param fileName string +---@return any success +function RL.GuiLoadStyle( fileName ) end + +---Load style default over global style +---@return any RL.GuiLoadStyleDefault +function RL.GuiLoadStyleDefault() end + +-- Gui - Tooltips management functions + +---Enable gui tooltips (global state) +---@return any RL.GuiEnableTooltip +function RL.GuiEnableTooltip() end + +---Disable gui tooltips (global state) +---@return any RL.GuiDisableTooltip +function RL.GuiDisableTooltip() end + +---Set tooltip string +---@param tooltip string +---@return any RL.GuiSetTooltip +function RL.GuiSetTooltip( tooltip ) end + +-- Gui - Icons functionality + +---Get text with icon id prepended (if supported) +---- Success return string +---@param iconId integer +---@param text string|nil +---@return any text +function RL.GuiIconText( iconId, text ) end + +---Set icon scale (1 by default) +---@param scale integer +---@return any RL.GuiSetIconScale +function RL.GuiSetIconScale( scale ) end + +---Get raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB +---- Success return Buffer +---@return any iconsBuffer +function RL.GuiGetIcons() end + +---Set raygui icons data in buffer. guiIcons size is by default: 256*(16*16/32) = 2048*4 = 8192 bytes = 8 KB +---- Failure return false +---- Success return true +---@param iconBuffer any +---@return any success +function RL.GuiSetIcons( iconBuffer ) end + +---Load raygui icons file (.rgi) into internal icons data +---- Failure return nil +---- Success return strings{} +---@param fileName string +---@param loadIconsName boolean +---@return any iconNames +function RL.GuiLoadIcons( fileName, loadIconsName ) end + +---Draw icon +---@param iconId integer +---@param pos table +---@param pixelSize integer +---@param color table +---@return any RL.GuiDrawIcon +function RL.GuiDrawIcon( iconId, pos, pixelSize, color ) end + +-- Gui - Container/separator controls, useful for controls organization + +---Window Box control, shows a window that can be closed +---- Success return int +---@param bounds table +---@param title string|nil +---@return any result +function RL.GuiWindowBox( bounds, title ) end + +---Group Box control with text name +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiGroupBox( bounds, text ) end + +---Line separator control, could contain text +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiLine( bounds, text ) end + +---Panel control, useful to group controls +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiPanel( bounds, text ) end + +---Tab Bar control, returns TAB to be closed or -1 +---- Success return int, int +---@param bounds table +---@param text string +---@param active integer +---@return any result +---@return any active +function RL.GuiTabBar( bounds, text, active ) end + +---Scroll Panel control +---- Success return int, Vector2, Rectangle +---@param bounds table +---@param text string|nil +---@param content table +---@param scroll table +---@param view table +---@return any result +---@return any scroll +---@return any view +function RL.GuiScrollPanel( bounds, text, content, scroll, view ) end + +-- Gui - Basic controls set + +---Label control, shows text +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiLabel( bounds, text ) end + +---Button control, returns true when clicked +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiButton( bounds, text ) end + +---Label button control, show true when clicked +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiLabelButton( bounds, text ) end + +---Toggle Button control, returns true when active +---- Success return int, bool +---@param bounds table +---@param text string|nil +---@param active boolean +---@return any result +---@return any active +function RL.GuiToggle( bounds, text, active ) end + +---Toggle Group control, returns active toggle index +---- Success return int, int +---@param bounds table +---@param text string|nil +---@param active integer +---@return any result +---@return any active +function RL.GuiToggleGroup( bounds, text, active ) end + +---Toggle Slider control, returns true when clicked +---- Success return int, int +---@param bounds table +---@param text string|nil +---@param active integer +---@return any result +---@return any active +function RL.GuiToggleSlider( bounds, text, active ) end + +---Check Box control, returns true when active +---- Success return bool, Rectangle +---@param bounds table +---@param text string|nil +---@param checked boolean +---@return any result +---@return any checked +---@return any textBounds +function RL.GuiCheckBox( bounds, text, checked ) end + +---Combo Box control, returns selected item index +---- Success return int, int +---@param bounds table +---@param text string|nil +---@param active integer +---@return any result +---@return any active +function RL.GuiComboBox( bounds, text, active ) end + +---Dropdown Box control, returns selected item +---- Success return int, int +---@param bounds table +---@param text string +---@param active integer +---@param editMode boolean +---@return any result +---@return any active +function RL.GuiDropdownBox( bounds, text, active, editMode ) end + +---Spinner control, returns selected value +---- Success return int, int, Rectangle +---@param bounds table +---@param text string|nil +---@param value integer +---@param minValue integer +---@param maxValue integer +---@param editMode boolean +---@return any result +---@return any value +---@return any textBounds +function RL.GuiSpinner( bounds, text, value, minValue, maxValue, editMode ) end + +---Value Box control, updates input text with numbers +---- Success return int, int, Rectangle +---@param bounds table +---@param text string|nil +---@param value integer +---@param minValue integer +---@param maxValue integer +---@param editMode boolean +---@return any result +---@return any value +---@return any textBounds +function RL.GuiValueBox( bounds, text, value, minValue, maxValue, editMode ) end + +---Text Box control, updates input text +---- Success return int, string +---@param bounds table +---@param text string +---@param bufferSize integer +---@param editMode boolean +---@return any result +---@return any text +function RL.GuiTextBox( bounds, text, bufferSize, editMode ) end + +---Slider control, returns selected value +---- Success return int, float, Rectangle, Rectangle +---@param bounds table +---@param textLeft string|nil +---@param textRight string|nil +---@param value number +---@param minValue number +---@param maxValue number +---@return any result +---@return any value +---@return any textLeftBounds +---@return any textRightBounds +function RL.GuiSlider( bounds, textLeft, textRight, value, minValue, maxValue ) end + +---Slider Bar control, returns selected value +---- Success return int, float, Rectangle, Rectangle +---@param bounds table +---@param textLeft string|nil +---@param textRight string|nil +---@param value number +---@param minValue number +---@param maxValue number +---@return any result +---@return any value +---@return any textLeftBounds +---@return any textRightBounds +function RL.GuiSliderBar( bounds, textLeft, textRight, value, minValue, maxValue ) end + +---Progress Bar control, shows current progress value +---- Success return int, float, Rectangle, Rectangle +---@param bounds table +---@param textLeft string|nil +---@param textRight string|nil +---@param value number +---@param minValue number +---@param maxValue number +---@return any result +---@return any value +---@return any textLeftBounds +---@return any textRightBounds +function RL.GuiProgressBar( bounds, textLeft, textRight, value, minValue, maxValue ) end + +---Status Bar control, shows info text +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiStatusBar( bounds, text ) end + +---Dummy control for placeholders +---- Success return int +---@param bounds table +---@param text string|nil +---@return any result +function RL.GuiDummyRec( bounds, text ) end + +---Grid control, returns mouse cell position +---- Success return int, Vector2 +---@param bounds table +---@param text string|nil +---@param spacing number +---@param subdivs integer +---@param mouseCell table +---@return any result +---@return any mouseCell +function RL.GuiGrid( bounds, text, spacing, subdivs, mouseCell ) end + +---Scroll bar control +---- Success return int +---@param bounds table +---@param value integer +---@param minValue integer +---@param maxValue integer +---@return any value +function RL.GuiScrollBar( bounds, value, minValue, maxValue ) end + +-- Gui - Advance controls set + +---List View control, returns selected list item index +---- Success return int, int, int +---@param bounds table +---@param text string|nil +---@param scrollIndex integer +---@param active integer +---@return any result +---@return any scrollIndex +---@return any active +function RL.GuiListView( bounds, text, scrollIndex, active ) end + +---List View with extended parameters +---- Success return int, int, int, int +---@param bounds table +---@param text string +---@param scrollIndex integer +---@param active integer +---@param focus integer +---@return any result +---@return any scrollIndex +---@return any active +---@return any focus +function RL.GuiListViewEx( bounds, text, scrollIndex, active, focus ) end + +---Message Box control, displays a message +---- Success return int +---@param bounds table +---@param title string|nil +---@param message string +---@param buttons string +---@return any result +function RL.GuiMessageBox( bounds, title, message, buttons ) end + +---Text Input Box control, ask for text, supports secret +---- Success return int, string, bool +---@param bounds table +---@param title string +---@param message string +---@param buttons string +---@param text string +---@param textMaxSize integer +---@param secretViewActive boolean +---@return any result +---@return any text +---@return any secretViewActive +function RL.GuiTextInputBox( bounds, title, message, buttons, text, textMaxSize, secretViewActive ) end + +---Color Picker control (multiple color controls) +---- Success return int, Color +---@param bounds table +---@param text string|nil +---@param color table +---@return any result +---@return any color +function RL.GuiColorPicker( bounds, text, color ) end + +---Color Panel control +---- Success return int, Color +---@param bounds table +---@param text string|nil +---@param color table +---@return any result +---@return any color +function RL.GuiColorPanel( bounds, text, color ) end + +---Color Bar Alpha control +---- Success return int, float +---@param bounds table +---@param text string|nil +---@param alpha number +---@return any result +---@return any alpha +function RL.GuiColorBarAlpha( bounds, text, alpha ) end + +---Color Bar Hue control +---- Success return int, float +---@param bounds table +---@param text string|nil +---@param value number +---@return any result +---@return any value +function RL.GuiColorBarHue( bounds, text, value ) end + +---Color Picker control that avoids conversion to RGB on each call (multiple color controls) +---- Success return int, Vector3 +---@param bounds table +---@param text string|nil +---@param colorHsv table +---@return any result +---@return any colorHsv +function RL.GuiColorPickerHSV( bounds, text, colorHsv ) end + +---Color Panel control that returns HSV color value, used by GuiColorPickerHSV() +---- Success return int, Vector3 +---@param bounds table +---@param text string|nil +---@param colorHsv table +---@return any result +---@return any colorHsv +function RL.GuiColorPanelHSV( bounds, text, colorHsv ) end + +-- Lights - Light management functions + +---Create a light and get shader locations +---- Success return Light +---@param type integer +---@param position table +---@param target table +---@param color table +---@param shader any +---@return any light +function RL.CreateLight( type, position, target, color, shader ) end + +---Send light properties to shader +---@param shader any +---@param light any +---@return any RL.UpdateLightValues +function RL.UpdateLightValues( shader, light ) end + +---Set light type +---@param light any +---@param type integer +---@return any RL.SetLightType +function RL.SetLightType( light, type ) end + +---Set light position +---@param light any +---@param position table +---@return any RL.SetLightPosition +function RL.SetLightPosition( light, position ) end + +---Set light target +---@param light any +---@param target table +---@return any RL.SetLightTarget +function RL.SetLightTarget( light, target ) end + +---Set light color +---@param light any +---@param color table +---@return any RL.SetLightColor +function RL.SetLightColor( light, color ) end + +---Set light enabled +---@param light any +---@param enabled boolean +---@return any RL.SetLightEnabled +function RL.SetLightEnabled( light, enabled ) end + +---Get light type +---- Success return int +---@param light any +---@return any type +function RL.GetLightType( light ) end + +---Get light position +---- Success return Vector3 +---@param light any +---@return any position +function RL.GetLightPosition( light ) end + +---Get light target +---- Success return Vector3 +---@param light any +---@return any target +function RL.GetLightTarget( light ) end + +---Get light color +---- Success return Color +---@param light any +---@return any color +function RL.GetLightColor( light ) end + +---Get light enabled +---- Success return bool +---@param light any +---@return any enabled +function RL.IsLightEnabled( light ) end + +-- RLGL - Matrix operations + +---Choose the current matrix to be transformed +---@param mode integer +---@return any RL.rlMatrixMode +function RL.rlMatrixMode( mode ) end + +---Push the current matrix to stack +---@return any RL.rlPushMatrix +function RL.rlPushMatrix() end + +---Pop latest inserted matrix from stack +---@return any RL.rlPopMatrix +function RL.rlPopMatrix() end + +---Reset current matrix to identity matrix +---@return any RL.rlLoadIdentity +function RL.rlLoadIdentity() end + +---Multiply the current matrix by a translation matrix +---@param translation table +---@return any RL.rlTranslatef +function RL.rlTranslatef( translation ) end + +---Multiply the current matrix by a rotation matrix +---@param angle number +---@param rotation table +---@return any RL.rlRotatef +function RL.rlRotatef( angle, rotation ) end + +---Multiply the current matrix by a scaling matrix +---@param scale table +---@return any RL.rlScalef +function RL.rlScalef( scale ) end + +---Multiply the current matrix by another matrix +---@param matrix table +---@return any RL.rlMultMatrixf +function RL.rlMultMatrixf( matrix ) end + +---Multiply the current matrix by a perspective matrix generated by parameters +---@param left number +---@param right number +---@param bottom number +---@param top number +---@param znear number +---@param zfar number +---@return any RL.rlFrustum +function RL.rlFrustum( left, right, bottom, top, znear, zfar ) end + +---Multiply the current matrix by an orthographic matrix generated by parameters +---@param left number +---@param right number +---@param bottom number +---@param top number +---@param znear number +---@param zfar number +---@return any RL.rlOrtho +function RL.rlOrtho( left, right, bottom, top, znear, zfar ) end + +---Set the viewport area (transformation from normalized device coordinates to window coordinates) +---NOTE: We store current viewport dimensions +---@param viewport table +---@return any RL.rlViewport +function RL.rlViewport( viewport ) end + +---Set clip planes distances +---@param nearPlane number +---@param farPlane number +---@return any RL.rlSetClipPlanes +function RL.rlSetClipPlanes( nearPlane, farPlane ) end + +---Get cull plane distance near +---- Success return float +---@return any distance +function RL.rlGetCullDistanceNear() end + +---Get cull plane distance far +---- Success return float +---@return any distance +function RL.rlGetCullDistanceFar() end + +-- RLGL - Vertex level operations + +---Initialize drawing mode (how to organize vertex) +---@param mode integer +---@return any RL.rlBegin +function RL.rlBegin( mode ) end + +---Finish vertex providing +---@return any RL.rlEnd +function RL.rlEnd() end + +---Define one vertex (position) +---@param position table +---@return any RL.rlVertex2f +function RL.rlVertex2f( position ) end + +---Define one vertex (position) +---@param position table +---@return any RL.rlVertex3f +function RL.rlVertex3f( position ) end + +---Define one vertex (texture coordinate) - 2 float +---@param texCoord table +---@return any RL.rlTexCoord2f +function RL.rlTexCoord2f( texCoord ) end + +---Define one vertex (normal) - 3 float +---@param normal table +---@return any RL.rlNormal3f +function RL.rlNormal3f( normal ) end + +---Define one vertex (color) - 4 byte +---@param color table +---@return any RL.rlColor4ub +function RL.rlColor4ub( color ) end + +---Define one vertex (color) - 3 float +---@param color table +---@return any RL.rlColor3f +function RL.rlColor3f( color ) end + +---Define one vertex (color) - 4 float +---@param color table +---@return any RL.rlColor4f +function RL.rlColor4f( color ) end + +-- RLGL - Vertex buffers state + +---Enable vertex array (VAO, if supported) +---- Success return bool +---@param vaoId integer +---@return any supported +function RL.rlEnableVertexArray( vaoId ) end + +---Disable vertex array (VAO, if supported) +---@return any RL.rlDisableVertexArray +function RL.rlDisableVertexArray() end + +---Enable vertex buffer (VBO) +---- Failure return false +---- Success return true +---@param id integer +---@return any RL.rlEnableVertexBuffer +function RL.rlEnableVertexBuffer( id ) end + +---Disable vertex buffer (VBO) +---@return any RL.rlDisableVertexBuffer +function RL.rlDisableVertexBuffer() end + +---Enable vertex buffer element (VBO element) +---@param id integer +---@return any RL.rlEnableVertexBufferElement +function RL.rlEnableVertexBufferElement( id ) end + +---Disable vertex buffer element (VBO element) +---@return any RL.rlDisableVertexBufferElement +function RL.rlDisableVertexBufferElement() end + +---Enable vertex attribute index +---@param index integer +---@return any RL.rlEnableVertexAttribute +function RL.rlEnableVertexAttribute( index ) end + +---Disable vertex attribute index +---@param index integer +---@return any RL.rlDisableVertexAttribute +function RL.rlDisableVertexAttribute( index ) end + +---Enable attribute state pointer +---@param vertexAttribType integer +---@param buffer any +---@return any RL.rlEnableStatePointer +function RL.rlEnableStatePointer( vertexAttribType, buffer ) end + +---Disable attribute state pointer +---@param vertexAttribType integer +---@return any RL.rlDisableStatePointer +function RL.rlDisableStatePointer( vertexAttribType ) end + +-- RLGL - Textures state + +---Select and active a texture slot +---@param slot integer +---@return any RL.rlActiveTextureSlot +function RL.rlActiveTextureSlot( slot ) end + +---Enable texture +---@param id integer +---@return any RL.rlEnableTexture +function RL.rlEnableTexture( id ) end + +---Disable texture +---@return any RL.rlDisableTexture +function RL.rlDisableTexture() end + +---Enable texture cubemap +---@param id integer +---@return any RL.rlEnableTextureCubemap +function RL.rlEnableTextureCubemap( id ) end + +---Disable texture cubemap +---@return any RL.rlDisableTextureCubemap +function RL.rlDisableTextureCubemap() end + +---Set texture parameters (filter, wrap) +---@param id integer +---@param param integer +---@param value integer +---@return any RL.rlTextureParameters +function RL.rlTextureParameters( id, param, value ) end + +---Set cubemap parameters (filter, wrap) +---@param id integer +---@param param integer +---@param value integer +---@return any RL.rlCubemapParameters +function RL.rlCubemapParameters( id, param, value ) end + +-- RLGL - Shader state + +---Enable shader program +---@param id integer +---@return any RL.rlEnableShader +function RL.rlEnableShader( id ) end + +---Disable shader program +---@return any RL.rlDisableShader +function RL.rlDisableShader() end + +-- RLGL - Framebuffer state + +---Enable render texture (fbo) +---@param id integer +---@return any RL.rlEnableFramebuffer +function RL.rlEnableFramebuffer( id ) end + +---Disable render texture (fbo), return to default framebuffer +---@return any RL.rlDisableFramebuffer +function RL.rlDisableFramebuffer() end + +---Get the currently active render texture (fbo), 0 for default framebuffer +---- Success return int +---@return any framebuffer +function RL.rlGetActiveFramebuffer() end + +---Activate multiple draw color buffers +---@param count integer +---@return any RL.rlActiveDrawBuffers +function RL.rlActiveDrawBuffers( count ) end + +---Blit active framebuffer to main framebuffer +---@param srcRect table +---@param dstRect table +---@param bufferMask integer +---@return any RL.rlBlitFramebuffer +function RL.rlBlitFramebuffer( srcRect, dstRect, bufferMask ) end + +---Bind framebuffer (FBO) +---@param target integer +---@param framebuffer integer +---@return any RL.rlBindFramebuffer +function RL.rlBindFramebuffer( target, framebuffer ) end + +-- RLGL - General render state + +---Enable color blending +---@return any RL.rlEnableColorBlend +function RL.rlEnableColorBlend() end + +---Disable color blending +---@return any RL.rlDisableColorBlend +function RL.rlDisableColorBlend() end + +---Enable depth test +---@return any RL.rlEnableDepthTest +function RL.rlEnableDepthTest() end + +---Disable depth test +---@return any RL.rlDisableDepthTest +function RL.rlDisableDepthTest() end + +---Enable depth write +---@return any RL.rlEnableDepthMask +function RL.rlEnableDepthMask() end + +---Disable depth write +---@return any RL.rlDisableDepthMask +function RL.rlDisableDepthMask() end + +---Enable backface culling +---@return any RL.rlEnableBackfaceCulling +function RL.rlEnableBackfaceCulling() end + +---Disable backface culling +---@return any RL.rlDisableBackfaceCulling +function RL.rlDisableBackfaceCulling() end + +---Color mask control +---@param r boolean +---@param g boolean +---@param b boolean +---@param a boolean +---@return any RL.rlColorMask +function RL.rlColorMask( r, g, b, a ) end + +---Set face culling mode +---@param mode integer +---@return any RL.rlSetCullFace +function RL.rlSetCullFace( mode ) end + +---Enable scissor test +---@return any RL.rlEnableScissorTest +function RL.rlEnableScissorTest() end + +---Disable scissor test +---@return any RL.rlDisableScissorTest +function RL.rlDisableScissorTest() end + +---Scissor test +---@param area table +---@return any RL.rlScissor +function RL.rlScissor( area ) end + +---Enable wire mode +---@return any RL.rlEnableWireMode +function RL.rlEnableWireMode() end + +---Enable point mode +---@return any RL.rlEnablePointMode +function RL.rlEnablePointMode() end + +---Disable wire mode +---@return any RL.rlDisableWireMode +function RL.rlDisableWireMode() end + +---Set the line drawing width +---@param width number +---@return any RL.rlSetLineWidth +function RL.rlSetLineWidth( width ) end + +---Get the line drawing width +---- Success return float +---@return any width +function RL.rlGetLineWidth() end + +---Enable line aliasing +---@return any RL.rlEnableSmoothLines +function RL.rlEnableSmoothLines() end + +---Disable line aliasing +---@return any RL.rlDisableSmoothLines +function RL.rlDisableSmoothLines() end + +---Enable stereo rendering +---@return any RL.rlEnableStereoRender +function RL.rlEnableStereoRender() end + +---Enable stereo rendering +---@return any RL.rlDisableStereoRender +function RL.rlDisableStereoRender() end + +---Check if stereo render is enabled +---- Success return bool +---@return any enabled +function RL.rlIsStereoRenderEnabled() end + +---Clear color buffer with color +---@param color table +---@return any RL.rlClearColor +function RL.rlClearColor( color ) end + +---Clear used screen buffers (color and depth) +---@return any RL.rlClearScreenBuffers +function RL.rlClearScreenBuffers() end + +---Check and log OpenGL error codes +---@return any RL.rlCheckErrors +function RL.rlCheckErrors() end + +---Set blending mode +---@param mode integer +---@return any RL.rlSetBlendMode +function RL.rlSetBlendMode( mode ) end + +---Set blending mode factor and equation (using OpenGL factors) +---@param glSrcFactor integer +---@param glDstFactor integer +---@param glEquation integer +---@return any RL.rlSetBlendFactors +function RL.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 any RL.rlSetBlendFactorsSeparate +function RL.rlSetBlendFactorsSeparate( glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, glEqAlpha ) end + +-- RLGL - Initialization functions + +---Get current OpenGL version +---- Success return int +---@return any version +function RL.rlGetVersion() end + +---Set current framebuffer width +---@param width integer +---@return any version +function RL.rlSetFramebufferWidth( width ) end + +---Get default framebuffer width +---- Success return int +---@return any width +function RL.rlGetFramebufferWidth() end + +---Set current framebuffer height +---@param height integer +---@return any version +function RL.rlSetFramebufferHeight( height ) end + +---Get default framebuffer height +---- Success return int +---@return any height +function RL.rlGetFramebufferHeight() end + +---Get default texture id +---- Success return int +---@return any id +function RL.rlGetTextureIdDefault() end + +---Get default shader id +---- Success return int +---@return any id +function RL.rlGetShaderIdDefault() end + +---Get default shader locations +---- Success return int{} +---@return any locations +function RL.rlGetShaderLocsDefault() end + +-- RLGL - Render batch management + +---Load a render batch system +---- Success return rlRenderBatch +---@param numBuffers integer +---@param bufferElements integer +---@return any renderBatch +function RL.rlLoadRenderBatch( numBuffers, bufferElements ) end + +---Unload render batch system +---@param renderBatch any +---@return any RL.rlUnloadRenderBatch +function RL.rlUnloadRenderBatch( renderBatch ) end + +---Draw render batch data (Update->Draw->Reset) +---@param renderBatch any +---@return any RL.rlDrawRenderBatch +function RL.rlDrawRenderBatch( renderBatch ) end + +---Set the active render batch for rlgl (nil for default internal) +---@param renderBatch any +---@return any RL.rlSetRenderBatchActive +function RL.rlSetRenderBatchActive( renderBatch ) end + +---Update and draw internal render batch +---@return any RL.rlDrawRenderBatchActive +function RL.rlDrawRenderBatchActive() end + +---Check internal buffer overflow for a given number of vertex and force a rlRenderBatch draw call if required +---- Success return bool +---@param vCount integer +---@return any overflow +function RL.rlCheckRenderBatchLimit( vCount ) end + +---Set current texture for render batch and check buffers limits +---@param id integer +---@return any RL.rlSetTexture +function RL.rlSetTexture( id ) end + +-- RLGL - Vertex buffers management + +---Load vertex array (vao) if supported +---- Success return int +---@return any vaoId +function RL.rlLoadVertexArray() end + +---Load a vertex buffer attribute +---- Success return int +---@param buffer any +---@param dynamic boolean +---@return any vboId +function RL.rlLoadVertexBuffer( buffer, dynamic ) end + +---Load a new attributes element buffer +---- Success return int +---@param buffer any +---@param dynamic boolean +---@return any vboId +function RL.rlLoadVertexBufferElement( buffer, dynamic ) end + +---Update GPU buffer with new data +---@param bufferId integer +---@param buffer any +---@param offset integer +---@return any RL.rlUpdateVertexBuffer +function RL.rlUpdateVertexBuffer( bufferId, buffer, offset ) end + +---Update vertex buffer elements with new data +---@param id integer +---@param buffer any +---@param offset integer +---@return any RL.rlUpdateVertexBufferElements +function RL.rlUpdateVertexBufferElements( id, buffer, offset ) end + +---Unload vertex array object (VAO) +---@param vaoId integer +---@return any RL.rlUnloadVertexArray +function RL.rlUnloadVertexArray( vaoId ) end + +---Unload vertex buffer (VBO) +---@param vboId integer +---@return any RL.rlUnloadVertexBuffer +function RL.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 any RL.rlSetVertexAttribute +function RL.rlSetVertexAttribute( index, compSize, type, normalized, stride, offset ) end + +---Set vertex attribute divisor +---@param index integer +---@param divisor integer +---@return any RL.rlSetVertexAttributeDivisor +function RL.rlSetVertexAttributeDivisor( index, divisor ) end + +---Set vertex attribute default value +---@param locIndex integer +---@param value table +---@param attribType integer +---@return any RL.rlSetVertexAttributeDefault +function RL.rlSetVertexAttributeDefault( locIndex, value, attribType ) end + +---Draw vertex array +---@param offset integer +---@param count integer +---@return any RL.rlDrawVertexArray +function RL.rlDrawVertexArray( offset, count ) end + +---Draw vertex array elements +---@param offset integer +---@param count integer +---@param buffer any +---@return any RL.rlDrawVertexArrayElements +function RL.rlDrawVertexArrayElements( offset, count, buffer ) end + +---Draw vertex array instanced +---@param offset integer +---@param count integer +---@param instances integer +---@return any RL.rlDrawVertexArrayInstanced +function RL.rlDrawVertexArrayInstanced( offset, count, instances ) end + +---Draw vertex array elements instanced +---@param offset integer +---@param count integer +---@param buffer any +---@param instances integer +---@return any RL.rlDrawVertexArrayElementsInstanced +function RL.rlDrawVertexArrayElementsInstanced( offset, count, buffer, instances ) end + +-- RLGL - Textures management + +---Load texture in GPU +---- Success return int +---@param data any +---@param size table +---@param format integer +---@param mipmapCount integer +---@return any id +function RL.rlLoadTexture( data, size, format, mipmapCount ) end + +---Load depth texture/renderbuffer (to be attached to fbo) +---- Success return int +---@param size table +---@param useRenderBuffer boolean +---@return any id +function RL.rlLoadTextureDepth( size, useRenderBuffer ) end + +---Load texture cubemap data +---- Success return int +---@param data any +---@param size integer +---@param format integer +---@param mipmapCount integer +---@return any id +function RL.rlLoadTextureCubemap( data, size, format, mipmapCount ) end + +---Update GPU texture with new data +---@param id integer +---@param offset table +---@param size table +---@param format integer +---@param data any +---@return any RL.rlUpdateTexture +function RL.rlUpdateTexture( id, offset, size, format, data ) end + +---Get OpenGL internal formats +---- Success return int, int, int +---@param format integer +---@return any glInternalFormat +---@return any glFormat +---@return any glType +function RL.rlGetGlTextureFormats( format ) end + +---Get name string for pixel format +---- Success return string +---@param format integer +---@return any name +function RL.rlGetPixelFormatName( format ) end + +---Unload texture from GPU memory +---@param id integer +---@return any RL.rlUnloadTexture +function RL.rlUnloadTexture( id ) end + +---Generate mipmap data for selected texture +---- Success return int +---@param id integer +---@param size table +---@param format integer +---@return any mipmapCount +function RL.rlGenTextureMipmaps( id, size, format ) end + +---Read texture pixel data +---- Success return Buffer +---@param id integer +---@param size table +---@param format integer +---@return any data +function RL.rlReadTexturePixels( id, size, format ) end + +---Read screen pixel data (color buffer) +---- Success return Buffer +---@param size table +---@return any data +function RL.rlReadScreenPixels( size ) end + +-- RLGL - Framebuffer management (fbo) + +---Load an empty framebuffer +---- Success return int +---@return any fboId +function RL.rlLoadFramebuffer() end + +---Attach texture/renderbuffer to a framebuffer +---@param fboId integer +---@param texId integer +---@param attachType integer +---@param texType integer +---@param mipLevel integer +---@return any RL.rlFramebufferAttach +function RL.rlFramebufferAttach( fboId, texId, attachType, texType, mipLevel ) end + +---Verify framebuffer is complete +---- Success return bool +---@param id integer +---@return any isComplete +function RL.rlFramebufferComplete( id ) end + +---Delete framebuffer from GPU +---@param id integer +---@return any RL.rlUnloadFramebuffer +function RL.rlUnloadFramebuffer( id ) end + +-- RLGL - Shaders management + +---Load shader from code strings +---- Success return int +---@param vsCode string +---@param fsCode string +---@return any shaderId +function RL.rlLoadShaderCode( vsCode, fsCode ) end + +---Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER) +---- Success return int +---@param shaderCode string +---@param type integer +---@return any shaderId +function RL.rlCompileShader( shaderCode, type ) end + +---Load custom shader program +---- Success return int +---@param vShaderId integer +---@param fShaderId integer +---@return any shaderProgramId +function RL.rlLoadShaderProgram( vShaderId, fShaderId ) end + +---Unload shader program +---@param id integer +---@return any RL.rlUnloadShaderProgram +function RL.rlUnloadShaderProgram( id ) end + +---Get shader location uniform +---- Success return int +---@param shaderId integer +---@param uniformName string +---@return any location +function RL.rlGetLocationUniform( shaderId, uniformName ) end + +---Get shader location attribute +---- Success return int +---@param shaderId integer +---@param attribName string +---@return any location +function RL.rlGetLocationAttrib( shaderId, attribName ) end + +---Set shader value uniform +---@param locIndex integer +---@param value any +---@param uniformType integer +---@param count integer +---@return any RL.rlSetUniform +function RL.rlSetUniform( locIndex, value, uniformType, count ) end + +---Set shader value matrix +---@param locIndex integer +---@param mat table +---@return any RL.rlSetUniformMatrix +function RL.rlSetUniformMatrix( locIndex, mat ) end + +---Set shader value matrices +---@param locIndex integer +---@param mat table +---@return any RL.rlSetUniformMatrices +function RL.rlSetUniformMatrices( locIndex, mat ) end + +---Set shader value sampler +---@param locIndex integer +---@param textureId integer +---@return any RL.rlSetUniformSampler +function RL.rlSetUniformSampler( locIndex, textureId ) end + +---Set shader currently active (id and locations) +---@param id integer +---@param locs table +---@return any RL.rlSetShader +function RL.rlSetShader( id, locs ) end + +-- RLGL - Compute shader management + +---Load compute shader program +---- Success return int +---@param shaderId integer +---@return any programId +function RL.rlLoadComputeShaderProgram( shaderId ) end + +---Dispatch compute shader (equivalent to *draw* for graphics pipeline) +---@param groupX integer +---@param groupY integer +---@param groupZ integer +---@return any RL.rlComputeShaderDispatch +function RL.rlComputeShaderDispatch( groupX, groupY, groupZ ) end + +-- RLGL - Shader buffer storage object management (ssbo) + +---Load shader storage buffer object (SSBO) +---- Success return int +---@param size integer +---@param data any +---@param usageHint integer +---@return any buffer +function RL.rlLoadShaderBuffer( size, data, usageHint ) end + +---Unload shader storage buffer object (SSBO) +---@param ssboId integer +---@return any RL.rlUnloadShaderBuffer +function RL.rlUnloadShaderBuffer( ssboId ) end + +---Update SSBO buffer data +---@param id integer +---@param data any +---@param offset integer +---@return any RL.rlUpdateShaderBuffer +function RL.rlUpdateShaderBuffer( id, data, offset ) end + +---Bind SSBO buffer +---@param id integer +---@param index integer +---@return any RL.rlBindShaderBuffer +function RL.rlBindShaderBuffer( id, index ) end + +---Read SSBO buffer data (GPU->CPU) +---- Success return Buffer +---@param id integer +---@param count integer +---@param offset integer +---@return any data +function RL.rlReadShaderBuffer( id, count, offset ) end + +---Copy SSBO data between buffers +---@param destId integer +---@param srcId integer +---@param destOffset integer +---@param srcOffset integer +---@param count integer +---@return any RL.rlCopyShaderBuffer +function RL.rlCopyShaderBuffer( destId, srcId, destOffset, srcOffset, count ) end + +---Get SSBO buffer size +---- Success return int +---@param id integer +---@return any size +function RL.rlGetShaderBufferSize( id ) end + +-- RLGL - Buffer management + +---Bind image texture +---@param id integer +---@param index integer +---@param format integer +---@param readonly boolean +---@return any RL.rlBindImageTexture +function RL.rlBindImageTexture( id, index, format, readonly ) end + +-- RLGL - Matrix state management + +---Get internal modelview matrix +---- Success return Matrix +---@return any modelview +function RL.rlGetMatrixModelview() end + +---Get internal projection matrix +---- Success return Matrix +---@return any projection +function RL.rlGetMatrixProjection() end + +---Get internal accumulated transform matrix +---- Success return Matrix +---@return any transform +function RL.rlGetMatrixTransform() end + +---Get internal projection matrix for stereo render (selected eye) +---- Success return Matrix +---@param eye integer +---@return any projection +function RL.rlGetMatrixProjectionStereo( eye ) end + +---Get internal view offset matrix for stereo render (selected eye) +---- Success return Matrix +---@param eye integer +---@return any viewOffset +function RL.rlGetMatrixViewOffsetStereo( eye ) end + +---Set a custom projection matrix (replaces internal projection matrix) +---@param proj table +---@return any RL.rlSetMatrixProjection +function RL.rlSetMatrixProjection( proj ) end + +---Set a custom modelview matrix (replaces internal modelview matrix) +---@param view table +---@return any RL.rlSetMatrixModelview +function RL.rlSetMatrixModelview( view ) end + +---Set eyes projection matrices for stereo rendering +---@param right table +---@param left table +---@return any RL.rlSetMatrixProjectionStereo +function RL.rlSetMatrixProjectionStereo( right, left ) end + +---Set eyes view offsets matrices for stereo rendering +---@param right table +---@param left table +---@return any RL.rlSetMatrixViewOffsetStereo +function RL.rlSetMatrixViewOffsetStereo( right, left ) end + +-- OpenGL - Rendering + +---Clear buffers to preset values +---@param mask integer +---@return any RL.glClear +function RL.glClear( mask ) end + +-- OpenGL - Frame Buffers + +---Copy a block of pixels from one framebuffer object to another. +---Use nil RenderTexture for window framebuffer +---@param srcTex any +---@param dstTex any +---@param srcRect table +---@param dstRect table +---@param mask integer +---@param filter integer +---@return any RL.glBlitFramebuffer +function RL.glBlitFramebuffer( srcTex, dstTex, srcRect, dstRect, mask, filter ) end + +-- OpenGL - State Management + +---Specify mapping of depth values from normalized device coordinates to window coordinates +---@param nearVal number +---@param farVal number +---@return any RL.glDepthRange +function RL.glDepthRange( nearVal, farVal ) end + +---Enable server-side GL capabilities +---@param cap integer +---@return any RL.glEnable +function RL.glEnable( cap ) end + +---Disable server-side GL capabilities +---@param cap integer +---@return any RL.glDisable +function RL.glDisable( cap ) end + +---Set the scale and units used to calculate depth values +---@param factor number +---@param units number +---@return any RL.glPolygonOffset +function RL.glPolygonOffset( factor, units ) end + +---Set front and back function and reference value for stencil testing +---@param func integer +---@param ref integer +---@param mask integer +---@return any RL.glStencilFunc +function RL.glStencilFunc( func, ref, mask ) end + +---Set front and/or back function and reference value for stencil testing +---@param face integer +---@param func integer +---@param ref integer +---@param mask integer +---@return any RL.glStencilFuncSeparate +function RL.glStencilFuncSeparate( face, func, ref, mask ) end + +---Control the front and back writing of individual bits in the stencil planes +---@param mask integer +---@return any RL.glStencilMask +function RL.glStencilMask( mask ) end + +---Control the front and/or back writing of individual bits in the stencil planes +---@param face integer +---@param mask integer +---@return any RL.glStencilMaskSeparate +function RL.glStencilMaskSeparate( face, mask ) end + +---Set front and back stencil test actions +---@param sfail integer +---@param dpfail integer +---@param dppass integer +---@return any RL.glStencilOp +function RL.glStencilOp( sfail, dpfail, dppass ) end + +---Set front and back stencil test actions +---@param face integer +---@param sfail integer +---@param dpfail integer +---@param dppass integer +---@return any RL.glStencilOpSeparate +function RL.glStencilOpSeparate( face, sfail, dpfail, dppass ) end + +-- OpenGL - Utility + +---Return a string describing the current GL connection. GL_EXTENSIONS returns the extension string supported by the implementation at index +---- Success return string +---@param name integer +---@param index integer|nil +---@return any connection +function RL.glGetString( name, index ) end + +-- Easings - Linear Easing functions + +---Ease linear +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseLinear( t, b, c, d ) end + +-- Easings - Sine Easing functions + +---Ease sine in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseSineIn( t, b, c, d ) end + +---Ease sine out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseSineOut( t, b, c, d ) end + +---Ease sine in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseSineInOut( t, b, c, d ) end + +-- Easings - Circular Easing functions + +---Ease circle in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseCircIn( t, b, c, d ) end + +---Ease circle out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseCircOut( t, b, c, d ) end + +---Ease circle in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseCircInOut( t, b, c, d ) end + +-- Easings - Cubic Easing functions + +---Ease cubic in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseCubicIn( t, b, c, d ) end + +---Ease cubic out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseCubicOut( t, b, c, d ) end + +---Ease cubic in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseCubicInOut( t, b, c, d ) end + +-- Easings - Quadratic Easing functions + +---Ease quadratic in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseQuadIn( t, b, c, d ) end + +---Ease quadratic out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseQuadOut( t, b, c, d ) end + +---Ease quadratic in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseQuadInOut( t, b, c, d ) end + +-- Easings - Exponential Easing functions + +---Ease exponential in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseExpoIn( t, b, c, d ) end + +---Ease exponential out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseExpoOut( t, b, c, d ) end + +---Ease exponential in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseExpoInOut( t, b, c, d ) end + +-- Easings - Back Easing functions + +---Ease back in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseBackIn( t, b, c, d ) end + +---Ease back out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseBackOut( t, b, c, d ) end + +---Ease back in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseBackInOut( t, b, c, d ) end + +-- Easings - Bounce Easing functions + +---Ease bounce in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseBounceIn( t, b, c, d ) end + +---Ease bounce out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseBounceOut( t, b, c, d ) end + +---Ease bounce in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseBounceInOut( t, b, c, d ) end + +-- Easings - Elastic Easing functions + +---Ease elastic in +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseElasticIn( t, b, c, d ) end + +---Ease elastic out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseElasticOut( t, b, c, d ) end + +---Ease elastic in out +---- Success return float +---@param t number +---@param b number +---@param c number +---@param d number +---@return any value +function RL.EaseElasticInOut( t, b, c, d ) end + +-- Bitwise Operations - Arithmetic + +---Equivalent to a & b in C +---- Success return int +---@param a integer +---@param b integer +---@return any result +function RL.BitAnd( a, b ) end + +---Equivalent to a | b in C +---- Success return int +---@param a integer +---@param b integer +---@return any result +function RL.BitOr( a, b ) end + +---Equivalent to a ^ b in C +---- Success return int +---@param a integer +---@param b integer +---@return any result +function RL.BitXor( a, b ) end + +---Equivalent to ~v in C +---- Success return int +---@param v integer +---@return any result +function RL.BitNot( v ) end + +---Equivalent to v << n in C +---- Success return int +---@param v integer +---@param n integer +---@return any result +function RL.BitShiftLeft( v, n ) end + +---Equivalent to v >> n in C +---- Success return int +---@param v integer +---@param n integer +---@return any result +function RL.BitShiftRight( v, n ) end + +---Set bit in index i to state b in value v +---- Success return int +---@param v integer +---@param i integer +---@param b boolean +---@return any result +function RL.BitSet( v, i, b ) end + +---Get bit in index i from value v +---- Success return bool +---@param v integer +---@param i integer +---@return any bit +function RL.BitGet( v, i ) end + +---Toggle bit in index i in value v +---- Success return int +---@param v integer +---@param i integer +---@return any result +function RL.BitToggle( v, i ) end + +-- GLFW Core - Input-related functions: keyboard + +---This function returns the name of the specified printable key, encoded as UTF-8. +---If the key is KEY_UNKNOWN, the scancode is used to identify the key, +---otherwise the scancode is ignored. If you specify a non-printable key, +---or KEY_UNKNOWN and a scancode that maps to a non-printable key, +---this function returns nil but does not emit an error. +---- Success return string or nil +---@param key integer +---@param scancode integer +---@return any keyName +function RL.GetKeyName( key, scancode ) end + +---This function returns the platform-specific scancode of the specified key. +---If the key is KEY_UNKNOWN or does not exist on the keyboard this method will return -1. +---- Success return int +---@param key integer +---@return any scancode +function RL.GetKeyScancode( key ) end + diff --git a/tools/apiScanner.lua b/tools/apiScanner.lua new file mode 100644 index 0000000..88a27cf --- /dev/null +++ b/tools/apiScanner.lua @@ -0,0 +1,177 @@ +local raylib = { + prefix = "RLAPI", + file = "raylib.h", + blacklist = { + GetScreenWidth = "Replaced by GetScreenSize", + GetScreenHeight = "Replaced by GetScreenSize", + GetRenderWidth = "Replaced by GetRenderSize", + GetRenderHeight = "Replaced by GetRenderSize", + GetMonitorWidth = "Replaced by GetMonitorSize", + GetMonitorHeight = "Replaced by GetMonitorSize", + GetMonitorPhysicalWidth = "Replaced by GetMonitorPhysicalSize", + GetMonitorPhysicalHeight = "Replaced by GetMonitorPhysicalSize", + UnloadRandomSequence = "Handled internally", + MemAlloc = "Buffer should be used instead", + MemRealloc = "Buffer should be used instead", + MemFree = "Buffer should be used instead", + SetTraceLogCallback = "Handled internally", + SetLoadFileDataCallback = "Not seen necessary", + SetSaveFileDataCallback = "Not seen necessary", + SetLoadFileTextCallback = "Not seen necessary", + SetSaveFileTextCallback = "Not seen necessary", + UnloadFileData = "Handled internally", + UnloadFileText = "Handled internally", + UnloadDirectoryFiles = "Handled internally", + UnloadDroppedFiles = "Handled internally", + GetMouseX = "Replaced by GetMousePosition", + GetMouseY = "Replaced by GetMousePosition", + GetTouchX = "Replaced by GetTouchPosition", + GetTouchY = "Replaced by GetTouchPosition", + UpdateCamera = "Replaced by UpdateCamera3D", + UpdateCameraPro = "Replaced by UpdateCameraPro3D", + DrawPixelV = "Replaced by DrawPixel", + DrawLineV = "Replaced by DrawLine", + DrawLineEx = "Replaced by DrawLine", + DrawCircleV = "Replaced by DrawCircle", + DrawCircleLinesV = "Replaced by DrawCircleLines", + DrawRectangleV = "Replaced by DrawRectangle", + DrawRectangleRec = "Replaced by DrawRectangle", + UnloadImageColors = "Handled internally", + UnloadImagePalette = "Handled internally", + ImageDrawPixelV = "Replaced by ImageDrawPixel", + ImageDrawLineV = "Replaced by ImageDrawLine", + ImageDrawCircleV = "Replaced by ImageDrawCircle", + ImageDrawCircleLinesV = "Replaced by ImageDrawCircleLines", + ImageDrawRectangleV = "Replaced by ImageDrawRectangle", + ImageDrawRectangleRec = "Replaced by ImageDrawRectangle", + DrawTextureV = "Replaced by DrawTexture", + UnloadFontData = "Handled internally", + UnloadUTF8 = "Handled internally", + UnloadCodepoints = "Handled internally", + TextCopy = "Can be replaced by Lua equivalent", + TextIsEqual = "Can be replaced by Lua equivalent", + TextLength = "Can be replaced by Lua equivalent", + TextFormat = "Can be replaced by Lua equivalent", + TextJoin = "Can be replaced by Lua equivalent", + TextAppend = "Can be replaced by Lua equivalent", + TextToUpper = "Can be replaced by Lua equivalent", + TextToLower = "Can be replaced by Lua equivalent", + TextToInteger = "Can be replaced by Lua equivalent", + TextToFloat = "Can be replaced by Lua equivalent", + DrawCubeV = "Replaced by DrawCube", + DrawCubeWiresV = "Replaced by DrawCubeWires", + UploadMesh = "Handled internally", + UpdateMeshBuffer = "Handled internally", + UnloadWaveSamples = "Handled internally", + GetPixelColor = "Not seen necessary", + SetPixelColor = "Not seen necessary", + }, + info = { + } +} +local rlgl = { + prefix = "RLAPI", + file = "rlgl.h", + blacklist = { + rlVertex2i = "Most likely not needed", + rlglInit = "Handled internally", + rlglClose = "Handled internally", + rlLoadExtensions = "Handled internally", + rlLoadDrawCube = "Most likely not needed", + rlLoadDrawQuad = "Most likely not needed", + }, + info = { + rlEnableStatePointer = "Available for GRAPHICS_API_OPENGL_11", + rlDisableStatePointer = "Available for GRAPHICS_API_OPENGL_11", + }, +} +local raygui = { + prefix = "RAYGUIAPI", + file = "raygui.h", + blacklist = { + }, + info = { + }, +} +local raymath = { + prefix = "RMAPI", + file = "raymath.h", + blacklist = { + Vector3ToFloatV = "Can be replaced by Lua equivalent", + MatrixToFloatV = "Can be replaced by Lua equivalent", + }, + info = { + }, +} +local easings = { + prefix = "EASEDEF", + file = "easings.h", + blacklist = { + EaseLinearNone = "Replaced by EaseLinear", + EaseLinearIn = "Replaced by EaseLinear", + EaseLinearOut = "Replaced by EaseLinear", + EaseLinearInOut = "Replaced by EaseLinear", + }, + info = { + }, +} + +local filePrefix = "../include/" +local headers = { + raylib, + rlgl, + raygui, + raymath, + easings, +} + +if RL.arg[4] == "--help" then + print( "You can get blacklisted functions with argument '--blacklist'. Give additional argument to find specific function." ) + return +end + +for _, header in ipairs( headers ) do + if RL.arg[4] == "--blacklist" then + if RL.arg[5] == nil then + print( "\nFunctions blacklisted from '"..header.file.."':\n" ) + + for func, info in pairs( header.blacklist ) do + print( func.."\t\""..info.."\"" ) + end + else + for func, info in pairs( header.blacklist ) do + if func:lower() == RL.arg[5]:lower() then + print( "\nFunction '"..func.."' blacklisted from '"..header.file.."'\t\""..info.."\"\n" ) + end + end + end + else + local file = io.open( filePrefix..header.file, "r" ) + + if file ~= nil then + local line = "" + + print( "\nFunctions not implemented from '"..header.file.."':\n" ) + + repeat + line = file:read( "*l" ) + + if line ~= nil and line:sub( 1, #header.prefix ) == header.prefix then + local splits = RL.TextSplit( line:sub( 1, RL.TextFindIndex( line, "(" ) ), " " ) + local func = splits[ #splits ] + func = func:gsub( "*", "" ) + + if RL[ func ] == nil and not header.blacklist[ func ] then + local output = func + + if header.info[ func ] ~= nil then + output = output.."\t\""..header.info[ func ].."\"" + end + + print( output ) + end + end + until line == nil + end + end +end diff --git a/tools/docgen.lua b/tools/docgen.lua new file mode 100644 index 0000000..6b01765 --- /dev/null +++ b/tools/docgen.lua @@ -0,0 +1,457 @@ +--[[ + Create api.md and ReiLua_API.lua files from c sources. + + To generate API for other platforms you need to change sourceFiles. +]]-- + +-- Export each module as separate .md file. Does not affect on ReiLua_API.lua file. +local separate = false + +if arg ~= nil and arg[1] ~= nil and arg[1] == "-s" then + separate = true +end + +local function split( str, sep ) + if sep == nil then + sep = "%s" + end + + local t = {} + + for str in string.gmatch( str, "([^"..sep.."]+)" ) do + table.insert( t, str ) + end + + return t +end + +local function getParamType( param ) + if param == "Color" or param == "Vector2" or param == "Vector3" or param == "Vector4" + or param == "Quaternion" or param == "Matrix" or param == "Rectangle" then + return "table" + elseif param == "float" then return "number" + elseif param == "int" then return "integer" + elseif param == "string" then return "string" + elseif param == "bool" then return "boolean" + elseif param == "nil" then return "nil" + elseif param:sub( #param - 1, #param ) == "{}" then return "table" + else + return "any" + end +end + +local function getParam( param ) + local text = "" + local params = split( param, "|" ) + + for i, p in ipairs( params ) do + text = text..getParamType( p ) + + if i < #params then + text = text.."|" + end + end + + return text +end + +local function parseFunction( line ) + local splitted = split( line, "(" ) + local parString = splitted[2]:sub(2) + parString = parString:sub( 1, #parString - 2 ) + local parameters = split( parString, "," ) + local str = "" + local parStr = "" + + for i, par in ipairs( parameters ) do + local sepPar = split( par, " " ) + parStr = parStr..sepPar[2] + str = str.."---@param "..sepPar[2].." " + -- str = str..getParamType( sepPar[1] ).."\n" + str = str..getParam( sepPar[1] ).."\n" + + if i < #parameters then + parStr = parStr..", " + end + end + + local returnsAndFuncName = split( splitted[1], "=" ) + + for i, ret in ipairs( split( returnsAndFuncName[1]:sub(3), "," ) ) do + if ret:sub( 1, 1 ) == " " then + ret = ret:sub(2) + end + + str = str.."---@return any "..ret.."\n" + end + + str = str.."function "..returnsAndFuncName[ #returnsAndFuncName ]:sub(2) + + if parStr ~= "" then + str = str.."( "..parStr.." )" + else + str = str.."()" + end + + return str.." end\n" +end + +local apiFile = io.open( "../API.md", "w" ) +local luaApiFile = io.open( "../ReiLua_API.lua", "w" ) + +-- Header +apiFile:write( "# ReiLua API\n" ) + +-- Usage. + +apiFile:write( "\n## Functions\n" ) +apiFile:write( "\nApplication needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where \"main.lua\" is located can be given as argument. There are seven Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', 'RL.exit' and 'RL.config'.\n" ) + +local FUNC_DESC = { + init = "This function will be called after window has been initialized. Should be used as the main init point.", + update = "This function will be called every frame during execution. It will get time duration from last frame on argument 'delta'", + draw = "This function will be called every frame after update and it should have all rendering related functions. Note: Engine will call Raylib functions 'BeginDrawing()' before this function call and 'EndDrawing()' after it. You can still use RL.BeginDrawing() and RL.EndDrawing() manually from anywhere.", + event = "This function will be called on events input. Content of event table is determined by event type.", + log = "This function can be used for custom log message handling.", + exit = "This function will be called on program close. Cleanup could be done here.", + config = "This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point.", + load = "This function will be called when loading resource that allocates memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures.", + unload = "This function will be called when unloading resource that has allocated memory. Usefull for memory leak debugging. Note! Cannot detect all resources, for example material textures.", +} + +apiFile:write( "\n---\n> function RL.init()\n\n"..FUNC_DESC.init.."\n\n---\n" ) +apiFile:write( "\n> function RL.update( delta )\n\n"..FUNC_DESC.update.."\n\n---\n" ) +apiFile:write( "\n> function RL.draw()\n\n"..FUNC_DESC.draw.."\n\n---\n" ) +apiFile:write( "\n> function RL.event( event )\n\n"..FUNC_DESC.event.."\n\n---\n" ) +apiFile:write( "\n> function RL.log( logLevel, message )\n\n"..FUNC_DESC.log.."\n\n---\n" ) +apiFile:write( "\n> function RL.exit()\n\n"..FUNC_DESC.exit.."\n\n---\n" ) +apiFile:write( "\n> function RL.config()\n\n"..FUNC_DESC.config.."\n\n---\n" ) +apiFile:write( "\n> function RL.load()\n\n"..FUNC_DESC.load.."\n\n---\n" ) +apiFile:write( "\n> function RL.unload()\n\n"..FUNC_DESC.unload.."\n\n---\n" ) + +luaApiFile:write( "-- Put this file into your project folder to provide annotations when using Lua language server.\n\n" ) +luaApiFile:write( "RL={}\n\n" ) +luaApiFile:write( "-- Functions.\n\n" ) + +luaApiFile:write( +"---"..FUNC_DESC.init.."\nfunction RL.init() end\n" ) +luaApiFile:write( +"---"..FUNC_DESC.update.."\n---@param delta number\nfunction RL.update( delta ) end\n" ) +luaApiFile:write( +"---"..FUNC_DESC.draw.."\nfunction RL.draw() end\n" ) +luaApiFile:write( +"---"..FUNC_DESC.event.."\n---@param event table\nfunction RL.event( event ) end\n" ) +luaApiFile:write( +"---"..FUNC_DESC.log.."\n---@param logLevel integer\n---@param message string\nfunction RL.log( logLevel, message ) end\n" ) +luaApiFile:write( +"---"..FUNC_DESC.exit.."\nfunction RL.exit() end\n" ) +luaApiFile:write( +"---"..FUNC_DESC.config.."\nfunction RL.config() end\n" ) + +-- Object unloading. + +apiFile:write( "\n## Object unloading\n" ) +apiFile:write( "\nSome objects allocate memory that needs to be freed when object is no longer needed. By default objects like Textures are unloaded by the Lua garbage collector. It is generatty however recommended to handle this manually in more complex projects. You can change the behavior with SetGCUnload.\n" ) + +-- Arguments. + +apiFile:write( "\n## Arguments\n" ) +apiFile:write( "\nArguments are stored in 'RL.arg' array.\n" ) + +-- Structures. + +apiFile:write( "\n## Structures\n\ +Raylib structs in Lua\n\n---\n" ) + +apiFile:write( "\n> Vector2 = { 1.0, 1.0 } or { x = 1.0, y = 1.0 }\n\ +Vector2, 2 components\n\n---\n" ) +apiFile:write( "\n> Vector3 = { 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0 }\n\ +Vector3, 3 components\n\n---\n" ) +apiFile:write( "\n> Vector4 = { 1.0, 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0, w = 1.0 }\n\ +Vector4, 4 components\n\n---\n" ) +apiFile:write( "\n> Quaternion = { 0.0, 0.0, 0.0, 1.0 } or { x = 0.0, y = 0.0, z = 0.0, w = 1.0 }\n\ +Quaternion, 4 components (Vector4 alias)\n\n---\n" ) +apiFile:write( "\n> Matrix = { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } }\n\ +Matrix, 4x4 components, column major, OpenGL style, right-handed. Identity matrix example\n\n---\n" ) +apiFile:write( "\n> Color = { 255, 255, 255, 255 } or { r = 255, g = 255, b = 255, a = 255 }\n\ +Color, 4 components, R8G8B8A8 (32bit)\n\n---\n" ) +apiFile:write( "\n> Rectangle = { 0.0, 0.0, 1.0, 1.0 } or { x = 0.0, y = 0.0, width = 1.0, height = 1.0 }\n\ +Rectangle, 4 components\n\n---\n" ) +apiFile:write( "\n> Image = Userdata\n\ +Image, pixel data stored in CPU memory (RAM)\n\n---\n" ) +apiFile:write( "\n> Texture = Userdata\n\ +Texture, tex data stored in GPU memory (VRAM)\ +```\ +textureData = {\ + id = unsigned int, --OpenGL texture id\ + width = int, --Texture base width\ + height = int, --Texture base height\ + mipmaps = int, --Mipmap levels, 1 by default\ + format = int --Data format (PixelFormat type)\ +}\ +```\n\n---\n" ) +apiFile:write( "\n> RenderTexture = Userdata\n\ +RenderTexture, fbo for texture rendering\ +```\ +renderTextureData = {\ + id = unsigned int, --OpenGL framebuffer object id\ + texture = Texture, --Color buffer attachment texture\ + depth = Texture, --Depth buffer attachment texture\ +}\ +```\n\n---\n" ) +apiFile:write( "\n> Font = Userdata\n\ +Font, font texture and GlyphInfo array data\n\n---\n" ) +apiFile:write( "\n> Camera2D = Userdata\n\ +Camera2D, defines position/orientation in 2d space\n\n---\n" ) +apiFile:write( "\n> Camera3D = Userdata\n\ +Camera, defines position/orientation in 3d space\n\n---\n" ) +apiFile:write( "\n> Mesh = Userdata\n\ +Mesh, vertex data and vao/vbo\n\ +```\ +meshData = {\ + vertices = Vector3{}, --Vertex position (XYZ - 3 components per vertex) (shader-location = 0)\ + texcoords = Vector2{}, --Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)\ + texcoords2 = Vector2{}, --Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)\ + normals = Vector3{}, --Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)\ + tangents = Vector4{}, --Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)\ + colors = Color{}, --Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)\ + indices = int{} --Vertex indices (in case vertex data comes indexed)\ +}\ +```\n\n---\n" ) +apiFile:write( "\n> Material = Userdata\n\ +Material, includes shader and maps\n\ +```\ +materialData = {\ + shader = Shader,\ + maps = { --Material maps array (MAX_MATERIAL_MAPS)\ + {\ + MATERIAL_MAP_*, --Example MATERIAL_MAP_ALBEDO\ + {\ + texture = Texture, --Material map texture\ + color = Color, --Material map color\ + value = float, --Material map value\ + },\ + },\ + ...\ + },\ + params = { float, float, float, float } --Material generic parameters (if required)\ +}\ +```\n\n---\n" ) +apiFile:write( "\n> Model = Userdata\n\ +Model, meshes, materials and animation data\n\n---\n" ) +apiFile:write( "\n> Ray = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 } } or { position = { 0.0, 0.0, 0.0 }, direction = { 1.0, 0.0, 0.0 } }\n\ +Ray, ray for raycasting\n\n---\n" ) +apiFile:write( "\n> RayCollision = { hit = true, distance = 1.0, point = { 0.0, 0.0, 0.0 }, normal = { 0.0, 0.0, 1.0 } }\n\ +RayCollision, ray hit information\n\n---\n" ) +apiFile:write( "\n> BoundingBox = { { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 } } or { min = { 0.0, 0.0, 0.0 }, max = { 1.0, 1.0, 1.0 } }\n\ +BoundingBox\n\n---\n" ) +apiFile:write( "\n> GlyphInfo = Userdata\n\ +GlyphInfo, font characters glyphs info\n\ +```\ +glyphInfoData = {\ + value = int, --Character value (Unicode)\ + offsetX = int, --Character offset X when drawing\ + offsetY = int, --Character offset Y when drawing\ + advanceX = int, --Character advance position X\ + image = Image, --Character image data\ +}\ +```\n\n---\n" ) +apiFile:write( "\n> BoneInfo = { name = string[32], parent = int }\n\ +Bone, skeletal animation bone\n\n---\n" ) +apiFile:write( "\n> Transform = { translation = Vector3, rotation = Quaternion, scale = Vector3 }\n\ +Transform, vertex transformation data\n\n---\n" ) +apiFile:write( "\n> Wave = Userdata\n\ +Wave, audio wave data\n\n---\n" ) +apiFile:write( "\n> Sound = Userdata\n\ +Sound\n\n---\n" ) +apiFile:write( "\n> SoundAlias = Userdata\n\ +SoundAlias\n\n---\n" ) +apiFile:write( "\n> Music = Userdata\n\ +Music, audio stream, anything longer than ~10 seconds should be streamed\n\n---\n" ) +apiFile:write( "\n> NPatchInfo = { { 0, 0, 24, 24 }, 8, 8, 8, 8, NPATCH_NINE_PATCH } or { source = { 0, 0, 24, 24 }, left = 8, top = 8, right = 8, bottom = 8, layout = NPATCH_NINE_PATCH }\n\ +NPatchInfo, n-patch layout info\n\n---\n" ) +apiFile:write( "\n> ModelAnimations = Userdata\n\ +ModelAnimation\n\n---\n" ) +apiFile:write( "\n> AutomationEvent = Userdata\n\ +Automation event\n\n---\n" ) +apiFile:write( "\n> AutomationEventList = Userdata\n\ +Automation event list\n\n---\n" ) +apiFile:write( "\n> Buffer = Buffer userdata\n\ +Data buffer for C primitive types. Type should be one of the Buffer types.\n\n---\n" ) + +if separate then + apiFile:close() +end + +-- Defines. + +local definesCount = 0 +local sourceFiles = { + "lua_core", + "platforms/core_desktop_glfw", + -- "platforms/core_desktop_sdl", +} + +for _, src in ipairs( sourceFiles ) do + local srcFile = io.open( "../src/"..src..".c", "r" ) + local writing = false + + if separate then + local splits = split( src, "/" ) + + apiFile = io.open( "../"..splits[ #splits ]..".md", "w" ) + end + + repeat + local line = srcFile:read( "*l" ) + local lineSplit = split( line, " " ) + + if line == "/*DOC_DEFINES_END*/" then + writing = false + break + end + + if writing then + if lineSplit[1] == "\t/*" then + local gategorySplit = split( line, "*" ) + apiFile:write( "\n## Defines - "..gategorySplit[2]:sub( 2, #gategorySplit[2] - 1 ).."\n" ) + luaApiFile:write( "\n-- Defines - "..gategorySplit[2]:sub( 2, #gategorySplit[2] - 1 ).."\n\n" ) + elseif lineSplit[1] ~= "#ifdef" and lineSplit[1] ~= "#endif" then + -- Remove comma from the end. + local defineName = lineSplit[2]:sub( 1, -2 ) + local value = RL[ defineName ] + local comment = lineSplit[6] -- First split after // + + if comment ~= nil then + local i = 7 + + while lineSplit[i] ~= nil do + comment = comment.." "..lineSplit[i] + i = i + 1 + end + luaApiFile:write( "---"..comment.."\n" ) + end + + definesCount = definesCount + 1 + + if value == nil then + apiFile:write( "\n"..defineName.." = nil\n\n" ) + luaApiFile:write( "RL."..defineName.."=nil\n" ) + elseif type( value ) == "table" then + -- All tables are colors. + apiFile:write( defineName.." = { " + ..math.floor( value[1] )..", "..math.floor( value[2] )..", " + ..math.floor( value[3] )..", "..math.floor( value[4] ).." }\n\n" ) + luaApiFile:write( "RL."..defineName.."={" + ..math.floor( value[1] )..","..math.floor( value[2] ).."," + ..math.floor( value[3] )..","..math.floor( value[4] ).."}\n" ) + else + apiFile:write( "> "..defineName.." = "..value.."\n\n" ) + luaApiFile:write( "RL."..defineName.."="..value.."\n" ) + end + + if comment ~= nil then + apiFile:write( comment.."\n\n" ) + end + + apiFile:write( "---\n\n" ) + end + end + + if line == "/*DOC_DEFINES_START*/" then + writing = true + end + until line == nil + + srcFile:close() +end + +-- Functions and events. + +sourceFiles = { + "core", + "shapes", + "textures", + "text", + "models", + "audio", + "rmath", + "rgui", + "lights", + "rlgl", + "gl", + "easings", + "bitwiseOp", + "platforms/core_desktop_glfw", + -- "platforms/core_desktop_sdl", +} + +local functionCount = 0 + +for _, src in ipairs( sourceFiles ) do + local srcFile = io.open( "../src/"..src..".c", "r" ) + local line = "" + local funcStr = "" + local p = false + local event = false + + if separate then + local splits = split( src, "/" ) + + apiFile = io.open( "../"..splits[ #splits ]..".md", "a" ) + end + + repeat + line = srcFile:read( "*l" ) + + if line == "*/" then + p = false + apiFile:write( "\n---\n" ) + + if not event then + luaApiFile:write( funcStr.."\n" ) + funcStr = "" + end + -- There should be not function definition after events. + elseif line == "/* Events. */" then + event = true + end + + if p then + apiFile:write( line.."\n" ) + + if line:sub( 1, 2 ) == "##" then + if not event then + luaApiFile:write( "-- "..line:sub( 4 ).."\n" ) + end + elseif line:sub( 1, 1 ) == ">" then + -- Do not parse events. Only visible in API.md + if not event then + funcStr = parseFunction( line ) + functionCount = functionCount + 1 + end + elseif line:sub( 1, 1 ) ~= "" then + if not event then + luaApiFile:write( "---"..line.."\n" ) + end + end + end + + if line == "/*" then + p = true + apiFile:write( "\n" ) + end + until line == nil + + srcFile:close() + + if separate then + apiFile:close() + end +end + +if not separate then + apiFile:close() +end + +print( "Parsed:\n"..definesCount.." Defines\n"..functionCount.." Functions" ) -- cgit v1.2.3 From e19bddd8d7b77e6aa173b8138b31679415afb3fa Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 3 Nov 2025 19:50:20 +0530 Subject: chore: fix build scripts to create build directory and update gitignore - Update all build scripts (.sh and .bat) to automatically create build directory if it doesn't exist - Fix 'can't cd to build' error that occurred when build directory was missing - Update .gitignore to exclude build artifacts and IDE files - Add proper navigation to project root in build_dev.bat for consistency --- .gitignore | 3 ++- scripts/build_dev.bat | 6 +++++- scripts/build_dev.sh | 7 ++++++- scripts/build_release.bat | 8 ++++++-- scripts/build_release.sh | 9 +++++++-- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 600d2d3..474e379 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.vscode \ No newline at end of file +.vscode +build/ \ No newline at end of file diff --git a/scripts/build_dev.bat b/scripts/build_dev.bat index c1d79d2..40f394e 100644 --- a/scripts/build_dev.bat +++ b/scripts/build_dev.bat @@ -7,7 +7,11 @@ echo ReiLua - Development Build echo ================================ echo. -REM Navigate to build directory +REM Get script directory and navigate to project root +cd /d "%~dp0.." + +REM Create and navigate to build directory +if not exist "build" mkdir build cd build if errorlevel 1 ( echo ERROR: Cannot access build directory diff --git a/scripts/build_dev.sh b/scripts/build_dev.sh index 4383d36..ed5079d 100644 --- a/scripts/build_dev.sh +++ b/scripts/build_dev.sh @@ -7,7 +7,12 @@ echo "ReiLua - Development Build" echo "================================" echo "" -# Navigate to build directory +# Get the script directory and navigate to project root +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR/.." || exit 1 + +# Create and navigate to build directory +mkdir -p build cd build || exit 1 # Clean old embedded files (important for dev builds!) diff --git a/scripts/build_release.bat b/scripts/build_release.bat index 17b76c1..a1a08c0 100644 --- a/scripts/build_release.bat +++ b/scripts/build_release.bat @@ -7,13 +7,17 @@ echo ReiLua - Release Build echo ================================ echo. +REM Get script directory and navigate to project root +cd /d "%~dp0.." + REM Check if we're in the right directory if not exist "CMakeLists.txt" ( - echo ERROR: Please run this script from the ReiLua root directory + echo ERROR: Cannot find CMakeLists.txt in project root exit /b 1 ) -REM Navigate to build directory +REM Create and navigate to build directory +if not exist "build" mkdir build cd build if errorlevel 1 ( echo ERROR: Cannot access build directory diff --git a/scripts/build_release.sh b/scripts/build_release.sh index 758ce34..cccdefe 100644 --- a/scripts/build_release.sh +++ b/scripts/build_release.sh @@ -7,13 +7,18 @@ echo "ReiLua - Release Build" echo "================================" echo "" +# Get the script directory and navigate to project root +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR/.." || exit 1 + # Check if we're in the right directory if [ ! -f "CMakeLists.txt" ]; then - echo "ERROR: Please run this script from the ReiLua root directory" + echo "ERROR: Cannot find CMakeLists.txt in project root" exit 1 fi -# Navigate to build directory +# Create and navigate to build directory +mkdir -p build cd build || exit 1 # Clean old embedded files -- cgit v1.2.3