diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/API.md | 13269 | ||||
| -rw-r--r-- | docs/ASSET_LOADING.md | 266 | ||||
| -rw-r--r-- | docs/BUILD_SCRIPTS.md | 213 | ||||
| -rw-r--r-- | docs/CUSTOMIZATION.md | 401 | ||||
| -rw-r--r-- | docs/DOCUMENTATION_INDEX.md | 167 | ||||
| -rw-r--r-- | docs/EMBEDDING.md | 289 | ||||
| -rw-r--r-- | docs/README.md | 34 | ||||
| -rw-r--r-- | docs/SPLASH_SCREENS.md | 229 | ||||
| -rw-r--r-- | docs/UPGRADE_SUMMARY.md | 186 | ||||
| -rw-r--r-- | docs/ZED_EDITOR_SETUP.md | 434 | ||||
| -rw-r--r-- | docs/generate.py | 174 | ||||
| -rw-r--r-- | docs/index.html | 15 | ||||
| -rw-r--r-- | docs/manual.html | 2144 | ||||
| -rw-r--r-- | docs/reference.html | 6023 | ||||
| -rw-r--r-- | docs/style.css | 136 |
15 files changed, 8526 insertions, 15454 deletions
diff --git a/docs/API.md b/docs/API.md deleted file mode 100644 index 201fc1b..0000000 --- a/docs/API.md +++ /dev/null @@ -1,13269 +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. - ---- - -## ReiLua Enhanced Functions - -These functions are part of ReiLua Enhanced Edition and provide additional functionality for asset loading and game development. - ---- - -> RL.BeginAssetLoading( int totalAssets ) - -Initialize asset loading progress tracking and show the loading screen. This displays a beautiful loading UI with progress bar and asset names. - -Parameters: -- `totalAssets` (integer) - Total number of assets to load - -Example: -```lua -RL.BeginAssetLoading(10) -- We're loading 10 assets -``` - -Features: -- Shows animated "LOADING..." text with dots -- Displays progress bar with shimmer effect -- Shows current asset name being loaded -- Shows progress counter (e.g., "3 / 10") -- 1-bit pixel art aesthetic - ---- - -> RL.UpdateAssetLoading( string assetName ) - -Update loading progress for the current asset. Call this after each asset is loaded to update the progress bar and display. - -Parameters: -- `assetName` (string) - Name of the asset currently being loaded - -Example: -```lua -RL.UpdateAssetLoading("player.png") --- Load the asset here -playerTexture = RL.LoadTexture("assets/player.png") -``` - -Notes: -- Automatically increments the loaded asset counter -- Updates the loading screen UI -- Shows the asset name on screen -- Updates progress bar percentage - ---- - -> RL.EndAssetLoading() - -Finish asset loading and hide the loading screen. Call this after all assets have been loaded. - -Example: -```lua -RL.EndAssetLoading() -``` - -Complete Example: -```lua -function RL.init() - local assets = {} - 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) - - if path:match("%.png$") then - assets[i] = RL.LoadTexture(path) - elseif path:match("%.wav$") then - assets[i] = RL.LoadSound(path) - end - end - - -- Done loading - RL.EndAssetLoading() -end -``` - ---- - -## 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 deleted file mode 100644 index f5c5d8c..0000000 --- a/docs/ASSET_LOADING.md +++ /dev/null @@ -1,266 +0,0 @@ -# Asset Loading System - -ReiLua includes a built-in asset loading system with a loading screen UI that shows progress while assets are being loaded. - -## Features - -- Automatic Progress Tracking - Tracks how many assets have been loaded -- Loading UI with: - - Animated "Loading..." text with dots - - Smooth progress bar with shimmer effect - - Progress percentage (e.g., "3 / 10") - - Current asset name being loaded -- Easy to Use - Just 3 functions to show loading progress -- Works in 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) - -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 deleted file mode 100644 index 191bd37..0000000 --- a/docs/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**: `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 deleted file mode 100644 index 22529be..0000000 --- a/docs/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 `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 deleted file mode 100644 index 854bfd2..0000000 --- a/docs/DOCUMENTATION_INDEX.md +++ /dev/null @@ -1,167 +0,0 @@ -# Documentation Overview - -This document provides a quick reference to all available documentation for ReiLua Enhanced Edition. - -## Core Documentation - -**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, and troubleshooting. - -Read this first! - ---- - -## Feature-Specific Guides - -**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, and troubleshooting. - -**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, and troubleshooting. - -**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, and customization options. - -**BUILD_SCRIPTS.md** - Build automation documentation - -`scripts\build_dev.bat` / `scripts/build_dev.sh` for development builds, `scripts\build_release.bat` / `scripts/build_release.sh` for release builds, features of each build type, workflow examples, customizing executable name, icon, and properties, and troubleshooting. - -**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, and removing ReiLua branding (with attribution notes). - -**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, and workflow tips. - ---- - -## Technical Documentation - -**API.md** - Complete API reference - -1000+ functions, all ReiLua/Raylib bindings, function signatures, Raygui, Raymath, Lights, Easings, and RLGL modules. - -**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** - Technical implementation details - -Features added in this enhanced version, files modified and added, build options explained, testing checklist, and known changes from original ReiLua - ---- - -## Quick Reference by Task - -I want to start making a game - -1. Read 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 -2. Use `scripts\build_release.bat` / `scripts/build_release.sh` -3. Follow the complete release workflow in README.md - -I want to add a loading screen - -1. Read 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 -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 -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 -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 - 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 -2. Search for function name -3. See function signature and description -4. Or copy 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 -- 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 deleted file mode 100644 index 59e9fb1..0000000 --- a/docs/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/docs/README.md b/docs/README.md new file mode 100644 index 0000000..ab45668 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,34 @@ +# ReiLua Documentation + +Simple HTML documentation for ReiLua, inspired by the Lua manual style. + +## Contents + +- index.html - Homepage +- manual.html - Complete user guide +- reference.html - API reference (1924 functions and structures) +- style.css - Stylesheet +- generate.py - Documentation generator + +## Viewing + +Open index.html in any web browser. + +## Hosting + +Upload the entire html_docs folder to your web server. + +## Regenerating + +If you update the markdown source files, regenerate with: + + cd html_docs + python generate.py + +Requires Python 3. + +## Style + +Clean white background with navy blue headers, inspired by the official Lua manual. + +Simple, practical, and easy to read. diff --git a/docs/SPLASH_SCREENS.md b/docs/SPLASH_SCREENS.md deleted file mode 100644 index 1d1f290..0000000 --- a/docs/SPLASH_SCREENS.md +++ /dev/null @@ -1,229 +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, `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 deleted file mode 100644 index c9c885f..0000000 --- a/docs/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:** - - `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 deleted file mode 100644 index c1ba754..0000000 --- a/docs/ZED_EDITOR_SETUP.md +++ /dev/null @@ -1,434 +0,0 @@ -# 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: -> Note There is a sample zed settings json file in the repo root (zed.sample.settings.json) -```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/docs/generate.py b/docs/generate.py new file mode 100644 index 0000000..4320bcc --- /dev/null +++ b/docs/generate.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python3 +"""ReiLua Documentation Generator""" +import os, re +from pathlib import Path + +HTML_TEMPLATE = '''<!DOCTYPE HTML><html><head><title>{title}</title> +<link rel="stylesheet" href="style.css"><meta charset="utf-8"></head><body> +<div class="container"><div class="navigation"> +<a href="index.html">home</a> · <a href="manual.html">manual</a> · <a href="reference.html">reference</a> +</div>{content}<div class="footer"><p>ReiLua Enhanced · <a href="https://indrajith.dev">indrajith.dev</a></p></div></div></body></html>''' + +def fix_links(t): + t=re.sub(r'\(([^)]+)\.md\)',r'(manual.html)',t) + t=re.sub(r'\(docs/[^)]+\.md\)',r'(manual.html)',t) + t=re.sub(r'\(\.\.\/docs\/[^)]+\.md\)',r'(manual.html)',t) + return t + +def md2html(md): + h=fix_links(md) + + # Protect code blocks by replacing them with placeholders + code_blocks = [] + def save_code(m): + code_blocks.append(m.group(0)) + return f'___CODE_BLOCK_{len(code_blocks)-1}___' + h=re.sub(r'```[^\n]*\n.*?```',save_code,h,flags=re.DOTALL) + + # Now process markdown (code is protected) + # Headers - MUST be before bold/italic to avoid conflicts + h=re.sub(r'^#### (.+)$',r'<h4>\1</h4>',h,flags=re.MULTILINE) + h=re.sub(r'^### (.+)$',r'<h3>\1</h3>',h,flags=re.MULTILINE) + h=re.sub(r'^## (.+)$',r'<h2>\1</h2>',h,flags=re.MULTILINE) + h=re.sub(r'^# (.+)$',r'<h1>\1</h1>',h,flags=re.MULTILINE) + + # Links + h=re.sub(r'\[([^\]]+)\]\(([^\)]+)\)',r'<a href="\2">\1</a>',h) + + # Bold/italic (after headers to avoid **text:** becoming headings) + h=re.sub(r'\*\*([^\*]+)\*\*',r'<strong>\1</strong>',h) + h=re.sub(r'\*([^\*\n]+)\*',r'<em>\1</em>',h) + + # Inline code + h=re.sub(r'`([^`]+)`',r'<code>\1</code>',h) + + # Restore code blocks + for i, block in enumerate(code_blocks): + content = re.search(r'```[^\n]*\n(.*?)```', block, re.DOTALL).group(1) + h = h.replace(f'___CODE_BLOCK_{i}___', f'<pre><code>{content}</code></pre>') + + # Process line by line for paragraphs and lists + lines=h.split('\n') + result=[] + in_ul=False + in_pre=False + para_buffer=[] + + def flush_para(): + if para_buffer: + result.append('<p>' + ' '.join(para_buffer) + '</p>') + para_buffer.clear() + + for line in lines: + s=line.strip() + + # Track pre blocks + if '<pre>' in line: + flush_para() + in_pre=True + result.append(line) + continue + if '</pre>' in line: + in_pre=False + result.append(line) + continue + if in_pre: + result.append(line) + continue + + # Handle list items + if s.startswith(('- ','* ')): + flush_para() + if not in_ul: + result.append('<ul>') + in_ul=True + item=re.sub(r'^[\-\*]\s+','',s) + result.append(f'<li>{item}</li>') + continue + + # End list if needed + if in_ul and not s.startswith(('- ','* ')): + result.append('</ul>') + in_ul=False + + # Handle block elements + if s.startswith('<h') or s.startswith('<div') or s.startswith('<hr'): + flush_para() + result.append(line) + continue + + # Empty line = paragraph break + if not s: + flush_para() + continue + + # Accumulate paragraph text + if s and not s.startswith('<'): + para_buffer.append(s) + else: + flush_para() + result.append(line) + + # Flush remaining + flush_para() + if in_ul: + result.append('</ul>') + + return '\n'.join(result) + +def parse_api(f): + with open(f,'r',encoding='utf-8') as fp: c=fp.read() + secs=[]; cur=None; lines=c.split('\n'); i=0 + while i<len(lines): + l=lines[i]; s=l.strip() + if s.startswith('## ') and not s.startswith('###'): + if cur and cur.get('items'): secs.append(cur) + cur={'title':s.replace('##','').strip(),'items':[]}; i+=1; continue + if s.startswith('>'): + if not cur: cur={'title':'Definitions','items':[]} + d=s.replace('>','').strip(); desc=[]; i+=1 + while i<len(lines): + n=lines[i]; ns=n.strip() + if ns.startswith('>') or (ns.startswith('##') and not ns.startswith('###')): break + if ns=='---': i+=1; break + desc.append(n); i+=1 + cur['items'].append({'definition':d,'description':'\n'.join(desc).strip()}); continue + i+=1 + if cur and cur.get('items'): secs.append(cur) + return secs + +out=Path(__file__).parent +(out/'index.html').write_text(HTML_TEMPLATE.format(title='ReiLua',content='<h1>ReiLua Enhanced</h1><p>Lua binding for Raylib.</p><h2>Documentation</h2><ul><li><a href="manual.html">Manual</a></li><li><a href="reference.html">API Reference</a></li></ul><h2>Quick Start</h2><p>Create <code>main.lua</code>:</p><pre><code>function RL.init()\n RL.SetWindowTitle("Hello")\nend\n\nfunction RL.update(dt)\nend\n\nfunction RL.draw()\n RL.ClearBackground(RL.RAYWHITE)\n RL.DrawText("Hello!",190,200,20,RL.BLACK)\nend</code></pre><p>Run: <code>ReiLua.exe</code></p>'),encoding='utf-8') +print('✓ index.html') + +parts=['<h1>ReiLua Manual</h1>'] +readme=Path('../README.md') +if readme.exists(): + parts.append(md2html(re.sub(r'!\[.*?\]\(.*?\)','',readme.read_text(encoding='utf-8')))) + parts.append('<hr>') +for fp,t in [('../docs/EMBEDDING.md','Embedding'),('../docs/ASSET_LOADING.md','Asset Loading'),('../docs/SPLASH_SCREENS.md','Splash Screens'),('../docs/BUILD_SCRIPTS.md','Build Scripts'),('../docs/CUSTOMIZATION.md','Customization'),('../docs/ZED_EDITOR_SETUP.md','Editor Setup')]: + p=Path(fp) + if p.exists(): + a=t.lower().replace(' ','-') + parts.append(f'<h2 id="{a}">{t}</h2>') + parts.append(md2html(p.read_text(encoding='utf-8'))) + parts.append('<hr>') +(out/'manual.html').write_text(HTML_TEMPLATE.format(title='Manual',content='\n'.join(parts)),encoding='utf-8') +print('✓ manual.html') + +secs=parse_api(Path('../docs/API.md')) +parts=['<h1>ReiLua API Reference</h1><p>Complete function reference.</p><h2>Contents</h2><ul>'] +for s in secs: + a=s['title'].lower().replace(' ','-').replace('/','').replace('.','') + parts.append(f'<li><a href="#{a}">{s["title"]}</a> ({len(s["items"])} items)</li>') +parts.append('</ul>') +for s in secs: + a=s['title'].lower().replace(' ','-').replace('/','').replace('.','') + parts.append(f'<h2 id="{a}">{s["title"]}</h2>') + for i in s['items']: + parts.append(f'<div class="apii"><code>{i["definition"]}</code></div>') + if i['description']: + parts.append(f'<div class="apidesc">{md2html(i["description"])}</div>') +(out/'reference.html').write_text(HTML_TEMPLATE.format(title='API Reference',content='\n'.join(parts)),encoding='utf-8') +print(f'✓ reference.html ({sum(len(s["items"]) for s in secs)} items)') +print('Complete!') diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..ef7e6e1 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,15 @@ +<!DOCTYPE HTML><html><head><title>ReiLua</title> +<link rel="stylesheet" href="style.css"><meta charset="utf-8"></head><body> +<div class="container"><div class="navigation"> +<a href="index.html">home</a> · <a href="manual.html">manual</a> · <a href="reference.html">reference</a> +</div><h1>ReiLua Enhanced</h1><p>Lua binding for Raylib.</p><h2>Documentation</h2><ul><li><a href="manual.html">Manual</a></li><li><a href="reference.html">API Reference</a></li></ul><h2>Quick Start</h2><p>Create <code>main.lua</code>:</p><pre><code>function RL.init() + RL.SetWindowTitle("Hello") +end + +function RL.update(dt) +end + +function RL.draw() + RL.ClearBackground(RL.RAYWHITE) + RL.DrawText("Hello!",190,200,20,RL.BLACK) +end</code></pre><p>Run: <code>ReiLua.exe</code></p><div class="footer"><p>ReiLua Enhanced · <a href="https://indrajith.dev">indrajith.dev</a></p></div></div></body></html>
\ No newline at end of file diff --git a/docs/manual.html b/docs/manual.html new file mode 100644 index 0000000..5cae8e5 --- /dev/null +++ b/docs/manual.html @@ -0,0 +1,2144 @@ +<!DOCTYPE HTML><html><head><title>Manual</title> +<link rel="stylesheet" href="style.css"><meta charset="utf-8"></head><body> +<div class="container"><div class="navigation"> +<a href="index.html">home</a> · <a href="manual.html">manual</a> · <a href="reference.html">reference</a> +</div><h1>ReiLua Manual</h1> +<h1>ReiLua - Enhanced Edition</h1> +<p>> <strong>A modified version of ReiLua with embedded main.lua, embedded assets, splash screens, and asset loading system</strong></p> +<h2>About This Version</h2> +<p>This is an enhanced version of ReiLua featuring:</p> +<ul> +<li><strong>Embedded Lua Support</strong> - Bundle all your Lua code into a single executable</li> +<li><strong>Embedded Assets</strong> - Package images, sounds, and other assets into your game</li> +<li><strong>Splash Screens</strong> - Customizable startup screens featuring Raylib and ReiLua</li> +<li><strong>Asset Loading System</strong> - Loading screen with progress tracking</li> +<li><strong>Automated Build Scripts</strong> - One-command development and release builds</li> +<li><strong>Console Control</strong> - Debug logging system for development</li> +</ul> +<h2>What is ReiLua?</h2> +<p>ReiLua brings the power and simplicity of Raylib to the beginner-friendly Lua language in a straightforward manner. It is a loose binding to Raylib - some functions are excluded and some are added. The concept of pointing to a "main.lua" file and accessing functions "init", "update", and "draw" is borrowed from the Löve game framework.</p> +<strong>Note:</strong> ReiLua is lovingly handcrafted and will likely contain bugs and documentation errors, so it would be much appreciated if you would report any such findings. +<strong>Reilua</strong> means "fair" in Finnish. +<h2>Attributions</h2> +<p>This enhanced version is built upon:</p> +<h3>Core Framework</h3> +<ul> +<li><strong><a href="https://github.com/raysan5/raylib">Raylib</a></strong> (v5.5) - A simple and easy-to-use library to enjoy videogames programming</li> +<li>Created by Ray(Ramon Santamaria) (<a href="https://github.com/raysan5">@raysan5</a>)</li> +<li>Licensed under the zlib/libpng license</li> +<li><strong><a href="https://github.com/nullstare/ReiLua">ReiLua</a></strong> - The original Lua bindings for Raylib</li> +<li>Created by Jussi Viitala</li> +<li>Licensed under the MIT license</li> +<li><strong><a href="https://www.lua.org/">Lua</a></strong> (v5.4) - Powerful, efficient, lightweight, embeddable scripting language</li> +</ul> +<h3>Enhancements Added</h3> +<ul> +<li>Embedded Lua and asset support system</li> +<li>Splash screen implementation</li> +<li>Asset loading progress API with retro UI</li> +<li>Build automation scripts</li> +<li>Console control system</li> +<li>Comprehensive documentation</li> +</ul> +<h3>Additional Components</h3> +<ul> +<li><strong>Raygui</strong> - Immediate mode GUI library</li> +<li><strong>Raymath</strong> - Math utilities for game development</li> +<li><strong>Lights</strong> - 3D lighting system</li> +<li><strong>Easings</strong> - Easing functions for smooth animations</li> +<li><strong>RLGL</strong> - OpenGL abstraction layer</li> +</ul> +<h3>Font</h3> +<ul> +<li><strong>Oleaguid</strong> - Custom pixel art font for splash and loading screens</li> +</ul> +<h2>Status</h2> +<p>ReiLua is WIP and some planned raylib functionality is still missing, but it already has over 1000 functions. Current Raylib version is 5.5.</p> +<h3>Included Submodules</h3> +<ul> +<li>Raygui</li> +<li>Raymath</li> +<li>Lights</li> +<li>Easings</li> +<li>RLGL</li> +</ul> +<h3>Missing Features</h3> +<p>List of some MISSING features that are planned to be included:</p> +<ul> +<li>Core</li> +<li>VR stereo config functions for VR simulator</li> +</ul> +<h2>Roadmap</h2> +<ul> +<li>v0.9</li> +<li>Stability improvements</li> +<li>Additional raylib bindings</li> +<li>v1.0</li> +<li>raylib 6.0 support</li> +</ul> +<h2>Quick Start</h2> +<h3>For Game Developers</h3> +<p>Development Mode (Fast Iteration):</p> +<pre><code># 1. Create your game files +GameFolder/ +├── main.lua +├── assets/ +│ ├── player.png +│ └── music.wav + +# 2. Run ReiLua pointing to your game folder +ReiLua.exe GameFolder/ + +# Or from your game folder +cd GameFolder +path/to/ReiLua.exe + +# Skip splash screens during development +ReiLua.exe --no-logo + +# Enable console for debugging +ReiLua.exe --log --no-logo +</code></pre> +<p>Release Mode (Single Executable):</p> +<pre><code># See "Building for Release" section below +</code></pre> +<h3>Basic Example</h3> +<p>Create a <code>main.lua</code> file:</p> +<pre><code>local textColor = RL.BLACK +local textPos = { 192, 200 } +local textSize = 20 +local text = "Congrats! You created your first window!" + +function RL.init() + RL.SetWindowTitle( "First window" ) + RL.SetWindowState( RL.FLAG_VSYNC_HINT ) +end + +function RL.update( delta ) + if RL.IsKeyPressed( RL.KEY_ENTER ) then + local winSize = RL.GetScreenSize() + local measuredSize = RL.MeasureTextEx( RL.GetFontDefault(), text, textSize, 2 ) + + textColor = RL.BLUE + textPos = { winSize[1] / 2 - measuredSize[1] / 2, winSize[2] / 2 - measuredSize[2] / 2 } + end + + if RL.IsKeyPressed( RL.KEY_SPACE ) then + textColor = RL.RED + textPos = { 192, 200 } + end +end + +function RL.draw() + RL.ClearBackground( RL.RAYWHITE ) + RL.DrawText( text, textPos, textSize, textColor ) +end +</code></pre> +<p>Run it:</p> +<pre><code>ReiLua.exe --no-logo +</code></pre> +<h2>Framework Functions</h2> +<p>ReiLua looks for a 'main.lua' or 'main' file as the entry point. There are seven Lua functions that the framework will call:</p> +<ul> +<li><strong><code>RL.init()</code></strong> - Called once at startup for initialization</li> +<li><strong><code>RL.update(delta)</code></strong> - Called every frame before draw, receives delta time</li> +<li><strong><code>RL.draw()</code></strong> - Called every frame for rendering</li> +<li><strong><code>RL.event(event)</code></strong> - Called when events occur</li> +<li><strong><code>RL.log(logLevel, message)</code></strong> - Called for logging</li> +<li><strong><code>RL.exit()</code></strong> - Called when the application is closing</li> +<li><strong><code>RL.config()</code></strong> - ⚠️ Deprecated in this version</li> +</ul> +<p>All functionality can be found in "API.md".</p> +<h2>Enhanced Features</h2> +<h3>1. Splash Screens</h3> +<p>This version includes customizable splash screens that display at startup:</p> +<strong>Screen 1:</strong> Custom text - Bold text on Raylib red background (customizable) +<strong>Screen 2:</strong> "Made using" - Displays Raylib and ReiLua logos side-by-side +<p>Each screen fades in (0.8s), displays (2.5s), and fades out (0.8s) for a total of ~8 seconds.</p> +<p>Skip During Development:</p> +<pre><code>ReiLua.exe --no-logo +</code></pre> +<p>Customize:</p> +<ul> +<li>Change text in <code>src/splash.c</code></li> +<li>Replace logos in <code>logo/</code> folder</li> +<li>Adjust timing with constants in <code>src/splash.c</code></li> +</ul> +<p>See <a href="manual.html">SPLASH_SCREENS.md</a> for full documentation.</p> +<h3>2. Asset Loading System</h3> +<p>Beautiful loading screen with progress tracking:</p> +<pre><code>function RL.init() + -- List your assets + local assets = { + "assets/player.png", + "assets/enemy.png", + "assets/background.png", + "assets/music.wav", + } + + -- Start loading with progress + RL.BeginAssetLoading(#assets) + + -- Load each asset + for i, path in ipairs(assets) do + RL.UpdateAssetLoading(path) + + -- Your loading code + if path:match("%.png$") then + textures[i] = RL.LoadTexture(path) + elseif path:match("%.wav$") then + sounds[i] = RL.LoadSound(path) + end + end + + -- Finish loading + RL.EndAssetLoading() +end +</code></pre> +<p>Features:</p> +<ul> +<li>Retro 1-bit pixel art aesthetic</li> +<li>Animated loading text with dots</li> +<li>Progress bar with dithering pattern</li> +<li>Shows current asset name</li> +<li>Progress counter (e.g., "3/10")</li> +<li>Corner decorations</li> +</ul> +<p>See <a href="manual.html">ASSET_LOADING.md</a> for full documentation.</p> +<h3>3. Embedded Lua Files</h3> +<p>Bundle all your Lua code into the executable for easy distribution:</p> +<pre><code># Copy Lua files to build directory +cd build +copy ..\your_game\*.lua . + +# Build with embedding +cmake .. -DEMBED_MAIN=ON +cmake --build . --config Release +</code></pre> +<p>Result: Single executable with all Lua code embedded!</p> +<h3>4. Embedded Assets</h3> +<p>Package images, sounds, fonts, and other assets into your executable:</p> +<pre><code># Create assets folder and copy files +cd build +mkdir assets +copy ..\your_game\assets\* assets\ + +# Build with embedding +cmake .. -DEMBED_ASSETS=ON +cmake --build . --config Release +</code></pre> +<strong>Your Lua code doesn't change!</strong> Use the same paths: +<pre><code>-- Works in both development and release +playerImg = RL.LoadTexture("assets/player.png") +music = RL.LoadSound("assets/music.wav") +</code></pre> +<p>See <a href="manual.html">EMBEDDING.md</a> for full documentation.</p> +<h3>5. Console Control (Windows)</h3> +<p>By default, ReiLua runs without a console window for a clean user experience. Enable it for debugging:</p> +<pre><code># Show console for debugging +ReiLua.exe --log + +# Combine with other options +ReiLua.exe --log --no-logo +ReiLua.exe --log path/to/game +</code></pre> +<p>This shows:</p> +<ul> +<li>TraceLog output</li> +<li>Print statements</li> +<li>Lua errors</li> +<li>Debug information</li> +</ul> +<h3>6. Automated Build Scripts</h3> +<p>One-command builds for development and release:</p> +<p>Development Build (Fast Iteration):</p> +<pre><code># Windows +scripts\build_dev.bat + +# Linux/Unix +chmod +x scripts/build_dev.sh +scripts/build_dev.sh +</code></pre> +<ul> +<li>No embedding</li> +<li>Fast build times</li> +<li>Edit code without rebuilding</li> +</ul> +<p>Release Build (Distribution):</p> +<pre><code># Prepare files first +cd build +copy ..\your_game\*.lua . +mkdir assets +copy ..\your_game\assets\* assets\ + +# Build release +cd .. + +# Windows +scripts\build_release.bat + +# Linux/Unix +scripts/build_release.sh +</code></pre> +<ul> +<li>Embeds all Lua files</li> +<li>Embeds all assets</li> +<li>Creates single executable</li> +<li>Release optimizations</li> +</ul> +<p>See <a href="manual.html">BUILD_SCRIPTS.md</a> for full documentation.</p> +<h2>Command Line Options</h2> +<pre><code>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) +</code></pre> +<h3>Examples</h3> +<pre><code># Run game in current directory +ReiLua.exe + +# Run game in specific folder +ReiLua.exe path/to/game/ + +# Development mode (no splash, with console) +ReiLua.exe --log --no-logo + +# Interpreter mode (run single script) +ReiLua.exe -i script.lua + +# Show help +ReiLua.exe --help + +# Show version +ReiLua.exe --version +</code></pre> +<h2>Object Unloading</h2> +<p>Some objects allocate memory that needs to be freed when no longer needed. By default, objects like Textures are unloaded by the Lua garbage collector. However, it's generally recommended to handle this manually in more complex projects:</p> +<pre><code>RL.SetGCUnload() +</code></pre> +<h2>Interpreter Mode</h2> +<p>ReiLua can run single Lua files using interpreter mode:</p> +<pre><code>ReiLua -i hello.lua +</code></pre> +<p>The given file will be called with <code>dofile</code>.</p> +<h2>Generate API Documentation</h2> +<p>Generate API.md and ReiLua_API.lua from the build folder:</p> +<pre><code>ReiLua -i ../tools/docgen.lua +</code></pre> +<strong>Tip:</strong> Use tools/ReiLua_API.lua in your project folder to provide annotations when using "Lua Language Server". +<h2>Building from Source</h2> +<h3>Prerequisites</h3> +<p>You'll need to statically link Raylib and Lua to create the executable. This simplifies distribution, especially on Linux where different distros use different library versions.</p> +<ul> +<li><strong>Raylib</strong>: https://github.com/raysan5/raylib</li> +<li><strong>Lua</strong>: https://github.com/lua/lua or https://github.com/LuaJIT/LuaJIT</li> +<li><strong>CMake</strong>: https://cmake.org/download/</li> +<li><strong>Build tools</strong>: MinGW (Windows), GCC/Make (Linux)</li> +</ul> +<strong>Note:</strong> Lua header files are from Lua 5.4.0. If using a different version, replace them. +<h3>Windows</h3> +<h4>1. Install Tools</h4> +<ul> +<li>Download <strong>w64devkit</strong> from https://github.com/skeeto/w64devkit</li> +<li>Download <strong>CMake</strong> from https://cmake.org/download/ (install with PATH environment variables set)</li> +</ul> +<h4>2. Build Raylib</h4> +<pre><code># Download Raylib source +# Run w64devkit.exe and navigate to raylib/src +cd raylib/src +mingw32-make + +# Copy libraylib.a to ReiLua/lib folder +copy libraylib.a path\to\ReiLua\lib\ +</code></pre> +<h4>3. Build Lua</h4> +<p>Download Lua source from https://github.com/lua/lua</p> +<p>Modify Lua's makefile:</p> +<pre><code># Change this: +MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE +# To this: +MYCFLAGS= $(LOCAL) -std=c99 + +# Comment out or remove: +MYLIBS= -ldl -lreadline +</code></pre> +<p>Build:</p> +<pre><code># In w64devkit, navigate to Lua folder +mingw32-make + +# Copy liblua.a to ReiLua/lib folder +copy liblua.a path\to\ReiLua\lib\ +</code></pre> +<h4>4. Build ReiLua</h4> +<p>Quick Method (Recommended):</p> +<pre><code>cd ReiLua +scripts\build_dev.bat +</code></pre> +<p>Manual Method:</p> +<pre><code>cd ReiLua\build +cmake -G "MinGW Makefiles" .. +mingw32-make +</code></pre> +<h4>5. Test</h4> +<pre><code>cd build +ReiLua.exe ..\examples\snake\ +</code></pre> +<p>If you see a low-res snake racing off the window, success! Press Enter to reset.</p> +<h3>Linux</h3> +<h4>1. Install Dependencies</h4> +<pre><code>sudo apt install build-essential cmake +</code></pre> +<h4>2. Build Raylib and Lua</h4> +<p>Compile Raylib and Lua by following their instructions. They will compile to <code>libraylib.a</code> and <code>liblua.a</code> by default.</p> +<p>Move both <code>.a</code> files to the <code>ReiLua/lib</code> folder.</p> +<h4>3. Build ReiLua</h4> +<p>Quick Method (Recommended):</p> +<pre><code>cd ReiLua +chmod +x scripts/build_dev.sh +scripts/build_dev.sh +</code></pre> +<p>Manual Method:</p> +<pre><code>cd ReiLua/build +cmake .. +make +</code></pre> +<h4>4. Test</h4> +<pre><code>./ReiLua ../examples/snake/ +</code></pre> +<h3>MacOS</h3> +<p>Not tested, but should work similarly to Linux.</p> +<h3>Raspberry Pi</h3> +<p>Works best when Raylib is compiled using <code>PLATFORM=DRM</code>. See Raylib build instructions for Raspberry Pi.</p> +<p>Compile ReiLua with:</p> +<pre><code>cmake .. -DDRM=ON +</code></pre> +<strong>Note:</strong> DRM should be launched from CLI, not in X. +<h3>Web (Emscripten)</h3> +<p>Compile Raylib for web following its instructions: https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)</p> +<h4>1. Compile Lua for Web</h4> +<p>Modify Lua's makefile:</p> +<pre><code># Change: +MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE +# To: +MYCFLAGS= $(LOCAL) -std=c99 + +# Change: +MYLIBS= -ldl -lreadline +# To: +MYLIBS= -ldl + +# Change: +CC= gcc +# To: +CC= emcc + +# Change: +CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native +# To: +CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common + +# Change: +AR= ar rc +# To: +AR= emar + +# Change: +$(AR) $@ $? +# To: +$(AR) rcs $@ $? +</code></pre> +<p>Build with <code>make</code> if emsdk environmental variables are correct.</p> +<h4>2. Prepare Libraries</h4> +<p>Put <code>libraylib.a</code> and <code>liblua.a</code> into <code>ReiLua/lib/web/</code>.</p> +<h4>3. Create Resources Folder</h4> +<pre><code>cd ReiLua/build +mkdir resources +# Copy main.lua to resources/ +# Copy assets to resources/ +</code></pre> +<p>Structure:</p> +<pre><code>ReiLua/ +└── build/ + └── resources/ + ├── main.lua + └── assets/ +</code></pre> +<h4>4. Build</h4> +<pre><code>cd build +cmake .. -DCMAKE_TOOLCHAIN_FILE=<YOUR_PATH>/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DPLATFORM=Web +make +</code></pre> +<h4>5. Test</h4> +<pre><code>python -m http.server 8080 +</code></pre> +<p>Access in browser: <code>localhost:8080/ReiLua.html</code></p> +<h2>Complete Release Workflow</h2> +<h3>Step 1: Prepare Your Game</h3> +<pre><code>MyGame/ +├── main.lua +├── player.lua +├── enemy.lua +├── assets/ +│ ├── player.png +│ ├── enemy.png +│ └── music.wav +</code></pre> +<h3>Step 2: Copy Files to Build Directory</h3> +<pre><code>cd ReiLua/build + +# Copy all Lua files +copy ..\MyGame\*.lua . + +# Copy assets +mkdir assets +copy ..\MyGame\assets\* assets\ +# Or: xcopy /E /I ..\MyGame\assets assets +</code></pre> +<h3>Step 3: Build Release</h3> +<pre><code>cd .. +scripts\build_release.bat +# Or: scripts/build_release.sh on Linux +</code></pre> +<h3>Step 4: Test</h3> +<pre><code>cd build +ReiLua.exe --log +</code></pre> +<p>Verify:</p> +<ul> +<li>No file loading errors</li> +<li>Game runs correctly</li> +<li>All assets load properly</li> +</ul> +<h3>Step 5: Distribute</h3> +<pre><code>mkdir Distribution +copy ReiLua.exe Distribution\YourGameName.exe +</code></pre> +<p>Your game is now a single executable ready for distribution!</p> +<h2>Customizing Your Executable</h2> +<h3>Change Executable Name</h3> +<p>Edit <code>CMakeLists.txt</code>:</p> +<pre><code>project( YourGameName ) # Change from "ReiLua" +</code></pre> +<h3>Add Custom Icon</h3> +<p>Replace <code>icon.ico</code> with your own icon file, then rebuild.</p> +<h3>Edit Executable Properties</h3> +<p>Edit <code>resources.rc</code>:</p> +<pre><code>VALUE "CompanyName", "Your Studio Name" +VALUE "FileDescription", "Your Game Description" +VALUE "ProductName", "Your Game Name" +VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" +</code></pre> +<h3>Customize Splash Screens</h3> +<p>Edit <code>src/splash.c</code>:</p> +<pre><code>const char* text = "YOUR STUDIO NAME"; // Change this +</code></pre> +<p>Replace logos:</p> +<pre><code># Replace these files before building +logo/raylib_logo.png +logo/reilua_logo.png +</code></pre> +<h2>Setting Up Zed Editor</h2> +<p>Zed is a modern, high-performance code editor. Here's how to set it up for ReiLua development:</p> +<h3>Install Zed</h3> +<p>Download from: https://zed.dev/</p> +<h3>Setup Lua Language Support</h3> +<p>1. Open Zed 2. Press <code>Cmd+Shift+P</code> (Mac) or <code>Ctrl+Shift+P</code> (Windows/Linux) 3. Type "install language server" and select Lua 4. Zed will automatically install the Lua Language Server</p> +<h3>Configure for ReiLua</h3> +<p>Create <code>.zed/settings.json</code> in your project root:</p> +<pre><code>{ + "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", + "formatter": "language_server" + } + } +} +</code></pre> +<h3>Copy ReiLua API Definitions</h3> +<p>Copy <code>tools/ReiLua_API.lua</code> to your project folder. This provides autocomplete and documentation for all ReiLua functions.</p> +<pre><code>copy path\to\ReiLua\tools\ReiLua_API.lua your_game\ +</code></pre> +<h3>Keyboard Shortcuts</h3> +<p>Useful Zed shortcuts for Lua development:</p> +<ul> +<li><code>Ctrl+P</code> / <code>Cmd+P</code> - Quick file search</li> +<li><code>Ctrl+Shift+F</code> / <code>Cmd+Shift+F</code> - Search in files</li> +<li><code>Ctrl+.</code> / <code>Cmd+.</code> - Code actions</li> +<li><code>F12</code> - Go to definition</li> +<li><code>Shift+F12</code> - Find references</li> +<li><code>Ctrl+Space</code> - Trigger autocomplete</li> +</ul> +<h3>Extensions</h3> +<p>Install useful extensions: 1. Press <code>Ctrl+Shift+X</code> / <code>Cmd+Shift+X</code> 2. Search and install:</p> +<ul> +<li><strong>Lua</strong> - Syntax highlighting and language support</li> +<li><strong>Better Comments</strong> - Enhanced comment highlighting</li> +<li><strong>Error Lens</strong> - Inline error display</li> +</ul> +<h3>Workspace Setup</h3> +<p>Create a workspace for ReiLua projects:</p> +<p>1. Open your game folder in Zed 2. File → Add Folder to Workspace 3. Add the ReiLua source folder (for reference) 4. File → Save Workspace As...</p> +<p>This lets you easily reference ReiLua source while developing your game.</p> +<h3>Debugging</h3> +<p>For debugging Lua code with Zed:</p> +<p>1. Use <code>print()</code> statements liberally 2. Run ReiLua with <code>--log</code> flag to see output 3. Use <code>RL.TraceLog()</code> for more detailed logging:</p> +<pre><code>RL.TraceLog(RL.LOG_INFO, "Player position: " .. x .. ", " .. y) +RL.TraceLog(RL.LOG_WARNING, "Low health!") +RL.TraceLog(RL.LOG_ERROR, "Failed to load asset!") +</code></pre> +<h3>Terminal Integration</h3> +<p>Run ReiLua directly from Zed's terminal:</p> +<p>1. Press `<code> Ctrl+</code> `<code> / </code><code> Cmd+</code> `<code> to open terminal 2. Run your game:</p> +<pre><code>path\to\ReiLua.exe --log --no-logo +</code></pre> +<h3>Tips for ReiLua Development in Zed</h3> +<p>1. <strong>Use Multiple Cursors</strong>: </code>Alt+Click<code> to add cursors, great for batch edits 2. <strong>Split Views</strong>: </code>Ctrl+\<code> to split editor for side-by-side editing 3. <strong>Symbol Search</strong>: </code>Ctrl+T<code> / </code>Cmd+T<code> to search for functions 4. <strong>Zen Mode</strong>: </code>Ctrl+K Z<code> for distraction-free coding 5. <strong>Live Grep</strong>: </code>Ctrl+Shift+F<code> to search across all files</p> +<h2>Documentation</h2> +<h3>Comprehensive Guides</h3> +<ul> +<li><strong><a href="manual.html">EMBEDDING.md</a></strong> - Complete guide to embedding Lua and assets</li> +<li><strong><a href="manual.html">ASSET_LOADING.md</a></strong> - Asset loading API and loading screen documentation</li> +<li><strong><a href="manual.html">SPLASH_SCREENS.md</a></strong> - Splash screen customization guide</li> +<li><strong><a href="manual.html">BUILD_SCRIPTS.md</a></strong> - Build scripts documentation</li> +<li><strong><a href="manual.html">API.md</a></strong> - Complete API reference (1000+ functions)</li> +<li><strong><a href="manual.html">UPGRADE_SUMMARY.md</a></strong> - Technical details of enhancements</li> +</ul> +<h3>Quick References</h3> +<ul> +<li><strong>docs/API.md</strong> - All ReiLua/Raylib functions</li> +<li><strong>tools/ReiLua_API.lua</strong> - Lua annotations for IDE autocomplete</li> +<li><strong>examples/</strong> - Example games and demos</li> +</ul> +<h2>Troubleshooting</h2> +<h3>Common Issues</h3> +<p>Game doesn't start:</p> +<ul> +<li>Run with </code>--log<code> to see error messages</li> +<li>Check that </code>main.lua<code> exists</li> +<li>Verify all required assets exist</li> +</ul> +<p>Assets not loading:</p> +<ul> +<li>Check file paths (use forward slashes or escaped backslashes)</li> +<li>Verify files exist in the correct location</li> +<li>Use </code>--log<code> to see loading errors</li> +</ul> +<p>Splash screens don't show:</p> +<ul> +<li>Check you're not using </code>--no-logo<code> flag</li> +<li>Verify build completed successfully</li> +<li>Rebuild project: </code>cmake --build . --config Release<code></li> +</ul> +<p>Lua files not embedded:</p> +<ul> +<li>Ensure Lua files are in </code>build/<code> directory before building</li> +<li>Check </code>main.lua<code> exists</li> +<li>Verify </code>-DEMBED_MAIN=ON<code> was used</li> +</ul> +<p>Assets not embedded:</p> +<ul> +<li>Create </code>build/assets/<code> folder</li> +<li>Copy assets before building</li> +<li>Verify </code>-DEMBED_ASSETS=ON<code> was used</li> +</ul> +<p>Build fails:</p> +<ul> +<li>Check CMake and compiler are installed and in PATH</li> +<li>Verify </code>libraylib.a<code> and </code>liblua.a<code> are in </code>lib/<code> folder</li> +<li>Try clean build: </code>scripts\build_dev.bat clean<code></li> +</ul> +<h3>Getting Help</h3> +<p>1. Check documentation files listed above 2. Review the examples in </code>examples/<code> folder 3. Use </code>--log` flag to see detailed error messages 4. Check your file paths and directory structure</p> +<h2>Contributing</h2> +<p>Contributions are welcome! This is an enhanced version with additional features. When contributing:</p> +<p>1. Test thoroughly with both development and release builds 2. Update documentation if adding features 3. Follow existing code style 4. Test on multiple platforms if possible</p> +<h2>License</h2> +<p>ReiLua is licensed under the zlib/libpng license. See LICENSE file for details.</p> +<h3>Third-Party Licenses</h3> +<ul> +<li><strong>Raylib</strong> - zlib/libpng license</li> +<li><strong>Lua</strong> - MIT license</li> +<li><strong>Oleaguid Font</strong> - Check font documentation for licensing</li> +</ul> +<h2>Contact & Links</h2> +<ul> +<li><strong>Original ReiLua</strong>: https://github.com/Gamerfiend/ReiLua</li> +<li><strong>Raylib</strong>: https://github.com/raysan5/raylib</li> +<li><strong>Lua</strong>: https://www.lua.org/</li> +</ul> +<h2>Version Information</h2> +<ul> +<li><strong>ReiLua Version</strong>: Based on original ReiLua with enhancements</li> +<li><strong>Raylib Version</strong>: 5.5</li> +<li><strong>Lua Version</strong>: 5.4</li> +</ul> +<p>---</p> +<p>Happy Game Development!</p> +<hr> +<h2 id="embedding">Embedding</h2> +<h1>Embedding main.lua into Executable</h1> +<p>When you're ready to ship your game, you can embed all Lua files and asset files directly into the executable.</p> +<h2>Development vs Release Workflow</h2> +<p>Development Build (Fast Iteration)</p> +<p>During development, use external files for quick iteration.</p> +<p>Setup:</p> +<pre><code>GameFolder/ +├── ReiLua.exe +├── main.lua +├── player.lua +└── assets/ + ├── player.png + └── music.wav +</code></pre> +<p>Build:</p> +<pre><code>cd build +cmake .. +cmake --build . +</code></pre> +<p>Benefits:</p> +<ul> +<li>Edit Lua files and re-run immediately</li> +<li>Edit assets and reload</li> +<li>Fast development cycle</li> +<li>Debug with <code>--log</code> flag</li> +</ul> +<p>Release Build (Single Executable)</p> +<p>For distribution, embed everything into one file.</p> +<p>Setup:</p> +<pre><code>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\ +</code></pre> +<p>Build:</p> +<pre><code># Configure with embedding +cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON + +# Build release +cmake --build . --config Release +</code></pre> +<p>Result:</p> +<pre><code>Distribution/ +└── YourGame.exe (Everything embedded!) +</code></pre> +<p>Benefits:</p> +<ul> +<li>Single executable file</li> +<li>No external dependencies</li> +<li>Users can't modify game files</li> +<li>Smaller download (no separate files)</li> +</ul> +<h2>Quick Start</h2> +<h3>Embedding Lua Files</h3> +<p>1. <strong>Copy your Lua files to the build directory</strong>:</p> + <pre><code> copy main.lua build\main.lua + copy player.lua build\player.lua + </code></pre> +<p>2. <strong>Build with EMBED_MAIN option</strong>:</p> + <pre><code> cd build + cmake .. -DEMBED_MAIN=ON + cmake --build . --config Release + </code></pre> +<h2>Command Line Options</h2> +<p>ReiLua supports several command-line options:</p> +<pre><code>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) +</code></pre> +<h3>Console/Logging</h3> +<p>By default, ReiLua runs <strong>without a console window</strong> for a clean user experience. To enable console output for debugging:</p> +<pre><code># 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 +</code></pre> +<p>This is useful during development to see:</p> +<ul> +<li>TraceLog output</li> +<li>Print statements</li> +<li>Lua errors</li> +<li>Debug information</li> +</ul> +<h2>Complete Release Workflow</h2> +<p>Here's a complete step-by-step guide to prepare your game for release:</p> +<h3>Step 1: Organize Your Project</h3> +<p>Ensure your project has this structure:</p> +<pre><code>MyGame/ +├── main.lua +├── player.lua +├── enemy.lua +├── player.png +├── enemy.png +├── music.wav +└── icon.ico (optional) +</code></pre> +<h3>Step 2: Customize Branding (Optional)</h3> +<p>Change executable icon:</p> +<pre><code># Replace ReiLua's icon with yours +copy MyGame\icon.ico ReiLua\icon.ico +</code></pre> +<p>Edit executable properties: Open <code>ReiLua\resources.rc</code> and modify:</p> +<pre><code>VALUE "CompanyName", "Your Studio Name" +VALUE "FileDescription", "Your Game Description" +VALUE "ProductName", "Your Game Name" +VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" +</code></pre> +<p>Change executable name: Edit <code>ReiLua\CMakeLists.txt</code>:</p> +<pre><code>project( YourGameName ) # Change from "ReiLua" +</code></pre> +<p>See <a href="manual.html">CUSTOMIZATION.md</a> for full details.</p> +<h3>Important: Asset Paths</h3> +<strong>Keep your paths consistent!</strong> The embedding system now preserves the <code>assets/</code> prefix, so use the same paths in both development and release: +<pre><code>-- 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") +</code></pre> +<p>Your Lua code doesn't need to change between development and release builds!</p> +<h3>Step 3: Prepare Build Directory</h3> +<pre><code>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 +</code></pre> +<h3>Step 4: Build Release</h3> +<pre><code># Configure with embedding enabled +cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON + +# Build in release mode +cmake --build . --config Release +</code></pre> +<h3>Step 5: Test Release Build</h3> +<pre><code># Test with console to verify everything loaded +YourGameName.exe --log + +# Test production mode (no console) +YourGameName.exe +</code></pre> +<p>Check console output for:</p> +<ul> +<li>"ReiLua x.x.x" version info</li> +<li>No file loading errors</li> +<li>Game runs correctly</li> +</ul> +<h3>Step 6: Package for Distribution</h3> +<pre><code># Create distribution folder +mkdir ..\Distribution +copy YourGameName.exe ..\Distribution\ + +# Optional: Add README, LICENSE, etc. +copy ..\README.txt ..\Distribution\ +</code></pre> +<p>Your game is now ready to distribute as a single executable!</p> +<h3>Workflow Summary</h3> +<p>| Stage | Build Command | Files Needed | Result | |-------|--------------|--------------|--------| | <strong>Development</strong> | <code>cmake .. && cmake --build .</code> | Lua + assets external | Fast iteration | | <strong>Testing</strong> | <code>cmake .. -DEMBED_MAIN=ON && cmake --build .</code> | Lua in build/ | Test embedding | | <strong>Release</strong> | <code>cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON && cmake --build . --config Release</code> | Lua + assets in build/ | Single .exe |</p> +<h3>Troubleshooting</h3> +<p>Problem: "No .lua files found in build directory"</p> +<pre><code># Solution: Copy Lua files to build directory +copy ..\*.lua . +</code></pre> +<p>Problem: "No files found in assets folder"</p> +<pre><code># Solution: Create assets folder and copy files +mkdir assets +copy ..\*.png assets\ +</code></pre> +<p>Problem: Game crashes on startup</p> +<pre><code># Solution: Run with --log to see error messages +YourGameName.exe --log +</code></pre> +<p>Problem: Assets not loading</p> +<ul> +<li>Verify assets are in <code>build/assets/</code> before building</li> +<li>Check asset filenames match in your Lua code</li> +<li>Use <code>--log</code> to see loading errors</li> +</ul> +<h3>Notes</h3> +<ul> +<li><code>.lua</code> files in the <strong>build directory root</strong> are embedded when using <code>EMBED_MAIN=ON</code></li> +<li>Asset files in <strong>build/assets/</strong> folder (and subfolders) are embedded when using <code>EMBED_ASSETS=ON</code></li> +<li><code>main.lua</code> must exist and is always the entry point</li> +<li>Asset embedding works with subdirectories: <code>assets/images/player.png</code> → Load with <code>LoadImage("player.png")</code></li> +<li>Both Lua and asset embedding can be used independently or together</li> +<li>The system falls back to file system if embedded file is not found</li> +<li>No code changes needed - all raylib functions work automatically with embedded assets</li> +</ul> +<h2>Customizing Your Executable</h2> +<p>Want to add your own icon and version info to the executable? See <a href="manual.html">CUSTOMIZATION.md</a> for details on:</p> +<ul> +<li>Adding a custom icon</li> +<li>Setting exe properties (company name, version, description)</li> +<li>Renaming the executable</li> +</ul> +<hr> +<h2 id="asset-loading">Asset Loading</h2> +<h1>Asset Loading System</h1> +<p>ReiLua includes a built-in asset loading system with a loading screen UI that shows progress while assets are being loaded.</p> +<h2>Features</h2> +<ul> +<li>Automatic Progress Tracking - Tracks how many assets have been loaded</li> +<li>Loading UI with:</li> +<li>Animated "Loading..." text with dots</li> +<li>Smooth progress bar with shimmer effect</li> +<li>Progress percentage (e.g., "3 / 10")</li> +<li>Current asset name being loaded</li> +<li>Easy to Use - Just 3 functions to show loading progress</li> +<li>Works in development and release builds</li> +</ul> +<h2>API Functions</h2> +<h3>RL.BeginAssetLoading(totalAssets)</h3> +<p>Initialize asset loading progress tracking and show the loading screen.</p> +<p>Parameters:</p> +<ul> +<li><code>totalAssets</code> (integer) - Total number of assets to load</li> +</ul> +<p>Example:</p> +<pre><code>RL.BeginAssetLoading(10) -- We're loading 10 assets +</code></pre> +<p>---</p> +<h3>RL.UpdateAssetLoading(assetName)</h3> +<p>Update the loading progress and display current asset being loaded.</p> +<p>Parameters:</p> +<ul> +<li><code>assetName</code> (string) - Name of the asset currently being loaded</li> +</ul> +<p>Example:</p> +<pre><code>RL.UpdateAssetLoading("player.png") +</code></pre> +<p>Call this <strong>after</strong> each asset is loaded to update the progress bar.</p> +<p>---</p> +<h3>RL.EndAssetLoading()</h3> +<p>Finish asset loading and hide the loading screen.</p> +<p>Example:</p> +<pre><code>RL.EndAssetLoading() +</code></pre> +<h2>Quick Example</h2> +<pre><code>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 +</code></pre> +<h2>Complete Example</h2> +<pre><code>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 +</code></pre> +<h2> Loading Screen Appearance</h2> +<p>The loading screen features a clean 1-bit pixel art style:</p> +<p>Design:</p> +<ul> +<li>Pure black and white aesthetic</li> +<li>Retro pixel art styling</li> +<li>Minimal and clean design</li> +</ul> +<p>Elements:</p> +<ul> +<li><strong>Title</strong>: "LOADING" in bold white pixel text</li> +<li><strong>Animated Dots</strong>: White pixelated dots (4x4 squares) that cycle</li> +<li><strong>Progress Bar</strong>:</li> +<li>200px wide, 16px tall</li> +<li>Thick 2px white border (pixel art style)</li> +<li>White fill with black dithering pattern</li> +<li>Retro/Classic terminal aesthetic</li> +<li><strong>Progress Text</strong>: "3/10" in white pixel font style</li> +<li><strong>Asset Name</strong>: Current loading asset in small white text</li> +<li><strong>Corner Decorations</strong>: White pixel art L-shaped corners in all 4 corners</li> +</ul> +<p>Background:</p> +<ul> +<li>Pure black background (#000000)</li> +<li>High contrast for maximum clarity</li> +</ul> +<p>Color Palette:</p> +<ul> +<li>White text and UI (#FFFFFF)</li> +<li>Black background (#000000)</li> +<li>Pure 1-bit aesthetic (inverted terminal style)</li> +</ul> +<p>Style Inspiration:</p> +<ul> +<li>Classic terminal / console aesthetic</li> +<li>MS-DOS loading screens</li> +<li>1-bit dithering patterns</li> +<li>Chunky pixel borders</li> +<li>Retro computing / CRT monitor style</li> +</ul> +<h2> Customization</h2> +<p>If you want to customize the loading screen appearance, you can modify the colors and sizes in <code>src/lua_core.c</code> in the <code>drawLoadingScreen()</code> function.</p> +<h2> Performance Tips</h2> +<p>1. <strong>Call UpdateAssetLoading AFTER loading</strong> - This ensures the progress updates at the right time 2. <strong>Load assets in order of importance</strong> - Load critical assets first 3. <strong>Group similar assets</strong> - Load all textures, then sounds, etc. 4. <strong>Use descriptive names</strong> - Shows better feedback to users</p> +<h2> Example Asset Loading Patterns</h2> +<h3>Pattern 1: Simple List</h3> +<pre><code>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() +</code></pre> +<h3>Pattern 2: With Types</h3> +<pre><code>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() +</code></pre> +<h3>Pattern 3: Error Handling</h3> +<pre><code>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() +</code></pre> +<h2> When to Use</h2> +<p>Use the loading system when:</p> +<ul> +<li>You have more than 5-10 assets to load</li> +<li>Assets are large (images, sounds, fonts)</li> +<li>Loading might take more than 1 second</li> +<li>You want polished loading feedback</li> +</ul> +<p>You can skip it when:</p> +<ul> +<li>You have very few, small assets</li> +<li>Loading is nearly instant</li> +<li>You prefer immediate game start</li> +</ul> +<h2>✨ Benefits</h2> +<ul> +<li>Polished user experience</li> +<li>User knows the game is loading, not frozen</li> +<li>Shows progress for large asset sets</li> +<li>Works with embedded assets</li> +<li>Minimal code required</li> +<li>Beautiful default UI</li> +</ul> +<p>The loading system makes your game feel polished with just a few lines of code!</p> +<hr> +<h2 id="splash-screens">Splash Screens</h2> +<h1>Splash Screens</h1> +<p>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.</p> +<h2>Overview</h2> +<p>When you run your ReiLua game, it automatically shows two splash screens in sequence:</p> +<p>1. <strong>Custom Text</strong> - Clean, bold text on Raylib red background (similar to Squid Game style) 2. <strong>"Made using"</strong> - Text with Raylib and ReiLua logos displayed side-by-side</p> +<p>Each splash screen:</p> +<ul> +<li>Fades in over 0.8 seconds</li> +<li>Displays for 2.5 seconds</li> +<li>Fades out over 0.8 seconds</li> +<li>Total display time: 8.2 seconds for both screens</li> +</ul> +<h2>Features</h2> +<h3>Always Embedded</h3> +<p>The logo images are <strong>always embedded</strong> into the executable in both development and release builds. This means:</p> +<ul> +<li>No external logo files needed</li> +<li>Consistent splash screens across all builds</li> +<li>No risk of missing logo files</li> +<li>Clean appearance from the start</li> +</ul> +<h3>Asset Loading Integration</h3> +<p>The splash screens display <strong>before</strong> your game's asset loading begins. This means:</p> +<p>1. User starts your game 2. Splash screens play (~8 seconds) 3. Your <code>RL.init()</code> function runs 4. Asset loading with progress indicator (if you use it) 5. Your game starts</p> +<p>This creates a smooth, polished startup experience.</p> +<h2>Skipping Splash Screens (Development)</h2> +<p>During development, you often need to test your game repeatedly. Waiting for splash screens every time can slow down your workflow. Use the <code>--no-logo</code> flag to skip them:</p> +<pre><code># Windows +ReiLua.exe --no-logo + +# Linux/Mac +./ReiLua --no-logo + +# With other options +ReiLua.exe --log --no-logo +./ReiLua --no-logo path/to/game/ +</code></pre> +<strong>Note:</strong> The <code>--no-logo</code> flag only works in development. In release builds, users should see the full splash screen sequence. +<h2>Technical Details</h2> +<h3>How It Works</h3> +<p>The splash screen system is implemented in C and runs before any Lua code executes:</p> +<p>1. <strong>Logo Embedding</strong>: During build, <code>scripts/embed_logo.py</code> converts PNG files to C byte arrays 2. <strong>Initialization</strong>: Before calling <code>RL.init()</code>, the engine initializes splash screens 3. <strong>Display Loop</strong>: A dedicated loop handles timing, fading, and rendering 4. <strong>Cleanup</strong>: After completion, resources are freed and Lua code begins</p> +<h3>Files</h3> +<ul> +<li><code>src/splash.c</code> - Splash screen implementation</li> +<li><code>include/splash.h</code> - Header file</li> +<li><code>scripts/embed_logo.py</code> - Python script to embed logo images</li> +<li><code>logo/raylib_logo.png</code> - Raylib logo (embedded)</li> +<li><code>logo/reilua_logo.png</code> - ReiLua logo (embedded)</li> +</ul> +<h3>Build Integration</h3> +<p>The CMakeLists.txt automatically:</p> +<p>1. Runs <code>scripts/embed_logo.py</code> during build 2. Generates <code>embedded_logo.h</code> with logo data 3. Defines <code>EMBED_LOGO</code> flag 4. Compiles <code>splash.c</code> with the project</p> +<p>No manual steps required - it just works!</p> +<h2>Customization</h2> +<h3>Changing Splash Screen Text</h3> +<p>To change the default text to your studio name:</p> +<p>1. Open <code>src/splash.c</code> 2. Find the splash drawing function 3. Change the text line:</p> + <pre><code> const char* text = "YOUR STUDIO NAME"; + </code></pre> +<p>4. Rebuild the project</p> +<strong>Note:</strong> Use ALL CAPS for the Squid Game-style aesthetic. +<h3>Changing Logos</h3> +<p>To use different logos:</p> +<p>1. Replace <code>logo/raylib_logo.png</code> and/or <code>logo/reilua_logo.png</code> 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</p> +<h3>Changing Timing</h3> +<p>To adjust how long each screen displays:</p> +<p>1. Open <code>src/splash.c</code> 2. Modify these constants at the top:</p> + <pre><code> #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 + </code></pre> +<p>3. Rebuild the project</p> +<h3>Removing Splash Screens Entirely</h3> +<p>If you don't want any splash screens:</p> +<p>1. Open <code>src/main.c</code> 2. Find this block:</p> + <pre><code> /* Show splash screens if not skipped */ + if ( !skip_splash ) { + splashInit(); + // ... splash code ... + splashCleanup(); + } + </code></pre> +<p>3. Comment out or remove the entire block 4. Rebuild the project</p> +<h2>Example: Complete Startup Sequence</h2> +<p>Here's what a typical game startup looks like with everything enabled:</p> +<pre><code>ReiLua.exe MyGame/ +</code></pre> +<p>User Experience: 1. <strong>Splash Screen 1</strong> (4.1 seconds)</p> +<ul> +<li>Custom text displayed in bold (default: "YOUR STUDIO NAME")</li> +<li>Red background (Raylib color #E62937)</li> +<li>Subtle zoom effect</li> +</ul> +<p>2. <strong>Splash Screen 2</strong> (4.1 seconds)</p> +<ul> +<li>"Made using" text at top</li> +<li>Raylib + ReiLua logos side-by-side (max 200px each)</li> +<li>Black background</li> +</ul> +<p>3. <strong>Asset Loading</strong> (varies)</p> +<ul> +<li>Your loading screen with progress bar</li> +<li>Shows "Loading texture1.png", "3/10", etc.</li> +</ul> +<p>4. <strong>Game Start</strong></p> +<ul> +<li>Your game's main screen appears</li> +<li>Player can interact</li> +</ul> +<h2>Best Practices</h2> +<p>1. <strong>Keep --no-logo for Development</strong>: Always use <code>--no-logo</code> during active development 2. <strong>Test Without Flag</strong>: Occasionally test without <code>--no-logo</code> to ensure splash screens work 3. <strong>Customize for Your Studio</strong>: Change the text and logos to match your branding 4. <strong>Consider Total Time</strong>: Splash (~8s) + Loading (varies) = Total startup time 5. <strong>Optimize Loading</strong>: Keep asset loading fast to maintain a good first impression</p> +<h2>Troubleshooting</h2> +<h3>Splash Screens Don't Show</h3> +<strong>Problem</strong>: Game starts immediately without splash screens +<strong>Solutions</strong>: +<ul> +<li>Check you're not using <code>--no-logo</code> flag</li> +<li>Verify logos exist in <code>logo/</code> folder before building</li> +<li>Check console output for embedding errors</li> +<li>Rebuild project completely: <code>cmake .. && make clean && make</code></li> +</ul> +<h3>Logos Appear Corrupted</h3> +<strong>Problem</strong>: Logos display incorrectly or not at all +<strong>Solutions</strong>: +<ul> +<li>Verify PNG files are valid (open in image viewer)</li> +<li>Check file sizes aren't too large (keep under 1MB each)</li> +<li>Ensure PNGs use standard format (not progressive or exotic encoding)</li> +<li>Rebuild project to regenerate embedded data</li> +</ul> +<h3>Compilation Errors</h3> +<strong>Problem</strong>: Build fails with logo-related errors +<strong>Solutions</strong>: +<ul> +<li>Ensure Python 3 is installed and in PATH</li> +<li>Check <code>scripts/embed_logo.py</code> has correct paths</li> +<li>Verify <code>logo/</code> folder exists with both PNG files</li> +<li>Check CMake output for specific error messages</li> +</ul> +<h2>Command Reference</h2> +<pre><code># Development (skip splash) +ReiLua --no-logo + +# Development with logging +ReiLua --log --no-logo + +# Production/testing (full splash) +ReiLua + +# Help +ReiLua --help +</code></pre> +<p>---</p> +<p>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!</p> +<hr> +<h2 id="build-scripts">Build Scripts</h2> +<h1>Build Scripts Documentation</h1> +<p>ReiLua includes automated build scripts for easy development and release builds.</p> +<h2>Available Scripts</h2> +<h3>Development Build Scripts</h3> +<ul> +<li><strong>Windows</strong>: <code>scripts\build_dev.bat</code></li> +<li><strong>Linux/Unix</strong>: <code>scripts/build_dev.sh</code></li> +</ul> +<h3>Release Build Scripts </h3> +<ul> +<li><strong>Windows</strong>: <code>scripts\build_release.bat</code></li> +<li><strong>Linux/Unix</strong>: <code>scripts/build_release.sh</code></li> +</ul> +<h2>Development Build</h2> +<h3>Purpose</h3> +<p>Fast iteration during game development with external Lua files and assets.</p> +<h3>Usage</h3> +<p>Windows:</p> +<pre><code>scripts\build_dev.bat +</code></pre> +<p>Linux/Unix:</p> +<pre><code>chmod +x scripts/build_dev.sh +scripts/build_dev.sh +</code></pre> +<h3>Features</h3> +<ul> +<li>No embedding - loads Lua and assets from file system</li> +<li>Fast build times</li> +<li>Edit code and assets without rebuilding</li> +<li>Automatic cleanup of embedded files</li> +<li>Warns if Lua files or assets are in build directory</li> +<li>Optional clean build: <code>scripts\build_dev.bat clean</code> or <code>scripts/build_dev.sh clean</code></li> +</ul> +<h3>Output</h3> +<ul> +<li>Development executable: <code>build/ReiLua.exe</code></li> +<li>Run your game: <code>cd your_game && path/to/build/ReiLua.exe</code></li> +<li>Debug mode: <code>path/to/build/ReiLua.exe --log</code></li> +</ul> +<h2>Release Build</h2> +<h3>Purpose</h3> +<p>Create a single-file executable for distribution with all code and assets embedded.</p> +<h3>Preparation</h3> +<p>Before running the release build, prepare your files:</p> +<pre><code>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/ +</code></pre> +<h3>Usage</h3> +<p>Windows:</p> +<pre><code>scripts\build_release.bat +</code></pre> +<p>Linux/Unix:</p> +<pre><code>chmod +x scripts/build_release.sh +scripts/build_release.sh +</code></pre> +<h3>Features</h3> +<ul> +<li>Embeds all Lua files from <code>build/</code> directory</li> +<li>Embeds all assets from <code>build/assets/</code> folder</li> +<li>Creates single-file executable</li> +<li>Release optimization enabled</li> +<li>Verifies Lua files and assets before building</li> +<li>Shows summary of embedded files after build</li> +<li>Interactive confirmation before building</li> +</ul> +<h3>Output</h3> +<ul> +<li>Release executable: <code>build/ReiLua.exe</code></li> +<li>Ready for distribution - no external dependencies</li> +<li>Can be renamed to your game name</li> +</ul> +<h3>Build Configuration</h3> +<p>The release build automatically configures:</p> +<ul> +<li><code>EMBED_MAIN=ON</code> - Embeds all Lua files</li> +<li><code>EMBED_ASSETS=ON</code> - Embeds all assets (if assets folder exists)</li> +<li><code>CMAKE_BUILD_TYPE=Release</code> - Optimized build</li> +</ul> +<h2>Customizing Your Executable</h2> +<h3>Adding Custom Icon</h3> +<p>1. Replace <code>icon.ico</code> with your own icon file 2. Keep the same filename or update <code>resources.rc</code> 3. Rebuild</p> +<h3>Changing Executable Properties</h3> +<p>Edit <code>resources.rc</code> to customize:</p> +<pre><code>VALUE "CompanyName", "Your Studio Name" +VALUE "FileDescription", "Your Game Description" +VALUE "ProductName", "Your Game Name" +VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" +</code></pre> +<h3>Renaming the Executable</h3> +<p>Edit <code>CMakeLists.txt</code>:</p> +<pre><code>project( YourGameName ) # Line 6 +</code></pre> +<p>After building, the executable will be named <code>YourGameName.exe</code>.</p> +<h2>Workflow Examples</h2> +<h3>Development Workflow</h3> +<pre><code># 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 +</code></pre> +<h3>Release Workflow</h3> +<pre><code># 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 +</code></pre> +<h2>Troubleshooting</h2> +<h3>"CMake configuration failed"</h3> +<ul> +<li>Ensure CMake is installed and in PATH</li> +<li>Ensure MinGW is installed and in PATH</li> +<li>Check <code>CMakeLists.txt</code> exists in parent directory</li> +</ul> +<h3>"No Lua files found"</h3> +<ul> +<li>Copy your Lua files to <code>build/</code> directory before release build</li> +<li>Ensure <code>main.lua</code> exists (required entry point)</li> +</ul> +<h3>"Build failed"</h3> +<ul> +<li>Check compiler errors in output</li> +<li>Ensure all dependencies are installed</li> +<li>Try clean build: <code>scripts\build_dev.bat clean</code></li> +</ul> +<h3>Development build embedding warning</h3> +<ul> +<li>The dev build script warns if it finds Lua files or assets in build/</li> +<li>These should be removed for development builds</li> +<li>The script offers to remove them automatically</li> +</ul> +<h2>Script Features</h2> +<h3>Safety Features</h3> +<ul> +<li>Checks for correct directory before running</li> +<li>Validates required files exist</li> +<li>Warns about potential issues</li> +<li>Interactive confirmations for release builds</li> +<li>Automatic cleanup of old embedded files</li> +</ul> +<h3>User Friendly</h3> +<ul> +<li>Clear progress messages</li> +<li>Colored output (where supported)</li> +<li>Helpful error messages</li> +<li>Pause at end to review results</li> +<li>Quick reference commands shown after build</li> +</ul> +<h2>Notes</h2> +<ul> +<li>Development builds are <strong>much faster</strong> than release builds</li> +<li>Release builds may take longer due to embedding and optimization</li> +<li>Always test your release build before distribution</li> +<li>The scripts work on both Windows (CMD/PowerShell) and Unix shells</li> +<li>On Unix, make scripts executable: <code>chmod +x build_*.sh</code></li> +</ul> +<hr> +<h2 id="customization">Customization</h2> +<h1>Customizing Your ReiLua Executable</h1> +<p>This guide explains how to customize the ReiLua executable with your own branding.</p> +<h2>Overview</h2> +<p>You can customize:</p> +<ul> +<li>Executable name</li> +<li>Window icon</li> +<li>File properties (company name, version, description, etc.)</li> +<li>Splash screen text and logos</li> +<li>Loading screen appearance</li> +</ul> +<h2>Quick Customization Checklist</h2> +<ul> +<li>[ ] Change executable name in CMakeLists.txt</li> +<li>[ ] Replace icon.ico with your game icon</li> +<li>[ ] Edit resources.rc with your game information</li> +<li>[ ] Customize splash screens in src/splash.c</li> +<li>[ ] Replace logo images in logo/ folder</li> +<li>[ ] Rebuild the project</li> +</ul> +<h2>1. Changing the Executable Name</h2> +<p>The easiest customization - change "ReiLua.exe" to "YourGame.exe".</p> +<h3>Steps</h3> +<p>1. Open <code>CMakeLists.txt</code> 2. Find line 6 (near the top):</p> + <pre><code> project( ReiLua ) + </code></pre> +<p>3. Change to your game name:</p> + <pre><code> project( MyAwesomeGame ) + </code></pre> +<p>4. Rebuild:</p> + <pre><code> cd build + cmake .. + cmake --build . --config Release + </code></pre> +<p>Result: Executable is now named <code>MyAwesomeGame.exe</code></p> +<h2>2. Adding a Custom Icon</h2> +<p>Replace the default icon with your game's icon.</p> +<h3>Requirements</h3> +<ul> +<li><strong>Format</strong>: .ico file (Windows icon format)</li> +<li><strong>Recommended sizes</strong>: 16x16, 32x32, 48x48, 256x256</li> +<li><strong>Tools</strong>: Use online converters or tools like IcoFX, GIMP, or Photoshop</li> +</ul> +<h3>Steps</h3> +<p>1. Create or convert your image to .ico format 2. Replace <code>icon.ico</code> in the ReiLua root folder with your icon 3. Keep the same filename (<code>icon.ico</code>) or update <code>resources.rc</code>:</p> + <pre><code> IDI_ICON1 ICON "your_icon.ico" + </code></pre> +<p>4. Rebuild the project</p> +<strong>Tip</strong>: Many online tools can convert PNG to ICO: +<ul> +<li>https://convertio.co/png-ico/</li> +<li>https://www.icoconverter.com/</li> +</ul> +<h2>3. Customizing Executable Properties</h2> +<p>When users right-click your .exe and select "Properties", they see file information. Customize this to show your game details.</p> +<h3>Steps</h3> +<p>1. Open <code>resources.rc</code> 2. Find the <code>VERSIONINFO</code> section 3. Modify these values:</p> +<pre><code>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 +</code></pre> +<h3>Common Values</h3> +<strong>FileVersion / ProductVersion Format</strong>: Major, Minor, Patch, Build +<ul> +<li>Example: <code>1,0,0,0</code> for version 1.0.0.0</li> +<li>Example: <code>2,3,1,5</code> for version 2.3.1.5</li> +</ul> +<strong>CompanyName Examples</strong>: +<ul> +<li>"Your Studio Name"</li> +<li>"Independent Developer"</li> +<li>"Your Name Games"</li> +</ul> +<strong>FileDescription</strong>: +<ul> +<li>Short description users see in file properties</li> +<li>Example: "Space Adventure Game"</li> +<li>Example: "Puzzle Game with Physics"</li> +</ul> +<strong>LegalCopyright</strong>: +<ul> +<li>Standard format: "Copyright (C) Year Your Name"</li> +<li>Example: "Copyright (C) 2025 Indie Studios"</li> +</ul> +<p>4. Rebuild the project</p> +<h2>4. Customizing Splash Screens</h2> +<p>Change the text and logos that appear when your game starts.</p> +<h3>Changing Splash Screen Text</h3> +<p>1. Open <code>src/splash.c</code> 2. Find the splash drawing function (around line 150) 3. Change this line:</p> + <pre><code> const char* text = "YOUR STUDIO NAME"; + </code></pre> +<strong>Style Tips</strong>: +<ul> +<li>Use ALL CAPS for bold impact</li> +<li>Keep it short (under 30 characters)</li> +<li>Examples: "INDIE STUDIO GAMES", "MADE BY YOUR NAME", "GAME JAM 2025"</li> +</ul> +<h3>Changing Splash Screen Logos</h3> +<p>1. Create or find your logos:</p> +<ul> +<li><strong>Recommended size</strong>: 256x256 pixels or smaller</li> +<li><strong>Format</strong>: PNG with transparency</li> +<li><strong>Style</strong>: Simple, recognizable logos work best</li> +</ul> +<p>2. Replace these files:</p> + <pre><code> logo/raylib_logo.png → Your game logo + logo/reilua_logo.png → Your studio logo (or keep ReiLua logo as credit) + </code></pre> +<p>3. Logo sizing:</p> +<ul> +<li>Logos are automatically scaled to max 200px</li> +<li>They display side-by-side on second splash screen</li> +<li>Maintain aspect ratio</li> +</ul> +<p>4. Rebuild the project - logos are automatically embedded</p> +<h3>Changing Splash Screen Timing</h3> +<p>1. Open <code>src/splash.c</code> 2. Modify these constants at the top:</p> + <pre><code> #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) + </code></pre> +<strong>Recommendations</strong>: +<ul> +<li>Keep fade times between 0.5 - 1.5 seconds</li> +<li>Display time between 1.5 - 3.5 seconds</li> +<li>Total splash time ideally under 10 seconds</li> +</ul> +<h3>Changing Splash Screen Colors</h3> +<p>1. Open <code>src/splash.c</code> 2. Find color definitions:</p> + <pre><code> // 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 + </code></pre> +<strong>Color Examples</strong>: +<ul> +<li>White: <code>(Color){ 255, 255, 255, 255 }</code></li> +<li>Blue: <code>(Color){ 0, 120, 215, 255 }</code></li> +<li>Dark Gray: <code>(Color){ 32, 32, 32, 255 }</code></li> +<li>Your brand color: <code>(Color){ R, G, B, 255 }</code></li> +</ul> +<h2>5. Customizing the Loading Screen</h2> +<p>Change the appearance of the asset loading screen.</p> +<h3>Steps</h3> +<p>1. Open <code>src/lua_core.c</code> 2. Find the <code>drawLoadingScreen()</code> function 3. Modify colors and style:</p> +<pre><code>// 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 +</code></pre> +<h3>Customizing Loading Text</h3> +<pre><code>// In drawLoadingScreen() function +const char* loadingText = "LOADING"; // Change to "LOADING GAME", etc. +</code></pre> +<h3>Changing Progress Bar Size</h3> +<pre><code>int barWidth = 200; // Default 200px, change as needed +int barHeight = 16; // Default 16px, change as needed +int borderThick = 2; // Border thickness +</code></pre> +<h2>6. Complete Rebranding Example</h2> +<p>Here's a complete example of rebranding ReiLua as "Space Quest":</p> +<h3>1. CMakeLists.txt</h3> +<pre><code>project( SpaceQuest ) +</code></pre> +<h3>2. resources.rc</h3> +<pre><code>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" +</code></pre> +<h3>3. icon.ico</h3> +<p>Replace with your space-themed icon</p> +<h3>4. src/splash.c</h3> +<pre><code>const char* text = "COSMIC GAMES STUDIO"; +</code></pre> +<h3>5. logo/ folder</h3> +<pre><code>logo/raylib_logo.png → Your game logo (space ship, planet, etc.) +logo/reilua_logo.png → Studio logo (keep ReiLua logo for credit) +</code></pre> +<h3>6. Build</h3> +<pre><code>cd build +cmake .. +cmake --build . --config Release +</code></pre> +<p>Result: <code>SpaceQuest.exe</code> with all your custom branding!</p> +<h2>7. Advanced: Removing ReiLua Branding</h2> +<p>If you want to completely remove ReiLua references:</p> +<h3>Remove "Made with ReiLua" Logo</h3> +<p>1. Open <code>src/splash.c</code> 2. Find <code>drawMadeWithSplash()</code> function 3. Comment out or modify the function to only show your logo</p> +<h3>Remove Second Splash Screen</h3> +<p>1. Open <code>src/main.c</code> 2. Find the splash screen loop 3. Modify to only call your custom splash</p> +<strong>Note</strong>: Please keep attribution to Raylib and ReiLua in your game's credits or about screen as a courtesy! +<h2>8. Build and Test</h2> +<p>After making any customizations:</p> +<pre><code># 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 +</code></pre> +<p>Verify:</p> +<ul> +<li>Executable has correct name</li> +<li>Icon appears in file explorer</li> +<li>Right-click → Properties shows correct info</li> +<li>Splash screens display correctly</li> +<li>Loading screen appears as expected</li> +</ul> +<h2>Checklist: Release-Ready Customization</h2> +<p>Before releasing your game:</p> +<ul> +<li>[ ] Executable name matches your game</li> +<li>[ ] Custom icon is recognizable at small sizes</li> +<li>[ ] File properties are complete and accurate</li> +<li>[ ] Splash screens show correct studio name</li> +<li>[ ] Logos are high quality and appropriate size</li> +<li>[ ] Loading screen matches your game's aesthetic</li> +<li>[ ] Copyright and legal information is correct</li> +<li>[ ] Version numbers are accurate</li> +<li>[ ] Tested on target platforms</li> +<li>[ ] Credits mention Raylib and ReiLua</li> +</ul> +<h2>Tips for Polish</h2> +<p>1. <strong>Consistent Branding</strong>: Use the same colors, fonts, and style across splash screens, loading screen, and in-game UI</p> +<p>2. <strong>Icon Quality</strong>: Invest time in a good icon - it's the first thing users see</p> +<p>3. <strong>Version Management</strong>: Update version numbers for each release</p> +<p>4. <strong>Legal Info</strong>: Always include proper copyright and attribution</p> +<p>5. <strong>Test Everything</strong>: Test your branded executable on a clean system</p> +<p>6. <strong>Keep Credits</strong>: Mention Raylib and ReiLua in your game's credits screen</p> +<h2>Troubleshooting</h2> +<p>Icon doesn't change:</p> +<ul> +<li>Ensure .ico file is valid</li> +<li>Rebuild completely (clean build)</li> +<li>Clear icon cache (Windows): Delete <code>IconCache.db</code></li> +</ul> +<p>Properties don't update:</p> +<ul> +<li>Verify <code>resources.rc</code> syntax is correct</li> +<li>Rebuild completely</li> +<li>Check that resource compiler ran (check build output)</li> +</ul> +<p>Splash screens don't show changes:</p> +<ul> +<li>Rebuild with clean build</li> +<li>Check <code>scripts/embed_logo.py</code> ran successfully</li> +<li>Verify logo files exist in <code>logo/</code> folder</li> +</ul> +<p>Executable name unchanged:</p> +<ul> +<li>Check <code>CMakeLists.txt</code> project name</li> +<li>Do a clean rebuild</li> +<li>Verify cmake configuration step succeeded</li> +</ul> +<h2>Additional Resources</h2> +<h3>Icon Creation Tools</h3> +<ul> +<li><strong>IcoFX</strong>: Icon editor (paid)</li> +<li><strong>GIMP</strong>: Free, supports ICO export</li> +<li><strong>Online</strong>: convertio.co, icoconverter.com</li> +</ul> +<h3>Image Editing</h3> +<ul> +<li><strong>GIMP</strong>: Free, powerful image editor</li> +<li><strong>Paint.NET</strong>: Simple, free Windows editor</li> +<li><strong>Photoshop</strong>: Industry standard (paid)</li> +</ul> +<h3>Color Picking</h3> +<ul> +<li><strong>ColorPicker</strong>: Use system color picker</li> +<li><strong>HTML Color Codes</strong>: htmlcolorcodes.com</li> +<li><strong>Adobe Color</strong>: color.adobe.com</li> +</ul> +<p>---</p> +<p>Now your ReiLua executable is fully branded and ready to represent your game!</p> +<hr> +<h2 id="editor-setup">Editor Setup</h2> +<h1>Zed Editor Setup for ReiLua</h1> +<p>This guide explains how to set up autocomplete, type hints, and documentation for ReiLua in Zed Editor.</p> +<p>---</p> +<h2>Method 1: Using Lua Language Server (Recommended)</h2> +<p>Zed uses the <strong>Lua Language Server (LuaLS)</strong> for Lua support. ReiLua includes <code>tools/ReiLua_API.lua</code> with LuaLS annotations.</p> +<h3>Setup Steps</h3> +<h4>1. Install Lua Language Server in Zed</h4> +<p>Zed should automatically install LuaLS when you open a Lua file. If not:</p> +<p>1. Open Zed 2. Go to <strong>Extensions</strong> (Cmd/Ctrl + Shift + X) 3. Search for "Lua" 4. Install the Lua extension</p> +<h4>2. Configure Your Project</h4> +<p>Create a <code>.luarc.json</code> file in your project root:</p> +<pre><code>{ + "runtime.version": "Lua 5.4", + "workspace.library": [ + "${3rd}/luassert/library", + "${3rd}/busted/library" + ], + "completion.enable": true, + "diagnostics.globals": [ + "RL" + ], + "workspace.checkThirdParty": false +} +</code></pre> +<h4>3. Copy tools/ReiLua_API.lua to Your Project</h4> +<p>Copy <code>tools/ReiLua_API.lua</code> to your game project folder:</p> +<pre><code># From ReiLua directory +cp tools/ReiLua_API.lua /path/to/your/game/project/ +</code></pre> +<p>Or on Windows:</p> +<pre><code>Copy-Item tools/ReiLua_API.lua "C:\path\to\your\game\project\" +</code></pre> +<h4>4. (Optional) Create Library Directory</h4> +<p>For better organization, create a library directory:</p> +<pre><code>your-game/ +├── main.lua +├── .luarc.json +└── .lua/ + └── tools/ReiLua_API.lua +</code></pre> +<p>Update <code>.luarc.json</code>:</p> +<pre><code>{ + "runtime.version": "Lua 5.4", + "workspace.library": [".lua"], + "completion.enable": true, + "diagnostics.globals": ["RL"], + "workspace.checkThirdParty": false +} +</code></pre> +<p>---</p> +<h2>Method 2: Global Configuration (All Projects)</h2> +<p>To make ReiLua API available for all projects:</p> +<h3>Windows</h3> +<p>1. Create directory: <code>%USERPROFILE%\.luarocks\lib\lua\5.4\</code> 2. Copy <code>tools/ReiLua_API.lua</code> to this directory 3. Add to global LuaLS config:</p> +<strong>Location:</strong> <code>%APPDATA%\Zed\settings.json</code> or via Zed settings +<pre><code>{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.workspace.library": [ + "C:\\Users\\YourName\\.luarocks\\lib\\lua\\5.4" + ], + "Lua.diagnostics.globals": ["RL"] + } + } + } +} +</code></pre> +<h3>Linux/macOS</h3> +<p>1. Create directory: <code>~/.lua/reilua/</code> 2. Copy <code>tools/ReiLua_API.lua</code> to this directory 3. Update Zed settings:</p> +<pre><code>{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.workspace.library": [ + "~/.lua/reilua" + ], + "Lua.diagnostics.globals": ["RL"] + } + } + } +} +</code></pre> +<p>---</p> +<h2>Method 3: Using Zed's LSP Configuration</h2> +<p>Create a <code>.zed/settings.json</code> in your project: > Note There is a sample zed settings json file in the repo root (zed.sample.settings.json)</p> +<pre><code>{ + "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 + } + } + } +} +</code></pre> +<p>---</p> +<h2>Verifying Setup</h2> +<p>Create a test file <code>test.lua</code>:</p> +<pre><code>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 +</code></pre> +<p>If autocomplete works, you should see:</p> +<ul> +<li>Function suggestions when typing <code>RL.</code></li> +<li>Parameter hints when calling functions</li> +<li>Documentation on hover</li> +<li>Constant values (RL.RED, RL.KEY_SPACE, etc.)</li> +</ul> +<p>---</p> +<h2>Enhanced Features</h2> +<h3>Enable Inlay Hints</h3> +<p>In Zed settings:</p> +<pre><code>{ + "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 + } + } + } +} +</code></pre> +<p>This will show:</p> +<ul> +<li>Parameter names inline</li> +<li>Variable types</li> +<li>Return types</li> +</ul> +<h3>Disable Annoying Warnings</h3> +<p>Add these to suppress common false positives:</p> +<pre><code>{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.diagnostics.disable": [ + "lowercase-global", + "unused-local", + "duplicate-set-field", + "missing-fields", + "undefined-field" + ], + "Lua.diagnostics.globals": ["RL"] + } + } + } +} +</code></pre> +<p>Common warnings and what they mean:</p> +<ul> +<li><code>lowercase-global</code> - Using global variables with lowercase names (RL is intentional)</li> +<li><code>unused-local</code> - Local variables that aren't used</li> +<li><code>duplicate-set-field</code> - Redefining functions (callback functions are expected to be redefined)</li> +<li><code>missing-fields</code> - Table fields that might not exist</li> +<li><code>undefined-field</code> - Accessing fields that aren't documented</li> +</ul> +<p>> <strong>Note:</strong> The <code>tools/ReiLua_API.lua</code> file now uses type annotations instead of function definitions for callbacks to prevent duplicate warnings.</p> +<p>---</p> +<h2>Troubleshooting</h2> +<h3>"duplicate-set-field" Error</h3> +<strong>Problem:</strong> Getting warnings like <code>Duplicate field 'init'. (Lua Diagnostics. duplicate-set-field)</code> +<strong>Why:</strong> The <code>tools/ReiLua_API.lua</code> file previously defined callback functions as empty function definitions. When you define them in your <code>main.lua</code>, LSP sees it as redefining the same field. +<strong>Solution:</strong> The latest <code>tools/ReiLua_API.lua</code> now uses type annotations instead: +<pre><code>-- Old way (caused warnings) +function RL.init() end + +-- New way (no warnings) +---@type fun() +RL.init = nil +</code></pre> +<p>Fix Steps: 1. <strong>Update <code>tools/ReiLua_API.lua</code></strong> - Copy the latest version from the repository 2. <strong>Or add to diagnostics.disable</strong> in your configuration:</p> + <pre><code> { + "diagnostics.disable": ["duplicate-set-field"] + } + </code></pre> +<p>3. <strong>Restart Zed</strong> to reload the configuration</p> +<p>Benefits of the new approach:</p> +<ul> +<li>No duplicate warnings</li> +<li>Still get autocomplete</li> +<li>Still get documentation on hover</li> +<li>Still get type checking</li> +</ul> +<p>---</p> +<h3>Autocomplete Not Working</h3> +<p>1. <strong>Restart Zed</strong> after configuration changes 2. <strong>Check LSP Status</strong>: Look for Lua Language Server in bottom-right status bar 3. <strong>Verify File Location</strong>: Ensure <code>tools/ReiLua_API.lua</code> is in the workspace 4. <strong>Check Console</strong>: Open Zed's log to see LSP errors</p> +<h3>Performance Issues</h3> +<p>If the language server is slow:</p> +<pre><code>{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua.workspace.maxPreload": 2000, + "Lua.workspace.preloadFileSize": 1000 + } + } + } +} +</code></pre> +<h3>Missing Documentation</h3> +<p>Ensure hover is enabled:</p> +<pre><code>{ + "hover_popover_enabled": true +} +</code></pre> +<p>---</p> +<h2>Advanced: Custom Annotations</h2> +<p>You can extend <code>tools/ReiLua_API.lua</code> with your own game types:</p> +<pre><code>---@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 = {} +</code></pre> +<p>---</p> +<h2>Keyboard Shortcuts in Zed</h2> +<ul> +<li><strong>Trigger Autocomplete</strong>: <code>Ctrl+Space</code> (Windows/Linux) or <code>Cmd+Space</code> (macOS)</li> +<li><strong>Show Documentation</strong>: Hover or <code>Ctrl+K Ctrl+I</code></li> +<li><strong>Go to Definition</strong>: <code>F12</code> or <code>Cmd+Click</code></li> +<li><strong>Find References</strong>: <code>Shift+F12</code></li> +<li><strong>Rename Symbol</strong>: <code>F2</code></li> +</ul> +<p>---</p> +<h2>Additional Resources</h2> +<ul> +<li><a href="https://github.com/LuaLS/lua-language-server">Lua Language Server GitHub</a></li> +<li><a href="https://github.com/LuaLS/lua-language-server/wiki/Annotations">LuaLS Annotations Guide</a></li> +<li><a href="https://zed.dev/docs">Zed Documentation</a></li> +</ul> +<p>---</p> +<h2>Example Project Structure</h2> +<pre><code>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/ +</code></pre> +<p>---</p> +<h2>Quick Start Template</h2> +<p>Save this as <code>.luarc.json</code> in your project:</p> +<pre><code>{ + "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 +} +</code></pre> +<p>Save this as <code>.zed/settings.json</code>:</p> +<pre><code>{ + "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 + } +} +</code></pre> +<p>Then copy <code>tools/ReiLua_API.lua</code> to your project root, and you're ready to go!</p> +<p>---</p> +<p>Happy Coding!</p> +<hr><div class="footer"><p>ReiLua Enhanced · <a href="https://indrajith.dev">indrajith.dev</a></p></div></div></body></html>
\ No newline at end of file diff --git a/docs/reference.html b/docs/reference.html new file mode 100644 index 0000000..1ba0a40 --- /dev/null +++ b/docs/reference.html @@ -0,0 +1,6023 @@ +<!DOCTYPE HTML><html><head><title>API Reference</title> +<link rel="stylesheet" href="style.css"><meta charset="utf-8"></head><body> +<div class="container"><div class="navigation"> +<a href="index.html">home</a> · <a href="manual.html">manual</a> · <a href="reference.html">reference</a> +</div><h1>ReiLua API Reference</h1><p>Complete function reference.</p><h2>Contents</h2><ul> +<li><a href="#functions">Functions</a> (9 items)</li> +<li><a href="#reilua-enhanced-functions">ReiLua Enhanced Functions</a> (3 items)</li> +<li><a href="#structures">Structures</a> (31 items)</li> +<li><a href="#defines---systemwindow-config-flags">Defines - System/Window config flags</a> (15 items)</li> +<li><a href="#defines---trace-log-level">Defines - Trace log level</a> (8 items)</li> +<li><a href="#defines---keyboard-keys-(us-keyboard-layout)">Defines - Keyboard keys (US keyboard layout)</a> (110 items)</li> +<li><a href="#defines---mouse-buttons">Defines - Mouse buttons</a> (7 items)</li> +<li><a href="#defines---mouse-cursor">Defines - Mouse cursor</a> (11 items)</li> +<li><a href="#defines---gamepad-buttons">Defines - Gamepad buttons</a> (18 items)</li> +<li><a href="#defines---gamepad-axis">Defines - Gamepad axis</a> (6 items)</li> +<li><a href="#defines---material-map-index">Defines - Material map index</a> (13 items)</li> +<li><a href="#defines---shader-location-index">Defines - Shader location index</a> (31 items)</li> +<li><a href="#defines---shader-uniform-data-type">Defines - Shader uniform data type</a> (9 items)</li> +<li><a href="#defines---shader-attribute-data-types">Defines - Shader attribute data types</a> (4 items)</li> +<li><a href="#defines---pixel-formats">Defines - Pixel formats</a> (21 items)</li> +<li><a href="#defines---texture-parameters:-filter-mode">Defines - Texture parameters: filter mode</a> (6 items)</li> +<li><a href="#defines---texture-parameters:-wrap-mode">Defines - Texture parameters: wrap mode</a> (4 items)</li> +<li><a href="#defines---cubemap-layouts">Defines - Cubemap layouts</a> (5 items)</li> +<li><a href="#defines---font-type,-defines-generation-method">Defines - Font type, defines generation method</a> (3 items)</li> +<li><a href="#defines---color-blending-modes-(pre-defined)">Defines - Color blending modes (pre-defined)</a> (8 items)</li> +<li><a href="#defines---gesture">Defines - Gesture</a> (11 items)</li> +<li><a href="#defines---camera-system-modes">Defines - Camera system modes</a> (5 items)</li> +<li><a href="#defines---camera-projection">Defines - Camera projection</a> (2 items)</li> +<li><a href="#defines---n-patch-layout">Defines - N-patch layout</a> (3 items)</li> +<li><a href="#defines---math">Defines - Math</a> (4 items)</li> +<li><a href="#defines---gui-control-state">Defines - Gui control state</a> (4 items)</li> +<li><a href="#defines---gui-control-text-alignment">Defines - Gui control text alignment</a> (3 items)</li> +<li><a href="#defines---gui-control-text-alignment-vertical">Defines - Gui control text alignment vertical</a> (3 items)</li> +<li><a href="#defines---gui-control-text-wrap-mode">Defines - Gui control text wrap mode</a> (3 items)</li> +<li><a href="#defines---gui-controls">Defines - Gui controls</a> (16 items)</li> +<li><a href="#defines---gui-base-properties-for-every-control">Defines - Gui base properties for every control</a> (15 items)</li> +<li><a href="#defines---gui-extended-properties-depend-on-control">Defines - Gui extended properties depend on control</a> (7 items)</li> +<li><a href="#defines---gui-toggletogglegroup">Defines - Gui Toggle/ToggleGroup</a> (1 items)</li> +<li><a href="#defines---gui-slidersliderbar">Defines - Gui Slider/SliderBar</a> (2 items)</li> +<li><a href="#defines---gui-progressbar">Defines - Gui ProgressBar</a> (1 items)</li> +<li><a href="#defines---gui-scrollbar">Defines - Gui ScrollBar</a> (6 items)</li> +<li><a href="#defines---gui-checkbox">Defines - Gui CheckBox</a> (1 items)</li> +<li><a href="#defines---gui-combobox">Defines - Gui ComboBox</a> (2 items)</li> +<li><a href="#defines---gui-dropdownbox">Defines - Gui DropdownBox</a> (2 items)</li> +<li><a href="#defines---gui-textboxtextboxmultivalueboxspinner">Defines - Gui TextBox/TextBoxMulti/ValueBox/Spinner</a> (1 items)</li> +<li><a href="#defines---gui-spinner">Defines - Gui Spinner</a> (2 items)</li> +<li><a href="#defines---gui-listview">Defines - Gui ListView</a> (4 items)</li> +<li><a href="#defines---gui-colorpicker">Defines - Gui ColorPicker</a> (5 items)</li> +<li><a href="#defines---gui-icons-enumeration">Defines - Gui Icons enumeration</a> (220 items)</li> +<li><a href="#defines---light-type">Defines - Light type</a> (2 items)</li> +<li><a href="#defines---rlgl-default-internal-render-batch-elements-limits">Defines - RLGL Default internal render batch elements limits</a> (4 items)</li> +<li><a href="#defines---rlgl-internal-matrix-stack">Defines - RLGL Internal Matrix stack</a> (1 items)</li> +<li><a href="#defines---rlgl-shader-limits">Defines - RLGL Shader limits</a> (1 items)</li> +<li><a href="#defines---rlgl-projection-matrix-culling">Defines - RLGL Projection matrix culling</a> (2 items)</li> +<li><a href="#defines---rlgl-texture-parameters">Defines - RLGL Texture parameters</a> (16 items)</li> +<li><a href="#defines---rlgl-matrix-modes-(equivalent-to-opengl)">Defines - RLGL Matrix modes (equivalent to OpenGL)</a> (3 items)</li> +<li><a href="#defines---rlgl-primitive-assembly-draw-modes">Defines - RLGL Primitive assembly draw modes</a> (3 items)</li> +<li><a href="#defines---rlgl-gl-equivalent-data-types">Defines - RLGL GL equivalent data types</a> (2 items)</li> +<li><a href="#defines---rlgl-gl-buffer-usage-hint">Defines - RLGL GL buffer usage hint</a> (9 items)</li> +<li><a href="#defines---rlgl-shader-type">Defines - RLGL Shader type</a> (3 items)</li> +<li><a href="#defines---rlgl-gl-blending-factors">Defines - RLGL GL blending factors</a> (15 items)</li> +<li><a href="#defines---rlgl-gl-blending-functionsequations">Defines - RLGL GL blending functions/equations</a> (15 items)</li> +<li><a href="#defines---rlgl-default-shader-vertex-attribute-locations">Defines - RLGL Default shader vertex attribute locations</a> (7 items)</li> +<li><a href="#defines---rlgl-glversion">Defines - RLGL GlVersion</a> (5 items)</li> +<li><a href="#defines---rlgl-framebuffer-attachment-type">Defines - RLGL Framebuffer attachment type</a> (10 items)</li> +<li><a href="#defines---rlgl-framebuffer-texture-attachment-type">Defines - RLGL Framebuffer texture attachment type</a> (8 items)</li> +<li><a href="#defines---rlgl-cullmode">Defines - RLGL CullMode</a> (2 items)</li> +<li><a href="#defines---opengl-bitfield-mask">Defines - OpenGL Bitfield mask</a> (3 items)</li> +<li><a href="#defines---opengl-texture-parameter">Defines - OpenGL Texture parameter</a> (2 items)</li> +<li><a href="#defines---opengl-capability">Defines - OpenGL Capability</a> (11 items)</li> +<li><a href="#defines---opengl-test-function">Defines - OpenGL Test function</a> (8 items)</li> +<li><a href="#defines---opengl-face">Defines - OpenGL Face</a> (3 items)</li> +<li><a href="#defines---opengl-stencil-test">Defines - OpenGL Stencil test</a> (8 items)</li> +<li><a href="#defines---opengl-connection">Defines - OpenGL Connection</a> (5 items)</li> +<li><a href="#defines---cbuffer-data-type">Defines - CBuffer Data type</a> (10 items)</li> +<li><a href="#defines---keyboard-keys-(us-keyboard-layout)">Defines - Keyboard keys (US keyboard layout)</a> (1 items)</li> +<li><a href="#defines---glfw-api-tokens">Defines - GLFW API tokens.</a> (5 items)</li> +<li><a href="#defines---glfw-window-events">Defines - GLFW Window Events.</a> (5 items)</li> +<li><a href="#defines---glfw-input-events">Defines - GLFW Input Events.</a> (7 items)</li> +<li><a href="#core---window-related-functions">Core - Window-related functions</a> (45 items)</li> +<li><a href="#core---cursor-related-functions">Core - Cursor-related functions</a> (6 items)</li> +<li><a href="#core---drawing-related-functions">Core - Drawing-related functions</a> (15 items)</li> +<li><a href="#core---shader-management-functions">Core - Shader management functions</a> (15 items)</li> +<li><a href="#core---screen-space-related-functions">Core - Screen-space-related functions</a> (8 items)</li> +<li><a href="#core---timing-related-functions">Core - Timing-related functions</a> (4 items)</li> +<li><a href="#core---custom-frame-control-functions">Core - Custom frame control functions</a> (3 items)</li> +<li><a href="#core---random-values-generation-functions">Core - Random values generation functions</a> (3 items)</li> +<li><a href="#core---misc">Core - Misc</a> (10 items)</li> +<li><a href="#core---files-management-functions">Core - Files management functions</a> (5 items)</li> +<li><a href="#core---files-system-functions">Core - Files system functions</a> (21 items)</li> +<li><a href="#core---compressionencoding-functionality">Core - Compression/Encoding functionality</a> (7 items)</li> +<li><a href="#core---automation-events-functionality">Core - Automation events functionality</a> (14 items)</li> +<li><a href="#core---input-related-functions:-keyboard">Core - Input-related functions: keyboard</a> (8 items)</li> +<li><a href="#core---input-related-functions:-gamepads">Core - Input-related functions: gamepads</a> (11 items)</li> +<li><a href="#core---input-related-functions:-mouse">Core - Input-related functions: mouse</a> (14 items)</li> +<li><a href="#core---input-related-functions:-touch">Core - Input-related functions: touch</a> (3 items)</li> +<li><a href="#core---input-related-functions:-gestures">Core - Input-related functions: gestures</a> (8 items)</li> +<li><a href="#core---camera2d-system-functions">Core - Camera2D System functions</a> (9 items)</li> +<li><a href="#core---camera3d-system-functions">Core - Camera3D System functions</a> (25 items)</li> +<li><a href="#core---buffer-management-functions">Core - Buffer management functions</a> (15 items)</li> +<li><a href="#shapes---basic-shapes-drawing-functions">Shapes - Basic shapes drawing functions</a> (33 items)</li> +<li><a href="#shapes---splines-drawing-functions">Shapes - Splines drawing functions</a> (10 items)</li> +<li><a href="#shapes---spline-segment-point-evaluation-functions,-for-a-given-t-[00f--10f]">Shapes - Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]</a> (5 items)</li> +<li><a href="#shapes---basic-shapes-collision-detection-functions">Shapes - Basic shapes collision detection functions</a> (12 items)</li> +<li><a href="#textures---image-loading-functions">Textures - Image loading functions</a> (13 items)</li> +<li><a href="#textures---image-generation-functions">Textures - Image generation functions</a> (9 items)</li> +<li><a href="#textures---image-manipulation-functions">Textures - Image manipulation functions</a> (34 items)</li> +<li><a href="#textures---image-configuration-functions">Textures - Image configuration functions</a> (5 items)</li> +<li><a href="#textures---image-drawing-functions">Textures - Image drawing functions</a> (16 items)</li> +<li><a href="#textures---texture-loading-functions">Textures - Texture loading functions</a> (13 items)</li> +<li><a href="#textures---texture-configuration-functions">Textures - Texture configuration functions</a> (7 items)</li> +<li><a href="#textures---texture-drawing-functions">Textures - Texture drawing functions</a> (6 items)</li> +<li><a href="#textures---rendertexture-configuration-functions">Textures - RenderTexture configuration functions</a> (3 items)</li> +<li><a href="#textures---colorpixel-related-functions">Textures - Color/pixel related functions</a> (15 items)</li> +<li><a href="#text---font-loadingunloading-functions">Text - Font loading/unloading functions</a> (12 items)</li> +<li><a href="#text---text-drawing-functions">Text - Text drawing functions</a> (7 items)</li> +<li><a href="#text---text-font-info-functions">Text - Text font info functions</a> (14 items)</li> +<li><a href="#text---glyphinfo-management-functions">Text - GlyphInfo management functions</a> (10 items)</li> +<li><a href="#text---text-codepoints-management-functions-(unicode-characters)">Text - Text codepoints management functions (unicode characters)</a> (7 items)</li> +<li><a href="#text---text-strings-management-functions-(no-utf-8-strings,-only-byte-chars)">Text - Text strings management functions (no UTF-8 strings, only byte chars)</a> (8 items)</li> +<li><a href="#models---basic-geometric-3d-shapes-drawing-functions">Models - Basic geometric 3D shapes drawing functions</a> (21 items)</li> +<li><a href="#models---model-management-functions">Models - Model management functions</a> (19 items)</li> +<li><a href="#models---model-drawing-functions">Models - Model drawing functions</a> (10 items)</li> +<li><a href="#models---mesh-management-functions">Models - Mesh management functions</a> (10 items)</li> +<li><a href="#models---mesh-generation-functions">Models - Mesh generation functions</a> (12 items)</li> +<li><a href="#models---material-management-functions">Models - Material management functions</a> (16 items)</li> +<li><a href="#model---model-animations-management-functions">Model - Model animations management functions</a> (14 items)</li> +<li><a href="#model---collision-detection-functions">Model - Collision detection functions</a> (9 items)</li> +<li><a href="#audio---audio-device-management-functions">Audio - Audio device management functions</a> (5 items)</li> +<li><a href="#audio---wavesound-loadingunloading-functions">Audio - Wave/Sound loading/unloading functions</a> (13 items)</li> +<li><a href="#audio---wavesound-management-functions">Audio - Wave/Sound management functions</a> (13 items)</li> +<li><a href="#audio---music-management-functions">Audio - Music management functions</a> (19 items)</li> +<li><a href="#audio---audiostream-management-functions">Audio - AudioStream management functions</a> (19 items)</li> +<li><a href="#math---utils">Math - Utils</a> (8 items)</li> +<li><a href="#math---vector2">Math - Vector2</a> (30 items)</li> +<li><a href="#math---vector-3">Math - Vector 3</a> (38 items)</li> +<li><a href="#math---vector4">Math - Vector4</a> (22 items)</li> +<li><a href="#math---matrix">Math - Matrix</a> (21 items)</li> +<li><a href="#math---quaternion">Math - Quaternion</a> (24 items)</li> +<li><a href="#math---frustum">Math - Frustum</a> (4 items)</li> +<li><a href="#gui---global-gui-state-control-functions">Gui - Global gui state control functions</a> (12 items)</li> +<li><a href="#gui---font-setget-functions">Gui - Font set/get functions</a> (2 items)</li> +<li><a href="#gui---style-setget-functions">Gui - Style set/get functions</a> (2 items)</li> +<li><a href="#gui---styles-loading-functions">Gui - Styles loading functions</a> (2 items)</li> +<li><a href="#gui---tooltips-management-functions">Gui - Tooltips management functions</a> (3 items)</li> +<li><a href="#gui---icons-functionality">Gui - Icons functionality</a> (6 items)</li> +<li><a href="#gui---containerseparator-controls,-useful-for-controls-organization">Gui - Container/separator controls, useful for controls organization</a> (6 items)</li> +<li><a href="#gui---basic-controls-set">Gui - Basic controls set</a> (19 items)</li> +<li><a href="#gui---advance-controls-set">Gui - Advance controls set</a> (10 items)</li> +<li><a href="#lights---light-management-functions">Lights - Light management functions</a> (12 items)</li> +<li><a href="#rlgl---matrix-operations">RLGL - Matrix operations</a> (14 items)</li> +<li><a href="#rlgl---vertex-level-operations">RLGL - Vertex level operations</a> (9 items)</li> +<li><a href="#rlgl---vertex-buffers-state">RLGL - Vertex buffers state</a> (10 items)</li> +<li><a href="#rlgl---textures-state">RLGL - Textures state</a> (7 items)</li> +<li><a href="#rlgl---shader-state">RLGL - Shader state</a> (2 items)</li> +<li><a href="#rlgl---framebuffer-state">RLGL - Framebuffer state</a> (6 items)</li> +<li><a href="#rlgl---general-render-state">RLGL - General render state</a> (29 items)</li> +<li><a href="#rlgl---initialization-functions">RLGL - Initialization functions</a> (8 items)</li> +<li><a href="#rlgl---render-batch-management">RLGL - Render batch management</a> (7 items)</li> +<li><a href="#rlgl---vertex-buffers-management">RLGL - Vertex buffers management</a> (14 items)</li> +<li><a href="#rlgl---textures-management">RLGL - Textures management</a> (10 items)</li> +<li><a href="#rlgl---framebuffer-management-(fbo)">RLGL - Framebuffer management (fbo)</a> (4 items)</li> +<li><a href="#rlgl---shaders-management">RLGL - Shaders management</a> (11 items)</li> +<li><a href="#rlgl---compute-shader-management">RLGL - Compute shader management</a> (2 items)</li> +<li><a href="#rlgl---shader-buffer-storage-object-management-(ssbo)">RLGL - Shader buffer storage object management (ssbo)</a> (7 items)</li> +<li><a href="#rlgl---buffer-management">RLGL - Buffer management</a> (1 items)</li> +<li><a href="#rlgl---matrix-state-management">RLGL - Matrix state management</a> (9 items)</li> +<li><a href="#opengl---rendering">OpenGL - Rendering</a> (1 items)</li> +<li><a href="#opengl---frame-buffers">OpenGL - Frame Buffers</a> (1 items)</li> +<li><a href="#opengl---state-management">OpenGL - State Management</a> (10 items)</li> +<li><a href="#opengl---utility">OpenGL - Utility</a> (1 items)</li> +<li><a href="#easings---linear-easing-functions">Easings - Linear Easing functions</a> (1 items)</li> +<li><a href="#easings---sine-easing-functions">Easings - Sine Easing functions</a> (3 items)</li> +<li><a href="#easings---circular-easing-functions">Easings - Circular Easing functions</a> (3 items)</li> +<li><a href="#easings---cubic-easing-functions">Easings - Cubic Easing functions</a> (3 items)</li> +<li><a href="#easings---quadratic-easing-functions">Easings - Quadratic Easing functions</a> (3 items)</li> +<li><a href="#easings---exponential-easing-functions">Easings - Exponential Easing functions</a> (3 items)</li> +<li><a href="#easings---back-easing-functions">Easings - Back Easing functions</a> (3 items)</li> +<li><a href="#easings---bounce-easing-functions">Easings - Bounce Easing functions</a> (3 items)</li> +<li><a href="#easings---elastic-easing-functions">Easings - Elastic Easing functions</a> (3 items)</li> +<li><a href="#bitwise-operations---arithmetic">Bitwise Operations - Arithmetic</a> (9 items)</li> +<li><a href="#glfw-core---input-related-functions:-keyboard">GLFW Core - Input-related functions: keyboard</a> (2 items)</li> +<li><a href="#window-events">Window events</a> (5 items)</li> +<li><a href="#input-events">Input events</a> (10 items)</li> +</ul> +<h2 id="functions">Functions</h2> +<div class="apii"><code>function RL.init()</code></div> +<div class="apidesc"><p>This function will be called after window has been initialized. Should be used as the main init point.</p></div> +<div class="apii"><code>function RL.update( delta )</code></div> +<div class="apidesc"><p>This function will be called every frame during execution. It will get time duration from last frame on argument 'delta'</p></div> +<div class="apii"><code>function RL.draw()</code></div> +<div class="apidesc"><p>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.</p></div> +<div class="apii"><code>function RL.event( event )</code></div> +<div class="apidesc"><p>This function will be called on events input. Content of event table is determined by event type.</p></div> +<div class="apii"><code>function RL.log( logLevel, message )</code></div> +<div class="apidesc"><p>This function can be used for custom log message handling.</p></div> +<div class="apii"><code>function RL.exit()</code></div> +<div class="apidesc"><p>This function will be called on program close. Cleanup could be done here.</p></div> +<div class="apii"><code>function RL.config()</code></div> +<div class="apidesc"><p>This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point.</p></div> +<div class="apii"><code>function RL.load()</code></div> +<div class="apidesc"><p>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.</p></div> +<div class="apii"><code>function RL.unload()</code></div> +<div class="apidesc"><p>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.</p></div> +<h2 id="reilua-enhanced-functions">ReiLua Enhanced Functions</h2> +<div class="apii"><code>RL.BeginAssetLoading( int totalAssets )</code></div> +<div class="apidesc"><p>Initialize asset loading progress tracking and show the loading screen. This displays a beautiful loading UI with progress bar and asset names.</p> +<p>Parameters:</p> +<ul> +<li><code>totalAssets</code> (integer) - Total number of assets to load</li> +</ul> +<p>Example:</p> +<pre><code>RL.BeginAssetLoading(10) -- We're loading 10 assets +</code></pre> +<p>Features:</p> +<ul> +<li>Shows animated "LOADING..." text with dots</li> +<li>Displays progress bar with shimmer effect</li> +<li>Shows current asset name being loaded</li> +<li>Shows progress counter (e.g., "3 / 10")</li> +<li>1-bit pixel art aesthetic</li> +</ul></div> +<div class="apii"><code>RL.UpdateAssetLoading( string assetName )</code></div> +<div class="apidesc"><p>Update loading progress for the current asset. Call this after each asset is loaded to update the progress bar and display.</p> +<p>Parameters:</p> +<ul> +<li><code>assetName</code> (string) - Name of the asset currently being loaded</li> +</ul> +<p>Example:</p> +<pre><code>RL.UpdateAssetLoading("player.png") +-- Load the asset here +playerTexture = RL.LoadTexture("assets/player.png") +</code></pre> +<p>Notes:</p> +<ul> +<li>Automatically increments the loaded asset counter</li> +<li>Updates the loading screen UI</li> +<li>Shows the asset name on screen</li> +<li>Updates progress bar percentage</li> +</ul></div> +<div class="apii"><code>RL.EndAssetLoading()</code></div> +<div class="apidesc"><p>Finish asset loading and hide the loading screen. Call this after all assets have been loaded.</p> +<p>Example:</p> +<pre><code>RL.EndAssetLoading() +</code></pre> +<p>Complete Example:</p> +<pre><code>function RL.init() + local assets = {} + 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) + + if path:match("%.png$") then + assets[i] = RL.LoadTexture(path) + elseif path:match("%.wav$") then + assets[i] = RL.LoadSound(path) + end + end + + -- Done loading + RL.EndAssetLoading() +end +</code></pre></div> +<h2 id="structures">Structures</h2> +<div class="apii"><code>Vector2 = { 1.0, 1.0 } or { x = 1.0, y = 1.0 }</code></div> +<div class="apidesc"><p>Vector2, 2 components</p></div> +<div class="apii"><code>Vector3 = { 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0 }</code></div> +<div class="apidesc"><p>Vector3, 3 components</p></div> +<div class="apii"><code>Vector4 = { 1.0, 1.0, 1.0, 1.0 } or { x = 1.0, y = 1.0, z = 1.0, w = 1.0 }</code></div> +<div class="apidesc"><p>Vector4, 4 components</p></div> +<div class="apii"><code>Quaternion = { 0.0, 0.0, 0.0, 1.0 } or { x = 0.0, y = 0.0, z = 0.0, w = 1.0 }</code></div> +<div class="apidesc"><p>Quaternion, 4 components (Vector4 alias)</p></div> +<div class="apii"><code>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 } }</code></div> +<div class="apidesc"><p>Matrix, 4x4 components, column major, OpenGL style, right-handed. Identity matrix example</p></div> +<div class="apii"><code>Color = { 255, 255, 255, 255 } or { r = 255, g = 255, b = 255, a = 255 }</code></div> +<div class="apidesc"><p>Color, 4 components, R8G8B8A8 (32bit)</p></div> +<div class="apii"><code>Rectangle = { 0.0, 0.0, 1.0, 1.0 } or { x = 0.0, y = 0.0, width = 1.0, height = 1.0 }</code></div> +<div class="apidesc"><p>Rectangle, 4 components</p></div> +<div class="apii"><code>Image = Userdata</code></div> +<div class="apidesc"><p>Image, pixel data stored in CPU memory (RAM)</p></div> +<div class="apii"><code>Texture = Userdata</code></div> +<div class="apidesc"><p>Texture, tex data stored in GPU memory (VRAM)</p> +<pre><code>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) +} +</code></pre></div> +<div class="apii"><code>RenderTexture = Userdata</code></div> +<div class="apidesc"><p>RenderTexture, fbo for texture rendering</p> +<pre><code>renderTextureData = { + id = unsigned int, --OpenGL framebuffer object id + texture = Texture, --Color buffer attachment texture + depth = Texture, --Depth buffer attachment texture +} +</code></pre></div> +<div class="apii"><code>Font = Userdata</code></div> +<div class="apidesc"><p>Font, font texture and GlyphInfo array data</p></div> +<div class="apii"><code>Camera2D = Userdata</code></div> +<div class="apidesc"><p>Camera2D, defines position/orientation in 2d space</p></div> +<div class="apii"><code>Camera3D = Userdata</code></div> +<div class="apidesc"><p>Camera, defines position/orientation in 3d space</p></div> +<div class="apii"><code>Mesh = Userdata</code></div> +<div class="apidesc"><p>Mesh, vertex data and vao/vbo</p> +<pre><code>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) +} +</code></pre></div> +<div class="apii"><code>Material = Userdata</code></div> +<div class="apidesc"><p>Material, includes shader and maps</p> +<pre><code>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) +} +</code></pre></div> +<div class="apii"><code>Model = Userdata</code></div> +<div class="apidesc"><p>Model, meshes, materials and animation data</p></div> +<div class="apii"><code>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 } }</code></div> +<div class="apidesc"><p>Ray, ray for raycasting</p></div> +<div class="apii"><code>RayCollision = { hit = true, distance = 1.0, point = { 0.0, 0.0, 0.0 }, normal = { 0.0, 0.0, 1.0 } }</code></div> +<div class="apidesc"><p>RayCollision, ray hit information</p></div> +<div class="apii"><code>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 } }</code></div> +<div class="apidesc"><p>BoundingBox</p></div> +<div class="apii"><code>GlyphInfo = Userdata</code></div> +<div class="apidesc"><p>GlyphInfo, font characters glyphs info</p> +<pre><code>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 +} +</code></pre></div> +<div class="apii"><code>BoneInfo = { name = string[32], parent = int }</code></div> +<div class="apidesc"><p>Bone, skeletal animation bone</p></div> +<div class="apii"><code>Transform = { translation = Vector3, rotation = Quaternion, scale = Vector3 }</code></div> +<div class="apidesc"><p>Transform, vertex transformation data</p></div> +<div class="apii"><code>Wave = Userdata</code></div> +<div class="apidesc"><p>Wave, audio wave data</p></div> +<div class="apii"><code>Sound = Userdata</code></div> +<div class="apidesc"><p>Sound</p></div> +<div class="apii"><code>SoundAlias = Userdata</code></div> +<div class="apidesc"><p>SoundAlias</p></div> +<div class="apii"><code>Music = Userdata</code></div> +<div class="apidesc"><p>Music, audio stream, anything longer than ~10 seconds should be streamed</p></div> +<div class="apii"><code>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 }</code></div> +<div class="apidesc"><p>NPatchInfo, n-patch layout info</p></div> +<div class="apii"><code>ModelAnimations = Userdata</code></div> +<div class="apidesc"><p>ModelAnimation</p></div> +<div class="apii"><code>AutomationEvent = Userdata</code></div> +<div class="apidesc"><p>Automation event</p></div> +<div class="apii"><code>AutomationEventList = Userdata</code></div> +<div class="apidesc"><p>Automation event list</p></div> +<div class="apii"><code>Buffer = Buffer userdata</code></div> +<div class="apidesc"><p>Data buffer for C primitive types. Type should be one of the Buffer types.</p></div> +<h2 id="defines---systemwindow-config-flags">Defines - System/Window config flags</h2> +<div class="apii"><code>FLAG_VSYNC_HINT = 64</code></div> +<div class="apidesc"><p>Set to try enabling V-Sync on GPU</p></div> +<div class="apii"><code>FLAG_FULLSCREEN_MODE = 2</code></div> +<div class="apidesc"><p>Set to run program in fullscreen</p></div> +<div class="apii"><code>FLAG_WINDOW_RESIZABLE = 4</code></div> +<div class="apidesc"><p>Set to allow resizable window</p></div> +<div class="apii"><code>FLAG_WINDOW_UNDECORATED = 8</code></div> +<div class="apidesc"><p>Set to disable window decoration (frame and buttons)</p></div> +<div class="apii"><code>FLAG_WINDOW_HIDDEN = 128</code></div> +<div class="apidesc"><p>Set to hide window</p></div> +<div class="apii"><code>FLAG_WINDOW_MINIMIZED = 512</code></div> +<div class="apidesc"><p>Set to minimize window (iconify)</p></div> +<div class="apii"><code>FLAG_WINDOW_MAXIMIZED = 1024</code></div> +<div class="apidesc"><p>Set to maximize window (expanded to monitor)</p></div> +<div class="apii"><code>FLAG_WINDOW_UNFOCUSED = 2048</code></div> +<div class="apidesc"><p>Set to window non focused</p></div> +<div class="apii"><code>FLAG_WINDOW_TOPMOST = 4096</code></div> +<div class="apidesc"><p>Set to window always on top</p></div> +<div class="apii"><code>FLAG_WINDOW_ALWAYS_RUN = 256</code></div> +<div class="apidesc"><p>Set to allow windows running while minimized</p></div> +<div class="apii"><code>FLAG_WINDOW_TRANSPARENT = 16</code></div> +<div class="apidesc"><p>Set to allow transparent framebuffer</p></div> +<div class="apii"><code>FLAG_WINDOW_HIGHDPI = 8192</code></div> +<div class="apidesc"><p>Set to support HighDPI</p></div> +<div class="apii"><code>FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384</code></div> +<div class="apidesc"><p>Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED</p></div> +<div class="apii"><code>FLAG_MSAA_4X_HINT = 32</code></div> +<div class="apidesc"><p>Set to try enabling MSAA 4X</p></div> +<div class="apii"><code>FLAG_INTERLACED_HINT = 65536</code></div> +<div class="apidesc"><p>Set to try enabling interlaced video format (for V3D)</p></div> +<h2 id="defines---trace-log-level">Defines - Trace log level</h2> +<div class="apii"><code>LOG_ALL = 0</code></div> +<div class="apidesc"><p>Display all logs</p></div> +<div class="apii"><code>LOG_TRACE = 1</code></div> +<div class="apidesc"><p>Trace logging, intended for internal use only</p></div> +<div class="apii"><code>LOG_DEBUG = 2</code></div> +<div class="apidesc"><p>Debug logging, used for internal debugging, it should be disabled on release builds</p></div> +<div class="apii"><code>LOG_INFO = 3</code></div> +<div class="apidesc"><p>Info logging, used for program execution info</p></div> +<div class="apii"><code>LOG_WARNING = 4</code></div> +<div class="apidesc"><p>Warning logging, used on recoverable failures</p></div> +<div class="apii"><code>LOG_ERROR = 5</code></div> +<div class="apidesc"><p>Error logging, used on unrecoverable failures</p></div> +<div class="apii"><code>LOG_FATAL = 6</code></div> +<div class="apidesc"><p>Fatal logging, used to abort program: exit(EXIT_FAILURE)</p></div> +<div class="apii"><code>LOG_NONE = 7</code></div> +<div class="apidesc"><p>Disable logging</p></div> +<h2 id="defines---keyboard-keys-(us-keyboard-layout)">Defines - Keyboard keys (US keyboard layout)</h2> +<div class="apii"><code>KEY_NULL = 0</code></div> +<div class="apidesc"><p>Key: NULL, used for no key pressed</p></div> +<div class="apii"><code>KEY_APOSTROPHE = 39</code></div> +<div class="apidesc"><p>Key: '</p></div> +<div class="apii"><code>KEY_COMMA = 44</code></div> +<div class="apidesc"><p>Key: ,</p></div> +<div class="apii"><code>KEY_MINUS = 45</code></div> +<div class="apidesc"><p>Key: -</p></div> +<div class="apii"><code>KEY_PERIOD = 46</code></div> +<div class="apidesc"><p>Key: .</p></div> +<div class="apii"><code>KEY_SLASH = 47</code></div> +<div class="apidesc"><p>Key: /</p></div> +<div class="apii"><code>KEY_ZERO = 48</code></div> +<div class="apidesc"><p>Key: 0</p></div> +<div class="apii"><code>KEY_ONE = 49</code></div> +<div class="apidesc"><p>Key: 1</p></div> +<div class="apii"><code>KEY_TWO = 50</code></div> +<div class="apidesc"><p>Key: 2</p></div> +<div class="apii"><code>KEY_THREE = 51</code></div> +<div class="apidesc"><p>Key: 3</p></div> +<div class="apii"><code>KEY_FOUR = 52</code></div> +<div class="apidesc"><p>Key: 4</p></div> +<div class="apii"><code>KEY_FIVE = 53</code></div> +<div class="apidesc"><p>Key: 5</p></div> +<div class="apii"><code>KEY_SIX = 54</code></div> +<div class="apidesc"><p>Key: 6</p></div> +<div class="apii"><code>KEY_SEVEN = 55</code></div> +<div class="apidesc"><p>Key: 7</p></div> +<div class="apii"><code>KEY_EIGHT = 56</code></div> +<div class="apidesc"><p>Key: 8</p></div> +<div class="apii"><code>KEY_NINE = 57</code></div> +<div class="apidesc"><p>Key: 9</p></div> +<div class="apii"><code>KEY_SEMICOLON = 59</code></div> +<div class="apidesc"><p>Key: ;</p></div> +<div class="apii"><code>KEY_EQUAL = 61</code></div> +<div class="apidesc"><p>Key: =</p></div> +<div class="apii"><code>KEY_A = 65</code></div> +<div class="apidesc"><p>Key: A | a</p></div> +<div class="apii"><code>KEY_B = 66</code></div> +<div class="apidesc"><p>Key: B | b</p></div> +<div class="apii"><code>KEY_C = 67</code></div> +<div class="apidesc"><p>Key: C | c</p></div> +<div class="apii"><code>KEY_D = 68</code></div> +<div class="apidesc"><p>Key: D | d</p></div> +<div class="apii"><code>KEY_E = 69</code></div> +<div class="apidesc"><p>Key: E | e</p></div> +<div class="apii"><code>KEY_F = 70</code></div> +<div class="apidesc"><p>Key: F | f</p></div> +<div class="apii"><code>KEY_G = 71</code></div> +<div class="apidesc"><p>Key: G | g</p></div> +<div class="apii"><code>KEY_H = 72</code></div> +<div class="apidesc"><p>Key: H | h</p></div> +<div class="apii"><code>KEY_I = 73</code></div> +<div class="apidesc"><p>Key: I | i</p></div> +<div class="apii"><code>KEY_J = 74</code></div> +<div class="apidesc"><p>Key: J | j</p></div> +<div class="apii"><code>KEY_K = 75</code></div> +<div class="apidesc"><p>Key: K | k</p></div> +<div class="apii"><code>KEY_L = 76</code></div> +<div class="apidesc"><p>Key: L | l</p></div> +<div class="apii"><code>KEY_M = 77</code></div> +<div class="apidesc"><p>Key: M | m</p></div> +<div class="apii"><code>KEY_N = 78</code></div> +<div class="apidesc"><p>Key: N | n</p></div> +<div class="apii"><code>KEY_O = 79</code></div> +<div class="apidesc"><p>Key: O | o</p></div> +<div class="apii"><code>KEY_P = 80</code></div> +<div class="apidesc"><p>Key: P | p</p></div> +<div class="apii"><code>KEY_Q = 81</code></div> +<div class="apidesc"><p>Key: Q | q</p></div> +<div class="apii"><code>KEY_R = 82</code></div> +<div class="apidesc"><p>Key: R | r</p></div> +<div class="apii"><code>KEY_S = 83</code></div> +<div class="apidesc"><p>Key: S | s</p></div> +<div class="apii"><code>KEY_T = 84</code></div> +<div class="apidesc"><p>Key: T | t</p></div> +<div class="apii"><code>KEY_U = 85</code></div> +<div class="apidesc"><p>Key: U | u</p></div> +<div class="apii"><code>KEY_V = 86</code></div> +<div class="apidesc"><p>Key: V | v</p></div> +<div class="apii"><code>KEY_W = 87</code></div> +<div class="apidesc"><p>Key: W | w</p></div> +<div class="apii"><code>KEY_X = 88</code></div> +<div class="apidesc"><p>Key: X | x</p></div> +<div class="apii"><code>KEY_Y = 89</code></div> +<div class="apidesc"><p>Key: Y | y</p></div> +<div class="apii"><code>KEY_Z = 90</code></div> +<div class="apidesc"><p>Key: Z | z</p></div> +<div class="apii"><code>KEY_LEFT_BRACKET = 91</code></div> +<div class="apidesc"><p>Key: [</p></div> +<div class="apii"><code>KEY_BACKSLASH = 92</code></div> +<div class="apidesc"><p>Key: '\'</p></div> +<div class="apii"><code>KEY_RIGHT_BRACKET = 93</code></div> +<div class="apidesc"><p>Key: ]</p></div> +<div class="apii"><code>KEY_GRAVE = 96</code></div> +<div class="apidesc"><p>Key: `</p></div> +<div class="apii"><code>KEY_SPACE = 32</code></div> +<div class="apidesc"><p>Key: Space</p></div> +<div class="apii"><code>KEY_ESCAPE = 256</code></div> +<div class="apidesc"><p>Key: Esc</p></div> +<div class="apii"><code>KEY_ENTER = 257</code></div> +<div class="apidesc"><p>Key: Enter</p></div> +<div class="apii"><code>KEY_TAB = 258</code></div> +<div class="apidesc"><p>Key: Tab</p></div> +<div class="apii"><code>KEY_BACKSPACE = 259</code></div> +<div class="apidesc"><p>Key: Backspace</p></div> +<div class="apii"><code>KEY_INSERT = 260</code></div> +<div class="apidesc"><p>Key: Ins</p></div> +<div class="apii"><code>KEY_DELETE = 261</code></div> +<div class="apidesc"><p>Key: Del</p></div> +<div class="apii"><code>KEY_RIGHT = 262</code></div> +<div class="apidesc"><p>Key: Cursor right</p></div> +<div class="apii"><code>KEY_LEFT = 263</code></div> +<div class="apidesc"><p>Key: Cursor left</p></div> +<div class="apii"><code>KEY_DOWN = 264</code></div> +<div class="apidesc"><p>Key: Cursor down</p></div> +<div class="apii"><code>KEY_UP = 265</code></div> +<div class="apidesc"><p>Key: Cursor up</p></div> +<div class="apii"><code>KEY_PAGE_UP = 266</code></div> +<div class="apidesc"><p>Key: Page up</p></div> +<div class="apii"><code>KEY_PAGE_DOWN = 267</code></div> +<div class="apidesc"><p>Key: Page down</p></div> +<div class="apii"><code>KEY_HOME = 268</code></div> +<div class="apidesc"><p>Key: Home</p></div> +<div class="apii"><code>KEY_END = 269</code></div> +<div class="apidesc"><p>Key: End</p></div> +<div class="apii"><code>KEY_CAPS_LOCK = 280</code></div> +<div class="apidesc"><p>Key: Caps lock</p></div> +<div class="apii"><code>KEY_SCROLL_LOCK = 281</code></div> +<div class="apidesc"><p>Key: Scroll down</p></div> +<div class="apii"><code>KEY_NUM_LOCK = 282</code></div> +<div class="apidesc"><p>Key: Num lock</p></div> +<div class="apii"><code>KEY_PRINT_SCREEN = 283</code></div> +<div class="apidesc"><p>Key: Print screen</p></div> +<div class="apii"><code>KEY_PAUSE = 284</code></div> +<div class="apidesc"><p>Key: Pause</p></div> +<div class="apii"><code>KEY_F1 = 290</code></div> +<div class="apidesc"><p>Key: F1</p></div> +<div class="apii"><code>KEY_F2 = 291</code></div> +<div class="apidesc"><p>Key: F2</p></div> +<div class="apii"><code>KEY_F3 = 292</code></div> +<div class="apidesc"><p>Key: F3</p></div> +<div class="apii"><code>KEY_F4 = 293</code></div> +<div class="apidesc"><p>Key: F4</p></div> +<div class="apii"><code>KEY_F5 = 294</code></div> +<div class="apidesc"><p>Key: F5</p></div> +<div class="apii"><code>KEY_F6 = 295</code></div> +<div class="apidesc"><p>Key: F6</p></div> +<div class="apii"><code>KEY_F7 = 296</code></div> +<div class="apidesc"><p>Key: F7</p></div> +<div class="apii"><code>KEY_F8 = 297</code></div> +<div class="apidesc"><p>Key: F8</p></div> +<div class="apii"><code>KEY_F9 = 298</code></div> +<div class="apidesc"><p>Key: F9</p></div> +<div class="apii"><code>KEY_F10 = 299</code></div> +<div class="apidesc"><p>Key: F10</p></div> +<div class="apii"><code>KEY_F11 = 300</code></div> +<div class="apidesc"><p>Key: F11</p></div> +<div class="apii"><code>KEY_F12 = 301</code></div> +<div class="apidesc"><p>Key: F12</p></div> +<div class="apii"><code>KEY_LEFT_SHIFT = 340</code></div> +<div class="apidesc"><p>Key: Shift left</p></div> +<div class="apii"><code>KEY_LEFT_CONTROL = 341</code></div> +<div class="apidesc"><p>Key: Control left</p></div> +<div class="apii"><code>KEY_LEFT_ALT = 342</code></div> +<div class="apidesc"><p>Key: Alt left</p></div> +<div class="apii"><code>KEY_LEFT_SUPER = 343</code></div> +<div class="apidesc"><p>Key: Super left</p></div> +<div class="apii"><code>KEY_RIGHT_SHIFT = 344</code></div> +<div class="apidesc"><p>Key: Shift right</p></div> +<div class="apii"><code>KEY_RIGHT_CONTROL = 345</code></div> +<div class="apidesc"><p>Key: Control right</p></div> +<div class="apii"><code>KEY_RIGHT_ALT = 346</code></div> +<div class="apidesc"><p>Key: Alt right</p></div> +<div class="apii"><code>KEY_RIGHT_SUPER = 347</code></div> +<div class="apidesc"><p>Key: Super right</p></div> +<div class="apii"><code>KEY_KB_MENU = 348</code></div> +<div class="apidesc"><p>Key: KB menu</p></div> +<div class="apii"><code>KEY_KP_0 = 320</code></div> +<div class="apidesc"><p>Key: Keypad 0</p></div> +<div class="apii"><code>KEY_KP_1 = 321</code></div> +<div class="apidesc"><p>Key: Keypad 1</p></div> +<div class="apii"><code>KEY_KP_2 = 322</code></div> +<div class="apidesc"><p>Key: Keypad 2</p></div> +<div class="apii"><code>KEY_KP_3 = 323</code></div> +<div class="apidesc"><p>Key: Keypad 3</p></div> +<div class="apii"><code>KEY_KP_4 = 324</code></div> +<div class="apidesc"><p>Key: Keypad 4</p></div> +<div class="apii"><code>KEY_KP_5 = 325</code></div> +<div class="apidesc"><p>Key: Keypad 5</p></div> +<div class="apii"><code>KEY_KP_6 = 326</code></div> +<div class="apidesc"><p>Key: Keypad 6</p></div> +<div class="apii"><code>KEY_KP_7 = 327</code></div> +<div class="apidesc"><p>Key: Keypad 7</p></div> +<div class="apii"><code>KEY_KP_8 = 328</code></div> +<div class="apidesc"><p>Key: Keypad 8</p></div> +<div class="apii"><code>KEY_KP_9 = 329</code></div> +<div class="apidesc"><p>Key: Keypad 9</p></div> +<div class="apii"><code>KEY_KP_DECIMAL = 330</code></div> +<div class="apidesc"><p>Key: Keypad .</p></div> +<div class="apii"><code>KEY_KP_DIVIDE = 331</code></div> +<div class="apidesc"><p>Key: Keypad /</p></div> +<div class="apii"><code>KEY_KP_MULTIPLY = 332</code></div> +<div class="apidesc"><p>Key: Keypad *</p></div> +<div class="apii"><code>KEY_KP_SUBTRACT = 333</code></div> +<div class="apidesc"><p>Key: Keypad -</p></div> +<div class="apii"><code>KEY_KP_ADD = 334</code></div> +<div class="apidesc"><p>Key: Keypad +</p></div> +<div class="apii"><code>KEY_KP_ENTER = 335</code></div> +<div class="apidesc"><p>Key: Keypad Enter</p></div> +<div class="apii"><code>KEY_KP_EQUAL = 336</code></div> +<div class="apidesc"><p>Key: Keypad =</p></div> +<div class="apii"><code>KEY_BACK = 4</code></div> +<div class="apidesc"><p>Key: Android back button</p></div> +<div class="apii"><code>KEY_MENU = 5</code></div> +<div class="apidesc"><p>Key: Android menu button</p></div> +<div class="apii"><code>KEY_VOLUME_UP = 24</code></div> +<div class="apidesc"><p>Key: Android volume up button</p></div> +<div class="apii"><code>KEY_VOLUME_DOWN = 25</code></div> +<div class="apidesc"><p>Key: Android volume down button</p></div> +<h2 id="defines---mouse-buttons">Defines - Mouse buttons</h2> +<div class="apii"><code>MOUSE_BUTTON_LEFT = 0</code></div> +<div class="apidesc"><p>Mouse button left</p></div> +<div class="apii"><code>MOUSE_BUTTON_RIGHT = 1</code></div> +<div class="apidesc"><p>Mouse button right</p></div> +<div class="apii"><code>MOUSE_BUTTON_MIDDLE = 2</code></div> +<div class="apidesc"><p>Mouse button middle (pressed wheel)</p></div> +<div class="apii"><code>MOUSE_BUTTON_SIDE = 3</code></div> +<div class="apidesc"><p>Mouse button side (advanced mouse device)</p></div> +<div class="apii"><code>MOUSE_BUTTON_EXTRA = 4</code></div> +<div class="apidesc"><p>Mouse button extra (advanced mouse device)</p></div> +<div class="apii"><code>MOUSE_BUTTON_FORWARD = 5</code></div> +<div class="apidesc"><p>Mouse button forward (advanced mouse device)</p></div> +<div class="apii"><code>MOUSE_BUTTON_BACK = 6</code></div> +<div class="apidesc"><p>Mouse button back (advanced mouse device)</p></div> +<h2 id="defines---mouse-cursor">Defines - Mouse cursor</h2> +<div class="apii"><code>MOUSE_CURSOR_DEFAULT = 0</code></div> +<div class="apidesc"><p>Default pointer shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_ARROW = 1</code></div> +<div class="apidesc"><p>Arrow shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_IBEAM = 2</code></div> +<div class="apidesc"><p>Text writing cursor shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_CROSSHAIR = 3</code></div> +<div class="apidesc"><p>Cross shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_POINTING_HAND = 4</code></div> +<div class="apidesc"><p>Pointing hand cursor</p></div> +<div class="apii"><code>MOUSE_CURSOR_RESIZE_EW = 5</code></div> +<div class="apidesc"><p>Horizontal resize/move arrow shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_RESIZE_NS = 6</code></div> +<div class="apidesc"><p>Vertical resize/move arrow shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_RESIZE_NWSE = 7</code></div> +<div class="apidesc"><p>Top-left to bottom-right diagonal resize/move arrow shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_RESIZE_NESW = 8</code></div> +<div class="apidesc"><p>The top-right to bottom-left diagonal resize/move arrow shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_RESIZE_ALL = 9</code></div> +<div class="apidesc"><p>The omnidirectional resize/move cursor shape</p></div> +<div class="apii"><code>MOUSE_CURSOR_NOT_ALLOWED = 10</code></div> +<div class="apidesc"><p>The operation-not-allowed shape</p></div> +<h2 id="defines---gamepad-buttons">Defines - Gamepad buttons</h2> +<div class="apii"><code>GAMEPAD_BUTTON_UNKNOWN = 0</code></div> +<div class="apidesc"><p>Unknown button, just for error checking</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_FACE_UP = 1</code></div> +<div class="apidesc"><p>Gamepad left DPAD up button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2</code></div> +<div class="apidesc"><p>Gamepad left DPAD right button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3</code></div> +<div class="apidesc"><p>Gamepad left DPAD down button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4</code></div> +<div class="apidesc"><p>Gamepad left DPAD left button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_FACE_UP = 5</code></div> +<div class="apidesc"><p>Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6</code></div> +<div class="apidesc"><p>Gamepad right button right (i.e. PS3: Square, Xbox: X)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7</code></div> +<div class="apidesc"><p>Gamepad right button down (i.e. PS3: Cross, Xbox: A)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8</code></div> +<div class="apidesc"><p>Gamepad right button left (i.e. PS3: Circle, Xbox: B)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9</code></div> +<div class="apidesc"><p>Gamepad top/back trigger left (first), it could be a trailing button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10</code></div> +<div class="apidesc"><p>Gamepad top/back trigger left (second), it could be a trailing button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11</code></div> +<div class="apidesc"><p>Gamepad top/back trigger right (one), it could be a trailing button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12</code></div> +<div class="apidesc"><p>Gamepad top/back trigger right (second), it could be a trailing button</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_MIDDLE_LEFT = 13</code></div> +<div class="apidesc"><p>Gamepad center buttons, left one (i.e. PS3: Select)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_MIDDLE = 14</code></div> +<div class="apidesc"><p>Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_MIDDLE_RIGHT = 15</code></div> +<div class="apidesc"><p>Gamepad center buttons, right one (i.e. PS3: Start)</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_LEFT_THUMB = 16</code></div> +<div class="apidesc"><p>Gamepad joystick pressed button left</p></div> +<div class="apii"><code>GAMEPAD_BUTTON_RIGHT_THUMB = 17</code></div> +<div class="apidesc"><p>Gamepad joystick pressed button right</p></div> +<h2 id="defines---gamepad-axis">Defines - Gamepad axis</h2> +<div class="apii"><code>GAMEPAD_AXIS_LEFT_X = 0</code></div> +<div class="apidesc"><p>Gamepad left stick X axis</p></div> +<div class="apii"><code>GAMEPAD_AXIS_LEFT_Y = 1</code></div> +<div class="apidesc"><p>Gamepad left stick Y axis</p></div> +<div class="apii"><code>GAMEPAD_AXIS_RIGHT_X = 2</code></div> +<div class="apidesc"><p>Gamepad right stick X axis</p></div> +<div class="apii"><code>GAMEPAD_AXIS_RIGHT_Y = 3</code></div> +<div class="apidesc"><p>Gamepad right stick Y axis</p></div> +<div class="apii"><code>GAMEPAD_AXIS_LEFT_TRIGGER = 4</code></div> +<div class="apidesc"><p>Gamepad back trigger left, pressure level: [1..-1]</p></div> +<div class="apii"><code>GAMEPAD_AXIS_RIGHT_TRIGGER = 5</code></div> +<div class="apidesc"><p>Gamepad back trigger right, pressure level: [1..-1]</p></div> +<h2 id="defines---material-map-index">Defines - Material map index</h2> +<div class="apii"><code>MATERIAL_MAP_ALBEDO = 0</code></div> +<div class="apidesc"><p>Albedo material (same as: MATERIAL_MAP_DIFFUSE)</p></div> +<div class="apii"><code>MATERIAL_MAP_METALNESS = 1</code></div> +<div class="apidesc"><p>Metalness material (same as: MATERIAL_MAP_SPECULAR)</p></div> +<div class="apii"><code>MATERIAL_MAP_NORMAL = 2</code></div> +<div class="apidesc"><p>Normal material</p></div> +<div class="apii"><code>MATERIAL_MAP_ROUGHNESS = 3</code></div> +<div class="apidesc"><p>Roughness material</p></div> +<div class="apii"><code>MATERIAL_MAP_OCCLUSION = 4</code></div> +<div class="apidesc"><p>Ambient occlusion material</p></div> +<div class="apii"><code>MATERIAL_MAP_EMISSION = 5</code></div> +<div class="apidesc"><p>Emission material</p></div> +<div class="apii"><code>MATERIAL_MAP_HEIGHT = 6</code></div> +<div class="apidesc"><p>Heightmap material</p></div> +<div class="apii"><code>MATERIAL_MAP_CUBEMAP = 7</code></div> +<div class="apidesc"><p>Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)</p></div> +<div class="apii"><code>MATERIAL_MAP_IRRADIANCE = 8</code></div> +<div class="apidesc"><p>Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)</p></div> +<div class="apii"><code>MATERIAL_MAP_PREFILTER = 9</code></div> +<div class="apidesc"><p>Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)</p></div> +<div class="apii"><code>MATERIAL_MAP_BRDF = 10</code></div> +<div class="apidesc"><p>Brdf material</p></div> +<div class="apii"><code>MATERIAL_MAP_DIFFUSE = 0</code></div> +<div class="apidesc"><p>Diffuce material (same as: MATERIAL_MAP_ALBEDO)</p></div> +<div class="apii"><code>MATERIAL_MAP_SPECULAR = 1</code></div> +<div class="apidesc"><p>Specular material (same as: MATERIAL_MAP_METALNESS)</p></div> +<h2 id="defines---shader-location-index">Defines - Shader location index</h2> +<div class="apii"><code>SHADER_LOC_VERTEX_POSITION = 0</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: position</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_TEXCOORD01 = 1</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: texcoord01</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_TEXCOORD02 = 2</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: texcoord02</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_NORMAL = 3</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: normal</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_TANGENT = 4</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: tangent</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_COLOR = 5</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: color</p></div> +<div class="apii"><code>SHADER_LOC_MATRIX_MVP = 6</code></div> +<div class="apidesc"><p>Shader location: matrix uniform: model-view-projection</p></div> +<div class="apii"><code>SHADER_LOC_MATRIX_VIEW = 7</code></div> +<div class="apidesc"><p>Shader location: matrix uniform: view (camera transform)</p></div> +<div class="apii"><code>SHADER_LOC_MATRIX_PROJECTION = 8</code></div> +<div class="apidesc"><p>Shader location: matrix uniform: projection</p></div> +<div class="apii"><code>SHADER_LOC_MATRIX_MODEL = 9</code></div> +<div class="apidesc"><p>Shader location: matrix uniform: model (transform)</p></div> +<div class="apii"><code>SHADER_LOC_MATRIX_NORMAL = 10</code></div> +<div class="apidesc"><p>Shader location: matrix uniform: normal</p></div> +<div class="apii"><code>SHADER_LOC_VECTOR_VIEW = 11</code></div> +<div class="apidesc"><p>Shader location: vector uniform: view</p></div> +<div class="apii"><code>SHADER_LOC_COLOR_DIFFUSE = 12</code></div> +<div class="apidesc"><p>Shader location: vector uniform: diffuse color</p></div> +<div class="apii"><code>SHADER_LOC_COLOR_SPECULAR = 13</code></div> +<div class="apidesc"><p>Shader location: vector uniform: specular color</p></div> +<div class="apii"><code>SHADER_LOC_COLOR_AMBIENT = 14</code></div> +<div class="apidesc"><p>Shader location: vector uniform: ambient color</p></div> +<div class="apii"><code>SHADER_LOC_MAP_ALBEDO = 15</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)</p></div> +<div class="apii"><code>SHADER_LOC_MAP_METALNESS = 16</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)</p></div> +<div class="apii"><code>SHADER_LOC_MAP_NORMAL = 17</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: normal</p></div> +<div class="apii"><code>SHADER_LOC_MAP_ROUGHNESS = 18</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: roughness</p></div> +<div class="apii"><code>SHADER_LOC_MAP_OCCLUSION = 19</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: occlusion</p></div> +<div class="apii"><code>SHADER_LOC_MAP_EMISSION = 20</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: emission</p></div> +<div class="apii"><code>SHADER_LOC_MAP_HEIGHT = 21</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: height</p></div> +<div class="apii"><code>SHADER_LOC_MAP_CUBEMAP = 22</code></div> +<div class="apidesc"><p>Shader location: samplerCube texture: cubemap</p></div> +<div class="apii"><code>SHADER_LOC_MAP_IRRADIANCE = 23</code></div> +<div class="apidesc"><p>Shader location: samplerCube texture: irradiance</p></div> +<div class="apii"><code>SHADER_LOC_MAP_PREFILTER = 24</code></div> +<div class="apidesc"><p>Shader location: samplerCube texture: prefilter</p></div> +<div class="apii"><code>SHADER_LOC_MAP_BRDF = 25</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: brdf</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_BONEIDS = 26</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: boneIds</p></div> +<div class="apii"><code>SHADER_LOC_VERTEX_BONEWEIGHTS = 27</code></div> +<div class="apidesc"><p>Shader location: vertex attribute: boneWeights</p></div> +<div class="apii"><code>SHADER_LOC_BONE_MATRICES = 28</code></div> +<div class="apidesc"><p>Shader location: array of matrices uniform: boneMatrices</p></div> +<div class="apii"><code>SHADER_LOC_MAP_DIFFUSE = 15</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: diffuce (same as: SHADER_LOC_MAP_ALBEDO)</p></div> +<div class="apii"><code>SHADER_LOC_MAP_SPECULAR = 16</code></div> +<div class="apidesc"><p>Shader location: sampler2d texture: specular (same as: SHADER_LOC_MAP_METALNESS)</p></div> +<h2 id="defines---shader-uniform-data-type">Defines - Shader uniform data type</h2> +<div class="apii"><code>SHADER_UNIFORM_FLOAT = 0</code></div> +<div class="apidesc"><p>Shader uniform type: float</p></div> +<div class="apii"><code>SHADER_UNIFORM_VEC2 = 1</code></div> +<div class="apidesc"><p>Shader uniform type: vec2 (2 float)</p></div> +<div class="apii"><code>SHADER_UNIFORM_VEC3 = 2</code></div> +<div class="apidesc"><p>Shader uniform type: vec3 (3 float)</p></div> +<div class="apii"><code>SHADER_UNIFORM_VEC4 = 3</code></div> +<div class="apidesc"><p>Shader uniform type: vec4 (4 float)</p></div> +<div class="apii"><code>SHADER_UNIFORM_INT = 4</code></div> +<div class="apidesc"><p>Shader uniform type: int</p></div> +<div class="apii"><code>SHADER_UNIFORM_IVEC2 = 5</code></div> +<div class="apidesc"><p>Shader uniform type: ivec2 (2 int)</p></div> +<div class="apii"><code>SHADER_UNIFORM_IVEC3 = 6</code></div> +<div class="apidesc"><p>Shader uniform type: ivec3 (3 int)</p></div> +<div class="apii"><code>SHADER_UNIFORM_IVEC4 = 7</code></div> +<div class="apidesc"><p>Shader uniform type: ivec4 (4 int)</p></div> +<div class="apii"><code>SHADER_UNIFORM_SAMPLER2D = 8</code></div> +<div class="apidesc"><p>Shader uniform type: sampler2d</p></div> +<h2 id="defines---shader-attribute-data-types">Defines - Shader attribute data types</h2> +<div class="apii"><code>SHADER_ATTRIB_FLOAT = 0</code></div> +<div class="apidesc"><p>Shader attribute type: float</p></div> +<div class="apii"><code>SHADER_ATTRIB_VEC2 = 1</code></div> +<div class="apidesc"><p>Shader attribute type: vec2 (2 float)</p></div> +<div class="apii"><code>SHADER_ATTRIB_VEC3 = 2</code></div> +<div class="apidesc"><p>Shader attribute type: vec3 (3 float)</p></div> +<div class="apii"><code>SHADER_ATTRIB_VEC4 = 3</code></div> +<div class="apidesc"><p>Shader attribute type: vec4 (4 float)</p></div> +<h2 id="defines---pixel-formats">Defines - Pixel formats</h2> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1</code></div> +<div class="apidesc"><p>8 bit per pixel (no alpha)</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2</code></div> +<div class="apidesc"><p>8*2 bpp (2 channels)</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3</code></div> +<div class="apidesc"><p>16 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4</code></div> +<div class="apidesc"><p>24 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5</code></div> +<div class="apidesc"><p>16 bpp (1 bit alpha)</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6</code></div> +<div class="apidesc"><p>16 bpp (4 bit alpha)</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7</code></div> +<div class="apidesc"><p>32 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R32 = 8</code></div> +<div class="apidesc"><p>32 bpp (1 channel - float)</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9</code></div> +<div class="apidesc"><p>32*3 bpp (3 channels - float)</p></div> +<div class="apii"><code>PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10</code></div> +<div class="apidesc"><p>32*4 bpp (4 channels - float)</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_DXT1_RGB = 14</code></div> +<div class="apidesc"><p>4 bpp (no alpha)</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15</code></div> +<div class="apidesc"><p>4 bpp (1 bit alpha)</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16</code></div> +<div class="apidesc"><p>8 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17</code></div> +<div class="apidesc"><p>8 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_ETC1_RGB = 18</code></div> +<div class="apidesc"><p>4 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_ETC2_RGB = 19</code></div> +<div class="apidesc"><p>4 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20</code></div> +<div class="apidesc"><p>8 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_PVRT_RGB = 21</code></div> +<div class="apidesc"><p>4 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22</code></div> +<div class="apidesc"><p>4 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23</code></div> +<div class="apidesc"><p>8 bpp</p></div> +<div class="apii"><code>PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24</code></div> +<div class="apidesc"><p>2 bpp</p></div> +<h2 id="defines---texture-parameters:-filter-mode">Defines - Texture parameters: filter mode</h2> +<div class="apii"><code>TEXTURE_FILTER_POINT = 0</code></div> +<div class="apidesc"><p>No filter, just pixel approximation</p></div> +<div class="apii"><code>TEXTURE_FILTER_BILINEAR = 1</code></div> +<div class="apidesc"><p>Linear filtering</p></div> +<div class="apii"><code>TEXTURE_FILTER_TRILINEAR = 2</code></div> +<div class="apidesc"><p>Trilinear filtering (linear with mipmaps)</p></div> +<div class="apii"><code>TEXTURE_FILTER_ANISOTROPIC_4X = 3</code></div> +<div class="apidesc"><p>Anisotropic filtering 4x</p></div> +<div class="apii"><code>TEXTURE_FILTER_ANISOTROPIC_8X = 4</code></div> +<div class="apidesc"><p>Anisotropic filtering 8x</p></div> +<div class="apii"><code>TEXTURE_FILTER_ANISOTROPIC_16X = 5</code></div> +<div class="apidesc"><p>Anisotropic filtering 16x</p></div> +<h2 id="defines---texture-parameters:-wrap-mode">Defines - Texture parameters: wrap mode</h2> +<div class="apii"><code>TEXTURE_WRAP_REPEAT = 0</code></div> +<div class="apidesc"><p>Repeats texture in tiled mode</p></div> +<div class="apii"><code>TEXTURE_WRAP_CLAMP = 1</code></div> +<div class="apidesc"><p>Clamps texture to edge pixel in tiled mode</p></div> +<div class="apii"><code>TEXTURE_WRAP_MIRROR_REPEAT = 2</code></div> +<div class="apidesc"><p>Mirrors and repeats the texture in tiled mode</p></div> +<div class="apii"><code>TEXTURE_WRAP_MIRROR_CLAMP = 3</code></div> +<div class="apidesc"><p>Mirrors and clamps to border the texture in tiled mode</p></div> +<h2 id="defines---cubemap-layouts">Defines - Cubemap layouts</h2> +<div class="apii"><code>CUBEMAP_LAYOUT_AUTO_DETECT = 0</code></div> +<div class="apidesc"><p>Automatically detect layout type</p></div> +<div class="apii"><code>CUBEMAP_LAYOUT_LINE_VERTICAL = 1</code></div> +<div class="apidesc"><p>Layout is defined by a vertical line with faces</p></div> +<div class="apii"><code>CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2</code></div> +<div class="apidesc"><p>Layout is defined by a horizontal line with faces</p></div> +<div class="apii"><code>CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3</code></div> +<div class="apidesc"><p>Layout is defined by a 3x4 cross with cubemap faces</p></div> +<div class="apii"><code>CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4</code></div> +<div class="apidesc"><p>Layout is defined by a 4x3 cross with cubemap faces</p></div> +<h2 id="defines---font-type,-defines-generation-method">Defines - Font type, defines generation method</h2> +<div class="apii"><code>FONT_DEFAULT = 0</code></div> +<div class="apidesc"><p>Default font generation, anti-aliased</p></div> +<div class="apii"><code>FONT_BITMAP = 1</code></div> +<div class="apidesc"><p>Bitmap font generation, no anti-aliasing</p></div> +<div class="apii"><code>FONT_SDF = 2</code></div> +<div class="apidesc"><p>SDF font generation, requires external shader</p></div> +<h2 id="defines---color-blending-modes-(pre-defined)">Defines - Color blending modes (pre-defined)</h2> +<div class="apii"><code>BLEND_ALPHA = 0</code></div> +<div class="apidesc"><p>Blend textures considering alpha (default)</p></div> +<div class="apii"><code>BLEND_ADDITIVE = 1</code></div> +<div class="apidesc"><p>Blend textures adding colors</p></div> +<div class="apii"><code>BLEND_MULTIPLIED = 2</code></div> +<div class="apidesc"><p>Blend textures multiplying colors</p></div> +<div class="apii"><code>BLEND_ADD_COLORS = 3</code></div> +<div class="apidesc"><p>Blend textures adding colors (alternative)</p></div> +<div class="apii"><code>BLEND_SUBTRACT_COLORS = 4</code></div> +<div class="apidesc"><p>Blend textures subtracting colors (alternative)</p></div> +<div class="apii"><code>BLEND_ALPHA_PREMULTIPLY = 5</code></div> +<div class="apidesc"><p>Blend premultiplied textures considering alpha</p></div> +<div class="apii"><code>BLEND_CUSTOM = 6</code></div> +<div class="apidesc"><p>Blend textures using custom src/dst factors (use rlSetBlendFactors())</p></div> +<div class="apii"><code>BLEND_CUSTOM_SEPARATE = 7</code></div> +<div class="apidesc"><p>Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())</p></div> +<h2 id="defines---gesture">Defines - Gesture</h2> +<div class="apii"><code>GESTURE_NONE = 0</code></div> +<div class="apidesc"><p>No gesture</p></div> +<div class="apii"><code>GESTURE_TAP = 1</code></div> +<div class="apidesc"><p>Tap gesture</p></div> +<div class="apii"><code>GESTURE_DOUBLETAP = 2</code></div> +<div class="apidesc"><p>Double tap gesture</p></div> +<div class="apii"><code>GESTURE_HOLD = 4</code></div> +<div class="apidesc"><p>Hold gesture</p></div> +<div class="apii"><code>GESTURE_DRAG = 8</code></div> +<div class="apidesc"><p>Drag gesture</p></div> +<div class="apii"><code>GESTURE_SWIPE_RIGHT = 16</code></div> +<div class="apidesc"><p>Swipe right gesture</p></div> +<div class="apii"><code>GESTURE_SWIPE_LEFT = 32</code></div> +<div class="apidesc"><p>Swipe left gesture</p></div> +<div class="apii"><code>GESTURE_SWIPE_UP = 64</code></div> +<div class="apidesc"><p>Swipe up gesture</p></div> +<div class="apii"><code>GESTURE_SWIPE_DOWN = 128</code></div> +<div class="apidesc"><p>Swipe down gesture</p></div> +<div class="apii"><code>GESTURE_PINCH_IN = 256</code></div> +<div class="apidesc"><p>Pinch in gesture</p></div> +<div class="apii"><code>GESTURE_PINCH_OUT = 512</code></div> +<div class="apidesc"><p>Pinch out gesture</p></div> +<h2 id="defines---camera-system-modes">Defines - Camera system modes</h2> +<div class="apii"><code>CAMERA_CUSTOM = 0</code></div> +<div class="apidesc"><p>Custom camera</p></div> +<div class="apii"><code>CAMERA_FREE = 1</code></div> +<div class="apidesc"><p>Free camera</p></div> +<div class="apii"><code>CAMERA_ORBITAL = 2</code></div> +<div class="apidesc"><p>Orbital camera</p></div> +<div class="apii"><code>CAMERA_FIRST_PERSON = 3</code></div> +<div class="apidesc"><p>First person camera</p></div> +<div class="apii"><code>CAMERA_THIRD_PERSON = 4</code></div> +<div class="apidesc"><p>Third person camera</p></div> +<h2 id="defines---camera-projection">Defines - Camera projection</h2> +<div class="apii"><code>CAMERA_PERSPECTIVE = 0</code></div> +<div class="apidesc"><p>Perspective projection</p></div> +<div class="apii"><code>CAMERA_ORTHOGRAPHIC = 1</code></div> +<div class="apidesc"><p>Orthographic projection</p></div> +<h2 id="defines---n-patch-layout">Defines - N-patch layout</h2> +<div class="apii"><code>NPATCH_NINE_PATCH = 0</code></div> +<div class="apidesc"><p>Npatch layout: 3x3 tiles</p></div> +<div class="apii"><code>NPATCH_THREE_PATCH_VERTICAL = 1</code></div> +<div class="apidesc"><p>Npatch layout: 1x3 tiles</p></div> +<div class="apii"><code>NPATCH_THREE_PATCH_HORIZONTAL = 2</code></div> +<div class="apidesc"><p>Npatch layout: 3x1 tiles</p></div> +<h2 id="defines---math">Defines - Math</h2> +<div class="apii"><code>PI = 3.1415927410126</code></div> +<div class="apidesc"><p>Pi</p></div> +<div class="apii"><code>EPSILON = 9.9999999747524e-07</code></div> +<div class="apidesc"><p>Epsilon</p></div> +<div class="apii"><code>DEG2RAD = 0.017453292384744</code></div> +<div class="apidesc"><p>Degrees to radians</p></div> +<div class="apii"><code>RAD2DEG = 57.295776367188</code></div> +<div class="apidesc"><p>Radians to degrees</p></div> +<h2 id="defines---gui-control-state">Defines - Gui control state</h2> +<div class="apii"><code>STATE_NORMAL = 0</code></div> +<div class="apii"><code>STATE_FOCUSED = 1</code></div> +<div class="apii"><code>STATE_PRESSED = 2</code></div> +<div class="apii"><code>STATE_DISABLED = 3</code></div> +<h2 id="defines---gui-control-text-alignment">Defines - Gui control text alignment</h2> +<div class="apii"><code>TEXT_ALIGN_LEFT = 0</code></div> +<div class="apii"><code>TEXT_ALIGN_CENTER = 1</code></div> +<div class="apii"><code>TEXT_ALIGN_RIGHT = 2</code></div> +<h2 id="defines---gui-control-text-alignment-vertical">Defines - Gui control text alignment vertical</h2> +<div class="apii"><code>TEXT_ALIGN_TOP = 0</code></div> +<div class="apii"><code>TEXT_ALIGN_MIDDLE = 1</code></div> +<div class="apii"><code>TEXT_ALIGN_BOTTOM = 2</code></div> +<h2 id="defines---gui-control-text-wrap-mode">Defines - Gui control text wrap mode</h2> +<div class="apii"><code>TEXT_WRAP_NONE = 0</code></div> +<div class="apii"><code>TEXT_WRAP_CHAR = 1</code></div> +<div class="apii"><code>TEXT_WRAP_WORD = 2</code></div> +<h2 id="defines---gui-controls">Defines - Gui controls</h2> +<div class="apii"><code>DEFAULT = 0</code></div> +<div class="apii"><code>LABEL = 1</code></div> +<div class="apidesc"><p>Used also for: LABELBUTTON</p></div> +<div class="apii"><code>BUTTON = 2</code></div> +<div class="apii"><code>TOGGLE = 3</code></div> +<div class="apidesc"><p>Used also for: TOGGLEGROUP</p></div> +<div class="apii"><code>SLIDER = 4</code></div> +<div class="apidesc"><p>Used also for: SLIDERBAR</p></div> +<div class="apii"><code>PROGRESSBAR = 5</code></div> +<div class="apii"><code>CHECKBOX = 6</code></div> +<div class="apii"><code>COMBOBOX = 7</code></div> +<div class="apii"><code>DROPDOWNBOX = 8</code></div> +<div class="apii"><code>TEXTBOX = 9</code></div> +<div class="apidesc"><p>Used also for: TEXTBOXMULTI</p></div> +<div class="apii"><code>VALUEBOX = 10</code></div> +<div class="apii"><code>SPINNER = 11</code></div> +<div class="apidesc"><p>Uses: BUTTON, VALUEBOX</p></div> +<div class="apii"><code>LISTVIEW = 12</code></div> +<div class="apii"><code>COLORPICKER = 13</code></div> +<div class="apii"><code>SCROLLBAR = 14</code></div> +<div class="apii"><code>STATUSBAR = 15</code></div> +<h2 id="defines---gui-base-properties-for-every-control">Defines - Gui base properties for every control</h2> +<div class="apii"><code>BORDER_COLOR_NORMAL = 0</code></div> +<div class="apii"><code>BASE_COLOR_NORMAL = 1</code></div> +<div class="apii"><code>TEXT_COLOR_NORMAL = 2</code></div> +<div class="apii"><code>BORDER_COLOR_FOCUSED = 3</code></div> +<div class="apii"><code>BASE_COLOR_FOCUSED = 4</code></div> +<div class="apii"><code>TEXT_COLOR_FOCUSED = 5</code></div> +<div class="apii"><code>BORDER_COLOR_PRESSED = 6</code></div> +<div class="apii"><code>BASE_COLOR_PRESSED = 7</code></div> +<div class="apii"><code>TEXT_COLOR_PRESSED = 8</code></div> +<div class="apii"><code>BORDER_COLOR_DISABLED = 9</code></div> +<div class="apii"><code>BASE_COLOR_DISABLED = 10</code></div> +<div class="apii"><code>TEXT_COLOR_DISABLED = 11</code></div> +<div class="apii"><code>BORDER_WIDTH = 12</code></div> +<div class="apii"><code>TEXT_PADDING = 13</code></div> +<div class="apii"><code>TEXT_ALIGNMENT = 14</code></div> +<h2 id="defines---gui-extended-properties-depend-on-control">Defines - Gui extended properties depend on control</h2> +<div class="apii"><code>TEXT_SIZE = 16</code></div> +<div class="apidesc"><p>Text size (glyphs max height)</p></div> +<div class="apii"><code>TEXT_SPACING = 17</code></div> +<div class="apidesc"><p>Text spacing between glyphs</p></div> +<div class="apii"><code>LINE_COLOR = 18</code></div> +<div class="apidesc"><p>Line control color</p></div> +<div class="apii"><code>BACKGROUND_COLOR = 19</code></div> +<div class="apidesc"><p>Background color</p></div> +<div class="apii"><code>TEXT_LINE_SPACING = 20</code></div> +<div class="apidesc"><p>Text spacing between lines</p></div> +<div class="apii"><code>TEXT_ALIGNMENT_VERTICAL = 21</code></div> +<div class="apidesc"><p>Text vertical alignment inside text bounds (after border and padding)</p></div> +<div class="apii"><code>TEXT_WRAP_MODE = 22</code></div> +<div class="apidesc"><p>Text wrap-mode inside text bounds</p></div> +<h2 id="defines---gui-toggletogglegroup">Defines - Gui Toggle/ToggleGroup</h2> +<div class="apii"><code>GROUP_PADDING = 16</code></div> +<div class="apidesc"><p>ToggleGroup separation between toggles</p></div> +<h2 id="defines---gui-slidersliderbar">Defines - Gui Slider/SliderBar</h2> +<div class="apii"><code>SLIDER_WIDTH = 16</code></div> +<div class="apidesc"><p>Slider size of internal bar</p></div> +<div class="apii"><code>SLIDER_PADDING = 17</code></div> +<div class="apidesc"><p>Slider/SliderBar internal bar padding</p></div> +<h2 id="defines---gui-progressbar">Defines - Gui ProgressBar</h2> +<div class="apii"><code>PROGRESS_PADDING = 16</code></div> +<div class="apidesc"><p>ProgressBar internal padding</p></div> +<h2 id="defines---gui-scrollbar">Defines - Gui ScrollBar</h2> +<div class="apii"><code>ARROWS_SIZE = 16</code></div> +<div class="apii"><code>ARROWS_VISIBLE = 17</code></div> +<div class="apii"><code>SCROLL_SLIDER_PADDING = 18</code></div> +<div class="apidesc"><p>(SLIDERBAR, SLIDER_PADDING)</p></div> +<div class="apii"><code>SCROLL_SLIDER_SIZE = 19</code></div> +<div class="apii"><code>SCROLL_PADDING = 20</code></div> +<div class="apii"><code>SCROLL_SPEED = 21</code></div> +<h2 id="defines---gui-checkbox">Defines - Gui CheckBox</h2> +<div class="apii"><code>CHECK_PADDING = 16</code></div> +<div class="apidesc"><p>CheckBox internal check padding</p></div> +<h2 id="defines---gui-combobox">Defines - Gui ComboBox</h2> +<div class="apii"><code>COMBO_BUTTON_WIDTH = 16</code></div> +<div class="apidesc"><p>ComboBox right button width</p></div> +<div class="apii"><code>COMBO_BUTTON_SPACING = 17</code></div> +<div class="apidesc"><p>ComboBox button separation</p></div> +<h2 id="defines---gui-dropdownbox">Defines - Gui DropdownBox</h2> +<div class="apii"><code>ARROW_PADDING = 16</code></div> +<div class="apidesc"><p>DropdownBox arrow separation from border and items</p></div> +<div class="apii"><code>DROPDOWN_ITEMS_SPACING = 17</code></div> +<div class="apidesc"><p>DropdownBox items separation</p></div> +<h2 id="defines---gui-textboxtextboxmultivalueboxspinner">Defines - Gui TextBox/TextBoxMulti/ValueBox/Spinner</h2> +<div class="apii"><code>TEXT_READONLY = 16</code></div> +<div class="apidesc"><p>TextBox in read-only mode: 0-text editable, 1-text no-editable</p></div> +<h2 id="defines---gui-spinner">Defines - Gui Spinner</h2> +<div class="apii"><code>SPIN_BUTTON_WIDTH = 16</code></div> +<div class="apidesc"><p>Spinner left/right buttons width</p></div> +<div class="apii"><code>SPIN_BUTTON_SPACING = 17</code></div> +<div class="apidesc"><p>Spinner buttons separation</p></div> +<h2 id="defines---gui-listview">Defines - Gui ListView</h2> +<div class="apii"><code>LIST_ITEMS_HEIGHT = 16</code></div> +<div class="apidesc"><p>ListView items height</p></div> +<div class="apii"><code>LIST_ITEMS_SPACING = 17</code></div> +<div class="apidesc"><p>ListView items separation</p></div> +<div class="apii"><code>SCROLLBAR_WIDTH = 18</code></div> +<div class="apidesc"><p>ListView scrollbar size (usually width)</p></div> +<div class="apii"><code>SCROLLBAR_SIDE = 19</code></div> +<div class="apidesc"><p>ListView scrollbar side (0-left, 1-right)</p></div> +<h2 id="defines---gui-colorpicker">Defines - Gui ColorPicker</h2> +<div class="apii"><code>COLOR_SELECTOR_SIZE = 16</code></div> +<div class="apii"><code>HUEBAR_WIDTH = 17</code></div> +<div class="apidesc"><p>ColorPicker right hue bar width</p></div> +<div class="apii"><code>HUEBAR_PADDING = 18</code></div> +<div class="apidesc"><p>ColorPicker right hue bar separation from panel</p></div> +<div class="apii"><code>HUEBAR_SELECTOR_HEIGHT = 19</code></div> +<div class="apidesc"><p>ColorPicker right hue bar selector height</p></div> +<div class="apii"><code>HUEBAR_SELECTOR_OVERFLOW = 20</code></div> +<div class="apidesc"><p>ColorPicker right hue bar selector overflow</p></div> +<h2 id="defines---gui-icons-enumeration">Defines - Gui Icons enumeration</h2> +<div class="apii"><code>ICON_NONE = 0</code></div> +<div class="apii"><code>ICON_FOLDER_FILE_OPEN = 1</code></div> +<div class="apii"><code>ICON_FILE_SAVE_CLASSIC = 2</code></div> +<div class="apii"><code>ICON_FOLDER_OPEN = 3</code></div> +<div class="apii"><code>ICON_FOLDER_SAVE = 4</code></div> +<div class="apii"><code>ICON_FILE_OPEN = 5</code></div> +<div class="apii"><code>ICON_FILE_SAVE = 6</code></div> +<div class="apii"><code>ICON_FILE_EXPORT = 7</code></div> +<div class="apii"><code>ICON_FILE_ADD = 8</code></div> +<div class="apii"><code>ICON_FILE_DELETE = 9</code></div> +<div class="apii"><code>ICON_FILETYPE_TEXT = 10</code></div> +<div class="apii"><code>ICON_FILETYPE_AUDIO = 11</code></div> +<div class="apii"><code>ICON_FILETYPE_IMAGE = 12</code></div> +<div class="apii"><code>ICON_FILETYPE_PLAY = 13</code></div> +<div class="apii"><code>ICON_FILETYPE_VIDEO = 14</code></div> +<div class="apii"><code>ICON_FILETYPE_INFO = 15</code></div> +<div class="apii"><code>ICON_FILE_COPY = 16</code></div> +<div class="apii"><code>ICON_FILE_CUT = 17</code></div> +<div class="apii"><code>ICON_FILE_PASTE = 18</code></div> +<div class="apii"><code>ICON_CURSOR_HAND = 19</code></div> +<div class="apii"><code>ICON_CURSOR_POINTER = 20</code></div> +<div class="apii"><code>ICON_CURSOR_CLASSIC = 21</code></div> +<div class="apii"><code>ICON_PENCIL = 22</code></div> +<div class="apii"><code>ICON_PENCIL_BIG = 23</code></div> +<div class="apii"><code>ICON_BRUSH_CLASSIC = 24</code></div> +<div class="apii"><code>ICON_BRUSH_PAINTER = 25</code></div> +<div class="apii"><code>ICON_WATER_DROP = 26</code></div> +<div class="apii"><code>ICON_COLOR_PICKER = 27</code></div> +<div class="apii"><code>ICON_RUBBER = 28</code></div> +<div class="apii"><code>ICON_COLOR_BUCKET = 29</code></div> +<div class="apii"><code>ICON_TEXT_T = 30</code></div> +<div class="apii"><code>ICON_TEXT_A = 31</code></div> +<div class="apii"><code>ICON_SCALE = 32</code></div> +<div class="apii"><code>ICON_RESIZE = 33</code></div> +<div class="apii"><code>ICON_FILTER_POINT = 34</code></div> +<div class="apii"><code>ICON_FILTER_BILINEAR = 35</code></div> +<div class="apii"><code>ICON_CROP = 36</code></div> +<div class="apii"><code>ICON_CROP_ALPHA = 37</code></div> +<div class="apii"><code>ICON_SQUARE_TOGGLE = 38</code></div> +<div class="apii"><code>ICON_SYMMETRY = 39</code></div> +<div class="apii"><code>ICON_SYMMETRY_HORIZONTAL = 40</code></div> +<div class="apii"><code>ICON_SYMMETRY_VERTICAL = 41</code></div> +<div class="apii"><code>ICON_LENS = 42</code></div> +<div class="apii"><code>ICON_LENS_BIG = 43</code></div> +<div class="apii"><code>ICON_EYE_ON = 44</code></div> +<div class="apii"><code>ICON_EYE_OFF = 45</code></div> +<div class="apii"><code>ICON_FILTER_TOP = 46</code></div> +<div class="apii"><code>ICON_FILTER = 47</code></div> +<div class="apii"><code>ICON_TARGET_POINT = 48</code></div> +<div class="apii"><code>ICON_TARGET_SMALL = 49</code></div> +<div class="apii"><code>ICON_TARGET_BIG = 50</code></div> +<div class="apii"><code>ICON_TARGET_MOVE = 51</code></div> +<div class="apii"><code>ICON_CURSOR_MOVE = 52</code></div> +<div class="apii"><code>ICON_CURSOR_SCALE = 53</code></div> +<div class="apii"><code>ICON_CURSOR_SCALE_RIGHT = 54</code></div> +<div class="apii"><code>ICON_CURSOR_SCALE_LEFT = 55</code></div> +<div class="apii"><code>ICON_UNDO = 56</code></div> +<div class="apii"><code>ICON_REDO = 57</code></div> +<div class="apii"><code>ICON_REREDO = 58</code></div> +<div class="apii"><code>ICON_MUTATE = 59</code></div> +<div class="apii"><code>ICON_ROTATE = 60</code></div> +<div class="apii"><code>ICON_REPEAT = 61</code></div> +<div class="apii"><code>ICON_SHUFFLE = 62</code></div> +<div class="apii"><code>ICON_EMPTYBOX = 63</code></div> +<div class="apii"><code>ICON_TARGET = 64</code></div> +<div class="apii"><code>ICON_TARGET_SMALL_FILL = 65</code></div> +<div class="apii"><code>ICON_TARGET_BIG_FILL = 66</code></div> +<div class="apii"><code>ICON_TARGET_MOVE_FILL = 67</code></div> +<div class="apii"><code>ICON_CURSOR_MOVE_FILL = 68</code></div> +<div class="apii"><code>ICON_CURSOR_SCALE_FILL = 69</code></div> +<div class="apii"><code>ICON_CURSOR_SCALE_RIGHT_FILL = 70</code></div> +<div class="apii"><code>ICON_CURSOR_SCALE_LEFT_FILL = 71</code></div> +<div class="apii"><code>ICON_UNDO_FILL = 72</code></div> +<div class="apii"><code>ICON_REDO_FILL = 73</code></div> +<div class="apii"><code>ICON_REREDO_FILL = 74</code></div> +<div class="apii"><code>ICON_MUTATE_FILL = 75</code></div> +<div class="apii"><code>ICON_ROTATE_FILL = 76</code></div> +<div class="apii"><code>ICON_REPEAT_FILL = 77</code></div> +<div class="apii"><code>ICON_SHUFFLE_FILL = 78</code></div> +<div class="apii"><code>ICON_EMPTYBOX_SMALL = 79</code></div> +<div class="apii"><code>ICON_BOX = 80</code></div> +<div class="apii"><code>ICON_BOX_TOP = 81</code></div> +<div class="apii"><code>ICON_BOX_TOP_RIGHT = 82</code></div> +<div class="apii"><code>ICON_BOX_RIGHT = 83</code></div> +<div class="apii"><code>ICON_BOX_BOTTOM_RIGHT = 84</code></div> +<div class="apii"><code>ICON_BOX_BOTTOM = 85</code></div> +<div class="apii"><code>ICON_BOX_BOTTOM_LEFT = 86</code></div> +<div class="apii"><code>ICON_BOX_LEFT = 87</code></div> +<div class="apii"><code>ICON_BOX_TOP_LEFT = 88</code></div> +<div class="apii"><code>ICON_BOX_CENTER = 89</code></div> +<div class="apii"><code>ICON_BOX_CIRCLE_MASK = 90</code></div> +<div class="apii"><code>ICON_POT = 91</code></div> +<div class="apii"><code>ICON_ALPHA_MULTIPLY = 92</code></div> +<div class="apii"><code>ICON_ALPHA_CLEAR = 93</code></div> +<div class="apii"><code>ICON_DITHERING = 94</code></div> +<div class="apii"><code>ICON_MIPMAPS = 95</code></div> +<div class="apii"><code>ICON_BOX_GRID = 96</code></div> +<div class="apii"><code>ICON_GRID = 97</code></div> +<div class="apii"><code>ICON_BOX_CORNERS_SMALL = 98</code></div> +<div class="apii"><code>ICON_BOX_CORNERS_BIG = 99</code></div> +<div class="apii"><code>ICON_FOUR_BOXES = 100</code></div> +<div class="apii"><code>ICON_GRID_FILL = 101</code></div> +<div class="apii"><code>ICON_BOX_MULTISIZE = 102</code></div> +<div class="apii"><code>ICON_ZOOM_SMALL = 103</code></div> +<div class="apii"><code>ICON_ZOOM_MEDIUM = 104</code></div> +<div class="apii"><code>ICON_ZOOM_BIG = 105</code></div> +<div class="apii"><code>ICON_ZOOM_ALL = 106</code></div> +<div class="apii"><code>ICON_ZOOM_CENTER = 107</code></div> +<div class="apii"><code>ICON_BOX_DOTS_SMALL = 108</code></div> +<div class="apii"><code>ICON_BOX_DOTS_BIG = 109</code></div> +<div class="apii"><code>ICON_BOX_CONCENTRIC = 110</code></div> +<div class="apii"><code>ICON_BOX_GRID_BIG = 111</code></div> +<div class="apii"><code>ICON_OK_TICK = 112</code></div> +<div class="apii"><code>ICON_CROSS = 113</code></div> +<div class="apii"><code>ICON_ARROW_LEFT = 114</code></div> +<div class="apii"><code>ICON_ARROW_RIGHT = 115</code></div> +<div class="apii"><code>ICON_ARROW_DOWN = 116</code></div> +<div class="apii"><code>ICON_ARROW_UP = 117</code></div> +<div class="apii"><code>ICON_ARROW_LEFT_FILL = 118</code></div> +<div class="apii"><code>ICON_ARROW_RIGHT_FILL = 119</code></div> +<div class="apii"><code>ICON_ARROW_DOWN_FILL = 120</code></div> +<div class="apii"><code>ICON_ARROW_UP_FILL = 121</code></div> +<div class="apii"><code>ICON_AUDIO = 122</code></div> +<div class="apii"><code>ICON_FX = 123</code></div> +<div class="apii"><code>ICON_WAVE = 124</code></div> +<div class="apii"><code>ICON_WAVE_SINUS = 125</code></div> +<div class="apii"><code>ICON_WAVE_SQUARE = 126</code></div> +<div class="apii"><code>ICON_WAVE_TRIANGULAR = 127</code></div> +<div class="apii"><code>ICON_CROSS_SMALL = 128</code></div> +<div class="apii"><code>ICON_PLAYER_PREVIOUS = 129</code></div> +<div class="apii"><code>ICON_PLAYER_PLAY_BACK = 130</code></div> +<div class="apii"><code>ICON_PLAYER_PLAY = 131</code></div> +<div class="apii"><code>ICON_PLAYER_PAUSE = 132</code></div> +<div class="apii"><code>ICON_PLAYER_STOP = 133</code></div> +<div class="apii"><code>ICON_PLAYER_NEXT = 134</code></div> +<div class="apii"><code>ICON_PLAYER_RECORD = 135</code></div> +<div class="apii"><code>ICON_MAGNET = 136</code></div> +<div class="apii"><code>ICON_LOCK_CLOSE = 137</code></div> +<div class="apii"><code>ICON_LOCK_OPEN = 138</code></div> +<div class="apii"><code>ICON_CLOCK = 139</code></div> +<div class="apii"><code>ICON_TOOLS = 140</code></div> +<div class="apii"><code>ICON_GEAR = 141</code></div> +<div class="apii"><code>ICON_GEAR_BIG = 142</code></div> +<div class="apii"><code>ICON_BIN = 143</code></div> +<div class="apii"><code>ICON_HAND_POINTER = 144</code></div> +<div class="apii"><code>ICON_LASER = 145</code></div> +<div class="apii"><code>ICON_COIN = 146</code></div> +<div class="apii"><code>ICON_EXPLOSION = 147</code></div> +<div class="apii"><code>ICON_1UP = 148</code></div> +<div class="apii"><code>ICON_PLAYER = 149</code></div> +<div class="apii"><code>ICON_PLAYER_JUMP = 150</code></div> +<div class="apii"><code>ICON_KEY = 151</code></div> +<div class="apii"><code>ICON_DEMON = 152</code></div> +<div class="apii"><code>ICON_TEXT_POPUP = 153</code></div> +<div class="apii"><code>ICON_GEAR_EX = 154</code></div> +<div class="apii"><code>ICON_CRACK = 155</code></div> +<div class="apii"><code>ICON_CRACK_POINTS = 156</code></div> +<div class="apii"><code>ICON_STAR = 157</code></div> +<div class="apii"><code>ICON_DOOR = 158</code></div> +<div class="apii"><code>ICON_EXIT = 159</code></div> +<div class="apii"><code>ICON_MODE_2D = 160</code></div> +<div class="apii"><code>ICON_MODE_3D = 161</code></div> +<div class="apii"><code>ICON_CUBE = 162</code></div> +<div class="apii"><code>ICON_CUBE_FACE_TOP = 163</code></div> +<div class="apii"><code>ICON_CUBE_FACE_LEFT = 164</code></div> +<div class="apii"><code>ICON_CUBE_FACE_FRONT = 165</code></div> +<div class="apii"><code>ICON_CUBE_FACE_BOTTOM = 166</code></div> +<div class="apii"><code>ICON_CUBE_FACE_RIGHT = 167</code></div> +<div class="apii"><code>ICON_CUBE_FACE_BACK = 168</code></div> +<div class="apii"><code>ICON_CAMERA = 169</code></div> +<div class="apii"><code>ICON_SPECIAL = 170</code></div> +<div class="apii"><code>ICON_LINK_NET = 171</code></div> +<div class="apii"><code>ICON_LINK_BOXES = 172</code></div> +<div class="apii"><code>ICON_LINK_MULTI = 173</code></div> +<div class="apii"><code>ICON_LINK = 174</code></div> +<div class="apii"><code>ICON_LINK_BROKE = 175</code></div> +<div class="apii"><code>ICON_TEXT_NOTES = 176</code></div> +<div class="apii"><code>ICON_NOTEBOOK = 177</code></div> +<div class="apii"><code>ICON_SUITCASE = 178</code></div> +<div class="apii"><code>ICON_SUITCASE_ZIP = 179</code></div> +<div class="apii"><code>ICON_MAILBOX = 180</code></div> +<div class="apii"><code>ICON_MONITOR = 181</code></div> +<div class="apii"><code>ICON_PRINTER = 182</code></div> +<div class="apii"><code>ICON_PHOTO_CAMERA = 183</code></div> +<div class="apii"><code>ICON_PHOTO_CAMERA_FLASH = 184</code></div> +<div class="apii"><code>ICON_HOUSE = 185</code></div> +<div class="apii"><code>ICON_HEART = 186</code></div> +<div class="apii"><code>ICON_CORNER = 187</code></div> +<div class="apii"><code>ICON_VERTICAL_BARS = 188</code></div> +<div class="apii"><code>ICON_VERTICAL_BARS_FILL = 189</code></div> +<div class="apii"><code>ICON_LIFE_BARS = 190</code></div> +<div class="apii"><code>ICON_INFO = 191</code></div> +<div class="apii"><code>ICON_CROSSLINE = 192</code></div> +<div class="apii"><code>ICON_HELP = 193</code></div> +<div class="apii"><code>ICON_FILETYPE_ALPHA = 194</code></div> +<div class="apii"><code>ICON_FILETYPE_HOME = 195</code></div> +<div class="apii"><code>ICON_LAYERS_VISIBLE = 196</code></div> +<div class="apii"><code>ICON_LAYERS = 197</code></div> +<div class="apii"><code>ICON_WINDOW = 198</code></div> +<div class="apii"><code>ICON_HIDPI = 199</code></div> +<div class="apii"><code>ICON_FILETYPE_BINARY = 200</code></div> +<div class="apii"><code>ICON_HEX = 201</code></div> +<div class="apii"><code>ICON_SHIELD = 202</code></div> +<div class="apii"><code>ICON_FILE_NEW = 203</code></div> +<div class="apii"><code>ICON_FOLDER_ADD = 204</code></div> +<div class="apii"><code>ICON_ALARM = 205</code></div> +<div class="apii"><code>ICON_CPU = 206</code></div> +<div class="apii"><code>ICON_ROM = 207</code></div> +<div class="apii"><code>ICON_STEP_OVER = 208</code></div> +<div class="apii"><code>ICON_STEP_INTO = 209</code></div> +<div class="apii"><code>ICON_STEP_OUT = 210</code></div> +<div class="apii"><code>ICON_RESTART = 211</code></div> +<div class="apii"><code>ICON_BREAKPOINT_ON = 212</code></div> +<div class="apii"><code>ICON_BREAKPOINT_OFF = 213</code></div> +<div class="apii"><code>ICON_BURGER_MENU = 214</code></div> +<div class="apii"><code>ICON_CASE_SENSITIVE = 215</code></div> +<div class="apii"><code>ICON_REG_EXP = 216</code></div> +<div class="apii"><code>ICON_FOLDER = 217</code></div> +<div class="apii"><code>ICON_FILE = 218</code></div> +<div class="apii"><code>ICON_SAND_TIMER = 219</code></div> +<h2 id="defines---light-type">Defines - Light type</h2> +<div class="apii"><code>LIGHT_DIRECTIONAL = 0</code></div> +<div class="apidesc"><p>Directional light</p></div> +<div class="apii"><code>LIGHT_POINT = 1</code></div> +<div class="apidesc"><p>Point light</p></div> +<h2 id="defines---rlgl-default-internal-render-batch-elements-limits">Defines - RLGL Default internal render batch elements limits</h2> +<div class="apii"><code>RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192</code></div> +<div class="apidesc"><p>Default internal render batch elements limits</p></div> +<div class="apii"><code>RL_DEFAULT_BATCH_BUFFERS = 1</code></div> +<div class="apidesc"><p>Default number of batch buffers (multi-buffering)</p></div> +<div class="apii"><code>RL_DEFAULT_BATCH_DRAWCALLS = 256</code></div> +<div class="apidesc"><p>Default number of batch draw calls (by state changes: mode, texture)</p></div> +<div class="apii"><code>RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4</code></div> +<div class="apidesc"><p>Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())</p></div> +<h2 id="defines---rlgl-internal-matrix-stack">Defines - RLGL Internal Matrix stack</h2> +<div class="apii"><code>RL_MAX_MATRIX_STACK_SIZE = 32</code></div> +<div class="apidesc"><p>Maximum size of internal Matrix stack</p></div> +<h2 id="defines---rlgl-shader-limits">Defines - RLGL Shader limits</h2> +<div class="apii"><code>RL_MAX_SHADER_LOCATIONS = 32</code></div> +<div class="apidesc"><p>Maximum number of shader locations supported</p></div> +<h2 id="defines---rlgl-projection-matrix-culling">Defines - RLGL Projection matrix culling</h2> +<div class="apii"><code>RL_CULL_DISTANCE_NEAR = 0.01</code></div> +<div class="apidesc"><p>Default projection matrix near cull distance</p></div> +<div class="apii"><code>RL_CULL_DISTANCE_FAR = 1000</code></div> +<div class="apidesc"><p>Default projection matrix far cull distance</p></div> +<h2 id="defines---rlgl-texture-parameters">Defines - RLGL Texture parameters</h2> +<div class="apii"><code>RL_TEXTURE_WRAP_S = 10242</code></div> +<div class="apidesc"><p>GL_TEXTURE_WRAP_S</p></div> +<div class="apii"><code>RL_TEXTURE_WRAP_T = 10243</code></div> +<div class="apidesc"><p>GL_TEXTURE_WRAP_T</p></div> +<div class="apii"><code>RL_TEXTURE_MAG_FILTER = 10240</code></div> +<div class="apidesc"><p>GL_TEXTURE_MAG_FILTER</p></div> +<div class="apii"><code>RL_TEXTURE_MIN_FILTER = 10241</code></div> +<div class="apidesc"><p>GL_TEXTURE_MIN_FILTER</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_NEAREST = 9728</code></div> +<div class="apidesc"><p>GL_NEAREST</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_LINEAR = 9729</code></div> +<div class="apidesc"><p>GL_LINEAR</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_MIP_NEAREST = 9984</code></div> +<div class="apidesc"><p>GL_NEAREST_MIPMAP_NEAREST</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 9986</code></div> +<div class="apidesc"><p>GL_NEAREST_MIPMAP_LINEAR</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 9985</code></div> +<div class="apidesc"><p>GL_LINEAR_MIPMAP_NEAREST</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_MIP_LINEAR = 9987</code></div> +<div class="apidesc"><p>GL_LINEAR_MIPMAP_LINEAR</p></div> +<div class="apii"><code>RL_TEXTURE_FILTER_ANISOTROPIC = 12288</code></div> +<div class="apidesc"><p>Anisotropic filter (custom identifier)</p></div> +<div class="apii"><code>RL_TEXTURE_MIPMAP_BIAS_RATIO = 16384</code></div> +<div class="apidesc"><p>Texture mipmap bias, percentage ratio (custom identifier)</p></div> +<div class="apii"><code>RL_TEXTURE_WRAP_REPEAT = 10497</code></div> +<div class="apidesc"><p>GL_REPEAT</p></div> +<div class="apii"><code>RL_TEXTURE_WRAP_CLAMP = 33071</code></div> +<div class="apidesc"><p>GL_CLAMP_TO_EDGE</p></div> +<div class="apii"><code>RL_TEXTURE_WRAP_MIRROR_REPEAT = 33648</code></div> +<div class="apidesc"><p>GL_MIRRORED_REPEAT</p></div> +<div class="apii"><code>RL_TEXTURE_WRAP_MIRROR_CLAMP = 34626</code></div> +<div class="apidesc"><p>GL_MIRROR_CLAMP_EXT</p></div> +<h2 id="defines---rlgl-matrix-modes-(equivalent-to-opengl)">Defines - RLGL Matrix modes (equivalent to OpenGL)</h2> +<div class="apii"><code>RL_MODELVIEW = 5888</code></div> +<div class="apidesc"><p>GL_MODELVIEW</p></div> +<div class="apii"><code>RL_PROJECTION = 5889</code></div> +<div class="apidesc"><p>GL_PROJECTION</p></div> +<div class="apii"><code>RL_TEXTURE = 5890</code></div> +<div class="apidesc"><p>GL_TEXTURE</p></div> +<h2 id="defines---rlgl-primitive-assembly-draw-modes">Defines - RLGL Primitive assembly draw modes</h2> +<div class="apii"><code>RL_LINES = 1</code></div> +<div class="apidesc"><p>GL_LINES</p></div> +<div class="apii"><code>RL_TRIANGLES = 4</code></div> +<div class="apidesc"><p>GL_TRIANGLES</p></div> +<div class="apii"><code>RL_QUADS = 7</code></div> +<div class="apidesc"><p>GL_QUADS</p></div> +<h2 id="defines---rlgl-gl-equivalent-data-types">Defines - RLGL GL equivalent data types</h2> +<div class="apii"><code>RL_UNSIGNED_BYTE = 5121</code></div> +<div class="apidesc"><p>GL_UNSIGNED_BYTE</p></div> +<div class="apii"><code>RL_FLOAT = 5126</code></div> +<div class="apidesc"><p>GL_FLOAT</p></div> +<h2 id="defines---rlgl-gl-buffer-usage-hint">Defines - RLGL GL buffer usage hint</h2> +<div class="apii"><code>RL_STREAM_DRAW = 35040</code></div> +<div class="apidesc"><p>GL_STREAM_DRAW</p></div> +<div class="apii"><code>RL_STREAM_READ = 35041</code></div> +<div class="apidesc"><p>GL_STREAM_READ</p></div> +<div class="apii"><code>RL_STREAM_COPY = 35042</code></div> +<div class="apidesc"><p>GL_STREAM_COPY</p></div> +<div class="apii"><code>RL_STATIC_DRAW = 35044</code></div> +<div class="apidesc"><p>GL_STATIC_DRAW</p></div> +<div class="apii"><code>RL_STATIC_READ = 35045</code></div> +<div class="apidesc"><p>GL_STATIC_READ</p></div> +<div class="apii"><code>RL_STATIC_COPY = 35046</code></div> +<div class="apidesc"><p>GL_STATIC_COPY</p></div> +<div class="apii"><code>RL_DYNAMIC_DRAW = 35048</code></div> +<div class="apidesc"><p>GL_DYNAMIC_DRAW</p></div> +<div class="apii"><code>RL_DYNAMIC_READ = 35049</code></div> +<div class="apidesc"><p>GL_DYNAMIC_READ</p></div> +<div class="apii"><code>RL_DYNAMIC_COPY = 35050</code></div> +<div class="apidesc"><p>GL_DYNAMIC_COPY</p></div> +<h2 id="defines---rlgl-shader-type">Defines - RLGL Shader type</h2> +<div class="apii"><code>RL_FRAGMENT_SHADER = 35632</code></div> +<div class="apidesc"><p>GL_FRAGMENT_SHADER</p></div> +<div class="apii"><code>RL_VERTEX_SHADER = 35633</code></div> +<div class="apidesc"><p>GL_VERTEX_SHADER</p></div> +<div class="apii"><code>RL_COMPUTE_SHADER = 37305</code></div> +<div class="apidesc"><p>GL_COMPUTE_SHADER</p></div> +<h2 id="defines---rlgl-gl-blending-factors">Defines - RLGL GL blending factors</h2> +<div class="apii"><code>RL_ZERO = 0</code></div> +<div class="apidesc"><p>GL_ZERO</p></div> +<div class="apii"><code>RL_ONE = 1</code></div> +<div class="apidesc"><p>GL_ONE</p></div> +<div class="apii"><code>RL_SRC_COLOR = 768</code></div> +<div class="apidesc"><p>GL_SRC_COLOR</p></div> +<div class="apii"><code>RL_ONE_MINUS_SRC_COLOR = 769</code></div> +<div class="apidesc"><p>GL_ONE_MINUS_SRC_COLOR</p></div> +<div class="apii"><code>RL_SRC_ALPHA = 770</code></div> +<div class="apidesc"><p>GL_SRC_ALPHA</p></div> +<div class="apii"><code>RL_ONE_MINUS_SRC_ALPHA = 771</code></div> +<div class="apidesc"><p>GL_ONE_MINUS_SRC_ALPHA</p></div> +<div class="apii"><code>RL_DST_ALPHA = 772</code></div> +<div class="apidesc"><p>GL_DST_ALPHA</p></div> +<div class="apii"><code>RL_ONE_MINUS_DST_ALPHA = 773</code></div> +<div class="apidesc"><p>GL_ONE_MINUS_DST_ALPHA</p></div> +<div class="apii"><code>RL_DST_COLOR = 774</code></div> +<div class="apidesc"><p>GL_DST_COLOR</p></div> +<div class="apii"><code>RL_ONE_MINUS_DST_COLOR = 775</code></div> +<div class="apidesc"><p>GL_ONE_MINUS_DST_COLOR</p></div> +<div class="apii"><code>RL_SRC_ALPHA_SATURATE = 776</code></div> +<div class="apidesc"><p>GL_SRC_ALPHA_SATURATE</p></div> +<div class="apii"><code>RL_CONSTANT_COLOR = 32769</code></div> +<div class="apidesc"><p>GL_CONSTANT_COLOR</p></div> +<div class="apii"><code>RL_ONE_MINUS_CONSTANT_COLOR = 32770</code></div> +<div class="apidesc"><p>GL_ONE_MINUS_CONSTANT_COLOR</p></div> +<div class="apii"><code>RL_CONSTANT_ALPHA = 32771</code></div> +<div class="apidesc"><p>GL_CONSTANT_ALPHA</p></div> +<div class="apii"><code>RL_ONE_MINUS_CONSTANT_ALPHA = 32772</code></div> +<div class="apidesc"><p>GL_ONE_MINUS_CONSTANT_ALPHA</p></div> +<h2 id="defines---rlgl-gl-blending-functionsequations">Defines - RLGL GL blending functions/equations</h2> +<div class="apii"><code>RL_FUNC_ADD = 32774</code></div> +<div class="apidesc"><p>GL_FUNC_ADD</p></div> +<div class="apii"><code>RL_MIN = 32775</code></div> +<div class="apidesc"><p>GL_MIN</p></div> +<div class="apii"><code>RL_MAX = 32776</code></div> +<div class="apidesc"><p>GL_MAX</p></div> +<div class="apii"><code>RL_FUNC_SUBTRACT = 32778</code></div> +<div class="apidesc"><p>GL_FUNC_SUBTRACT</p></div> +<div class="apii"><code>RL_FUNC_REVERSE_SUBTRACT = 32779</code></div> +<div class="apidesc"><p>GL_FUNC_REVERSE_SUBTRACT</p></div> +<div class="apii"><code>RL_BLEND_EQUATION = 32777</code></div> +<div class="apidesc"><p>GL_BLEND_EQUATION</p></div> +<div class="apii"><code>RL_BLEND_EQUATION_RGB = 32777</code></div> +<div class="apidesc"><p>GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)</p></div> +<div class="apii"><code>RL_BLEND_EQUATION_ALPHA = 34877</code></div> +<div class="apidesc"><p>GL_BLEND_EQUATION_ALPHA</p></div> +<div class="apii"><code>RL_BLEND_DST_RGB = 32968</code></div> +<div class="apidesc"><p>GL_BLEND_DST_RGB</p></div> +<div class="apii"><code>RL_BLEND_SRC_RGB = 32969</code></div> +<div class="apidesc"><p>GL_BLEND_SRC_RGB</p></div> +<div class="apii"><code>RL_BLEND_DST_ALPHA = 32970</code></div> +<div class="apidesc"><p>GL_BLEND_DST_ALPHA</p></div> +<div class="apii"><code>RL_BLEND_SRC_ALPHA = 32971</code></div> +<div class="apidesc"><p>GL_BLEND_SRC_ALPHA</p></div> +<div class="apii"><code>RL_BLEND_COLOR = 32773</code></div> +<div class="apidesc"><p>GL_BLEND_COLOR</p></div> +<div class="apii"><code>RL_READ_FRAMEBUFFER = 36008</code></div> +<div class="apidesc"><p>GL_READ_FRAMEBUFFER</p></div> +<div class="apii"><code>RL_DRAW_FRAMEBUFFER = 36009</code></div> +<div class="apidesc"><p>GL_DRAW_FRAMEBUFFER</p></div> +<h2 id="defines---rlgl-default-shader-vertex-attribute-locations">Defines - RLGL Default shader vertex attribute locations</h2> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION = 0</code></div> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD = 1</code></div> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL = 2</code></div> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR = 3</code></div> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT = 4</code></div> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 = 5</code></div> +<div class="apii"><code>RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES = 6</code></div> +<h2 id="defines---rlgl-glversion">Defines - RLGL GlVersion</h2> +<div class="apii"><code>RL_OPENGL_11 = 1</code></div> +<div class="apidesc"><p>OpenGL 1.1</p></div> +<div class="apii"><code>RL_OPENGL_21 = 2</code></div> +<div class="apidesc"><p>OpenGL 2.1 (GLSL 120)</p></div> +<div class="apii"><code>RL_OPENGL_33 = 3</code></div> +<div class="apidesc"><p>OpenGL 3.3 (GLSL 330)</p></div> +<div class="apii"><code>RL_OPENGL_43 = 4</code></div> +<div class="apidesc"><p>OpenGL 4.3 (using GLSL 330)</p></div> +<div class="apii"><code>RL_OPENGL_ES_20 = 5</code></div> +<div class="apidesc"><p>OpenGL ES 2.0 (GLSL 100)</p></div> +<h2 id="defines---rlgl-framebuffer-attachment-type">Defines - RLGL Framebuffer attachment type</h2> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL0 = 0</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 0</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL1 = 1</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 1</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL2 = 2</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 2</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL3 = 3</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 3</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL4 = 4</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 4</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL5 = 5</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 5</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL6 = 6</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 6</p></div> +<div class="apii"><code>RL_ATTACHMENT_COLOR_CHANNEL7 = 7</code></div> +<div class="apidesc"><p>Framebuffer attachment type: color 7</p></div> +<div class="apii"><code>RL_ATTACHMENT_DEPTH = 100</code></div> +<div class="apidesc"><p>Framebuffer attachment type: depth</p></div> +<div class="apii"><code>RL_ATTACHMENT_STENCIL = 200</code></div> +<div class="apidesc"><p>Framebuffer attachment type: stencil</p></div> +<h2 id="defines---rlgl-framebuffer-texture-attachment-type">Defines - RLGL Framebuffer texture attachment type</h2> +<div class="apii"><code>RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: cubemap, +X side</p></div> +<div class="apii"><code>RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: cubemap, -X side</p></div> +<div class="apii"><code>RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: cubemap, +Y side</p></div> +<div class="apii"><code>RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: cubemap, -Y side</p></div> +<div class="apii"><code>RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: cubemap, +Z side</p></div> +<div class="apii"><code>RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: cubemap, -Z side</p></div> +<div class="apii"><code>RL_ATTACHMENT_TEXTURE2D = 100</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: texture2d</p></div> +<div class="apii"><code>RL_ATTACHMENT_RENDERBUFFER = 200</code></div> +<div class="apidesc"><p>Framebuffer texture attachment type: renderbuffer</p></div> +<h2 id="defines---rlgl-cullmode">Defines - RLGL CullMode</h2> +<div class="apii"><code>RL_CULL_FACE_FRONT = 0</code></div> +<div class="apii"><code>RL_CULL_FACE_BACK = 1</code></div> +<h2 id="defines---opengl-bitfield-mask">Defines - OpenGL Bitfield mask</h2> +<div class="apii"><code>GL_COLOR_BUFFER_BIT = 16384</code></div> +<div class="apii"><code>GL_DEPTH_BUFFER_BIT = 256</code></div> +<div class="apii"><code>GL_STENCIL_BUFFER_BIT = 1024</code></div> +<h2 id="defines---opengl-texture-parameter">Defines - OpenGL Texture parameter</h2> +<div class="apii"><code>GL_NEAREST = 9728</code></div> +<div class="apii"><code>GL_LINEAR = 9729</code></div> +<h2 id="defines---opengl-capability">Defines - OpenGL Capability</h2> +<div class="apii"><code>GL_BLEND = 3042</code></div> +<div class="apidesc"><p>If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc</p></div> +<div class="apii"><code>GL_CULL_FACE = 2884</code></div> +<div class="apidesc"><p>If enabled, cull polygons based on their winding in window coordinates. See glCullFace</p></div> +<div class="apii"><code>GL_DEPTH_TEST = 2929</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GL_DITHER = 3024</code></div> +<div class="apidesc"><p>If enabled, dither color components or indices before they are written to the color buffer</p></div> +<div class="apii"><code>GL_POLYGON_OFFSET_FILL = 32823</code></div> +<div class="apidesc"><p>If enabled, an offset is added to depth values of a polygon's fragments produced by rasterization. See glPolygonOffset</p></div> +<div class="apii"><code>GL_POLYGON_OFFSET_LINE = 10754</code></div> +<div class="apii"><code>GL_POLYGON_OFFSET_POINT = 10753</code></div> +<div class="apii"><code>GL_SAMPLE_ALPHA_TO_COVERAGE = 32926</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GL_SAMPLE_COVERAGE = 32928</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GL_SCISSOR_TEST = 3089</code></div> +<div class="apidesc"><p>If enabled, discard fragments that are outside the scissor rectangle. See glScissor</p></div> +<div class="apii"><code>GL_STENCIL_TEST = 2960</code></div> +<div class="apidesc"><p>If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp</p></div> +<h2 id="defines---opengl-test-function">Defines - OpenGL Test function</h2> +<div class="apii"><code>GL_NEVER = 512</code></div> +<div class="apidesc"><p>Always fails</p></div> +<div class="apii"><code>GL_LESS = 513</code></div> +<div class="apidesc"><p>Passes if ( ref & mask ) < ( stencil & mask )</p></div> +<div class="apii"><code>GL_LEQUAL = 515</code></div> +<div class="apidesc"><p>Passes if ( ref & mask ) <= ( stencil & mask )</p></div> +<div class="apii"><code>GL_GREATER = 516</code></div> +<div class="apidesc"><p>Passes if ( ref & mask ) > ( stencil & mask )</p></div> +<div class="apii"><code>GL_GEQUAL = 518</code></div> +<div class="apidesc"><p>Passes if ( ref & mask ) >= ( stencil & mask )</p></div> +<div class="apii"><code>GL_EQUAL = 514</code></div> +<div class="apidesc"><p>Passes if ( ref & mask ) = ( stencil & mask )</p></div> +<div class="apii"><code>GL_NOTEQUAL = 517</code></div> +<div class="apidesc"><p>Passes if ( ref & mask ) != ( stencil & mask )</p></div> +<div class="apii"><code>GL_ALWAYS = 519</code></div> +<div class="apidesc"><p>Always passes</p></div> +<h2 id="defines---opengl-face">Defines - OpenGL Face</h2> +<div class="apii"><code>GL_FRONT = 1028</code></div> +<div class="apii"><code>GL_BACK = 1029</code></div> +<div class="apii"><code>GL_FRONT_AND_BACK = 1032</code></div> +<h2 id="defines---opengl-stencil-test">Defines - OpenGL Stencil test</h2> +<div class="apii"><code>GL_KEEP = 7680</code></div> +<div class="apidesc"><p>Keeps the current value</p></div> +<div class="apii"><code>GL_ZERO = 0</code></div> +<div class="apidesc"><p>Sets the stencil buffer value to 0</p></div> +<div class="apii"><code>GL_REPLACE = 7681</code></div> +<div class="apidesc"><p>Sets the stencil buffer value to ref, as specified by glStencilFunc</p></div> +<div class="apii"><code>GL_INCR = 7682</code></div> +<div class="apidesc"><p>Increments the current stencil buffer value. Clamps to the maximum representable unsigned value</p></div> +<div class="apii"><code>GL_INCR_WRAP = 34055</code></div> +<div class="apidesc"><p>Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value</p></div> +<div class="apii"><code>GL_DECR = 7683</code></div> +<div class="apidesc"><p>Decrements the current stencil buffer value. Clamps to 0</p></div> +<div class="apii"><code>GL_DECR_WRAP = 34056</code></div> +<div class="apidesc"><p>Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero</p></div> +<div class="apii"><code>GL_INVERT = 5386</code></div> +<div class="apidesc"><p>Bitwise inverts the current stencil buffer value</p></div> +<h2 id="defines---opengl-connection">Defines - OpenGL Connection</h2> +<div class="apii"><code>GL_VENDOR = 7936</code></div> +<div class="apidesc"><p>Returns the company responsible for this GL implementation. This name does not change from release to release</p></div> +<div class="apii"><code>GL_RENDERER = 7937</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GL_VERSION = 7938</code></div> +<div class="apidesc"><p>Returns a version or release number of the form OpenGLES</p></div> +<div class="apii"><code>GL_SHADING_LANGUAGE_VERSION = 35724</code></div> +<div class="apidesc"><p>Returns a version or release number for the shading language of the form OpenGLESGLSLES</p></div> +<div class="apii"><code>GL_EXTENSIONS = 7939</code></div> +<div class="apidesc"><p>Returns a space-separated list of supported extensions to GL</p></div> +<h2 id="defines---cbuffer-data-type">Defines - CBuffer Data type</h2> +<div class="apii"><code>BUFFER_UNSIGNED_CHAR = 0</code></div> +<div class="apidesc"><p>C type unsigned char</p></div> +<div class="apii"><code>BUFFER_UNSIGNED_SHORT = 1</code></div> +<div class="apidesc"><p>C type unsigned short</p></div> +<div class="apii"><code>BUFFER_UNSIGNED_INT = 2</code></div> +<div class="apidesc"><p>C type unsigned int</p></div> +<div class="apii"><code>BUFFER_UNSIGNED_LONG = 3</code></div> +<div class="apidesc"><p>C type unsigned long</p></div> +<div class="apii"><code>BUFFER_CHAR = 4</code></div> +<div class="apidesc"><p>C type char</p></div> +<div class="apii"><code>BUFFER_SHORT = 5</code></div> +<div class="apidesc"><p>C type short</p></div> +<div class="apii"><code>BUFFER_INT = 6</code></div> +<div class="apidesc"><p>C type int</p></div> +<div class="apii"><code>BUFFER_LONG = 7</code></div> +<div class="apidesc"><p>C type long</p></div> +<div class="apii"><code>BUFFER_FLOAT = 8</code></div> +<div class="apidesc"><p>C type float</p></div> +<div class="apii"><code>BUFFER_DOUBLE = 9</code></div> +<div class="apidesc"><p>C type double</p></div> +<h2 id="defines---keyboard-keys-(us-keyboard-layout)">Defines - Keyboard keys (US keyboard layout)</h2> +<div class="apii"><code>GLFW_KEY_UNKNOWN = -1</code></div> +<div class="apidesc"><p>Key: Unknown</p></div> +<h2 id="defines---glfw-api-tokens">Defines - GLFW API tokens.</h2> +<div class="apii"><code>GLFW_RELEASE = 0</code></div> +<div class="apidesc"><p>The key or mouse button was released</p></div> +<div class="apii"><code>GLFW_PRESS = 1</code></div> +<div class="apidesc"><p>The key or mouse button was pressed</p></div> +<div class="apii"><code>GLFW_REPEAT = 2</code></div> +<div class="apidesc"><p>The key was held down until it repeated</p></div> +<div class="apii"><code>GLFW_CONNECTED = 262145</code></div> +<div class="apidesc"><p>Joystick connected</p></div> +<div class="apii"><code>GLFW_DISCONNECTED = 262146</code></div> +<div class="apidesc"><p>Joystick disconnected</p></div> +<h2 id="defines---glfw-window-events">Defines - GLFW Window Events.</h2> +<div class="apii"><code>GLFW_WINDOW_SIZE_EVENT = 0</code></div> +<div class="apidesc"><p>GLFW event window size changed</p></div> +<div class="apii"><code>GLFW_WINDOW_MAXIMIZE_EVENT = 1</code></div> +<div class="apidesc"><p>GLFW event window maximize</p></div> +<div class="apii"><code>GLFW_WINDOW_ICONYFY_EVENT = 2</code></div> +<div class="apidesc"><p>GLFW event window iconify</p></div> +<div class="apii"><code>GLFW_WINDOW_FOCUS_EVENT = 3</code></div> +<div class="apidesc"><p>GLFW event window focus</p></div> +<div class="apii"><code>GLFW_WINDOW_DROP_EVENT = 4</code></div> +<div class="apidesc"><p>GLFW event window drop</p></div> +<h2 id="defines---glfw-input-events">Defines - GLFW Input Events.</h2> +<div class="apii"><code>GLFW_KEY_EVENT = 5</code></div> +<div class="apidesc"><p>GLFW event keyboard key</p></div> +<div class="apii"><code>GLFW_CHAR_EVENT = 6</code></div> +<div class="apidesc"><p>GLFW event Unicode character</p></div> +<div class="apii"><code>GLFW_MOUSE_BUTTON_EVENT = 7</code></div> +<div class="apidesc"><p>GLFW event mouse button</p></div> +<div class="apii"><code>GLFW_MOUSE_CURSOR_POS_EVENT = 8</code></div> +<div class="apidesc"><p>GLFW event cursor position</p></div> +<div class="apii"><code>GLFW_MOUSE_SCROLL_EVENT = 9</code></div> +<div class="apidesc"><p>GLFW event mouse scroll</p></div> +<div class="apii"><code>GLFW_CURSOR_ENTER_EVENT = 10</code></div> +<div class="apidesc"><p>GLFW event cursor enter/leave</p></div> +<div class="apii"><code>GLFW_JOYSTICK_EVENT = 11</code></div> +<div class="apidesc"><p>GLFW event joystick</p></div> +<h2 id="core---window-related-functions">Core - Window-related functions</h2> +<div class="apii"><code>RL.InitWindow( Vector2 size, string title )</code></div> +<div class="apidesc"><p>Initialize window and OpenGL context. Note! Should be called only in RL.config. InitWindow will still be called automatically before RL.init</p></div> +<div class="apii"><code>RL.CloseWindow()</code></div> +<div class="apidesc"><p>Close window and unload OpenGL context and free all resources</p></div> +<div class="apii"><code>RL.WindowShouldClose()</code></div> +<div class="apidesc"><p>Check if application should close (KEY_ESCAPE pressed or windows close icon clicked). Note! Not needed unless you want to make custom main loop</p></div> +<div class="apii"><code>state = RL.IsWindowReady()</code></div> +<div class="apidesc"><p>Check if window has been initialized successfully</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>state = RL.IsWindowFullscreen()</code></div> +<div class="apidesc"><p>Check if window is currently fullscreen</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>state = RL.IsWindowHidden()</code></div> +<div class="apidesc"><p>Check if window is currently hidden (only PLATFORM_DESKTOP)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>state = RL.IsWindowMinimized()</code></div> +<div class="apidesc"><p>Check if window is currently minimized (only PLATFORM_DESKTOP)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>state = RL.IsWindowMaximized()</code></div> +<div class="apidesc"><p>Check if window is currently maximized (only PLATFORM_DESKTOP)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>state = RL.IsWindowFocused()</code></div> +<div class="apidesc"><p>Check if window is currently focused (only PLATFORM_DESKTOP)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>resized = RL.IsWindowResized()</code></div> +<div class="apidesc"><p>Check if window has been resized from last frame</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>state = RL.IsWindowState( int flag )</code></div> +<div class="apidesc"><p>Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.SetWindowState( int flag )</code></div> +<div class="apidesc"><p>Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)</p></div> +<div class="apii"><code>resized = RL.ClearWindowState( int flag )</code></div> +<div class="apidesc"><p>Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.ToggleFullscreen()</code></div> +<div class="apidesc"><p>Toggle window state: fullscreen/windowed, resizes monitor to match window resolution</p></div> +<div class="apii"><code>RL.ToggleBorderlessWindowed()</code></div> +<div class="apidesc"><p>Toggle window state: borderless windowed, resizes window to match monitor resolution</p></div> +<div class="apii"><code>RL.MaximizeWindow()</code></div> +<div class="apidesc"><p>Set window state: maximized, if resizable (only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>RL.MinimizeWindow()</code></div> +<div class="apidesc"><p>Set window state: minimized, if resizable (only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>RL.RestoreWindow()</code></div> +<div class="apidesc"><p>Set window state: not minimized/maximized (only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>RL.SetWindowIcon( Image image )</code></div> +<div class="apidesc"><p>Set icon for window (Only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>RL.SetWindowIcons( Image{} images )</code></div> +<div class="apidesc"><p>Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>RL.SetWindowTitle( string title )</code></div> +<div class="apidesc"><p>Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)</p></div> +<div class="apii"><code>RL.SetWindowPosition( Vector2 pos )</code></div> +<div class="apidesc"><p>Set window position on screen</p></div> +<div class="apii"><code>RL.SetWindowMonitor( int monitor )</code></div> +<div class="apidesc"><p>Set monitor for the current window</p></div> +<div class="apii"><code>RL.SetWindowMinSize( Vector2 size )</code></div> +<div class="apidesc"><p>Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)</p></div> +<div class="apii"><code>RL.SetWindowMaxSize( Vector2 size )</code></div> +<div class="apidesc"><p>Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)</p></div> +<div class="apii"><code>RL.SetWindowSize( Vector2 size )</code></div> +<div class="apidesc"><p>Set window dimensions</p></div> +<div class="apii"><code>RL.SetWindowOpacity( float opacity )</code></div> +<div class="apidesc"><p>Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>RL.SetWindowFocused()</code></div> +<div class="apidesc"><p>Set window focused (only PLATFORM_DESKTOP)</p></div> +<div class="apii"><code>windowHandle = RL.GetWindowHandle()</code></div> +<div class="apidesc"><p>Get native window handle. Return as lightuserdata</p> +<ul> +<li>Success return lightuserdata</li> +</ul></div> +<div class="apii"><code>size = RL.GetScreenSize()</code></div> +<div class="apidesc"><p>Get screen size</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>size = RL.GetRenderSize()</code></div> +<div class="apidesc"><p>Get render size</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>count = RL.GetMonitorCount()</code></div> +<div class="apidesc"><p>Get number of connected monitors</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>monitor = RL.GetCurrentMonitor()</code></div> +<div class="apidesc"><p>Get current connected monitor</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>position = RL.GetMonitorPosition( int monitor )</code></div> +<div class="apidesc"><p>Get specified monitor position</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>size = RL.GetMonitorSize( int monitor )</code></div> +<div class="apidesc"><p>Get specified monitor size</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>size = RL.GetMonitorPhysicalSize( int monitor )</code></div> +<div class="apidesc"><p>Get specified monitor physical size in millimetres</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>refreshRate = RL.GetMonitorRefreshRate( int monitor )</code></div> +<div class="apidesc"><p>Get specified monitor refresh rate</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>position = RL.GetWindowPosition()</code></div> +<div class="apidesc"><p>Get window position on monitor</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>dpi = RL.GetWindowScaleDPI()</code></div> +<div class="apidesc"><p>Get window scale DPI factor</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>name = RL.GetMonitorName( int monitor )</code></div> +<div class="apidesc"><p>Get the human-readable, UTF-8 encoded name of the specified monitor</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>RL.SetClipboardText( string text )</code></div> +<div class="apidesc"><p>Set clipboard text content</p></div> +<div class="apii"><code>text = RL.GetClipboardText()</code></div> +<div class="apidesc"><p>Get clipboard text content</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>image = RL.GetClipboardImage()</code></div> +<div class="apidesc"><p>Get clipboard image content</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>RL.EnableEventWaiting()</code></div> +<div class="apidesc"><p>Enable waiting for events on EndDrawing(), no automatic event polling</p></div> +<div class="apii"><code>RL.DisableEventWaiting()</code></div> +<div class="apidesc"><p>Disable waiting for events on EndDrawing(), automatic events polling</p></div> +<h2 id="core---cursor-related-functions">Core - Cursor-related functions</h2> +<div class="apii"><code>RL.ShowCursor()</code></div> +<div class="apidesc"><p>Shows cursor</p></div> +<div class="apii"><code>RL.HideCursor()</code></div> +<div class="apidesc"><p>Hides cursor</p></div> +<div class="apii"><code>hidden = RL.IsCursorHidden()</code></div> +<div class="apidesc"><p>Check if cursor is not visible</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.EnableCursor()</code></div> +<div class="apidesc"><p>Enables cursor (unlock cursor)</p></div> +<div class="apii"><code>RL.DisableCursor()</code></div> +<div class="apidesc"><p>Disables cursor (lock cursor)</p></div> +<div class="apii"><code>onSreen = RL.IsCursorOnScreen()</code></div> +<div class="apidesc"><p>Check if cursor is on the screen</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="core---drawing-related-functions">Core - Drawing-related functions</h2> +<div class="apii"><code>RL.ClearBackground( Color color )</code></div> +<div class="apidesc"><p>Set background color (framebuffer clear color)</p></div> +<div class="apii"><code>RL.BeginDrawing()</code></div> +<div class="apidesc"><p>Setup canvas (framebuffer) to start drawing</p></div> +<div class="apii"><code>RL.EndDrawing()</code></div> +<div class="apidesc"><p>End canvas drawing and swap buffers (double buffering)</p></div> +<div class="apii"><code>RL.BeginMode2D( camera2D camera )</code></div> +<div class="apidesc"><p>Begin 2D mode with custom camera (2D)</p></div> +<div class="apii"><code>RL.EndMode2D()</code></div> +<div class="apidesc"><p>Ends 2D mode with custom camera</p></div> +<div class="apii"><code>RL.BeginMode3D( camera3D camera )</code></div> +<div class="apidesc"><p>Begin 3D mode with custom camera (3D)</p></div> +<div class="apii"><code>RL.EndMode3D()</code></div> +<div class="apidesc"><p>Ends 3D mode and returns to default 2D orthographic mode</p></div> +<div class="apii"><code>RL.BeginTextureMode( RenderTexture target )</code></div> +<div class="apidesc"><p>Begin drawing to render texture</p></div> +<div class="apii"><code>RL.EndTextureMode()</code></div> +<div class="apidesc"><p>Ends drawing to render texture</p></div> +<div class="apii"><code>RL.BeginShaderMode( Shader shader )</code></div> +<div class="apidesc"><p>Begin custom shader drawing</p></div> +<div class="apii"><code>RL.EndShaderMode()</code></div> +<div class="apidesc"><p>End custom shader drawing (use default shader)</p></div> +<div class="apii"><code>RL.BeginBlendMode( int mode )</code></div> +<div class="apidesc"><p>Begin blending mode (BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED...)</p></div> +<div class="apii"><code>RL.EndBlendMode()</code></div> +<div class="apidesc"><p>End blending mode (reset to default: BLEND_ALPHA)</p></div> +<div class="apii"><code>RL.BeginScissorMode( Rectangle rectange )</code></div> +<div class="apidesc"><p>Begin scissor mode (define screen area for following drawing)</p></div> +<div class="apii"><code>RL.EndScissorMode()</code></div> +<div class="apidesc"><p>End scissor mode</p></div> +<h2 id="core---shader-management-functions">Core - Shader management functions</h2> +<div class="apii"><code>shader = RL.LoadShader( string|nil vsFileName, string|nil fsFileName )</code></div> +<div class="apidesc"><p>Load shader from files and bind default locations. NOTE: Set nil if no shader</p> +<ul> +<li>Failure return nil</li> +<li>Success return Shader</li> +</ul></div> +<div class="apii"><code>shader = RL.LoadShaderFromMemory( string|nil vsCode, string|nil fsCode )</code></div> +<div class="apidesc"><p>Load shader from code strings and bind default locations NOTE: Set nil if no shader</p> +<ul> +<li>Failure return nil</li> +<li>Success return Shader</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsShaderValid( Shader shader )</code></div> +<div class="apidesc"><p>Check if a shader is valid (loaded on GPU)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>shaderId = RL.GetShaderId( Shader shader )</code></div> +<div class="apidesc"><p>Get shader program id</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>location = RL.GetShaderLocation( Shader shader, string uniformName )</code></div> +<div class="apidesc"><p>Get shader uniform location</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>location = RL.GetShaderLocationAttrib( Shader shader, string attribName )</code></div> +<div class="apidesc"><p>Get shader attribute location</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.SetShaderLocationIndex( Shader shader, int shaderLocationIndex, int location )</code></div> +<div class="apidesc"><p>Set shader location index</p></div> +<div class="apii"><code>location = RL.GetShaderLocationIndex( Shader shader, int shaderLocationIndex )</code></div> +<div class="apidesc"><p>Get shader location index</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.SetShaderValueMatrix( Shader shader, int locIndex, Matrix mat )</code></div> +<div class="apidesc"><p>Set shader uniform value (matrix 4x4)</p></div> +<div class="apii"><code>RL.SetShaderValueTexture( Shader shader, int locIndex, Texture texture )</code></div> +<div class="apidesc"><p>Set shader uniform value for texture (sampler2d)</p></div> +<div class="apii"><code>RL.SetShaderValue( Shader shader, int locIndex, number{} values, int uniformType )</code></div> +<div class="apidesc"><p>Set shader uniform value NOTE: Even one value should be in table</p></div> +<div class="apii"><code>RL.SetShaderValueV( Shader shader, int locIndex, number{} values, int uniformType, int count )</code></div> +<div class="apidesc"><p>Set shader uniform value vector NOTE: Even one value should be in table</p></div> +<div class="apii"><code>RL.SetShaderValueWithBuffer( Shader shader, int locIndex, Buffer values, int uniformType )</code></div> +<div class="apidesc"><p>Set shader uniform value using Buffer object</p></div> +<div class="apii"><code>RL.SetShaderValueVWithBuffer( Shader shader, int locIndex, Buffer values, int uniformType, int count )</code></div> +<div class="apidesc"><p>Set shader uniform value vector using Buffer object</p></div> +<div class="apii"><code>RL.UnloadShader( Shader shader )</code></div> +<div class="apidesc"><p>Unload shader from GPU memory (VRAM)</p></div> +<h2 id="core---screen-space-related-functions">Core - Screen-space-related functions</h2> +<div class="apii"><code>ray = RL.GetScreenToWorldRay( Vector2 mousePosition, Camera3D camera )</code></div> +<div class="apidesc"><p>Get a ray trace from screen position (i.e mouse)</p> +<ul> +<li>Success return Ray</li> +</ul></div> +<div class="apii"><code>ray = RL.GetScreenToWorldRayEx( Vector2 mousePosition, Camera3D camera, Vector2 size )</code></div> +<div class="apidesc"><p>Get a ray trace from screen position (i.e mouse) in a viewport</p> +<ul> +<li>Success return Ray</li> +</ul></div> +<div class="apii"><code>position = RL.GetWorldToScreen( Vector3 position, Camera3D camera )</code></div> +<div class="apidesc"><p>Get the screen space position for a 3d world space position</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>position = RL.GetWorldToScreenEx( Vector3 position, Camera3D camera, Vector2 size )</code></div> +<div class="apidesc"><p>Get size position for a 3d world space position</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>position = RL.GetWorldToScreen2D( Vector2 position, Camera2D camera )</code></div> +<div class="apidesc"><p>Get the screen space position for a 2d camera world space position</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>position = RL.GetScreenToWorld2D( Vector2 position, Camera2D camera )</code></div> +<div class="apidesc"><p>Get the world space position for a 2d camera screen space position</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>matrix = RL.GetCameraMatrix( Camera3D camera )</code></div> +<div class="apidesc"><p>Get camera transform matrix (view matrix)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>matrix = RL.GetCameraMatrix2D( Camera2D camera )</code></div> +<div class="apidesc"><p>Get camera 2d transform matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<h2 id="core---timing-related-functions">Core - Timing-related functions</h2> +<div class="apii"><code>RL.SetTargetFPS( int fps )</code></div> +<div class="apidesc"><p>Set target FPS (maximum)</p></div> +<div class="apii"><code>delta = RL.GetFrameTime()</code></div> +<div class="apidesc"><p>Get time in seconds for last frame drawn (Delta time)</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>time = RL.GetTime()</code></div> +<div class="apidesc"><p>Get elapsed time in seconds since InitWindow()</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>FPS = RL.GetFPS()</code></div> +<div class="apidesc"><p>Get current FPS</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="core---custom-frame-control-functions">Core - Custom frame control functions</h2> +<div class="apii"><code>RL.SwapScreenBuffer()</code></div> +<div class="apidesc"><p>Swap back buffer with front buffer (screen drawing)</p></div> +<div class="apii"><code>RL.PollInputEvents()</code></div> +<div class="apidesc"><p>Register all input events</p></div> +<div class="apii"><code>RL.WaitTime( number seconds )</code></div> +<div class="apidesc"><p>Wait for some time (halt program execution)</p></div> +<h2 id="core---random-values-generation-functions">Core - Random values generation functions</h2> +<div class="apii"><code>RL.SetRandomSeed( int seed )</code></div> +<div class="apidesc"><p>Set the seed for the random number generator</p></div> +<div class="apii"><code>time = RL.GetRandomValue( int min, int max )</code></div> +<div class="apidesc"><p>Get a random value between min and max (both included)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>sequence = RL.LoadRandomSequence( int count, int min, int max )</code></div> +<div class="apidesc"><p>Load random values sequence, no values repeated</p> +<ul> +<li>Success return int{}</li> +</ul></div> +<h2 id="core---misc">Core - Misc</h2> +<div class="apii"><code>RL.TakeScreenshot( string fileName )</code></div> +<div class="apidesc"><p>Takes a screenshot of current screen (filename extension defines format)</p></div> +<div class="apii"><code>RL.SetConfigFlags( int flags )</code></div> +<div class="apidesc"><p>Setup init configuration flags (view FLAGS)</p></div> +<div class="apii"><code>RL.TraceLog( int logLevel, string text )</code></div> +<div class="apidesc"><p>Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)</p></div> +<div class="apii"><code>RL.SetTraceLogLevel( int logLevel )</code></div> +<div class="apidesc"><p>Set the current threshold (minimum) log level</p></div> +<div class="apii"><code>RL.SetLogLevelInvalid( int logLevel )</code></div> +<div class="apidesc"><p>Set the log level for bad function calls and invalid data formats.</p></div> +<div class="apii"><code>logLevel = RL.GetLogLevelInvalid()</code></div> +<div class="apidesc"><p>Get the log level for bad function calls and invalid data formats.</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.OpenURL( string url )</code></div> +<div class="apidesc"><p>Open URL with default system browser (if available)</p></div> +<div class="apii"><code>enabled = RL.IsGCUnloadEnabled()</code></div> +<div class="apidesc"><p>Check if Lua garbage collection is set to unload object data</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.SetGCUnload( bool enabled )</code></div> +<div class="apidesc"><p>Set Lua garbage collection to unload object data</p></div> +<div class="apii"><code>platform = RL.GetPlatform()</code></div> +<div class="apidesc"><p>Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten"</p> +<ul> +<li>Success return string</li> +</ul></div> +<h2 id="core---files-management-functions">Core - Files management functions</h2> +<div class="apii"><code>buffer = RL.LoadFileData( string fileName )</code></div> +<div class="apidesc"><p>Load file data as byte array (read). Buffer type is BUFFER_UNSIGNED_CHAR</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>success = RL.SaveFileData( string fileName, buffer Buffer )</code></div> +<div class="apidesc"><p>Save data to file from byte array (write), returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>success = RL.ExportDataAsCode( Buffer buffer, string fileName )</code></div> +<div class="apidesc"><p>Export data to code (.h), returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>text = RL.LoadFileText( string fileName )</code></div> +<div class="apidesc"><p>Load text data from file (read)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>success = RL.SaveFileText( string fileName, string text )</code></div> +<div class="apidesc"><p>Save text data to file (write), returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="core---files-system-functions">Core - Files system functions</h2> +<div class="apii"><code>path = RL.GetBasePath()</code></div> +<div class="apidesc"><p>Return game directory (where main.lua is located)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>fileExists = RL.FileExists( string fileName )</code></div> +<div class="apidesc"><p>Check if file exists</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>dirExists = RL.DirectoryExists( string dirPath )</code></div> +<div class="apidesc"><p>Check if a directory path exists</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>hasFileExtension = RL.IsFileExtension( string fileName, string ext )</code></div> +<div class="apidesc"><p>Check file extension (Including point: .png, .wav)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>length = RL.GetFileLength( string fileName )</code></div> +<div class="apidesc"><p>Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>extension = RL.GetFileExtension( string fileName )</code></div> +<div class="apidesc"><p>Get pointer to extension for a filename string (Includes dot: '.png')</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>fileName = RL.GetFileName( string filePath )</code></div> +<div class="apidesc"><p>Get pointer to filename for a path string</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>fileName = RL.GetFileNameWithoutExt( string filePath )</code></div> +<div class="apidesc"><p>Get filename string without extension (Uses static string)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>filePath = RL.GetDirectoryPath( string filePath )</code></div> +<div class="apidesc"><p>Get full path for a given fileName with path (Uses static string)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>directory = RL.GetPrevDirectoryPath( string dirPath )</code></div> +<div class="apidesc"><p>Get previous directory path for a given path (Uses static string)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>directory = RL.GetWorkingDirectory()</code></div> +<div class="apidesc"><p>Get current working directory (Uses static string)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>directory = RL.GetApplicationDirectory()</code></div> +<div class="apidesc"><p>Get the directory of the running application (uses static string)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>success = RL.MakeDirectory( string dirPath )</code></div> +<div class="apidesc"><p>Create directories (including full path requested), returns 0 on success</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>success = RL.ChangeDirectory( string directory )</code></div> +<div class="apidesc"><p>Change working directory, return true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>isFile = RL.IsPathFile( string path )</code></div> +<div class="apidesc"><p>Check if a given path is a file or a directory</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsFileNameValid( string fileName )</code></div> +<div class="apidesc"><p>Check if fileName is valid for the platform/OS</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>fileNames = RL.LoadDirectoryFiles( string dirPath )</code></div> +<div class="apidesc"><p>Load directory filepaths</p> +<ul> +<li>Success return string{}</li> +</ul></div> +<div class="apii"><code>fileNames = RL.LoadDirectoryFilesEx( string basePath, string|nil filter, bool scanSubdirs )</code></div> +<div class="apidesc"><p>Load directory filepaths with extension filtering and recursive directory scan</p> +<ul> +<li>Success return string{}</li> +</ul></div> +<div class="apii"><code>iSFileDropped = RL.IsFileDropped()</code></div> +<div class="apidesc"><p>Check if a file has been dropped into window</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>files = RL.LoadDroppedFiles()</code></div> +<div class="apidesc"><p>Load dropped filepaths</p> +<ul> +<li>Success return string{}</li> +</ul></div> +<div class="apii"><code>time = RL.GetFileModTime( string fileName )</code></div> +<div class="apidesc"><p>Get file modification time (Last write time)</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="core---compressionencoding-functionality">Core - Compression/Encoding functionality</h2> +<div class="apii"><code>compData = RL.CompressData( Buffer buffer )</code></div> +<div class="apidesc"><p>Compress data (DEFLATE algorithm)</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>decompData = RL.DecompressData( Buffer compData )</code></div> +<div class="apidesc"><p>Decompress data (DEFLATE algorithm).</p> +<ul> +<li>Success Buffer</li> +</ul></div> +<div class="apii"><code>encodedData, outputSize = RL.EncodeDataBase64( string data )</code></div> +<div class="apidesc"><p>Encode data to Base64 string</p> +<ul> +<li>Success return string, int</li> +</ul></div> +<div class="apii"><code>decodedData, outputSize = RL.DecodeDataBase64( string data )</code></div> +<div class="apidesc"><p>Decode Base64 string data</p> +<ul> +<li>Success return string, int</li> +</ul></div> +<div class="apii"><code>code = RL.ComputeCRC32( Buffer data )</code></div> +<div class="apidesc"><p>Compute CRC32 hash code.</p> +<ul> +<li>Failure return false</li> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>code = RL.ComputeMD5( Buffer data )</code></div> +<div class="apidesc"><p>Compute MD5 hash code, returns static int[4] (16 bytes).</p> +<ul> +<li>Failure return false</li> +<li>Success return int{4}</li> +</ul></div> +<div class="apii"><code>code = RL.ComputeSHA1( Buffer data )</code></div> +<div class="apidesc"><p>Compute SHA1 hash code, returns static int[5] (20 bytes).</p> +<ul> +<li>Failure return false</li> +<li>Success return int{5}</li> +</ul></div> +<h2 id="core---automation-events-functionality">Core - Automation events functionality</h2> +<div class="apii"><code>eventList = RL.LoadAutomationEventList( string|nil fileName )</code></div> +<div class="apidesc"><p>Load automation events list from file, nil for empty list, capacity = MAX_AUTOMATION_EVENTS</p> +<ul> +<li>Success return AutomationEventList</li> +</ul></div> +<div class="apii"><code>RL.UnloadAutomationEventList( AutomationEventList list )</code></div> +<div class="apidesc"><p>Unload automation events list from file</p></div> +<div class="apii"><code>success = RL.ExportAutomationEventList( string fileName )</code></div> +<div class="apidesc"><p>Export automation events list as text file</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>RL.SetAutomationEventList( AutomationEventList list )</code></div> +<div class="apidesc"><p>Set automation event list to record to</p></div> +<div class="apii"><code>RL.SetAutomationEventBaseFrame( int frame )</code></div> +<div class="apidesc"><p>Set automation event internal base frame to start recording</p></div> +<div class="apii"><code>RL.StartAutomationEventRecording()</code></div> +<div class="apidesc"><p>Start recording automation events (AutomationEventList must be set)</p></div> +<div class="apii"><code>RL.StopAutomationEventRecording()</code></div> +<div class="apidesc"><p>Stop recording automation events</p></div> +<div class="apii"><code>RL.PlayAutomationEvent( AutomationEvent event )</code></div> +<div class="apidesc"><p>Play a recorded automation event</p></div> +<div class="apii"><code>capacity = RL.GetAutomationEventListCapacity( AutomationEventList list )</code></div> +<div class="apidesc"><p>Get automation event list capacity</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>count = RL.GetAutomationEventListCount( AutomationEventList list )</code></div> +<div class="apidesc"><p>Get automation event list count</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>event = RL.GetAutomationEvent( AutomationEventList list, int index )</code></div> +<div class="apidesc"><p>Get automation event from automation event list. Return as lightuserdata</p> +<ul> +<li>Failure return nil</li> +<li>Success return AutomationEvent</li> +</ul></div> +<div class="apii"><code>frame = RL.GetAutomationEventFrame( AutomationEvent event )</code></div> +<div class="apidesc"><p>Get automation event frame</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>type = RL.GetAutomationEventType( AutomationEvent event )</code></div> +<div class="apidesc"><p>Get automation event type</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>params = RL.GetAutomationEventParams( AutomationEvent event )</code></div> +<div class="apidesc"><p>Get automation event params</p> +<ul> +<li>Success return int{}</li> +</ul></div> +<h2 id="core---input-related-functions:-keyboard">Core - Input-related functions: keyboard</h2> +<div class="apii"><code>pressed = RL.IsKeyPressed( int key )</code></div> +<div class="apidesc"><p>Detect if a key has been pressed once</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>pressed = RL.IsKeyPressedRepeat( int key )</code></div> +<div class="apidesc"><p>Check if a key has been pressed again (Only PLATFORM_DESKTOP)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>pressed = RL.IsKeyDown( int key )</code></div> +<div class="apidesc"><p>Detect if a key is being pressed</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>released = RL.IsKeyReleased( int key )</code></div> +<div class="apidesc"><p>Detect if a key has been released once</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>released = RL.IsKeyUp( int key )</code></div> +<div class="apidesc"><p>Check if a key is NOT being pressed</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>keycode = RL.GetKeyPressed()</code></div> +<div class="apidesc"><p>Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>unicode = RL.GetCharPressed()</code></div> +<div class="apidesc"><p>Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.SetExitKey( int key )</code></div> +<div class="apidesc"><p>Set a custom key to exit program (default is ESC)</p></div> +<h2 id="core---input-related-functions:-gamepads">Core - Input-related functions: gamepads</h2> +<div class="apii"><code>available = RL.IsGamepadAvailable( int gamepad )</code></div> +<div class="apidesc"><p>Detect if a gamepad is available</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>name = RL.GetGamepadName( int gamepad )</code></div> +<div class="apidesc"><p>Return gamepad internal name id</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>pressed = RL.IsGamepadButtonPressed( int gamepad, int button )</code></div> +<div class="apidesc"><p>Detect if a gamepad button has been pressed once</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>pressed = RL.IsGamepadButtonDown( int gamepad, int button )</code></div> +<div class="apidesc"><p>Detect if a gamepad button is being pressed</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>released = RL.IsGamepadButtonReleased( int gamepad, int button )</code></div> +<div class="apidesc"><p>Detect if a gamepad button has been released once</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>notPressed = RL.IsGamepadButtonUp( int gamepad, int button )</code></div> +<div class="apidesc"><p>Check if a gamepad button is NOT being pressed</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>button = RL.GetGamepadButtonPressed()</code></div> +<div class="apidesc"><p>Get the last gamepad button pressed</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>count = RL.GetGamepadAxisCount( int gamepad )</code></div> +<div class="apidesc"><p>Return gamepad axis count for a gamepad</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>value = RL.GetGamepadAxisMovement( int gamepad, int axis )</code></div> +<div class="apidesc"><p>Return axis movement value for a gamepad axis</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.SetGamepadMappings( string mappings )</code></div> +<div class="apidesc"><p>Set internal gamepad mappings (SDL_GameControllerDB)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.SetGamepadVibration( int gamepad, float leftMotor, float rightMotor, float duration )</code></div> +<div class="apidesc"><p>Set gamepad vibration for both motors (duration in seconds)</p></div> +<h2 id="core---input-related-functions:-mouse">Core - Input-related functions: mouse</h2> +<div class="apii"><code>pressed = RL.IsMouseButtonPressed( int button )</code></div> +<div class="apidesc"><p>Detect if a mouse button has been pressed once</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>pressed = RL.IsMouseButtonDown( int button )</code></div> +<div class="apidesc"><p>Detect if a mouse button is being pressed</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>released = RL.IsMouseButtonReleased( int button )</code></div> +<div class="apidesc"><p>Detect if a mouse button has been released once</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>released = RL.IsMouseButtonUp( int button )</code></div> +<div class="apidesc"><p>Check if a mouse button is NOT being pressed</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>position = RL.GetMousePosition()</code></div> +<div class="apidesc"><p>Returns mouse position</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>position = RL.GetMouseDelta()</code></div> +<div class="apidesc"><p>Get mouse delta between frames</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>RL.SetMousePosition( Vector2 position )</code></div> +<div class="apidesc"><p>Set mouse position XY</p></div> +<div class="apii"><code>RL.SetMouseOffset( Vector2 offset )</code></div> +<div class="apidesc"><p>Set mouse offset</p></div> +<div class="apii"><code>RL.SetMouseScale( Vector2 scale )</code></div> +<div class="apidesc"><p>Set mouse scaling</p></div> +<div class="apii"><code>offset = RL.GetMouseOffset()</code></div> +<div class="apidesc"><p>Get mouse offset</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>scale = RL.GetMouseScale()</code></div> +<div class="apidesc"><p>Get mouse scale</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>movement = RL.GetMouseWheelMove()</code></div> +<div class="apidesc"><p>Get mouse wheel movement for X or Y, whichever is larger</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>movement = RL.GetMouseWheelMoveV()</code></div> +<div class="apidesc"><p>Get mouse wheel movement for both X and Y</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>RL.SetMouseCursor( int cursor )</code></div> +<div class="apidesc"><p>Set mouse cursor</p></div> +<h2 id="core---input-related-functions:-touch">Core - Input-related functions: touch</h2> +<div class="apii"><code>position = RL.GetTouchPosition( int index )</code></div> +<div class="apidesc"><p>Get touch position XY for a touch point index (relative to screen size)</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>id = RL.GetTouchPointId( int index )</code></div> +<div class="apidesc"><p>Get touch point identifier for given index</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>count = RL.GetTouchPointCount()</code></div> +<div class="apidesc"><p>Get touch point identifier for given index</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="core---input-related-functions:-gestures">Core - Input-related functions: gestures</h2> +<div class="apii"><code>RL.SetGesturesEnabled( unsigned int flags )</code></div> +<div class="apidesc"><p>Enable a set of gestures using flags</p></div> +<div class="apii"><code>detected = RL.IsGestureDetected( int gesture )</code></div> +<div class="apidesc"><p>Check if a gesture have been detected</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>gesture = RL.GetGestureDetected()</code></div> +<div class="apidesc"><p>Get latest detected gesture</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>time = RL.GetGestureHoldDuration()</code></div> +<div class="apidesc"><p>Get gesture hold time in milliseconds</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>vector = RL.GetGestureDragVector()</code></div> +<div class="apidesc"><p>Get gesture drag vector</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>angle = RL.GetGestureDragAngle()</code></div> +<div class="apidesc"><p>Get gesture drag angle</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>vector = RL.GetGesturePinchVector()</code></div> +<div class="apidesc"><p>Get gesture pinch delta</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>angle = RL.GetGesturePinchAngle()</code></div> +<div class="apidesc"><p>Get gesture pinch angle</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="core---camera2d-system-functions">Core - Camera2D System functions</h2> +<div class="apii"><code>camera2D = RL.CreateCamera2D()</code></div> +<div class="apidesc"><p>Return camera2D set to default configuration</p> +<ul> +<li>Success return Camera2D</li> +</ul></div> +<div class="apii"><code>RL.SetCamera2DTarget( camera2D camera, Vector2 target )</code></div> +<div class="apidesc"><p>Set camera target (rotation and zoom origin)</p></div> +<div class="apii"><code>RL.SetCamera2DOffset( camera2D camera, Vector2 offset )</code></div> +<div class="apidesc"><p>Set camera offset (displacement from target)</p></div> +<div class="apii"><code>RL.SetCamera2DRotation( camera2D camera, float rotation )</code></div> +<div class="apidesc"><p>Set camera rotation in degrees</p></div> +<div class="apii"><code>RL.SetCamera2DZoom( camera2D camera, float zoom )</code></div> +<div class="apidesc"><p>Set camera zoom (scaling), should be 1.0f by default</p></div> +<div class="apii"><code>target = RL.GetCamera2DTarget( camera2D camera )</code></div> +<div class="apidesc"><p>Get camera2D target</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>offset = RL.GetCamera2DOffset( camera2D camera )</code></div> +<div class="apidesc"><p>Get camera2D offset</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>rotation = RL.GetCamera2DRotation( camera2D camera )</code></div> +<div class="apidesc"><p>Get camera2D rotation</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>zoom = RL.GetCamera2DZoom( camera2D camera )</code></div> +<div class="apidesc"><p>Get camera2D zoom</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="core---camera3d-system-functions">Core - Camera3D System functions</h2> +<div class="apii"><code>camera = RL.CreateCamera3D()</code></div> +<div class="apidesc"><p>Return camera3D id set to default configuration</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.SetCamera3DPosition( camera3D camera, Vector3 position )</code></div> +<div class="apidesc"><p>Set camera position (Remember to call "RL.UpdateCamera3D()" to apply changes)</p></div> +<div class="apii"><code>RL.SetCamera3DTarget( camera3D camera, Vector3 target )</code></div> +<div class="apidesc"><p>Set camera target it looks-at</p></div> +<div class="apii"><code>RL.SetCamera3DUp( camera3D camera, Vector3 up )</code></div> +<div class="apidesc"><p>Set camera up vector (Rotation over it's axis)</p></div> +<div class="apii"><code>RL.SetCamera3DFovy( camera3D camera, float fovy )</code></div> +<div class="apidesc"><p>Set camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic</p></div> +<div class="apii"><code>RL.SetCamera3DProjection( camera3D camera, int projection )</code></div> +<div class="apidesc"><p>Set camera projection mode (CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC)</p></div> +<div class="apii"><code>position = RL.GetCamera3DPosition( camera3D camera )</code></div> +<div class="apidesc"><p>Get camera position</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>target = RL.GetCamera3DTarget( camera3D camera )</code></div> +<div class="apidesc"><p>Get camera target it looks-at</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>up = RL.GetCamera3DUp( camera3D camera )</code></div> +<div class="apidesc"><p>Get camera up vector (Rotation over it's axis)</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>fovy = RL.GetCamera3DFovy( camera3D camera )</code></div> +<div class="apidesc"><p>Get camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>projection = RL.GetCamera3DProjection( camera3D camera )</code></div> +<div class="apidesc"><p>Get camera projection mode</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>forward = RL.GetCamera3DForward( camera3D camera )</code></div> +<div class="apidesc"><p>Returns the cameras forward vector (normalized)</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>up = RL.GetCamera3DUpNormalized( camera3D camera )</code></div> +<div class="apidesc"><p>Returns the cameras up vector (normalized) Note: The up vector might not be perpendicular to the forward vector</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>right = RL.GetCamera3DRight( camera3D camera )</code></div> +<div class="apidesc"><p>Returns the cameras right vector (normalized)</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>RL.Camera3DMoveForward( camera3D camera, float distance, bool moveInWorldPlane )</code></div> +<div class="apidesc"><p>Moves the camera in it's forward direction</p></div> +<div class="apii"><code>RL.Camera3DMoveUp( camera3D camera, float distance )</code></div> +<div class="apidesc"><p>Moves the camera in it's up direction</p></div> +<div class="apii"><code>RL.Camera3DMoveRight( camera3D camera, float distance, bool moveInWorldPlane )</code></div> +<div class="apidesc"><p>Moves the camera target in it's current right direction</p></div> +<div class="apii"><code>RL.Camera3DMoveToTarget( camera3D camera, float delta )</code></div> +<div class="apidesc"><p>Moves the camera position closer/farther to/from the camera target</p></div> +<div class="apii"><code>RL.Camera3DYaw( camera3D camera, float angle, bool rotateAroundTarget )</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>RL.Camera3DPitch( camera3D camera, float angle, bool lockView, bool rotateAroundTarget, bool rotateUp )</code></div> +<div class="apidesc"><p>Rotates the camera around it's right vector, pitch is "looking up and down"</p> +<ul> +<li>lockView prevents camera overrotation (aka "somersaults")</li> +<li>rotateAroundTarget defines if rotation is around target or around it's position</li> +<li>rotateUp rotates the up direction as well (typically only usefull in CAMERA_FREE)</li> +</ul> +<p>NOTE: angle must be provided in radians</p></div> +<div class="apii"><code>RL.Camera3DRoll( camera3D camera, float angle )</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>view = RL.GetCamera3DViewMatrix( camera3D camera )</code></div> +<div class="apidesc"><p>Returns the camera view matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>projection = RL.GetCamera3DProjectionMatrix( camera3D camera, float aspect )</code></div> +<div class="apidesc"><p>Returns the camera projection matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>RL.UpdateCamera3D( camera3D camera, int mode )</code></div> +<div class="apidesc"><p>Update camera position for selected mode</p></div> +<div class="apii"><code>RL.UpdateCamera3DPro( camera3D camera, Vector3 movement, Vector3 rotation, float zoom )</code></div> +<div class="apidesc"><p>Update camera movement, movement/rotation values should be provided by user</p></div> +<h2 id="core---buffer-management-functions">Core - Buffer management functions</h2> +<div class="apii"><code>buffer = RL.LoadBuffer( data{} buffer, int type )</code></div> +<div class="apidesc"><p>Load Buffer. Type should be one of the Buffer types. Empty buffer will set data to NULL.</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>buffer = RL.LoadBufferFormatted( int length, int type, int value )</code></div> +<div class="apidesc"><p>Load formatted buffer with all values set to 'value'</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>buffer = RL.LoadBufferFromFile( string path, int type )</code></div> +<div class="apidesc"><p>Read buffer data from binary file</p> +<ul> +<li>Failure return nil</li> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>buffer = RL.LoadBufferFromString( string buffer )</code></div> +<div class="apidesc"><p>Read buffer data from string</p> +<ul> +<li>Failure return nil</li> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>RL.UnloadBuffer( Buffer buffer )</code></div> +<div class="apidesc"><p>Unload buffer data</p></div> +<div class="apii"><code>RL.CopyBufferData( Buffer dst, Buffer src, int posDst, int posSrc, int size )</code></div> +<div class="apidesc"><p>Copy buffer data to another buffer. Size is in bytes</p></div> +<div class="apii"><code>RL.SetBufferData( Buffer buffer, int position, any{} values )</code></div> +<div class="apidesc"><p>Set buffer data value</p></div> +<div class="apii"><code>RL.SwapBufferEndianness( Buffer buffer )</code></div> +<div class="apidesc"><p>Swap buffer endianness from big endian to little endian and vice versa</p></div> +<div class="apii"><code>data = RL.GetBufferData( Buffer buffer, int position, int length )</code></div> +<div class="apidesc"><p>Get buffer data as table in the format it was stored</p> +<ul> +<li>Success return data{}</li> +</ul></div> +<div class="apii"><code>string = RL.GetBufferAsString( Buffer buffer )</code></div> +<div class="apidesc"><p>Get buffer as string</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>type = RL.GetBufferType( Buffer buffer )</code></div> +<div class="apidesc"><p>Get buffer type</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>size = RL.GetBufferSize( Buffer buffer )</code></div> +<div class="apidesc"><p>Get buffer size in bytes</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>size = RL.GetBufferElementSize( Buffer buffer )</code></div> +<div class="apidesc"><p>Get buffer element size in bytes</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>length = RL.GetBufferLength( Buffer buffer )</code></div> +<div class="apidesc"><p>Get buffer element count</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.ExportBuffer( Buffer buffer, string path )</code></div> +<div class="apidesc"><p>Write buffer data to binary file</p></div> +<h2 id="shapes---basic-shapes-drawing-functions">Shapes - Basic shapes drawing functions</h2> +<div class="apii"><code>RL.SetShapesTexture( Texture texture, Rectangle source )</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>texture = RL.GetShapesTexture()</code></div> +<div class="apidesc"><p>Get texture that is used for shapes drawing. Return as lightuserdata</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>source = RL.GetShapesTextureRectangle()</code></div> +<div class="apidesc"><p>Get texture source rectangle that is used for shapes drawing</p> +<ul> +<li>Success return Rectangle</li> +</ul></div> +<div class="apii"><code>RL.DrawPixel( Vector2 pos, Color color )</code></div> +<div class="apidesc"><p>Draw a pixel</p></div> +<div class="apii"><code>RL.DrawLine( Vector2 startPos, Vector2 endPos, float thickness, Color color )</code></div> +<div class="apidesc"><p>Draw a line defining thickness</p></div> +<div class="apii"><code>RL.DrawLineStrip( Vector2{} points, Color color )</code></div> +<div class="apidesc"><p>Draw lines sequence</p></div> +<div class="apii"><code>RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color )</code></div> +<div class="apidesc"><p>Draw a line using cubic-bezier curves in-out</p></div> +<div class="apii"><code>RL.DrawCircle( Vector2 center, float radius, Color color )</code></div> +<div class="apidesc"><p>Draw a color-filled circle</p></div> +<div class="apii"><code>RL.DrawCircleSector( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color )</code></div> +<div class="apidesc"><p>Draw a piece of a circle</p></div> +<div class="apii"><code>RL.DrawCircleSectorLines( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color )</code></div> +<div class="apidesc"><p>Draw circle sector outline</p></div> +<div class="apii"><code>RL.DrawCircleGradient( Vector2 center, float radius, Color color1, Color color2 )</code></div> +<div class="apidesc"><p>Draw a gradient-filled circle</p></div> +<div class="apii"><code>RL.DrawCircleLines( Vector2 center, float radius, Color color )</code></div> +<div class="apidesc"><p>Draw circle outline</p></div> +<div class="apii"><code>RL.DrawEllipse( Vector2 center, float radiusH, float radiusV, Color color )</code></div> +<div class="apidesc"><p>Draw ellipse</p></div> +<div class="apii"><code>RL.DrawEllipseLines( Vector2 center, float radiusH, float radiusV, Color color )</code></div> +<div class="apidesc"><p>Draw ellipse outline</p></div> +<div class="apii"><code>RL.DrawRing( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color )</code></div> +<div class="apidesc"><p>Draw ring</p></div> +<div class="apii"><code>RL.DrawRingLines( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color )</code></div> +<div class="apidesc"><p>Draw ring outline</p></div> +<div class="apii"><code>RL.DrawRectangle( Rectangle rec, Color color )</code></div> +<div class="apidesc"><p>Draw a color-filled rectangle</p></div> +<div class="apii"><code>RL.DrawRectanglePro( Rectangle rec, Vector2 origin, float rotation, Color color )</code></div> +<div class="apidesc"><p>Draw a color-filled rectangle with pro parameters</p></div> +<div class="apii"><code>RL.DrawRectangleGradientV( Rectangle rectangle, Color color1, Color color2 )</code></div> +<div class="apidesc"><p>Draw a vertical-gradient-filled rectangle</p></div> +<div class="apii"><code>RL.DrawRectangleGradientH( Rectangle rectangle, Color color1, Color color2 )</code></div> +<div class="apidesc"><p>Draw a horizontal-gradient-filled rectangle</p></div> +<div class="apii"><code>RL.DrawRectangleGradientEx( Rectangle rectangle, Color col1, Color col2, Color col3, Color col4 )</code></div> +<div class="apidesc"><p>Draw a gradient-filled rectangle with custom vertex colors</p></div> +<div class="apii"><code>RL.DrawRectangleLines( Rectangle rec, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle outline</p></div> +<div class="apii"><code>RL.DrawRectangleLinesEx( Rectangle rec, int lineThick, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle outline with extended parameters</p></div> +<div class="apii"><code>RL.DrawRectangleRounded( Rectangle rec, float roundness, int segments, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle with rounded edges</p></div> +<div class="apii"><code>RL.DrawRectangleRoundedLines( Rectangle rec, float roundness, int segments, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle lines with rounded edges</p></div> +<div class="apii"><code>RL.DrawRectangleRoundedLinesEx( Rectangle rec, float roundness, int segments, float lineThick, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle with rounded edges outline</p></div> +<div class="apii"><code>RL.DrawTriangle( Vector2 v1, Vector2 v2, Vector2 v3, Color color )</code></div> +<div class="apidesc"><p>Draw a color-filled triangle (Vertex in counter-clockwise order!)</p></div> +<div class="apii"><code>RL.DrawTriangleLines( Vector2 v1, Vector2 v2, Vector2 v3, Color color )</code></div> +<div class="apidesc"><p>Draw triangle outline (Vertex in counter-clockwise order!)</p></div> +<div class="apii"><code>RL.DrawTriangleFan( Vector2{} points, Color color )</code></div> +<div class="apidesc"><p>Draw a triangle fan defined by points (first vertex is the center)</p></div> +<div class="apii"><code>RL.DrawTriangleStrip( Vector2{} points, Color color )</code></div> +<div class="apidesc"><p>Draw a triangle strip defined by points</p></div> +<div class="apii"><code>RL.DrawPoly( Vector2 center, int sides, float radius, float rotation, Color color )</code></div> +<div class="apidesc"><p>Draw a regular polygon (Vector version)</p></div> +<div class="apii"><code>RL.DrawPolyLines( Vector2 center, int sides, float radius, float rotation, Color color )</code></div> +<div class="apidesc"><p>Draw a polygon outline of n sides</p></div> +<div class="apii"><code>RL.DrawPolyLinesEx( Vector2 center, int sides, float radius, float rotation, float lineThick, Color color )</code></div> +<div class="apidesc"><p>Draw a polygon outline of n sides with extended parameters</p></div> +<h2 id="shapes---splines-drawing-functions">Shapes - Splines drawing functions</h2> +<div class="apii"><code>RL.DrawSplineLinear( Vector2{} points, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline: Linear, minimum 2 points</p></div> +<div class="apii"><code>RL.DrawSplineBasis( Vector2{} points, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline: B-Spline, minimum 4 points</p></div> +<div class="apii"><code>RL.DrawSplineCatmullRom( Vector2{} points, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline: Catmull-Rom, minimum 4 points</p></div> +<div class="apii"><code>RL.DrawSplineBezierQuadratic( Vector2{} points, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]</p></div> +<div class="apii"><code>RL.DrawSplineBezierCubic( Vector2{} points, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]</p></div> +<div class="apii"><code>RL.DrawSplineSegmentLinear( Vector2 p1, Vector2 p2, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline segment: Linear, 2 points</p></div> +<div class="apii"><code>RL.DrawSplineSegmentBasis( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline segment: B-Spline, 4 points</p></div> +<div class="apii"><code>RL.DrawSplineSegmentCatmullRom( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline segment: Catmull-Rom, 4 points</p></div> +<div class="apii"><code>RL.DrawSplineSegmentBezierQuadratic( Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline segment: Quadratic Bezier, 2 points, 1 control point</p></div> +<div class="apii"><code>RL.DrawSplineSegmentBezierCubic( Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color )</code></div> +<div class="apidesc"><p>Draw spline segment: Cubic Bezier, 2 points, 2 control points</p></div> +<h2 id="shapes---spline-segment-point-evaluation-functions,-for-a-given-t-[00f--10f]">Shapes - Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]</h2> +<div class="apii"><code>point = RL.GetSplinePointLinear( Vector2 startPos, Vector2 endPos, float t )</code></div> +<div class="apidesc"><p>Get (evaluate) spline point: Linear</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>point = RL.GetSplinePointBasis( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t )</code></div> +<div class="apidesc"><p>Get (evaluate) spline point: B-Spline</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>point = RL.GetSplinePointCatmullRom( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t )</code></div> +<div class="apidesc"><p>Get (evaluate) spline point: Catmull-Rom</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>point = RL.GetSplinePointBezierQuad( Vector2 p1, Vector2 c2, Vector2 p3, float t )</code></div> +<div class="apidesc"><p>Get (evaluate) spline point: Quadratic Bezier</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>point = RL.GetSplinePointBezierCubic( Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t )</code></div> +<div class="apidesc"><p>Get (evaluate) spline point: Cubic Bezier</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<h2 id="shapes---basic-shapes-collision-detection-functions">Shapes - Basic shapes collision detection functions</h2> +<div class="apii"><code>collision = RL.CheckCollisionRecs( Rectangle rec1, Rectangle rec2 )</code></div> +<div class="apidesc"><p>Check collision between two rectangles</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionCircles( Vector2 center1, float radius1, Vector2 center2, float radius2 )</code></div> +<div class="apidesc"><p>Check collision between two circles</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionCircleRec( Vector2 center, float radius, Rectangle rec )</code></div> +<div class="apidesc"><p>Check collision between circle and rectangle</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionCircleLine( Vector2 center, float radius, Vector2 p1, Vector2 p2 )</code></div> +<div class="apidesc"><p>Check if circle collides with a line created betweeen two points [p1] and [p2]</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionPointRec( Vector2 point, Rectangle rec )</code></div> +<div class="apidesc"><p>Check if point is inside rectangle</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionPointCircle( Vector2 point, Vector2 center, float radius )</code></div> +<div class="apidesc"><p>Check if point is inside circle</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionPointTriangle( Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3 )</code></div> +<div class="apidesc"><p>Check if point is inside a triangle</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionPointPoly( Vector2 point, Vector2{} points )</code></div> +<div class="apidesc"><p>Check if point is within a polygon described by array of vertices</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision, position = RL.CheckCollisionLines( Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2 )</code></div> +<div class="apidesc"><p>Check the collision between two lines defined by two points each, returns collision point by reference</p> +<ul> +<li>Success return bool, Vector2</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionPointLine( Vector2 point, Vector2 p1, Vector2 p2, int threshold )</code></div> +<div class="apidesc"><p>Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>rectangle = RL.GetCollisionRec( Rectangle rec1, Rectangle rec2 )</code></div> +<div class="apidesc"><p>Get collision rectangle for two rectangles collision</p> +<ul> +<li>Success return Rectangle</li> +</ul></div> +<div class="apii"><code>rects{} = RL.RectPack( Rectangle{} rects, Vector2 size, int padding )</code></div> +<div class="apidesc"><p>Useful for e.g. packing rectangular textures into an atlas. stbrp_pack_rects</p> +<ul> +<li>Success return Rectangle{}</li> +</ul></div> +<h2 id="textures---image-loading-functions">Textures - Image loading functions</h2> +<div class="apii"><code>image = RL.LoadImage( string fileName )</code></div> +<div class="apidesc"><p>Load image from file into CPU memory (RAM)</p> +<ul> +<li>Failure return nil</li> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.LoadImageRaw( string fileName, Vector2 size, int format, int headerSize )</code></div> +<div class="apidesc"><p>Load image from RAW file data</p> +<ul> +<li>Failure return nil</li> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image, frameCount = RL.LoadImageAnim( string fileName )</code></div> +<div class="apidesc"><p>Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format</p> +<ul> +<li>Failure return nil</li> +<li>Success return Image, int</li> +</ul></div> +<div class="apii"><code>image, frameCount = RL.LoadImageAnimFromMemory( string fileType, Buffer fileData )</code></div> +<div class="apidesc"><p>Load image sequence from memory buffer. All frames are returned in RGBA format</p> +<ul> +<li>Success return Image, int</li> +</ul></div> +<div class="apii"><code>image, frameCount = RL.LoadImageFromMemory( string fileType, Buffer data )</code></div> +<div class="apidesc"><p>Load image from memory buffer, fileType refers to extension: i.e. '.png'</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image, frameCount = RL.LoadImageFromData( Buffer data, Vector2 size, int mipmaps, int format )</code></div> +<div class="apidesc"><p>Load image from data</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.LoadImageFromTexture( Texture texture )</code></div> +<div class="apidesc"><p>Load image from GPU texture data</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.LoadImageFromScreen()</code></div> +<div class="apidesc"><p>Load image from screen buffer and (screenshot)</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsImageValid( Image image )</code></div> +<div class="apidesc"><p>Check if an image is valid (data and parameters)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadImage( Image image )</code></div> +<div class="apidesc"><p>Unload image from CPU memory (RAM)</p></div> +<div class="apii"><code>success = RL.ExportImage( Image image, string fileName )</code></div> +<div class="apidesc"><p>Export image data to file, returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>buffer = RL.ExportImageToMemory( Image image, string fileType )</code></div> +<div class="apidesc"><p>Export image to memory buffer</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>success = RL.ExportImageAsCode( Image image, string fileName )</code></div> +<div class="apidesc"><p>Export image as code file defining an array of bytes, returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="textures---image-generation-functions">Textures - Image generation functions</h2> +<div class="apii"><code>image = RL.GenImageColor( Vector2 size, Color color )</code></div> +<div class="apidesc"><p>Generate image: plain color</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageGradientLinear( Vector2 size, int direction, Color a, Color b )</code></div> +<div class="apidesc"><p>Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageGradientRadial( Vector2 size, float density, Color inner, Color outer )</code></div> +<div class="apidesc"><p>Generate image: radial gradient</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageGradientSquare( Vector2 size, float density, Color inner, Color outer )</code></div> +<div class="apidesc"><p>Generate image: square gradient</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageChecked( Vector2 size, Vector2 checks, Color col1, Color col2 )</code></div> +<div class="apidesc"><p>Generate image: checked</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageWhiteNoise( Vector2 size, float factor )</code></div> +<div class="apidesc"><p>Generate image: white noise</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImagePerlinNoise( Vector2 size, Vector2 offset, float factor )</code></div> +<div class="apidesc"><p>Generate image: perlin noise</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageCellular( Vector2 size, int tileSize )</code></div> +<div class="apidesc"><p>Generate image: cellular algorithm. Bigger tileSize means bigger cells</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.GenImageText( Vector2 size, string text )</code></div> +<div class="apidesc"><p>Generate image: grayscale image from text data</p> +<ul> +<li>Success return Image</li> +</ul></div> +<h2 id="textures---image-manipulation-functions">Textures - Image manipulation functions</h2> +<div class="apii"><code>image = RL.ImageCopy( Image image )</code></div> +<div class="apidesc"><p>Create an image duplicate (useful for transformations)</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.ImageFromImage( Image image, Rectangle rec )</code></div> +<div class="apidesc"><p>Create an image from another image piece</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.ImageFromChannel( Image image, int selectedChannel )</code></div> +<div class="apidesc"><p>Create an image from a selected channel of another image (GRAYSCALE)</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.ImageText( string text, int fontSize, Color tint )</code></div> +<div class="apidesc"><p>Create an image from text (default font)</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>image = RL.ImageTextEx( Font font, string text, float fontSize, float spacing, Color tint )</code></div> +<div class="apidesc"><p>Create an image from text (custom sprite font)</p> +<ul> +<li>Success return Image</li> +</ul></div> +<div class="apii"><code>RL.ImageFormat( Image image, int newFormat )</code></div> +<div class="apidesc"><p>Convert image data to desired format</p></div> +<div class="apii"><code>RL.ImageToPOT( Image image, Color fill )</code></div> +<div class="apidesc"><p>Convert image to POT (power-of-two)</p></div> +<div class="apii"><code>RL.ImageCrop( Image image, Rectangle crop )</code></div> +<div class="apidesc"><p>Crop an image to a defined rectangle</p></div> +<div class="apii"><code>RL.ImageAlphaCrop( Image image, float threshold )</code></div> +<div class="apidesc"><p>Crop image depending on alpha value</p></div> +<div class="apii"><code>RL.ImageAlphaClear( Image image, Color color, float threshold )</code></div> +<div class="apidesc"><p>Clear alpha channel to desired color</p></div> +<div class="apii"><code>RL.ImageAlphaMask( Image image, Image alphaMask )</code></div> +<div class="apidesc"><p>Apply alpha mask to image</p></div> +<div class="apii"><code>RL.ImageAlphaPremultiply( Image image )</code></div> +<div class="apidesc"><p>Premultiply alpha channel</p></div> +<div class="apii"><code>RL.ImageBlurGaussian( Image image, int blurSize )</code></div> +<div class="apidesc"><p>Apply Gaussian blur using a box blur approximation</p></div> +<div class="apii"><code>RL.ImageKernelConvolution( Image image, float{} kernel )</code></div> +<div class="apidesc"><p>Apply custom square convolution kernel to image</p></div> +<div class="apii"><code>RL.ImageResize( Image image, Vector2 size )</code></div> +<div class="apidesc"><p>Resize image (Bicubic scaling algorithm)</p></div> +<div class="apii"><code>RL.ImageResizeNN( Image image, Vector2 size )</code></div> +<div class="apidesc"><p>Resize image (Nearest-Neighbor scaling algorithm)</p></div> +<div class="apii"><code>RL.ImageResizeCanvas( Image image, Vector2 size, Vector2 offset, Color fill )</code></div> +<div class="apidesc"><p>Resize canvas and fill with color</p></div> +<div class="apii"><code>RL.ImageMipmaps( Image image )</code></div> +<div class="apidesc"><p>Generate all mipmap levels for a provided image</p></div> +<div class="apii"><code>RL.ImageDither( Image image, Color bpp )</code></div> +<div class="apidesc"><p>Dither image data to 16bpp or lower (Floyd-Steinberg dithering)</p></div> +<div class="apii"><code>RL.ImageFlipVertical( Image image )</code></div> +<div class="apidesc"><p>Flip image vertically</p></div> +<div class="apii"><code>RL.ImageFlipHorizontal( Image image )</code></div> +<div class="apidesc"><p>Flip image horizontally</p></div> +<div class="apii"><code>RL.ImageRotate( Image image, int degrees )</code></div> +<div class="apidesc"><p>Rotate image by input angle in degrees (-359 to 359)</p></div> +<div class="apii"><code>RL.ImageRotateCW( Image image )</code></div> +<div class="apidesc"><p>Rotate image clockwise 90deg</p></div> +<div class="apii"><code>RL.ImageRotateCCW( Image image )</code></div> +<div class="apidesc"><p>Rotate image counter-clockwise 90deg</p></div> +<div class="apii"><code>RL.ImageColorTint( Image image, Color color )</code></div> +<div class="apidesc"><p>Modify image color: tint</p></div> +<div class="apii"><code>RL.ImageColorInvert( Image image )</code></div> +<div class="apidesc"><p>Modify image color: invert</p></div> +<div class="apii"><code>RL.ImageColorGrayscale( Image image )</code></div> +<div class="apidesc"><p>Modify image color: grayscale</p></div> +<div class="apii"><code>RL.ImageColorContrast( Image image, float contrast )</code></div> +<div class="apidesc"><p>Modify image color: contrast (-100 to 100)</p></div> +<div class="apii"><code>RL.ImageColorBrightness( Image image, int brightness )</code></div> +<div class="apidesc"><p>Modify image color: brightness (-255 to 255)</p></div> +<div class="apii"><code>RL.ImageColorReplace( Image image, Color color, Color replace )</code></div> +<div class="apidesc"><p>Modify image color: replace color</p></div> +<div class="apii"><code>colors = RL.LoadImageColors( Image image )</code></div> +<div class="apidesc"><p>Load color data from image as a Color array (RGBA - 32bit)</p> +<ul> +<li>Success return Color{}</li> +</ul></div> +<div class="apii"><code>colors = RL.LoadImagePalette( Image image, int maxPaletteSize )</code></div> +<div class="apidesc"><p>Load colors palette from image as a Color array (RGBA - 32bit)</p> +<ul> +<li>Success return Color{}</li> +</ul></div> +<div class="apii"><code>rectangle = RL.GetImageAlphaBorder( Image image, float threshold )</code></div> +<div class="apidesc"><p>Get image alpha border rectangle</p> +<ul> +<li>Success return Rectangle</li> +</ul></div> +<div class="apii"><code>color = RL.GetImageColor( Image image, Vector2 pixelPos )</code></div> +<div class="apidesc"><p>Get image pixel color at (x, y) position</p> +<ul> +<li>Success return Color</li> +</ul></div> +<h2 id="textures---image-configuration-functions">Textures - Image configuration functions</h2> +<div class="apii"><code>RL.SetImageData( Image image, Buffer data )</code></div> +<div class="apidesc"><p>Set image data from Buffer</p></div> +<div class="apii"><code>imageData = RL.GetImageData( Image image )</code></div> +<div class="apidesc"><p>Get image data as Buffer</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>size = RL.GetImageSize( Image image )</code></div> +<div class="apidesc"><p>Get image size</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>mipmaps = RL.GetImageMipmaps( Image image )</code></div> +<div class="apidesc"><p>Get image mipmaps. Mipmap levels, 1 by default</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>format = RL.GetImageFormat( Image image )</code></div> +<div class="apidesc"><p>Get image data format (PixelFormat type)</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="textures---image-drawing-functions">Textures - Image drawing functions</h2> +<div class="apii"><code>RL.ImageClearBackground( Image dst, Color color )</code></div> +<div class="apidesc"><p>Clear image background with given color</p></div> +<div class="apii"><code>RL.ImageDrawPixel( Image dst, Vector2 position, Color color )</code></div> +<div class="apidesc"><p>Draw pixel within an image</p></div> +<div class="apii"><code>RL.ImageDrawLine( Image dst, Vector2 start, Vector2 end, Color color )</code></div> +<div class="apidesc"><p>Draw line within an image</p></div> +<div class="apii"><code>RL.ImageDrawLineEx( Image dst, Vector2 start, Vector2 end, int thick, Color color )</code></div> +<div class="apidesc"><p>Draw a line defining thickness within an image</p></div> +<div class="apii"><code>RL.ImageDrawCircle( Image dst, Vector2 center, int radius, Color color )</code></div> +<div class="apidesc"><p>Draw circle within an image</p></div> +<div class="apii"><code>RL.ImageDrawCircleLines( Image dst, Vector2 center, int radius, Color color )</code></div> +<div class="apidesc"><p>Draw circle outline within an image</p></div> +<div class="apii"><code>RL.ImageDrawRectangle( Image dst, Rectangle rec, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle within an image</p></div> +<div class="apii"><code>RL.ImageDrawRectangleLines( Image dst, Rectangle rec, int thick, Color color )</code></div> +<div class="apidesc"><p>Draw rectangle lines within an image</p></div> +<div class="apii"><code>RL.ImageDrawTriangle( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color )</code></div> +<div class="apidesc"><p>Draw triangle within an image</p></div> +<div class="apii"><code>RL.ImageDrawTriangleEx( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3 )</code></div> +<div class="apidesc"><p>Draw triangle with interpolated colors within an image</p></div> +<div class="apii"><code>RL.ImageDrawTriangleLines( Image dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color )</code></div> +<div class="apidesc"><p>Draw triangle outline within an image</p></div> +<div class="apii"><code>RL.ImageDrawTriangleFan( Image dst, Vector2{} points, Color color )</code></div> +<div class="apidesc"><p>Draw a triangle fan defined by points within an image (first vertex is the center)</p></div> +<div class="apii"><code>RL.ImageDrawTriangleStrip( Image dst, Vector2{} points, Color color )</code></div> +<div class="apidesc"><p>Draw a triangle strip defined by points within an image</p></div> +<div class="apii"><code>RL.ImageDraw( Image dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint )</code></div> +<div class="apidesc"><p>Draw a source image within a destination image (Tint applied to source)</p></div> +<div class="apii"><code>RL.ImageDrawText( Image dst, string text, Vector2 position, float fontSize, Color tint )</code></div> +<div class="apidesc"><p>Draw text (using default font) within an image (destination)</p></div> +<div class="apii"><code>RL.ImageDrawTextEx( Image dst, Font font, string text, Vector2 position, float fontSize, float spacing, Color tint )</code></div> +<div class="apidesc"><p>Draw text (Custom sprite font) within an image (Destination)</p></div> +<h2 id="textures---texture-loading-functions">Textures - Texture loading functions</h2> +<div class="apii"><code>texture = RL.GetTextureDefault()</code></div> +<div class="apidesc"><p>Get default texture. Return as lightuserdata</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>texture = RL.LoadTexture( string fileName )</code></div> +<div class="apidesc"><p>Load texture from file into GPU memory ( VRAM )</p> +<ul> +<li>Failure return nil</li> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>texture = RL.LoadTextureFromImage( Image image )</code></div> +<div class="apidesc"><p>Load texture from image data</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>texture = RL.LoadTextureCubemap( Image image, int layout )</code></div> +<div class="apidesc"><p>Load cubemap from image, multiple image cubemap layouts supported</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>texture = RL.LoadTextureFromData( Texture{} textureData )</code></div> +<div class="apidesc"><p>Load Texture from data</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>renderTexture = RL.LoadRenderTexture( Vector2 size )</code></div> +<div class="apidesc"><p>Load texture for rendering (framebuffer)</p> +<ul> +<li>Success return RenderTexture</li> +</ul></div> +<div class="apii"><code>renderTexture = RL.LoadRenderTextureFromData( Texture{} renderTextureData )</code></div> +<div class="apidesc"><p>Load RenderTexture from data (framebuffer)</p> +<ul> +<li>Success return RenderTexture</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsTextureValid( Texture texture )</code></div> +<div class="apidesc"><p>Check if a texture is valid (loaded in GPU)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadTexture( Texture texture )</code></div> +<div class="apidesc"><p>Unload texture from GPU memory (VRAM)</p></div> +<div class="apii"><code>isValid = RL.IsRenderTextureValid( RenderTexture target )</code></div> +<div class="apidesc"><p>Check if a render texture is valid (loaded in GPU)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadRenderTexture( RenderTexture target )</code></div> +<div class="apidesc"><p>Unload render texture from GPU memory (VRAM)</p></div> +<div class="apii"><code>RL.UpdateTexture( Texture texture, Buffer pixels )</code></div> +<div class="apidesc"><p>Update GPU texture with new data</p></div> +<div class="apii"><code>RL.UpdateTextureRec( Texture texture, Rectangle rec, Buffer pixels )</code></div> +<div class="apidesc"><p>Update GPU texture rectangle with new data.</p></div> +<h2 id="textures---texture-configuration-functions">Textures - Texture configuration functions</h2> +<div class="apii"><code>RL.GenTextureMipmaps( Texture texture )</code></div> +<div class="apidesc"><p>Generate GPU mipmaps for a texture</p></div> +<div class="apii"><code>RL.SetTextureFilter( Texture texture, int filter )</code></div> +<div class="apidesc"><p>Set texture scaling filter mode (TEXTURE_FILTER_POINT, TEXTURE_FILTER_BILINEAR...)</p></div> +<div class="apii"><code>RL.SetTextureWrap( Texture texture, int wrap )</code></div> +<div class="apidesc"><p>Set texture wrapping mode (TEXTURE_WRAP_REPEAT, TEXTURE_WRAP_CLAMP...)</p></div> +<div class="apii"><code>id = RL.GetTextureId( Texture texture )</code></div> +<div class="apidesc"><p>Get OpenGL texture id</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>size = RL.GetTextureSize( Texture texture )</code></div> +<div class="apidesc"><p>Get texture size</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>mipmaps = RL.GetTextureMipmaps( Texture texture )</code></div> +<div class="apidesc"><p>Get texture mipmaps. Mipmap levels, 1 by default</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>format = RL.GetTextureFormat( Texture texture )</code></div> +<div class="apidesc"><p>Get texture data format (PixelFormat type)</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="textures---texture-drawing-functions">Textures - Texture drawing functions</h2> +<div class="apii"><code>RL.DrawTexture( Texture texture, Vector2 position, Color tint )</code></div> +<div class="apidesc"><p>Draw a Texture2D</p></div> +<div class="apii"><code>RL.DrawTextureEx( Texture texture, Vector2 position, float rotation, float scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a Texture2D with extended parameters</p></div> +<div class="apii"><code>RL.DrawTextureRec( Texture texture, Rectangle source, Vector2 position, Color tint )</code></div> +<div class="apidesc"><p>Draw a part of a texture defined by a rectangle</p></div> +<div class="apii"><code>RL.DrawTexturePro( Texture texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint )</code></div> +<div class="apidesc"><p>Draw a part of a texture defined by a rectangle with "pro" parameters</p></div> +<div class="apii"><code>RL.DrawTextureNPatch( Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint )</code></div> +<div class="apidesc"><p>Draws a texture (or part of it) that stretches or shrinks nicely</p></div> +<div class="apii"><code>RL.DrawTextureNPatchRepeat( Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint )</code></div> +<div class="apidesc"><p>Draws a texture (or part of it) that repeats nicely</p></div> +<h2 id="textures---rendertexture-configuration-functions">Textures - RenderTexture configuration functions</h2> +<div class="apii"><code>id = RL.GetRenderTextureId( RenderTexture renderTexture )</code></div> +<div class="apidesc"><p>Get OpenGL framebuffer object id</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>texture = RL.GetRenderTextureTexture( RenderTexture renderTexture )</code></div> +<div class="apidesc"><p>Get color buffer attachment texture. Returns as lightuserdata</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>texture = RL.GetRenderTextureDepthTexture( RenderTexture renderTexture )</code></div> +<div class="apidesc"><p>Get depth buffer attachment texture. Returns as lightuserdata</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<h2 id="textures---colorpixel-related-functions">Textures - Color/pixel related functions</h2> +<div class="apii"><code>isEqual = RL.ColorIsEqual( Color col1, Color col2 )</code></div> +<div class="apidesc"><p>Check if two colors are equal</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>color = RL.Fade( Color color, float alpha )</code></div> +<div class="apidesc"><p>Returns color with alpha applied, alpha goes from 0.0f to 1.0f</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>value = RL.ColorToInt( Color color )</code></div> +<div class="apidesc"><p>Returns hexadecimal value for a Color</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>color = RL.ColorNormalize( Color color )</code></div> +<div class="apidesc"><p>Returns Color normalized as float [0..1]</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>color = RL.ColorFromNormalized( Vector4 normalized )</code></div> +<div class="apidesc"><p>Color from normalized values [0..1]</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>HSV = RL.ColorToHSV( Color color )</code></div> +<div class="apidesc"><p>Returns HSV values for a Color, hue [0..360], saturation/value [0..1]</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>color = RL.ColorFromHSV( float hue, float saturation, float value )</code></div> +<div class="apidesc"><p>Returns a Color from HSV values, hue [0..360], saturation/value [0..1]</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.ColorTint( Color color, Color tint )</code></div> +<div class="apidesc"><p>Get color multiplied with another color</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.ColorBrightness( Color color, float factor )</code></div> +<div class="apidesc"><p>Get color with brightness correction, brightness factor goes from -1.0f to 1.0f</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.ColorContrast( Color color, float contrast )</code></div> +<div class="apidesc"><p>Get color with contrast correction, contrast values between -1.0f and 1.0f</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.ColorAlpha( Color color, float alpha )</code></div> +<div class="apidesc"><p>Returns color with alpha applied, alpha goes from 0.0f to 1.0f</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.ColorAlphaBlend( Color dst, Color src, Color tint )</code></div> +<div class="apidesc"><p>Returns src alpha-blended into dst color with tint</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.ColorLerp( Color color1, Color color2, float factor )</code></div> +<div class="apidesc"><p>Get color lerp interpolation between two colors, factor [0.0f..1.0f]</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>color = RL.GetColor( int hexValue )</code></div> +<div class="apidesc"><p>Get Color structure from hexadecimal value</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>size = RL.GetPixelDataSize( Vector2 size, int format )</code></div> +<div class="apidesc"><p>Get pixel data size in bytes for certain format</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="text---font-loadingunloading-functions">Text - Font loading/unloading functions</h2> +<div class="apii"><code>font = RL.GetFontDefault()</code></div> +<div class="apidesc"><p>Get the default Font. Return as lightuserdata</p> +<ul> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>font = RL.LoadFont( string fileName )</code></div> +<div class="apidesc"><p>Load font from file into GPU memory (VRAM)</p> +<ul> +<li>Failure return nil</li> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>font = RL.LoadFontEx( string fileName, int fontSize, int{}|nil codepoints )</code></div> +<div class="apidesc"><p>Load font from file with extended parameters, use NULL for codepoints to load the default character set</p> +<ul> +<li>Failure return nil</li> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>font = RL.LoadFontFromImage( Image image, Color key, int firstChar )</code></div> +<div class="apidesc"><p>Load font from Image (XNA style)</p> +<ul> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>font = RL.LoadFontFromMemory( string fileType, Buffer fileData, int fontSize, int{} codepoints )</code></div> +<div class="apidesc"><p>Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. NOTE: fileData type should be unsigned char</p> +<ul> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>font = RL.LoadFontFromData( Font{} fontData )</code></div> +<div class="apidesc"><p>Load Font from data</p> +<ul> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>font = RL.FontCopy( Font font )</code></div> +<div class="apidesc"><p>Load font copy as new userdata</p> +<ul> +<li>Success return Font</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsFontValid( Font font )</code></div> +<div class="apidesc"><p>Check if a font is valid (font data loaded, WARNING: GPU texture not checked)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>glyphs = RL.LoadFontData( Buffer fileData, int fontSize, int{} codepoints, int type )</code></div> +<div class="apidesc"><p>Load font data for further use. NOTE: fileData type should be unsigned char</p> +<ul> +<li>Success return GlyphInfo{}</li> +</ul></div> +<div class="apii"><code>image, rectangles = RL.GenImageFontAtlas( GlyphInfo{} glyphs, int fontSize, int padding, int packMethod )</code></div> +<div class="apidesc"><p>Generate image font atlas using chars info. NOTE: Packing method: 0-Default, 1-Skyline</p> +<ul> +<li>Success Image, Rectangle{}</li> +</ul></div> +<div class="apii"><code>RL.UnloadFont( Font font )</code></div> +<div class="apidesc"><p>Unload font from GPU memory (VRAM)</p></div> +<div class="apii"><code>RL.ExportFontAsCode( Font font, string fileName )</code></div> +<div class="apidesc"><p>Export font as code file, returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="text---text-drawing-functions">Text - Text drawing functions</h2> +<div class="apii"><code>RL.DrawFPS( Vector2 pos )</code></div> +<div class="apidesc"><p>Draw current FPS</p></div> +<div class="apii"><code>RL.DrawText( string text, Vector2 position, float fontSize, Color tint )</code></div> +<div class="apidesc"><p>Draw text (using default font)</p></div> +<div class="apii"><code>RL.DrawTextEx( Font font, string text, Vector2 position, float fontSize, float spacing, Color tint )</code></div> +<div class="apidesc"><p>Draw text using font and additional parameters</p></div> +<div class="apii"><code>RL.DrawTextPro( Font font, string text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint )</code></div> +<div class="apidesc"><p>Draw text using Font and pro parameters (rotation)</p></div> +<div class="apii"><code>RL.DrawTextCodepoint( Font font, int codepoint, Vector2 position, float fontSize, Color tint )</code></div> +<div class="apidesc"><p>Draw one character (codepoint)</p></div> +<div class="apii"><code>RL.DrawTextCodepoints( Font font, int{} codepoints, Vector2 position, float fontSize, float spacing, Color tint )</code></div> +<div class="apidesc"><p>Draw multiple character (codepoint)</p></div> +<div class="apii"><code>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 )</code></div> +<div class="apidesc"><p>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"</p> +<ul> +<li>Success return int, Vector2</li> +</ul></div> +<h2 id="text---text-font-info-functions">Text - Text font info functions</h2> +<div class="apii"><code>RL.SetTextLineSpacing( int spacing )</code></div> +<div class="apidesc"><p>Set vertical line spacing when drawing with line-breaks</p></div> +<div class="apii"><code>spacing = RL.GetTextLineSpacing()</code></div> +<div class="apidesc"><p>Get vertical line spacing when drawing with line-breaks</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>width = RL.MeasureText( string text, int fontSize )</code></div> +<div class="apidesc"><p>Measure string width for default font</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>size = RL.MeasureTextEx( Font font, string text, float fontSize, float spacing )</code></div> +<div class="apidesc"><p>Measure string size for Font</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>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 )</code></div> +<div class="apidesc"><p>Measure text inside rectangle limits.</p> +<ul> +<li>Success return Vector2, Vector2</li> +</ul></div> +<div class="apii"><code>index = RL.GetGlyphIndex( Font font, int codepoint )</code></div> +<div class="apidesc"><p>Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>glyphInfo = RL.GetGlyphInfo( Font font, int codepoint )</code></div> +<div class="apidesc"><p>Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found. Return as lightuserdata</p> +<ul> +<li>Success return GlyphInfo</li> +</ul></div> +<div class="apii"><code>glyphInfo = RL.GetGlyphInfoByIndex( Font font, int index )</code></div> +<div class="apidesc"><p>Get glyph font info data by index. Return as lightuserdata</p> +<ul> +<li>Failure return nil</li> +<li>Success return GlyphInfo</li> +</ul></div> +<div class="apii"><code>rect = RL.GetGlyphAtlasRec( Font font, int codepoint )</code></div> +<div class="apidesc"><p>Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found</p> +<ul> +<li>Success return Rectangle</li> +</ul></div> +<div class="apii"><code>rect = RL.GetGlyphAtlasRecByIndex( Font font, int index )</code></div> +<div class="apidesc"><p>Get glyph rectangle in font atlas by index</p> +<ul> +<li>Failure return nil</li> +<li>Success return Rectangle</li> +</ul></div> +<div class="apii"><code>baseSize = RL.GetFontBaseSize( Font font )</code></div> +<div class="apidesc"><p>Get font base size (default chars height)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>glyphCount = RL.GetFontGlyphCount( Font font )</code></div> +<div class="apidesc"><p>Get font number of glyph characters</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>glyphPadding = RL.GetFontGlyphPadding( Font font )</code></div> +<div class="apidesc"><p>Get font padding around the glyph characters</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>texture = RL.GetFontTexture( Font font )</code></div> +<div class="apidesc"><p>Get font texture atlas containing the glyphs. Return as lightuserdata</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<h2 id="text---glyphinfo-management-functions">Text - GlyphInfo management functions</h2> +<div class="apii"><code>glyphInfo = RL.LoadGlyphInfo( GlyphInfo{} glyphInfoData )</code></div> +<div class="apidesc"><p>Load GlyphInfo from data</p> +<ul> +<li>Success return GlyphInfo</li> +</ul></div> +<div class="apii"><code>RL.UnloadGlyphInfo( GlyphInfo glyphInfo )</code></div> +<div class="apidesc"><p>Unload glyphInfo image from CPU memory (RAM)</p></div> +<div class="apii"><code>RL.SetGlyphInfoValue( GlyphInfo glyphInfo, int value )</code></div> +<div class="apidesc"><p>Set glyphInfo character value (Unicode)</p></div> +<div class="apii"><code>RL.SetGlyphInfoOffset( GlyphInfo glyphInfo, Vector2 offset )</code></div> +<div class="apidesc"><p>Set glyphInfo character offset when drawing</p></div> +<div class="apii"><code>RL.SetGlyphInfoAdvanceX( GlyphInfo glyphInfo, int advanceX )</code></div> +<div class="apidesc"><p>Set glyphInfo character advance position X</p></div> +<div class="apii"><code>RL.SetGlyphInfoImage( GlyphInfo glyphInfo, Image image )</code></div> +<div class="apidesc"><p>Set glyphInfo character image data</p></div> +<div class="apii"><code>value = RL.GetGlyphInfoValue( GlyphInfo glyphInfo )</code></div> +<div class="apidesc"><p>Get glyphInfo character value (Unicode)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>offset = RL.GetGlyphInfoOffset( GlyphInfo glyphInfo )</code></div> +<div class="apidesc"><p>Get glyphInfo character offset when drawing</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>advanceX = RL.GetGlyphInfoAdvanceX( GlyphInfo glyphInfo )</code></div> +<div class="apidesc"><p>Get glyphInfo character advance position X</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>image = RL.GetGlyphInfoImage( GlyphInfo glyphInfo )</code></div> +<div class="apidesc"><p>Get glyphInfo character image data. Return as lightuserdata</p> +<ul> +<li>Success return Image</li> +</ul></div> +<h2 id="text---text-codepoints-management-functions-(unicode-characters)">Text - Text codepoints management functions (unicode characters)</h2> +<div class="apii"><code>string = RL.LoadUTF8( int{} codepoints )</code></div> +<div class="apidesc"><p>Load UTF-8 text encoded from codepoints array</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>codepoints = RL.LoadCodepoints( string text )</code></div> +<div class="apidesc"><p>Load all codepoints from a UTF-8 text string</p> +<ul> +<li>Success return int{}</li> +</ul></div> +<div class="apii"><code>count = RL.GetCodepointCount( string text )</code></div> +<div class="apidesc"><p>Get total number of codepoints in a UTF-8 encoded string</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>codepoint, codepointSize = RL.GetCodepoint( string text, int position )</code></div> +<div class="apidesc"><p>Get codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>codepoint, codepointSize = RL.GetCodepointNext( string text, int position )</code></div> +<div class="apidesc"><p>Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>codepoint, codepointSize = RL.GetCodepointPrevious( string text, int position )</code></div> +<div class="apidesc"><p>Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>string = RL.CodepointToUTF8( int codepoint )</code></div> +<div class="apidesc"><p>Encode one codepoint into UTF-8 byte array</p> +<ul> +<li>Success return string</li> +</ul></div> +<h2 id="text---text-strings-management-functions-(no-utf-8-strings,-only-byte-chars)">Text - Text strings management functions (no UTF-8 strings, only byte chars)</h2> +<div class="apii"><code>text = RL.TextSubtext( string text, int position, int length )</code></div> +<div class="apidesc"><p>Get a piece of a text string</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>text = RL.TextReplace( string text, string replace, string by )</code></div> +<div class="apidesc"><p>Replace text string</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>text = RL.TextInsert( string text, string insert, int position )</code></div> +<div class="apidesc"><p>Insert text in a specific position, moves all text forward</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>splits = RL.TextSplit( string text, char delimiter )</code></div> +<div class="apidesc"><p>Split text into multiple strings</p> +<ul> +<li>Success return string{}</li> +</ul></div> +<div class="apii"><code>index = RL.TextFindIndex( string text, string find )</code></div> +<div class="apidesc"><p>Find first text occurrence within a string</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>text = RL.TextToPascal( string text )</code></div> +<div class="apidesc"><p>Get Pascal case notation version of provided string</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>text = RL.TextToSnake( string text )</code></div> +<div class="apidesc"><p>Get Snake case notation version of provided string</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>text = RL.TextToCamel( string text )</code></div> +<div class="apidesc"><p>Get Camel case notation version of provided string</p> +<ul> +<li>Success return string</li> +</ul></div> +<h2 id="models---basic-geometric-3d-shapes-drawing-functions">Models - Basic geometric 3D shapes drawing functions</h2> +<div class="apii"><code>RL.DrawLine3D( Vector3 startPos, Vector3 endPos, Color color )</code></div> +<div class="apidesc"><p>Draw a line in 3D world space</p></div> +<div class="apii"><code>RL.DrawPoint3D( Vector3 position, Color color )</code></div> +<div class="apidesc"><p>Draw a point in 3D space, actually a small line</p></div> +<div class="apii"><code>RL.DrawCircle3D( Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color )</code></div> +<div class="apidesc"><p>Draw a circle in 3D world space</p></div> +<div class="apii"><code>RL.DrawTriangle3D( Vector3 v1, Vector3 v2, Vector3 v3, Color color )</code></div> +<div class="apidesc"><p>Draw a color-filled triangle (Vertex in counter-clockwise order!)</p></div> +<div class="apii"><code>RL.DrawTriangleStrip3D( Vector3{} points, Color color )</code></div> +<div class="apidesc"><p>Draw a triangle strip defined by points</p></div> +<div class="apii"><code>RL.DrawCube( Vector3 position, Vector3 size, Color color )</code></div> +<div class="apidesc"><p>Draw cube</p></div> +<div class="apii"><code>RL.DrawCubeWires( Vector3 position, Vector3 size, Color color )</code></div> +<div class="apidesc"><p>Draw cube wires</p></div> +<div class="apii"><code>RL.DrawSphere( Vector3 centerPos, float radius, Color color )</code></div> +<div class="apidesc"><p>Draw sphere</p></div> +<div class="apii"><code>RL.DrawSphereEx( Vector3 centerPos, float radius, int rings, int slices, Color color )</code></div> +<div class="apidesc"><p>Draw sphere with extended parameters</p></div> +<div class="apii"><code>RL.DrawSphereWires( Vector3 centerPos, float radius, int rings, int slices, Color color )</code></div> +<div class="apidesc"><p>Draw sphere wires</p></div> +<div class="apii"><code>RL.DrawCylinder( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color )</code></div> +<div class="apidesc"><p>Draw a cylinder/cone</p></div> +<div class="apii"><code>RL.DrawCylinderEx( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color )</code></div> +<div class="apidesc"><p>Draw a cylinder with base at startPos and top at endPos</p></div> +<div class="apii"><code>RL.DrawCylinderWires( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color )</code></div> +<div class="apidesc"><p>Draw a cylinder/cone wires</p></div> +<div class="apii"><code>RL.DrawCylinderWiresEx( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color )</code></div> +<div class="apidesc"><p>Draw a cylinder wires with base at startPos and top at endPos</p></div> +<div class="apii"><code>RL.DrawCapsule( Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color )</code></div> +<div class="apidesc"><p>Draw a capsule with the center of its sphere caps at startPos and endPos</p></div> +<div class="apii"><code>RL.DrawCapsuleWires( Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color )</code></div> +<div class="apidesc"><p>Draw capsule wireframe with the center of its sphere caps at startPos and endPos</p></div> +<div class="apii"><code>RL.DrawPlane( Vector3 centerPos, Vector2 size, Color color )</code></div> +<div class="apidesc"><p>Draw a plane XZ</p></div> +<div class="apii"><code>RL.DrawQuad3DTexture( Texture texture, Vector3{} vertices, Vector2{} texCoords, Color{} colors )</code></div> +<div class="apidesc"><p>Draw 3D textured quad. (Texture coordinates opengl style 0.0 - 1.0)</p></div> +<div class="apii"><code>RL.DrawRay( Ray ray, Color color )</code></div> +<div class="apidesc"><p>Draw a ray line</p></div> +<div class="apii"><code>RL.DrawGrid( int slices, float spacing )</code></div> +<div class="apidesc"><p>Draw a grid (Centered at ( 0, 0, 0 ))</p></div> +<div class="apii"><code>RL.DrawGridEx( Vector2 slices, Vector2 spacing, Matrix transform, Color color, Vector2|nil divider, Color|nil dividerColor )</code></div> +<div class="apidesc"><p>Draw a grid with extended parameters. Optionally you can define divider with different color for every n slices</p></div> +<h2 id="models---model-management-functions">Models - Model management functions</h2> +<div class="apii"><code>model = RL.LoadModel( string fileName )</code></div> +<div class="apidesc"><p>Load model from files (Meshes and materials)</p> +<ul> +<li>Failure return nil</li> +<li>Success return Model</li> +</ul></div> +<div class="apii"><code>model = RL.LoadModelFromMesh( Mesh mesh )</code></div> +<div class="apidesc"><p>Load model from generated mesh (Default material)</p> +<ul> +<li>Success return Model</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsModelValid( Model model )</code></div> +<div class="apidesc"><p>Check if a model is valid (loaded in GPU, VAO/VBOs)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadModel( Model model )</code></div> +<div class="apidesc"><p>Unload model (meshes/materials) from memory (RAM and/or VRAM)</p></div> +<div class="apii"><code>boundingBox = RL.GetModelBoundingBox( Model model )</code></div> +<div class="apidesc"><p>Compute model bounding box limits (considers all meshes)</p> +<ul> +<li>Success return BoundingBox</li> +</ul></div> +<div class="apii"><code>RL.SetModelTransform( Model model, Matrix transform )</code></div> +<div class="apidesc"><p>Set model transform matrix</p></div> +<div class="apii"><code>success = RL.SetModelMesh( Model model, int meshId, Mesh mesh )</code></div> +<div class="apidesc"><p>Set model mesh.</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>success = RL.SetModelMaterial( Model model, int materialId, Material material )</code></div> +<div class="apidesc"><p>Set material to model material</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>RL.SetModelMeshMaterial( Model model, int meshId, int materialId )</code></div> +<div class="apidesc"><p>Set material for a mesh (Mesh and material on this model)</p></div> +<div class="apii"><code>success = RL.SetModelBone( Model model, int boneId, BoneInfo bone )</code></div> +<div class="apidesc"><p>Set model bone information (skeleton)</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>success = RL.SetModelBindPose( Model model, int boneId, Transform pose )</code></div> +<div class="apidesc"><p>Set model bones base transformation (pose)</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>transform = RL.GetModelTransform( Model model )</code></div> +<div class="apidesc"><p>Get model transform matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>meshCount = RL.GetModelMeshCount( Model model )</code></div> +<div class="apidesc"><p>Get model number of meshes</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>meshCount = RL.GetModelMaterialCount( Model model )</code></div> +<div class="apidesc"><p>Get model number of materials</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>mesh = RL.GetModelMesh( Model model, int meshId )</code></div> +<div class="apidesc"><p>Get model mesh. Return as lightuserdata</p> +<ul> +<li>Failure return nil</li> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>material = RL.GetModelMaterial( Model model, int materialId )</code></div> +<div class="apidesc"><p>Get model material. Return as lightuserdata</p> +<ul> +<li>Failure return nil</li> +<li>Success return Material</li> +</ul></div> +<div class="apii"><code>boneCount = RL.GetModelBoneCount( Model model )</code></div> +<div class="apidesc"><p>Get model number of bones</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>bone = RL.GetModelBone( Model model, int boneId )</code></div> +<div class="apidesc"><p>Get model bones information (skeleton)</p> +<ul> +<li>Failure return nil</li> +<li>Success return BoneInfo</li> +</ul></div> +<div class="apii"><code>pose = RL.GetModelBindPose( Model model, int boneId )</code></div> +<div class="apidesc"><p>Get models bones base transformation (pose)</p> +<ul> +<li>Failure return nil</li> +<li>Success return Transform</li> +</ul></div> +<h2 id="models---model-drawing-functions">Models - Model drawing functions</h2> +<div class="apii"><code>RL.DrawModel( Model model, Vector3 position, float scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a model (With texture if set)</p></div> +<div class="apii"><code>RL.DrawModelEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a model with extended parameters</p></div> +<div class="apii"><code>RL.DrawModelWires( Model model, Vector3 position, float scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a model wires (with texture if set)</p></div> +<div class="apii"><code>RL.DrawModelWiresEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a model wires (with texture if set) with extended parameters</p></div> +<div class="apii"><code>RL.DrawModelPoints( Model model, Vector3 position, float scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a model as points</p></div> +<div class="apii"><code>RL.DrawModelPointsEx( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint )</code></div> +<div class="apidesc"><p>Draw a model as points with extended parameters</p></div> +<div class="apii"><code>RL.DrawBoundingBox( BoundingBox box, Color color )</code></div> +<div class="apidesc"><p>Draw bounding box (wires)</p></div> +<div class="apii"><code>RL.DrawBillboard( Camera3D camera, Texture texture, Vector3 position, float size, Color tint )</code></div> +<div class="apidesc"><p>Draw a billboard texture</p></div> +<div class="apii"><code>RL.DrawBillboardRec( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector2 size, Color tint )</code></div> +<div class="apidesc"><p>Draw a billboard texture defined by source</p></div> +<div class="apii"><code>RL.DrawBillboardPro( Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint )</code></div> +<div class="apidesc"><p>Draw a billboard texture defined by source and rotation</p></div> +<h2 id="models---mesh-management-functions">Models - Mesh management functions</h2> +<div class="apii"><code>RL.UpdateMesh( Mesh mesh, Mesh{} meshData )</code></div> +<div class="apidesc"><p>Update mesh vertex data in GPU. NOTE: Mainly intented to be used with custom meshes.</p></div> +<div class="apii"><code>RL.UnloadMesh( Mesh mesh )</code></div> +<div class="apidesc"><p>Unload mesh data from CPU and GPU</p></div> +<div class="apii"><code>RL.DrawMesh( Mesh mesh, Material material, Matrix transform )</code></div> +<div class="apidesc"><p>Draw a 3d mesh with material and transform</p></div> +<div class="apii"><code>RL.DrawMeshInstanced( Mesh mesh, Material material, Buffer transforms, int instances )</code></div> +<div class="apidesc"><p>Draw multiple mesh instances with material and different transforms</p></div> +<div class="apii"><code>success = RL.SetMeshColor( Mesh mesh, Color color )</code></div> +<div class="apidesc"><p>Updades mesh color vertex attribute buffer NOTE: Currently only works on custom mesh</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>success = RL.ExportMesh( Mesh mesh, string fileName )</code></div> +<div class="apidesc"><p>Export mesh data to file, returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>success = RL.ExportMeshAsCode( Mesh mesh, string fileName )</code></div> +<div class="apidesc"><p>Export mesh as code file (.h) defining multiple arrays of vertex attributes</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>boundingBox = RL.GetMeshBoundingBox( Mesh mesh )</code></div> +<div class="apidesc"><p>Compute mesh bounding box limits</p> +<ul> +<li>Success return BoundingBox</li> +</ul></div> +<div class="apii"><code>RL.GenMeshTangents( Mesh mesh )</code></div> +<div class="apidesc"><p>Compute mesh tangents</p></div> +<div class="apii"><code>meshData = RL.GetMeshData( Mesh mesh )</code></div> +<div class="apidesc"><p>Get mesh vertex attributes data as table.</p> +<ul> +<li>Success return Mesh{}</li> +</ul></div> +<h2 id="models---mesh-generation-functions">Models - Mesh generation functions</h2> +<div class="apii"><code>mesh = RL.GenMeshPoly( int sides, float radius )</code></div> +<div class="apidesc"><p>Generate polygonal mesh</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshPlane( float width, float length, int resX, int resZ )</code></div> +<div class="apidesc"><p>Generate plane mesh (With subdivisions)</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshCube( Vector3 size )</code></div> +<div class="apidesc"><p>Generate cuboid mesh</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshSphere( float radius, int rings, int slices )</code></div> +<div class="apidesc"><p>Generate sphere mesh (Standard sphere)</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshHemiSphere( float radius, int rings, int slices )</code></div> +<div class="apidesc"><p>Generate half-sphere mesh (no bottom cap)</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshCylinder( float radius, float height, int slices )</code></div> +<div class="apidesc"><p>Generate cylinder mesh</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshCone( float radius, float height, int slices )</code></div> +<div class="apidesc"><p>Generate cone/pyramid mesh</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshTorus( float radius, float size, int radSeg, int sides )</code></div> +<div class="apidesc"><p>Generate torus mesh</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshKnot( float radius, float size, int radSeg, int sides )</code></div> +<div class="apidesc"><p>Generate torus mesh</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshHeightmap( Image heightmap, Vector3 size )</code></div> +<div class="apidesc"><p>Generate heightmap mesh from image data</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshCubicmap( Image cubicmap, Vector3 cubeSize )</code></div> +<div class="apidesc"><p>Generate cubes-based map mesh from image data</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<div class="apii"><code>mesh = RL.GenMeshCustom( Mesh{} meshData, bool dynamic )</code></div> +<div class="apidesc"><p>Generate custom mesh from vertex attribute data and uploads it into a VAO (if supported) and VBO</p> +<ul> +<li>Success return Mesh</li> +</ul></div> +<h2 id="models---material-management-functions">Models - Material management functions</h2> +<div class="apii"><code>materials = RL.LoadMaterials( string fileName )</code></div> +<div class="apidesc"><p>Load materials from model file</p> +<ul> +<li>Success return Material{}</li> +</ul></div> +<div class="apii"><code>material = RL.GetMaterialDefault()</code></div> +<div class="apidesc"><p>Default material for reference. Return as lightuserdata</p> +<ul> +<li>Success return Material</li> +</ul></div> +<div class="apii"><code>material = RL.LoadMaterialDefault()</code></div> +<div class="apidesc"><p>Load default material as new object</p> +<ul> +<li>Success return Material</li> +</ul></div> +<div class="apii"><code>material = RL.CreateMaterial( Material{} materialData )</code></div> +<div class="apidesc"><p>Load material from table. See material table definition</p> +<ul> +<li>Success return Material</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsMaterialValid( Material material )</code></div> +<div class="apidesc"><p>Check if a material is valid (shader assigned, map textures loaded in GPU)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadMaterial( Material material, bool freeAll )</code></div> +<div class="apidesc"><p>Unload material from GPU memory (VRAM). Note! Use freeAll to unload shaders and textures</p></div> +<div class="apii"><code>RL.SetMaterialTexture( Material material, int mapType, Texture texture )</code></div> +<div class="apidesc"><p>Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...)</p></div> +<div class="apii"><code>RL.SetMaterialColor( Material material, int mapType, Color color )</code></div> +<div class="apidesc"><p>Set color for a material map type</p></div> +<div class="apii"><code>RL.SetMaterialValue( Material material, int mapType, float value )</code></div> +<div class="apidesc"><p>Set value for a material map type</p></div> +<div class="apii"><code>RL.SetMaterialShader( Material material, Shader shader )</code></div> +<div class="apidesc"><p>Set shader for material</p></div> +<div class="apii"><code>RL.SetMaterialParams( Material material, float{} params )</code></div> +<div class="apidesc"><p>Set material generic parameters (if required)</p></div> +<div class="apii"><code>texture = RL.GetMaterialTexture( Material material, int mapType )</code></div> +<div class="apidesc"><p>Get texture from material map type. Return as lightuserdata</p> +<ul> +<li>Success return Texture</li> +</ul></div> +<div class="apii"><code>color = RL.GetMaterialColor( Material material, int mapType )</code></div> +<div class="apidesc"><p>Get color from material map type</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>value = RL.GetMaterialValue( Material material, int mapType )</code></div> +<div class="apidesc"><p>Get color from material map type</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>shader = RL.GetMaterialShader( Material material )</code></div> +<div class="apidesc"><p>Get material shader. Return as lightuserdata</p> +<ul> +<li>Success return Shader</li> +</ul></div> +<div class="apii"><code>params = RL.GetMaterialParams( Material material )</code></div> +<div class="apidesc"><p>Get material parameters</p> +<ul> +<li>Success return float{}</li> +</ul></div> +<h2 id="model---model-animations-management-functions">Model - Model animations management functions</h2> +<div class="apii"><code>animations = RL.LoadModelAnimations( string fileName )</code></div> +<div class="apidesc"><p>Load model animations from file</p> +<ul> +<li>Failure return nil</li> +<li>Success return ModelAnimations{}</li> +</ul></div> +<div class="apii"><code>RL.UpdateModelAnimation( Model model, ModelAnimation animation, int frame )</code></div> +<div class="apidesc"><p>Update model animation pose</p></div> +<div class="apii"><code>RL.UpdateModelAnimationBones( Model model, ModelAnimation animation, int frame )</code></div> +<div class="apidesc"><p>Update model animation mesh bone matrices (GPU skinning)</p></div> +<div class="apii"><code>RL.UnloadModelAnimation( ModelAnimation animation )</code></div> +<div class="apidesc"><p>Unload animation data</p></div> +<div class="apii"><code>RL.UnloadModelAnimations( ModelAnimation{} animations )</code></div> +<div class="apidesc"><p>Unload animation table data</p></div> +<div class="apii"><code>valid = RL.IsModelAnimationValid( Model model, ModelAnimation animation )</code></div> +<div class="apidesc"><p>Check model animation skeleton match</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>success = RL.SetModelAnimationBone( ModelAnimation animation, int boneId, BoneInfo bone )</code></div> +<div class="apidesc"><p>Set modelAnimation bones information (skeleton)</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>success = RL.SetModelAnimationFramePose( ModelAnimation animation, int frame, int boneId, Transform pose )</code></div> +<div class="apidesc"><p>Set modelAnimation bones base transformation (pose)</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>RL.SetModelAnimationName( ModelAnimation animation, string name )</code></div> +<div class="apidesc"><p>Set modelAnimation name</p></div> +<div class="apii"><code>boneCount = RL.GetModelAnimationBoneCount( ModelAnimation animation )</code></div> +<div class="apidesc"><p>Return modelAnimation bone count</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>frameCount = RL.GetModelAnimationFrameCount( ModelAnimation animation )</code></div> +<div class="apidesc"><p>Return modelAnimation frame count</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>bone = RL.GetModelAnimationBone( ModelAnimation animation, int boneId )</code></div> +<div class="apidesc"><p>Get modelAnimation bones information (skeleton)</p> +<ul> +<li>Failure return nil</li> +<li>Success return BoneInfo</li> +</ul></div> +<div class="apii"><code>pose = RL.GetModelAnimationFramePose( ModelAnimation animation, int frame, int boneId )</code></div> +<div class="apidesc"><p>Get modelAnimation bones base transformation (pose)</p> +<ul> +<li>Failure return nil</li> +<li>Success return Transform</li> +</ul></div> +<div class="apii"><code>name = RL.GetModelAnimationName( ModelAnimation animation )</code></div> +<div class="apidesc"><p>Get modelAnimation name</p> +<ul> +<li>Success return string</li> +</ul></div> +<h2 id="model---collision-detection-functions">Model - Collision detection functions</h2> +<div class="apii"><code>collision = RL.CheckCollisionSpheres( Vector3 center1, float radius1, Vector3 center2, float radius2 )</code></div> +<div class="apidesc"><p>Check collision between two spheres</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionBoxes( BoundingBox box1, BoundingBox box2 )</code></div> +<div class="apidesc"><p>Check collision between two bounding boxes</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>collision = RL.CheckCollisionBoxSphere( BoundingBox box, Vector3 center, float radius )</code></div> +<div class="apidesc"><p>Check collision between box and sphere</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>rayCollision = RL.GetRayCollisionSphere( Ray ray, Vector3 center, float radius )</code></div> +<div class="apidesc"><p>Get collision info between ray and sphere. ( RayCollision is Lua table of { hit, distance, point, normal } )</p> +<ul> +<li>Success return RayCollision</li> +</ul></div> +<div class="apii"><code>rayCollision = RL.GetRayCollisionBox( Ray ray, BoundingBox box )</code></div> +<div class="apidesc"><p>Get collision info between ray and box</p> +<ul> +<li>Success return RayCollision</li> +</ul></div> +<div class="apii"><code>rayCollision = RL.GetRayCollisionMesh( Ray ray, Mesh mesh, Matrix transform )</code></div> +<div class="apidesc"><p>Get collision info between ray and mesh</p> +<ul> +<li>Success return RayCollision</li> +</ul></div> +<div class="apii"><code>rayCollision = RL.GetRayCollisionTriangle( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3 )</code></div> +<div class="apidesc"><p>Get collision info between ray and triangle</p> +<ul> +<li>Success return RayCollision</li> +</ul></div> +<div class="apii"><code>rayCollision = RL.GetRayCollisionQuad( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4 )</code></div> +<div class="apidesc"><p>Get collision info between ray and quad. NOTE: The points are expected to be in counter-clockwise winding</p> +<ul> +<li>Success return RayCollision</li> +</ul></div> +<div class="apii"><code>cells, exitPoint = RL.GetRayBoxCells( Ray ray, BoundingBox box, Vector3 cellSize )</code></div> +<div class="apidesc"><p>Get cell positions inside box that intersect with the ray. Also returns ray exit point. Returns empty table if ray misses the box</p> +<ul> +<li>Success return Vector3{}, RayCollision|nil</li> +</ul></div> +<h2 id="audio---audio-device-management-functions">Audio - Audio device management functions</h2> +<div class="apii"><code>RL.InitAudioDevice()</code></div> +<div class="apidesc"><p>Initialize audio device and context</p></div> +<div class="apii"><code>RL.CloseAudioDevice()</code></div> +<div class="apidesc"><p>Close the audio device and context</p></div> +<div class="apii"><code>isReady = RL.IsAudioDeviceReady()</code></div> +<div class="apidesc"><p>Check if audio device has been initialized successfully</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.SetMasterVolume( float volume )</code></div> +<div class="apidesc"><p>Set master volume (listener)</p></div> +<div class="apii"><code>volume = RL.GetMasterVolume()</code></div> +<div class="apidesc"><p>Get master volume (listener)</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="audio---wavesound-loadingunloading-functions">Audio - Wave/Sound loading/unloading functions</h2> +<div class="apii"><code>sound = RL.LoadSound( string fileName )</code></div> +<div class="apidesc"><p>Load sound from file</p> +<ul> +<li>Failure return nil</li> +<li>Success return Sound</li> +</ul></div> +<div class="apii"><code>wave = RL.LoadWave( string fileName )</code></div> +<div class="apidesc"><p>Load wave data from file</p> +<ul> +<li>Failure return nil</li> +<li>Success return Wave</li> +</ul></div> +<div class="apii"><code>wave = RL.LoadWaveFromMemory( string fileType, Buffer data )</code></div> +<div class="apidesc"><p>Load wave from memory buffer, fileType refers to extension: i.e. '.wav'</p> +<ul> +<li>Success return Wave</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsWaveValid( Wave wave )</code></div> +<div class="apidesc"><p>Checks if wave data is valid (data loaded and parameters)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>sound = RL.LoadSoundFromWave( Wave wave )</code></div> +<div class="apidesc"><p>Load sound from wave data</p> +<ul> +<li>Success return Sound</li> +</ul></div> +<div class="apii"><code>sound = RL.LoadSoundAlias( Sound source )</code></div> +<div class="apidesc"><p>Create a new sound that shares the same sample data as the source sound, does not own the sound data</p> +<ul> +<li>Success return Sound</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsSoundValid( Sound sound )</code></div> +<div class="apidesc"><p>Checks if a sound is valid (data loaded and buffers initialized)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UpdateSound( Sound sound, Buffer data, int sampleCount )</code></div> +<div class="apidesc"><p>Update sound buffer with new data</p></div> +<div class="apii"><code>RL.UnloadWave( Wave wave )</code></div> +<div class="apidesc"><p>Unload wave data</p></div> +<div class="apii"><code>RL.UnloadSound( Sound sound )</code></div> +<div class="apidesc"><p>Unload sound</p></div> +<div class="apii"><code>RL.UnloadSoundAlias( Sound alias )</code></div> +<div class="apidesc"><p>Unload a sound alias (does not deallocate sample data)</p></div> +<div class="apii"><code>success = RL.ExportWave( Wave wave, string fileName )</code></div> +<div class="apidesc"><p>Export wave data to file, returns true on success</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>success = RL.ExportWaveAsCode( Wave wave, string fileName )</code></div> +<div class="apidesc"><p>Export wave sample data to code (.h), returns true on success</p> +<ul> +<li>Success return true</li> +</ul></div> +<h2 id="audio---wavesound-management-functions">Audio - Wave/Sound management functions</h2> +<div class="apii"><code>RL.PlaySound( Sound sound )</code></div> +<div class="apidesc"><p>Play a sound</p></div> +<div class="apii"><code>RL.StopSound( Sound sound )</code></div> +<div class="apidesc"><p>Stop playing a sound</p></div> +<div class="apii"><code>RL.PauseSound( Sound sound )</code></div> +<div class="apidesc"><p>Pause a sound</p></div> +<div class="apii"><code>RL.ResumeSound( Sound sound )</code></div> +<div class="apidesc"><p>Resume a paused sound</p></div> +<div class="apii"><code>playing = RL.IsSoundPlaying( Sound sound )</code></div> +<div class="apidesc"><p>Check if a sound is currently playing</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.SetSoundVolume( Sound sound, float volume )</code></div> +<div class="apidesc"><p>Set volume for a sound (1.0 is max level)</p></div> +<div class="apii"><code>RL.SetSoundPitch( Sound sound, float pitch )</code></div> +<div class="apidesc"><p>Set pitch for a sound (1.0 is base level)</p></div> +<div class="apii"><code>RL.SetSoundPan( Sound sound, float pan )</code></div> +<div class="apidesc"><p>Set pan for a sound (0.5 is center)</p></div> +<div class="apii"><code>stream = RL.GetSoundStream( Sound sound )</code></div> +<div class="apidesc"><p>Get sound audio stream. Return as lightuserdata</p> +<ul> +<li>Success return AudioStream</li> +</ul></div> +<div class="apii"><code>RL.WaveFormat( Wave wave, int sampleRate, int sampleSize, int channels )</code></div> +<div class="apidesc"><p>Convert wave data to desired format</p></div> +<div class="apii"><code>samples = RL.LoadWaveSamples( Wave wave )</code></div> +<div class="apidesc"><p>Load samples data from wave as a 32bit float data array</p> +<ul> +<li>Success return float{}</li> +</ul></div> +<div class="apii"><code>wave = RL.WaveCopy( Wave wave )</code></div> +<div class="apidesc"><p>Copy a wave to a new wave</p> +<ul> +<li>Success return Wave</li> +</ul></div> +<div class="apii"><code>RL.WaveCrop( Wave wave, int initSample, int finalSample )</code></div> +<div class="apidesc"><p>Crop a wave to defined samples range</p></div> +<h2 id="audio---music-management-functions">Audio - Music management functions</h2> +<div class="apii"><code>music = RL.LoadMusicStream( string fileName )</code></div> +<div class="apidesc"><p>Load music stream from file</p> +<ul> +<li>Success return Music</li> +</ul></div> +<div class="apii"><code>music = RL.LoadMusicStreamFromMemory( string fileType, Buffer data )</code></div> +<div class="apidesc"><p>Load music stream from data</p> +<ul> +<li>Success return Music</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsMusicValid( Music music )</code></div> +<div class="apidesc"><p>Checks if a music stream is valid (context and buffers initialized)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadMusicStream( Music music )</code></div> +<div class="apidesc"><p>Unload music stream</p></div> +<div class="apii"><code>RL.PlayMusicStream( Music music )</code></div> +<div class="apidesc"><p>Start music playing</p></div> +<div class="apii"><code>playing = RL.IsMusicStreamPlaying( Music music )</code></div> +<div class="apidesc"><p>Check if music is playing</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UpdateMusicStream( Music music )</code></div> +<div class="apidesc"><p>Updates buffers for music streaming</p></div> +<div class="apii"><code>RL.StopMusicStream( Music music )</code></div> +<div class="apidesc"><p>Stop music playing</p></div> +<div class="apii"><code>RL.PauseMusicStream( Music music )</code></div> +<div class="apidesc"><p>Pause music playing</p></div> +<div class="apii"><code>RL.ResumeMusicStream( Music music )</code></div> +<div class="apidesc"><p>Resume playing paused music</p></div> +<div class="apii"><code>RL.SeekMusicStream( Music music, float position )</code></div> +<div class="apidesc"><p>Seek music to a position (in seconds)</p></div> +<div class="apii"><code>RL.SetMusicVolume( Music music, float volume )</code></div> +<div class="apidesc"><p>Set volume for music (1.0 is max level)</p></div> +<div class="apii"><code>RL.SetMusicPitch( Music music, float pitch )</code></div> +<div class="apidesc"><p>Set pitch for a music (1.0 is base level)</p></div> +<div class="apii"><code>RL.SetMusicPan( Music music, float pan )</code></div> +<div class="apidesc"><p>Set pan for a music (0.5 is center)</p></div> +<div class="apii"><code>RL.SetMusicLooping( Music music, bool looping )</code></div> +<div class="apidesc"><p>Set looping for a music</p></div> +<div class="apii"><code>looping = RL.GetMusicLooping( Music music )</code></div> +<div class="apidesc"><p>Get looping of a music</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>length = RL.GetMusicTimeLength( Music music )</code></div> +<div class="apidesc"><p>Get music time length (in seconds)</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>timePlayed = RL.GetMusicTimePlayed( Music music )</code></div> +<div class="apidesc"><p>Get current music time played (in seconds)</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>stream = RL.GetMusicStream( Music music )</code></div> +<div class="apidesc"><p>Get music audio stream. Return as lightuserdata</p> +<ul> +<li>Success return AudioStream</li> +</ul></div> +<h2 id="audio---audiostream-management-functions">Audio - AudioStream management functions</h2> +<div class="apii"><code>audioStream = RL.LoadAudioStream( int sampleRate, int sampleSize, int channels )</code></div> +<div class="apidesc"><p>Load audio stream (to stream raw audio pcm data)</p> +<ul> +<li>Success return AudioStream</li> +</ul></div> +<div class="apii"><code>isValid = RL.IsAudioStreamValid( AudioStream stream )</code></div> +<div class="apidesc"><p>Checks if an audio stream is valid (buffers initialized)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.UnloadAudioStream( AudioStream stream )</code></div> +<div class="apidesc"><p>Unload audio stream and free memory</p></div> +<div class="apii"><code>RL.UpdateAudioStream( AudioStream stream, Buffer data, int frameCount )</code></div> +<div class="apidesc"><p>Update audio stream buffers with data</p></div> +<div class="apii"><code>isProcessed = RL.IsAudioStreamProcessed( AudioStream stream )</code></div> +<div class="apidesc"><p>Check if any audio stream buffers requires refill</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.PlayAudioStream( AudioStream stream )</code></div> +<div class="apidesc"><p>Play audio stream</p></div> +<div class="apii"><code>RL.PauseAudioStream( AudioStream stream )</code></div> +<div class="apidesc"><p>Pause audio stream</p></div> +<div class="apii"><code>RL.ResumeAudioStream( AudioStream stream )</code></div> +<div class="apidesc"><p>Resume audio stream</p></div> +<div class="apii"><code>isPlaying = RL.IsAudioStreamPlaying( AudioStream stream )</code></div> +<div class="apidesc"><p>Check if audio stream is playing</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.StopAudioStream( AudioStream stream )</code></div> +<div class="apidesc"><p>Stop audio stream</p></div> +<div class="apii"><code>RL.SetAudioStreamVolume( AudioStream stream, float volume )</code></div> +<div class="apidesc"><p>Set volume for audio stream (1.0 is max level)</p></div> +<div class="apii"><code>RL.SetAudioStreamPitch( AudioStream stream, float pitch )</code></div> +<div class="apidesc"><p>Set pitch for audio stream (1.0 is base level)</p></div> +<div class="apii"><code>RL.SetAudioStreamPan( AudioStream stream, float pan )</code></div> +<div class="apidesc"><p>Set pan for audio stream (0.5 is centered)</p></div> +<div class="apii"><code>RL.SetAudioStreamBufferSizeDefault( int size )</code></div> +<div class="apidesc"><p>Default size for new audio streams</p></div> +<div class="apii"><code>RL.SetAudioStreamCallback( AudioStream stream, AudioCallback callback )</code></div> +<div class="apidesc"><p>Audio thread callback to request new data. AudioCallback should be lightuserdata function pointer</p></div> +<div class="apii"><code>RL.AttachAudioStreamProcessor( AudioStream stream, AudioCallback processor )</code></div> +<div class="apidesc"><p>Attach audio stream processor to stream, receives the samples as 'float'. AudioCallback should be lightuserdata function pointer</p></div> +<div class="apii"><code>RL.DetachAudioStreamProcessor( AudioStream stream, AudioCallback processor )</code></div> +<div class="apidesc"><p>Detach audio stream processor from stream. AudioCallback should be lightuserdata function pointer</p></div> +<div class="apii"><code>RL.AttachAudioMixedProcessor( AudioCallback processor )</code></div> +<div class="apidesc"><p>Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'. AudioCallback should be lightuserdata function pointer</p></div> +<div class="apii"><code>RL.DetachAudioMixedProcessor( AudioCallback processor )</code></div> +<div class="apidesc"><p>Detach audio stream processor from the entire audio pipeline. AudioCallback should be lightuserdata function pointer</p></div> +<h2 id="math---utils">Math - Utils</h2> +<div class="apii"><code>result = RL.Round( float value )</code></div> +<div class="apidesc"><p>Round float value</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.Sign( float value )</code></div> +<div class="apidesc"><p>Sign of value</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.Clamp( float value, float min, float max )</code></div> +<div class="apidesc"><p>Clamp float value</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Lerp( float a, float b, float amount )</code></div> +<div class="apidesc"><p>Calculate linear interpolation between two floats</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Normalize( float value, float a, float b )</code></div> +<div class="apidesc"><p>Normalize input value within input range</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Remap( float value, float inputStart, float inputEnd, float outputStart, float outputEnd )</code></div> +<div class="apidesc"><p>Remap input value within input range to output range</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Wrap( float value, float min, float max )</code></div> +<div class="apidesc"><p>Wrap input value from min to max</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.FloatEquals( float x, float y )</code></div> +<div class="apidesc"><p>Check whether two given floats are almost equal</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="math---vector2">Math - Vector2</h2> +<div class="apii"><code>result = RL.Vector2Zero()</code></div> +<div class="apidesc"><p>Vector with components value 0.0f</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2One()</code></div> +<div class="apidesc"><p>Vector with components value 1.0f</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Add( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Add two vectors (v1 + v2)</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2AddValue( Vector2 v, float add )</code></div> +<div class="apidesc"><p>Add vector and float value</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Subtract( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Subtract two vectors (v1 - v2)</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2SubtractValue( Vector2 v, float sub )</code></div> +<div class="apidesc"><p>Subtract vector by float value</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Length( vector2 v )</code></div> +<div class="apidesc"><p>Calculate vector length</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2LengthSqr( vector2 v )</code></div> +<div class="apidesc"><p>Calculate vector square length</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2DotProduct( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Calculate two vectors dot product</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Distance( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Calculate distance between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2DistanceSqr( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Calculate square distance between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Angle( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Calculate angle between two vectors NOTE: Angle is calculated from origin point (0, 0)</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2LineAngle( Vector2 a, Vector2 b )</code></div> +<div class="apidesc"><p>Calculate angle defined by a two vectors line NOTE: Parameters need to be normalized Current implementation should be aligned with glm::angle</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Scale( Vector2 v, float scale )</code></div> +<div class="apidesc"><p>Scale vector (multiply by value)</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Multiply( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Multiply vector by vector</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Negate( Vector2 v )</code></div> +<div class="apidesc"><p>Negate vector</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Divide( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Divide vector by vector</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Normalize( Vector2 v )</code></div> +<div class="apidesc"><p>Normalize provided vector</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Transform( Vector2 v, Matrix mat )</code></div> +<div class="apidesc"><p>Transforms a Vector2 by a given Matrix</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Lerp( Vector2 v1, Vector2 v2, float amount )</code></div> +<div class="apidesc"><p>Calculate linear interpolation between two vectors</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Reflect( Vector2 v, Vector2 normal )</code></div> +<div class="apidesc"><p>Calculate reflected vector to normal</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Min( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Get min value for each pair of components</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Max( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Get max value for each pair of components</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Rotate( Vector2 v, float angle )</code></div> +<div class="apidesc"><p>Rotate vector by angle</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2MoveTowards( Vector2 v, Vector2 target, float maxDistance )</code></div> +<div class="apidesc"><p>Move Vector towards target</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Invert( Vector2 v )</code></div> +<div class="apidesc"><p>Invert the given vector</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Clamp( Vector2 v, Vector2 min, Vector2 max )</code></div> +<div class="apidesc"><p>Clamp the components of the vector between min and max values specified by the given vectors</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2ClampValue( Vector2 v, float min, float max )</code></div> +<div class="apidesc"><p>Clamp the magnitude of the vector between two min and max values</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Equals( Vector2 v1, Vector2 v2 )</code></div> +<div class="apidesc"><p>Check whether two given vectors are almost equal</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>result = RL.Vector2Refract( Vector2 v, Vector2 n, float r )</code></div> +<div class="apidesc"><p>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</p> +<ul> +<li>Success return Vector2</li> +</ul></div> +<h2 id="math---vector-3">Math - Vector 3</h2> +<div class="apii"><code>result = RL.Vector3Zero()</code></div> +<div class="apidesc"><p>Vector with components value 0.0f</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3One()</code></div> +<div class="apidesc"><p>Vector with components value 1.0f</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Add( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Add two vectors</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3AddValue( Vector3 v, float add )</code></div> +<div class="apidesc"><p>Add vector and float value</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Subtract( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Subtract two vectors</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3SubtractValue( Vector3 v, float sub )</code></div> +<div class="apidesc"><p>Subtract vector by float value</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Scale( Vector3 v, float scalar )</code></div> +<div class="apidesc"><p>Multiply vector by scalar</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Multiply( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Multiply vector by vector</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3CrossProduct( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate two vectors cross product</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Perpendicular( Vector3 v )</code></div> +<div class="apidesc"><p>Calculate one vector perpendicular vector</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Length( Vector3 v )</code></div> +<div class="apidesc"><p>Calculate vector length</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3LengthSqr( Vector3 v )</code></div> +<div class="apidesc"><p>Calculate vector square length</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3DotProduct( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate two vectors dot product</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Distance( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate distance between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3DistanceSqr( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate square distance between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Angle( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate angle between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Negate( Vector3 v )</code></div> +<div class="apidesc"><p>Negate provided vector (invert direction)</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Divide( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Divide vector by vector</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Normalize( Vector3 v )</code></div> +<div class="apidesc"><p>Normalize provided vector</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Project( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate the projection of the vector v1 on to v2</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Reject( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Calculate the rejection of the vector v1 on to v2</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>v1, v2 = RL.Vector3OrthoNormalize( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other. Gram-Schmidt function implementation</p> +<ul> +<li>Success return Vector3, Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Transform( Vector3 v, Matrix mat )</code></div> +<div class="apidesc"><p>Transforms a Vector3 by a given Matrix</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3RotateByQuaternion( Vector3 v, Quaternion q )</code></div> +<div class="apidesc"><p>Transform a vector by quaternion rotation</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3RotateByAxisAngle( Vector3 v, Vector3 axis, float angle )</code></div> +<div class="apidesc"><p>Rotates a vector around an axis</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3MoveTowards( Vector3 v, Vector3 target, float maxDistance )</code></div> +<div class="apidesc"><p>Move Vector towards target</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Lerp( Vector3 v1, Vector3 v2, float amount )</code></div> +<div class="apidesc"><p>Calculate linear interpolation between two vectors</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3CubicHermite( Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount )</code></div> +<div class="apidesc"><p>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</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Reflect( Vector3 v, Vector3 normal )</code></div> +<div class="apidesc"><p>Calculate reflected vector to normal</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Min( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Get min value for each pair of components</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Max( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Get max value for each pair of components</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Barycenter( Vector3 p, Vector3 a, Vector3 b, Vector3 c )</code></div> +<div class="apidesc"><p>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</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Unproject( Vector3 source, Matrix projection, Matrix view )</code></div> +<div class="apidesc"><p>Projects a Vector3 from screen space into object space NOTE: We are avoiding calling other raymath functions despite available</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Invert( Vector3 v )</code></div> +<div class="apidesc"><p>Invert the given vector</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Clamp( Vector3 v, Vector3 min, Vector3 max )</code></div> +<div class="apidesc"><p>Clamp the components of the vector between min and max values specified by the given vectors</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3ClampValue( Vector3 v, float min, float max )</code></div> +<div class="apidesc"><p>Clamp the magnitude of the vector between two values</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Equals( Vector3 v1, Vector3 v2 )</code></div> +<div class="apidesc"><p>Check whether two given vectors are almost equal</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>result = RL.Vector3Refract( Vector3 v, Vector3 n, float r )</code></div> +<div class="apidesc"><p>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</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<h2 id="math---vector4">Math - Vector4</h2> +<div class="apii"><code>result = RL.Vector4Zero()</code></div> +<div class="apidesc"><p>Vector with components value 0.0f</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4One()</code></div> +<div class="apidesc"><p>Vector with components value 1.0f</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Add( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Add two vectors</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4AddValue( Vector4 v, float add )</code></div> +<div class="apidesc"><p>Add vector and float value</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Subtract( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Subtract two vectors</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4SubtractValue( Vector4 v, float sub )</code></div> +<div class="apidesc"><p>Subtract vector by float value</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Length( Vector4 v )</code></div> +<div class="apidesc"><p>Calculate vector length</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4LengthSqr( Vector4 v )</code></div> +<div class="apidesc"><p>Calculate vector square length</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4DotProduct( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Calculate two vectors dot product</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Distance( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Calculate distance between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4DistanceSqr( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Calculate square distance between two vectors</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Scale( Vector4 v, float scalar )</code></div> +<div class="apidesc"><p>Multiply vector by scalar</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Multiply( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Multiply vector by vector</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Negate( Vector4 v )</code></div> +<div class="apidesc"><p>Negate provided vector (invert direction)</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Divide( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Divide vector by vector</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Normalize( Vector4 v )</code></div> +<div class="apidesc"><p>Normalize provided vector</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Min( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Get min value for each pair of components</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Max( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Get max value for each pair of components</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Lerp( Vector4 v1, Vector4 v2, float amount )</code></div> +<div class="apidesc"><p>Calculate linear interpolation between two vectors</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4MoveTowards( Vector4 v, Vector4 target, float maxDistance )</code></div> +<div class="apidesc"><p>Move Vector towards target</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Invert( Vector4 v )</code></div> +<div class="apidesc"><p>Invert the given vector</p> +<ul> +<li>Success return Vector4</li> +</ul></div> +<div class="apii"><code>result = RL.Vector4Equals( Vector4 v1, Vector4 v2 )</code></div> +<div class="apidesc"><p>Check whether two given vectors are almost equal</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="math---matrix">Math - Matrix</h2> +<div class="apii"><code>result = RL.MatrixDeterminant( Matrix mat )</code></div> +<div class="apidesc"><p>Compute matrix determinant</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixTrace( Matrix mat )</code></div> +<div class="apidesc"><p>Get the trace of the matrix (sum of the values along the diagonal)</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixTranspose( Matrix mat )</code></div> +<div class="apidesc"><p>Transposes provided matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixInvert( Matrix mat )</code></div> +<div class="apidesc"><p>Invert provided matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixIdentity()</code></div> +<div class="apidesc"><p>Get identity matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixAdd( Matrix left, Matrix right )</code></div> +<div class="apidesc"><p>Add two matrices</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixSubtract( Matrix left, Matrix right )</code></div> +<div class="apidesc"><p>Subtract two matrices (left - right)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixMultiply( Matrix left, Matrix right )</code></div> +<div class="apidesc"><p>Get two matrix multiplication</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixTranslate( Vector3 translate )</code></div> +<div class="apidesc"><p>Get translation matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixRotate( Vector3 axis, float angle )</code></div> +<div class="apidesc"><p>Create rotation matrix from axis and angle. NOTE: Angle should be provided in radians</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixRotateX( float angle )</code></div> +<div class="apidesc"><p>Get x-rotation matrix (angle in radians)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixRotateY( float angle )</code></div> +<div class="apidesc"><p>Get y-rotation matrix (angle in radians)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixRotateZ( float angle )</code></div> +<div class="apidesc"><p>Get z-rotation matrix (angle in radians)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixRotateXYZ( Vector3 angles )</code></div> +<div class="apidesc"><p>Get xyz-rotation matrix (angles in radians)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixRotateZYX( Vector3 angles )</code></div> +<div class="apidesc"><p>Get zyx-rotation matrix (angles in radians)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixScale( Vector3 scale )</code></div> +<div class="apidesc"><p>Get scaling matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixFrustum( double left, double right, double bottom, double top, double near, double far )</code></div> +<div class="apidesc"><p>Get perspective projection matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixPerspective( double fovy, double aspect, double near, double far )</code></div> +<div class="apidesc"><p>Get perspective projection matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixOrtho( double left, double right, double bottom, double top, double near, double far )</code></div> +<div class="apidesc"><p>Get orthographic projection matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.MatrixLookAt( Vector3 eye, Vector3 target, Vector3 up )</code></div> +<div class="apidesc"><p>Get camera look-at matrix (View matrix)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>translation, rotation, scale = RL.MatrixDecompose( Matrix mat )</code></div> +<div class="apidesc"><p>Decompose a transformation matrix into its rotational, translational and scaling components</p> +<ul> +<li>Success return Vector3, Quaternion, Vector3</li> +</ul></div> +<h2 id="math---quaternion">Math - Quaternion</h2> +<div class="apii"><code>result = RL.QuaternionAdd( Quaternion q1, Quaternion q2 )</code></div> +<div class="apidesc"><p>Add two quaternions</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionAddValue( Quaternion q, float add )</code></div> +<div class="apidesc"><p>Add quaternion and float value</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionSubtract( Quaternion q1, Quaternion q2 )</code></div> +<div class="apidesc"><p>Subtract two quaternions</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionSubtractValue( Quaternion q, float sub )</code></div> +<div class="apidesc"><p>Subtract quaternion and float value</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionIdentity()</code></div> +<div class="apidesc"><p>Get identity quaternion</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionLength( Quaternion q )</code></div> +<div class="apidesc"><p>Computes the length of a quaternion</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionNormalize( Quaternion q )</code></div> +<div class="apidesc"><p>Normalize provided quaternion</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionInvert( Quaternion q )</code></div> +<div class="apidesc"><p>Invert provided quaternion</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionMultiply( Quaternion q1, Quaternion q2 )</code></div> +<div class="apidesc"><p>Calculate two quaternion multiplication</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionScale( Quaternion q, float mul )</code></div> +<div class="apidesc"><p>Scale quaternion by float value</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionDivide( Quaternion q1, Quaternion q2 )</code></div> +<div class="apidesc"><p>Divide two quaternions</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionLerp( Quaternion q1, Quaternion q2, float amount )</code></div> +<div class="apidesc"><p>Calculate linear interpolation between two quaternions</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionNlerp( Quaternion q1, Quaternion q2, float amount )</code></div> +<div class="apidesc"><p>Calculate slerp-optimized interpolation between two quaternions</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionSlerp( Quaternion q1, Quaternion q2, float amount )</code></div> +<div class="apidesc"><p>Calculates spherical linear interpolation between two quaternions</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionCubicHermiteSpline( Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t )</code></div> +<div class="apidesc"><p>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</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionFromVector3ToVector3( Vector3 from, Vector3 to )</code></div> +<div class="apidesc"><p>Calculate quaternion based on the rotation from one vector to another</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionFromMatrix( Matrix mat )</code></div> +<div class="apidesc"><p>Get a quaternion for a given rotation matrix</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionToMatrix( Quaternion q )</code></div> +<div class="apidesc"><p>Get a matrix for a given quaternion</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionFromAxisAngle( Vector3 axis, float angle )</code></div> +<div class="apidesc"><p>Get rotation quaternion for an angle and axis NOTE: angle must be provided in radians</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>axis, angle = RL.QuaternionToAxisAngle( Quaternion q )</code></div> +<div class="apidesc"><p>Get the rotation angle and axis for a given quaternion</p> +<ul> +<li>Success return Vector3, float</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionFromEuler( float pitch, float yaw, float roll )</code></div> +<div class="apidesc"><p>Get the quaternion equivalent to Euler angles NOTE: Rotation order is ZYX</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionToEuler( Quaternion q )</code></div> +<div class="apidesc"><p>Get the Euler angles equivalent to quaternion (roll, pitch, yaw) NOTE: Angles are returned in a Vector3 struct in radians</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionTransform( Quaternion q, Matrix mat )</code></div> +<div class="apidesc"><p>Transform a quaternion given a transformation matrix</p> +<ul> +<li>Success return Quaternion</li> +</ul></div> +<div class="apii"><code>result = RL.QuaternionEquals( Quaternion q1, Quaternion q2 )</code></div> +<div class="apidesc"><p>Check whether two given quaternions are almost equal</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="math---frustum">Math - Frustum</h2> +<div class="apii"><code>frustum = RL.ExtractFrustum( Matrix projection, Matrix modelview )</code></div> +<div class="apidesc"><p>Extract frustum from projection and modelView matrices.</p> +<ul> +<li>Success return Vector4{}</li> +</ul></div> +<div class="apii"><code>inFrustum = RL.PointInFrustum( Vector4{} frustum, Vector3 position )</code></div> +<div class="apidesc"><p>Check if point inside frustum</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>inFrustum = RL.SphereInFrustum( Vector4{} frustum, Vector3 position )</code></div> +<div class="apidesc"><p>Check if sphere inside frustum</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>inFrustum = RL.AABBInFrustum( Vector4{} frustum, Vector3 min, Vector3 max )</code></div> +<div class="apidesc"><p>Check if AABB inside frustum</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="gui---global-gui-state-control-functions">Gui - Global gui state control functions</h2> +<div class="apii"><code>RL.GuiEnable()</code></div> +<div class="apidesc"><p>Enable gui controls (global state)</p></div> +<div class="apii"><code>RL.GuiDisable()</code></div> +<div class="apidesc"><p>Disable gui controls (global state)</p></div> +<div class="apii"><code>RL.GuiLock()</code></div> +<div class="apidesc"><p>Lock gui controls (global state)</p></div> +<div class="apii"><code>RL.GuiUnlock()</code></div> +<div class="apidesc"><p>Unlock gui controls (global state)</p></div> +<div class="apii"><code>locked = RL.GuiIsLocked()</code></div> +<div class="apidesc"><p>Check if gui is locked (global state)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.GuiSetAlpha( float alpha )</code></div> +<div class="apidesc"><p>Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f</p></div> +<div class="apii"><code>RL.GuiSetState( int state )</code></div> +<div class="apidesc"><p>Set gui state (global state)</p></div> +<div class="apii"><code>state = RL.GuiGetState()</code></div> +<div class="apidesc"><p>Get gui state (global state)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.GuiSetSliderDragging( bool dragging )</code></div> +<div class="apidesc"><p>Set guiSliderDragging</p></div> +<div class="apii"><code>isSliderDragging = RL.GuiGetSliderDragging()</code></div> +<div class="apidesc"><p>Get guiSliderDragging</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.GuiSetSliderActive( Rectange rect )</code></div> +<div class="apidesc"><p>Set guiSliderActive</p></div> +<div class="apii"><code>isSliderDragging = RL.GuiGetSliderActive()</code></div> +<div class="apidesc"><p>Get guiSliderActive</p> +<ul> +<li>Success return Rectangle</li> +</ul></div> +<h2 id="gui---font-setget-functions">Gui - Font set/get functions</h2> +<div class="apii"><code>RL.GuiSetFont( Font font )</code></div> +<div class="apidesc"><p>Set gui custom font (global state)</p></div> +<div class="apii"><code>font = RL.GuiGetFont()</code></div> +<div class="apidesc"><p>Get gui font (global state). Return as lightuserdata</p> +<ul> +<li>Success return Font</li> +</ul></div> +<h2 id="gui---style-setget-functions">Gui - Style set/get functions</h2> +<div class="apii"><code>RL.GuiSetStyle( int control, int property, int value )</code></div> +<div class="apidesc"><p>Set one style property</p></div> +<div class="apii"><code>value = RL.GuiGetStyle( int control, int property )</code></div> +<div class="apidesc"><p>Get one style property</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="gui---styles-loading-functions">Gui - Styles loading functions</h2> +<div class="apii"><code>success = RL.GuiLoadStyle( string fileName )</code></div> +<div class="apidesc"><p>Load style file over global style variable (.rgs)</p> +<ul> +<li>Failure return nil</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>RL.GuiLoadStyleDefault()</code></div> +<div class="apidesc"><p>Load style default over global style</p></div> +<h2 id="gui---tooltips-management-functions">Gui - Tooltips management functions</h2> +<div class="apii"><code>RL.GuiEnableTooltip()</code></div> +<div class="apidesc"><p>Enable gui tooltips (global state)</p></div> +<div class="apii"><code>RL.GuiDisableTooltip()</code></div> +<div class="apidesc"><p>Disable gui tooltips (global state)</p></div> +<div class="apii"><code>RL.GuiSetTooltip( string tooltip )</code></div> +<div class="apidesc"><p>Set tooltip string</p></div> +<h2 id="gui---icons-functionality">Gui - Icons functionality</h2> +<div class="apii"><code>text = RL.GuiIconText( int iconId, string|nil text )</code></div> +<div class="apidesc"><p>Get text with icon id prepended (if supported)</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>RL.GuiSetIconScale( int scale )</code></div> +<div class="apidesc"><p>Set icon scale (1 by default)</p></div> +<div class="apii"><code>iconsBuffer = RL.GuiGetIcons()</code></div> +<div class="apidesc"><p>Get raygui icons data in buffer. guiIcons size is by default: 256<em>(16</em>16/32) = 2048*4 = 8192 bytes = 8 KB</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>success = RL.GuiSetIcons( Buffer iconBuffer )</code></div> +<div class="apidesc"><p>Set raygui icons data in buffer. guiIcons size is by default: 256<em>(16</em>16/32) = 2048*4 = 8192 bytes = 8 KB</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>iconNames = RL.GuiLoadIcons( string fileName, bool loadIconsName )</code></div> +<div class="apidesc"><p>Load raygui icons file (.rgi) into internal icons data</p> +<ul> +<li>Failure return nil</li> +<li>Success return strings{}</li> +</ul></div> +<div class="apii"><code>RL.GuiDrawIcon( int iconId, Vector2 pos, int pixelSize, Color color )</code></div> +<div class="apidesc"><p>Draw icon</p></div> +<h2 id="gui---containerseparator-controls,-useful-for-controls-organization">Gui - Container/separator controls, useful for controls organization</h2> +<div class="apii"><code>result = RL.GuiWindowBox( Rectangle bounds, string|nil title )</code></div> +<div class="apidesc"><p>Window Box control, shows a window that can be closed</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiGroupBox( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Group Box control with text name</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiLine( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Line separator control, could contain text</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiPanel( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Panel control, useful to group controls</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result, active = RL.GuiTabBar( Rectangle bounds, string text, int active )</code></div> +<div class="apidesc"><p>Tab Bar control, returns TAB to be closed or -1</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>result, scroll, view = RL.GuiScrollPanel( Rectangle bounds, string|nil text, Rectangle content, Vector2 scroll, Rectangle view )</code></div> +<div class="apidesc"><p>Scroll Panel control</p> +<ul> +<li>Success return int, Vector2, Rectangle</li> +</ul></div> +<h2 id="gui---basic-controls-set">Gui - Basic controls set</h2> +<div class="apii"><code>result = RL.GuiLabel( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Label control, shows text</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiButton( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Button control, returns true when clicked</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiLabelButton( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Label button control, show true when clicked</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result, active = RL.GuiToggle( Rectangle bounds, string|nil text, bool active )</code></div> +<div class="apidesc"><p>Toggle Button control, returns true when active</p> +<ul> +<li>Success return int, bool</li> +</ul></div> +<div class="apii"><code>result, active = RL.GuiToggleGroup( Rectangle bounds, string|nil text, int active )</code></div> +<div class="apidesc"><p>Toggle Group control, returns active toggle index</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>result, active = RL.GuiToggleSlider( Rectangle bounds, string|nil text, int active )</code></div> +<div class="apidesc"><p>Toggle Slider control, returns true when clicked</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>result, checked, textBounds = RL.GuiCheckBox( Rectangle bounds, string|nil text, bool checked )</code></div> +<div class="apidesc"><p>Check Box control, returns true when active</p> +<ul> +<li>Success return bool, Rectangle</li> +</ul></div> +<div class="apii"><code>result, active = RL.GuiComboBox( Rectangle bounds, string|nil text, int active )</code></div> +<div class="apidesc"><p>Combo Box control, returns selected item index</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>result, active = RL.GuiDropdownBox( Rectangle bounds, string text, int active, bool editMode )</code></div> +<div class="apidesc"><p>Dropdown Box control, returns selected item</p> +<ul> +<li>Success return int, int</li> +</ul></div> +<div class="apii"><code>result, value, textBounds = RL.GuiSpinner( Rectangle bounds, string|nil text, int value, int minValue, int maxValue, bool editMode )</code></div> +<div class="apidesc"><p>Spinner control, returns selected value</p> +<ul> +<li>Success return int, int, Rectangle</li> +</ul></div> +<div class="apii"><code>result, value, textBounds = RL.GuiValueBox( Rectangle bounds, string|nil text, int value, int minValue, int maxValue, bool editMode )</code></div> +<div class="apidesc"><p>Value Box control, updates input text with numbers</p> +<ul> +<li>Success return int, int, Rectangle</li> +</ul></div> +<div class="apii"><code>result, text = RL.GuiTextBox( Rectangle bounds, string text, int bufferSize, bool editMode )</code></div> +<div class="apidesc"><p>Text Box control, updates input text</p> +<ul> +<li>Success return int, string</li> +</ul></div> +<div class="apii"><code>result, value, textLeftBounds, textRightBounds = RL.GuiSlider( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue )</code></div> +<div class="apidesc"><p>Slider control, returns selected value</p> +<ul> +<li>Success return int, float, Rectangle, Rectangle</li> +</ul></div> +<div class="apii"><code>result, value, textLeftBounds, textRightBounds = RL.GuiSliderBar( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue )</code></div> +<div class="apidesc"><p>Slider Bar control, returns selected value</p> +<ul> +<li>Success return int, float, Rectangle, Rectangle</li> +</ul></div> +<div class="apii"><code>result, value, textLeftBounds, textRightBounds = RL.GuiProgressBar( Rectangle bounds, string|nil textLeft, string|nil textRight, float value, float minValue, float maxValue )</code></div> +<div class="apidesc"><p>Progress Bar control, shows current progress value</p> +<ul> +<li>Success return int, float, Rectangle, Rectangle</li> +</ul></div> +<div class="apii"><code>result = RL.GuiStatusBar( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Status Bar control, shows info text</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiDummyRec( Rectangle bounds, string|nil text )</code></div> +<div class="apidesc"><p>Dummy control for placeholders</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result, mouseCell = RL.GuiGrid( Rectangle bounds, string|nil text, float spacing, int subdivs, Vector2 mouseCell )</code></div> +<div class="apidesc"><p>Grid control, returns mouse cell position</p> +<ul> +<li>Success return int, Vector2</li> +</ul></div> +<div class="apii"><code>value = RL.GuiScrollBar( Rectangle bounds, int value, int minValue, int maxValue )</code></div> +<div class="apidesc"><p>Scroll bar control</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="gui---advance-controls-set">Gui - Advance controls set</h2> +<div class="apii"><code>result, scrollIndex, active = RL.GuiListView( Rectangle bounds, string|nil text, int scrollIndex, int active )</code></div> +<div class="apidesc"><p>List View control, returns selected list item index</p> +<ul> +<li>Success return int, int, int</li> +</ul></div> +<div class="apii"><code>result, scrollIndex, active, focus = RL.GuiListViewEx( Rectangle bounds, string text, int scrollIndex, int active, int focus )</code></div> +<div class="apidesc"><p>List View with extended parameters</p> +<ul> +<li>Success return int, int, int, int</li> +</ul></div> +<div class="apii"><code>result = RL.GuiMessageBox( Rectangle bounds, string|nil title, string message, string buttons )</code></div> +<div class="apidesc"><p>Message Box control, displays a message</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result, text, secretViewActive = RL.GuiTextInputBox( Rectangle bounds, string title, string message, string buttons, string text, int textMaxSize, bool secretViewActive )</code></div> +<div class="apidesc"><p>Text Input Box control, ask for text, supports secret</p> +<ul> +<li>Success return int, string, bool</li> +</ul></div> +<div class="apii"><code>result, color = RL.GuiColorPicker( Rectangle bounds, string|nil text, Color color )</code></div> +<div class="apidesc"><p>Color Picker control (multiple color controls)</p> +<ul> +<li>Success return int, Color</li> +</ul></div> +<div class="apii"><code>result, color = RL.GuiColorPanel( Rectangle bounds, string|nil text, Color color )</code></div> +<div class="apidesc"><p>Color Panel control</p> +<ul> +<li>Success return int, Color</li> +</ul></div> +<div class="apii"><code>result, alpha = RL.GuiColorBarAlpha( Rectangle bounds, string|nil text, float alpha )</code></div> +<div class="apidesc"><p>Color Bar Alpha control</p> +<ul> +<li>Success return int, float</li> +</ul></div> +<div class="apii"><code>result, value = RL.GuiColorBarHue( Rectangle bounds, string|nil text, float value )</code></div> +<div class="apidesc"><p>Color Bar Hue control</p> +<ul> +<li>Success return int, float</li> +</ul></div> +<div class="apii"><code>result, colorHsv = RL.GuiColorPickerHSV( Rectangle bounds, string|nil text, Vector3 colorHsv )</code></div> +<div class="apidesc"><p>Color Picker control that avoids conversion to RGB on each call (multiple color controls)</p> +<ul> +<li>Success return int, Vector3</li> +</ul></div> +<div class="apii"><code>result, colorHsv = RL.GuiColorPanelHSV( Rectangle bounds, string|nil text, Vector3 colorHsv )</code></div> +<div class="apidesc"><p>Color Panel control that returns HSV color value, used by GuiColorPickerHSV()</p> +<ul> +<li>Success return int, Vector3</li> +</ul></div> +<h2 id="lights---light-management-functions">Lights - Light management functions</h2> +<div class="apii"><code>light = RL.CreateLight( int type, Vector3 position, Vector3 target, Color color, Shader shader )</code></div> +<div class="apidesc"><p>Create a light and get shader locations</p> +<ul> +<li>Success return Light</li> +</ul></div> +<div class="apii"><code>RL.UpdateLightValues( Shader shader, Light light )</code></div> +<div class="apidesc"><p>Send light properties to shader</p></div> +<div class="apii"><code>RL.SetLightType( Light light, int type )</code></div> +<div class="apidesc"><p>Set light type</p></div> +<div class="apii"><code>RL.SetLightPosition( Light light, Vector3 position )</code></div> +<div class="apidesc"><p>Set light position</p></div> +<div class="apii"><code>RL.SetLightTarget( Light light, Vector3 target )</code></div> +<div class="apidesc"><p>Set light target</p></div> +<div class="apii"><code>RL.SetLightColor( Light light, Color color )</code></div> +<div class="apidesc"><p>Set light color</p></div> +<div class="apii"><code>RL.SetLightEnabled( Light light, bool enabled )</code></div> +<div class="apidesc"><p>Set light enabled</p></div> +<div class="apii"><code>type = RL.GetLightType( Light light )</code></div> +<div class="apidesc"><p>Get light type</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>position = RL.GetLightPosition( Light light )</code></div> +<div class="apidesc"><p>Get light position</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>target = RL.GetLightTarget( Light light )</code></div> +<div class="apidesc"><p>Get light target</p> +<ul> +<li>Success return Vector3</li> +</ul></div> +<div class="apii"><code>color = RL.GetLightColor( Light light )</code></div> +<div class="apidesc"><p>Get light color</p> +<ul> +<li>Success return Color</li> +</ul></div> +<div class="apii"><code>enabled = RL.IsLightEnabled( Light light )</code></div> +<div class="apidesc"><p>Get light enabled</p> +<ul> +<li>Success return bool</li> +</ul></div> +<h2 id="rlgl---matrix-operations">RLGL - Matrix operations</h2> +<div class="apii"><code>RL.rlMatrixMode( int mode )</code></div> +<div class="apidesc"><p>Choose the current matrix to be transformed</p></div> +<div class="apii"><code>RL.rlPushMatrix()</code></div> +<div class="apidesc"><p>Push the current matrix to stack</p></div> +<div class="apii"><code>RL.rlPopMatrix()</code></div> +<div class="apidesc"><p>Pop latest inserted matrix from stack</p></div> +<div class="apii"><code>RL.rlLoadIdentity()</code></div> +<div class="apidesc"><p>Reset current matrix to identity matrix</p></div> +<div class="apii"><code>RL.rlTranslatef( Vector3 translation )</code></div> +<div class="apidesc"><p>Multiply the current matrix by a translation matrix</p></div> +<div class="apii"><code>RL.rlRotatef( float angle, Vector3 rotation )</code></div> +<div class="apidesc"><p>Multiply the current matrix by a rotation matrix</p></div> +<div class="apii"><code>RL.rlScalef( Vector3 scale )</code></div> +<div class="apidesc"><p>Multiply the current matrix by a scaling matrix</p></div> +<div class="apii"><code>RL.rlMultMatrixf( Matrix matrix )</code></div> +<div class="apidesc"><p>Multiply the current matrix by another matrix</p></div> +<div class="apii"><code>RL.rlFrustum( float left, float right, float bottom, float top, float znear, float zfar )</code></div> +<div class="apidesc"><p>Multiply the current matrix by a perspective matrix generated by parameters</p></div> +<div class="apii"><code>RL.rlOrtho( float left, float right, float bottom, float top, float znear, float zfar )</code></div> +<div class="apidesc"><p>Multiply the current matrix by an orthographic matrix generated by parameters</p></div> +<div class="apii"><code>RL.rlViewport( Rectangle viewport )</code></div> +<div class="apidesc"><p>Set the viewport area (transformation from normalized device coordinates to window coordinates) NOTE: We store current viewport dimensions</p></div> +<div class="apii"><code>RL.rlSetClipPlanes( float nearPlane, float farPlane )</code></div> +<div class="apidesc"><p>Set clip planes distances</p></div> +<div class="apii"><code>distance = RL.rlGetCullDistanceNear()</code></div> +<div class="apidesc"><p>Get cull plane distance near</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>distance = RL.rlGetCullDistanceFar()</code></div> +<div class="apidesc"><p>Get cull plane distance far</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="rlgl---vertex-level-operations">RLGL - Vertex level operations</h2> +<div class="apii"><code>RL.rlBegin( int mode )</code></div> +<div class="apidesc"><p>Initialize drawing mode (how to organize vertex)</p></div> +<div class="apii"><code>RL.rlEnd()</code></div> +<div class="apidesc"><p>Finish vertex providing</p></div> +<div class="apii"><code>RL.rlVertex2f( Vector2 position )</code></div> +<div class="apidesc"><p>Define one vertex (position)</p></div> +<div class="apii"><code>RL.rlVertex3f( Vector3 position )</code></div> +<div class="apidesc"><p>Define one vertex (position)</p></div> +<div class="apii"><code>RL.rlTexCoord2f( Vector2 texCoord )</code></div> +<div class="apidesc"><p>Define one vertex (texture coordinate) - 2 float</p></div> +<div class="apii"><code>RL.rlNormal3f( Vector3 normal )</code></div> +<div class="apidesc"><p>Define one vertex (normal) - 3 float</p></div> +<div class="apii"><code>RL.rlColor4ub( Color color )</code></div> +<div class="apidesc"><p>Define one vertex (color) - 4 byte</p></div> +<div class="apii"><code>RL.rlColor3f( Vector3 color )</code></div> +<div class="apidesc"><p>Define one vertex (color) - 3 float</p></div> +<div class="apii"><code>RL.rlColor4f( Vector4 color )</code></div> +<div class="apidesc"><p>Define one vertex (color) - 4 float</p></div> +<h2 id="rlgl---vertex-buffers-state">RLGL - Vertex buffers state</h2> +<div class="apii"><code>supported = RL.rlEnableVertexArray( int vaoId )</code></div> +<div class="apidesc"><p>Enable vertex array (VAO, if supported)</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.rlDisableVertexArray()</code></div> +<div class="apidesc"><p>Disable vertex array (VAO, if supported)</p></div> +<div class="apii"><code>RL.rlEnableVertexBuffer( int id )</code></div> +<div class="apidesc"><p>Enable vertex buffer (VBO)</p> +<ul> +<li>Failure return false</li> +<li>Success return true</li> +</ul></div> +<div class="apii"><code>RL.rlDisableVertexBuffer()</code></div> +<div class="apidesc"><p>Disable vertex buffer (VBO)</p></div> +<div class="apii"><code>RL.rlEnableVertexBufferElement( int id )</code></div> +<div class="apidesc"><p>Enable vertex buffer element (VBO element)</p></div> +<div class="apii"><code>RL.rlDisableVertexBufferElement()</code></div> +<div class="apidesc"><p>Disable vertex buffer element (VBO element)</p></div> +<div class="apii"><code>RL.rlEnableVertexAttribute( int index )</code></div> +<div class="apidesc"><p>Enable vertex attribute index</p></div> +<div class="apii"><code>RL.rlDisableVertexAttribute( int index )</code></div> +<div class="apidesc"><p>Disable vertex attribute index</p></div> +<div class="apii"><code>RL.rlEnableStatePointer( int vertexAttribType, Buffer buffer )</code></div> +<div class="apidesc"><p>Enable attribute state pointer</p></div> +<div class="apii"><code>RL.rlDisableStatePointer( int vertexAttribType )</code></div> +<div class="apidesc"><p>Disable attribute state pointer</p></div> +<h2 id="rlgl---textures-state">RLGL - Textures state</h2> +<div class="apii"><code>RL.rlActiveTextureSlot( int slot )</code></div> +<div class="apidesc"><p>Select and active a texture slot</p></div> +<div class="apii"><code>RL.rlEnableTexture( int id )</code></div> +<div class="apidesc"><p>Enable texture</p></div> +<div class="apii"><code>RL.rlDisableTexture()</code></div> +<div class="apidesc"><p>Disable texture</p></div> +<div class="apii"><code>RL.rlEnableTextureCubemap( int id )</code></div> +<div class="apidesc"><p>Enable texture cubemap</p></div> +<div class="apii"><code>RL.rlDisableTextureCubemap()</code></div> +<div class="apidesc"><p>Disable texture cubemap</p></div> +<div class="apii"><code>RL.rlTextureParameters( int id, int param, int value )</code></div> +<div class="apidesc"><p>Set texture parameters (filter, wrap)</p></div> +<div class="apii"><code>RL.rlCubemapParameters( int id, int param, int value )</code></div> +<div class="apidesc"><p>Set cubemap parameters (filter, wrap)</p></div> +<h2 id="rlgl---shader-state">RLGL - Shader state</h2> +<div class="apii"><code>RL.rlEnableShader( int id )</code></div> +<div class="apidesc"><p>Enable shader program</p></div> +<div class="apii"><code>RL.rlDisableShader()</code></div> +<div class="apidesc"><p>Disable shader program</p></div> +<h2 id="rlgl---framebuffer-state">RLGL - Framebuffer state</h2> +<div class="apii"><code>RL.rlEnableFramebuffer( int id )</code></div> +<div class="apidesc"><p>Enable render texture (fbo)</p></div> +<div class="apii"><code>RL.rlDisableFramebuffer()</code></div> +<div class="apidesc"><p>Disable render texture (fbo), return to default framebuffer</p></div> +<div class="apii"><code>framebuffer = RL.rlGetActiveFramebuffer()</code></div> +<div class="apidesc"><p>Get the currently active render texture (fbo), 0 for default framebuffer</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlActiveDrawBuffers( int count )</code></div> +<div class="apidesc"><p>Activate multiple draw color buffers</p></div> +<div class="apii"><code>RL.rlBlitFramebuffer( Rectangle srcRect, Rectangle dstRect, int bufferMask )</code></div> +<div class="apidesc"><p>Blit active framebuffer to main framebuffer</p></div> +<div class="apii"><code>RL.rlBindFramebuffer( int target, int framebuffer )</code></div> +<div class="apidesc"><p>Bind framebuffer (FBO)</p></div> +<h2 id="rlgl---general-render-state">RLGL - General render state</h2> +<div class="apii"><code>RL.rlEnableColorBlend()</code></div> +<div class="apidesc"><p>Enable color blending</p></div> +<div class="apii"><code>RL.rlDisableColorBlend()</code></div> +<div class="apidesc"><p>Disable color blending</p></div> +<div class="apii"><code>RL.rlEnableDepthTest()</code></div> +<div class="apidesc"><p>Enable depth test</p></div> +<div class="apii"><code>RL.rlDisableDepthTest()</code></div> +<div class="apidesc"><p>Disable depth test</p></div> +<div class="apii"><code>RL.rlEnableDepthMask()</code></div> +<div class="apidesc"><p>Enable depth write</p></div> +<div class="apii"><code>RL.rlDisableDepthMask()</code></div> +<div class="apidesc"><p>Disable depth write</p></div> +<div class="apii"><code>RL.rlEnableBackfaceCulling()</code></div> +<div class="apidesc"><p>Enable backface culling</p></div> +<div class="apii"><code>RL.rlDisableBackfaceCulling()</code></div> +<div class="apidesc"><p>Disable backface culling</p></div> +<div class="apii"><code>RL.rlColorMask( bool r, bool g, bool b, bool a )</code></div> +<div class="apidesc"><p>Color mask control</p></div> +<div class="apii"><code>RL.rlSetCullFace( int mode )</code></div> +<div class="apidesc"><p>Set face culling mode</p></div> +<div class="apii"><code>RL.rlEnableScissorTest()</code></div> +<div class="apidesc"><p>Enable scissor test</p></div> +<div class="apii"><code>RL.rlDisableScissorTest()</code></div> +<div class="apidesc"><p>Disable scissor test</p></div> +<div class="apii"><code>RL.rlScissor( Rectangle area )</code></div> +<div class="apidesc"><p>Scissor test</p></div> +<div class="apii"><code>RL.rlEnableWireMode()</code></div> +<div class="apidesc"><p>Enable wire mode</p></div> +<div class="apii"><code>RL.rlEnablePointMode()</code></div> +<div class="apidesc"><p>Enable point mode</p></div> +<div class="apii"><code>RL.rlDisableWireMode()</code></div> +<div class="apidesc"><p>Disable wire mode</p></div> +<div class="apii"><code>RL.rlSetLineWidth( float width )</code></div> +<div class="apidesc"><p>Set the line drawing width</p></div> +<div class="apii"><code>width = RL.rlGetLineWidth()</code></div> +<div class="apidesc"><p>Get the line drawing width</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>RL.rlEnableSmoothLines()</code></div> +<div class="apidesc"><p>Enable line aliasing</p></div> +<div class="apii"><code>RL.rlDisableSmoothLines()</code></div> +<div class="apidesc"><p>Disable line aliasing</p></div> +<div class="apii"><code>RL.rlEnableStereoRender()</code></div> +<div class="apidesc"><p>Enable stereo rendering</p></div> +<div class="apii"><code>RL.rlDisableStereoRender()</code></div> +<div class="apidesc"><p>Enable stereo rendering</p></div> +<div class="apii"><code>enabled = RL.rlIsStereoRenderEnabled()</code></div> +<div class="apidesc"><p>Check if stereo render is enabled</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.rlClearColor( Color color )</code></div> +<div class="apidesc"><p>Clear color buffer with color</p></div> +<div class="apii"><code>RL.rlClearScreenBuffers()</code></div> +<div class="apidesc"><p>Clear used screen buffers (color and depth)</p></div> +<div class="apii"><code>RL.rlCheckErrors()</code></div> +<div class="apidesc"><p>Check and log OpenGL error codes</p></div> +<div class="apii"><code>RL.rlSetBlendMode( int mode )</code></div> +<div class="apidesc"><p>Set blending mode</p></div> +<div class="apii"><code>RL.rlSetBlendFactors( int glSrcFactor, int glDstFactor, int glEquation )</code></div> +<div class="apidesc"><p>Set blending mode factor and equation (using OpenGL factors)</p></div> +<div class="apii"><code>RL.rlSetBlendFactorsSeparate( int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha )</code></div> +<div class="apidesc"><p>Set blending mode factors and equations separately (using OpenGL factors)</p></div> +<h2 id="rlgl---initialization-functions">RLGL - Initialization functions</h2> +<div class="apii"><code>version = RL.rlGetVersion()</code></div> +<div class="apidesc"><p>Get current OpenGL version</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>version = RL.rlSetFramebufferWidth( int width )</code></div> +<div class="apidesc"><p>Set current framebuffer width</p></div> +<div class="apii"><code>width = RL.rlGetFramebufferWidth()</code></div> +<div class="apidesc"><p>Get default framebuffer width</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>version = RL.rlSetFramebufferHeight( int height )</code></div> +<div class="apidesc"><p>Set current framebuffer height</p></div> +<div class="apii"><code>height = RL.rlGetFramebufferHeight()</code></div> +<div class="apidesc"><p>Get default framebuffer height</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>id = RL.rlGetTextureIdDefault()</code></div> +<div class="apidesc"><p>Get default texture id</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>id = RL.rlGetShaderIdDefault()</code></div> +<div class="apidesc"><p>Get default shader id</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>locations = RL.rlGetShaderLocsDefault()</code></div> +<div class="apidesc"><p>Get default shader locations</p> +<ul> +<li>Success return int{}</li> +</ul></div> +<h2 id="rlgl---render-batch-management">RLGL - Render batch management</h2> +<div class="apii"><code>renderBatch = RL.rlLoadRenderBatch( int numBuffers, int bufferElements )</code></div> +<div class="apidesc"><p>Load a render batch system</p> +<ul> +<li>Success return rlRenderBatch</li> +</ul></div> +<div class="apii"><code>RL.rlUnloadRenderBatch( rlRenderBatch renderBatch )</code></div> +<div class="apidesc"><p>Unload render batch system</p></div> +<div class="apii"><code>RL.rlDrawRenderBatch( rlRenderBatch renderBatch )</code></div> +<div class="apidesc"><p>Draw render batch data (Update->Draw->Reset)</p></div> +<div class="apii"><code>RL.rlSetRenderBatchActive( rlRenderBatch renderBatch )</code></div> +<div class="apidesc"><p>Set the active render batch for rlgl (nil for default internal)</p></div> +<div class="apii"><code>RL.rlDrawRenderBatchActive()</code></div> +<div class="apidesc"><p>Update and draw internal render batch</p></div> +<div class="apii"><code>overflow = RL.rlCheckRenderBatchLimit( int vCount )</code></div> +<div class="apidesc"><p>Check internal buffer overflow for a given number of vertex and force a rlRenderBatch draw call if required</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.rlSetTexture( int id )</code></div> +<div class="apidesc"><p>Set current texture for render batch and check buffers limits</p></div> +<h2 id="rlgl---vertex-buffers-management">RLGL - Vertex buffers management</h2> +<div class="apii"><code>vaoId = RL.rlLoadVertexArray()</code></div> +<div class="apidesc"><p>Load vertex array (vao) if supported</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>vboId = RL.rlLoadVertexBuffer( Buffer buffer, bool dynamic )</code></div> +<div class="apidesc"><p>Load a vertex buffer attribute</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>vboId = RL.rlLoadVertexBufferElement( Buffer buffer, bool dynamic )</code></div> +<div class="apidesc"><p>Load a new attributes element buffer</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlUpdateVertexBuffer( int bufferId, Buffer buffer, int offset )</code></div> +<div class="apidesc"><p>Update GPU buffer with new data</p></div> +<div class="apii"><code>RL.rlUpdateVertexBufferElements( int id, Buffer buffer, int offset )</code></div> +<div class="apidesc"><p>Update vertex buffer elements with new data</p></div> +<div class="apii"><code>RL.rlUnloadVertexArray( int vaoId )</code></div> +<div class="apidesc"><p>Unload vertex array object (VAO)</p></div> +<div class="apii"><code>RL.rlUnloadVertexBuffer( int vboId )</code></div> +<div class="apidesc"><p>Unload vertex buffer (VBO)</p></div> +<div class="apii"><code>RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, int offset )</code></div> +<div class="apidesc"><p>Set vertex attribute data configuration</p></div> +<div class="apii"><code>RL.rlSetVertexAttributeDivisor( int index, int divisor )</code></div> +<div class="apidesc"><p>Set vertex attribute divisor</p></div> +<div class="apii"><code>RL.rlSetVertexAttributeDefault( int locIndex, float{} value, int attribType )</code></div> +<div class="apidesc"><p>Set vertex attribute default value</p></div> +<div class="apii"><code>RL.rlDrawVertexArray( int offset, int count )</code></div> +<div class="apidesc"><p>Draw vertex array</p></div> +<div class="apii"><code>RL.rlDrawVertexArrayElements( int offset, int count, Buffer buffer )</code></div> +<div class="apidesc"><p>Draw vertex array elements</p></div> +<div class="apii"><code>RL.rlDrawVertexArrayInstanced( int offset, int count, int instances )</code></div> +<div class="apidesc"><p>Draw vertex array instanced</p></div> +<div class="apii"><code>RL.rlDrawVertexArrayElementsInstanced( int offset, int count, Buffer buffer, int instances )</code></div> +<div class="apidesc"><p>Draw vertex array elements instanced</p></div> +<h2 id="rlgl---textures-management">RLGL - Textures management</h2> +<div class="apii"><code>id = RL.rlLoadTexture( Buffer data, Vector2 size, int format, int mipmapCount )</code></div> +<div class="apidesc"><p>Load texture in GPU</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>id = RL.rlLoadTextureDepth( Vector2 size, bool useRenderBuffer )</code></div> +<div class="apidesc"><p>Load depth texture/renderbuffer (to be attached to fbo)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>id = RL.rlLoadTextureCubemap( Buffer data, int size, int format, int mipmapCount )</code></div> +<div class="apidesc"><p>Load texture cubemap data</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlUpdateTexture( int id, Vector2 offset, Vector2 size, int format, Buffer data )</code></div> +<div class="apidesc"><p>Update GPU texture with new data</p></div> +<div class="apii"><code>glInternalFormat, glFormat, glType = RL.rlGetGlTextureFormats( int format )</code></div> +<div class="apidesc"><p>Get OpenGL internal formats</p> +<ul> +<li>Success return int, int, int</li> +</ul></div> +<div class="apii"><code>name = RL.rlGetPixelFormatName( int format )</code></div> +<div class="apidesc"><p>Get name string for pixel format</p> +<ul> +<li>Success return string</li> +</ul></div> +<div class="apii"><code>RL.rlUnloadTexture( int id )</code></div> +<div class="apidesc"><p>Unload texture from GPU memory</p></div> +<div class="apii"><code>mipmapCount = RL.rlGenTextureMipmaps( int id, Vector2 size, int format )</code></div> +<div class="apidesc"><p>Generate mipmap data for selected texture</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>data = RL.rlReadTexturePixels( int id, Vector2 size, int format )</code></div> +<div class="apidesc"><p>Read texture pixel data</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>data = RL.rlReadScreenPixels( Vector2 size )</code></div> +<div class="apidesc"><p>Read screen pixel data (color buffer)</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<h2 id="rlgl---framebuffer-management-(fbo)">RLGL - Framebuffer management (fbo)</h2> +<div class="apii"><code>fboId = RL.rlLoadFramebuffer()</code></div> +<div class="apidesc"><p>Load an empty framebuffer</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlFramebufferAttach( int fboId, int texId, int attachType, int texType, int mipLevel )</code></div> +<div class="apidesc"><p>Attach texture/renderbuffer to a framebuffer</p></div> +<div class="apii"><code>isComplete = RL.rlFramebufferComplete( int id )</code></div> +<div class="apidesc"><p>Verify framebuffer is complete</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>RL.rlUnloadFramebuffer( int id )</code></div> +<div class="apidesc"><p>Delete framebuffer from GPU</p></div> +<h2 id="rlgl---shaders-management">RLGL - Shaders management</h2> +<div class="apii"><code>shaderId = RL.rlLoadShaderCode( string vsCode, string fsCode )</code></div> +<div class="apidesc"><p>Load shader from code strings</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>shaderId = RL.rlCompileShader( string shaderCode, int type )</code></div> +<div class="apidesc"><p>Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>shaderProgramId = RL.rlLoadShaderProgram( int vShaderId, int fShaderId )</code></div> +<div class="apidesc"><p>Load custom shader program</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlUnloadShaderProgram( int id )</code></div> +<div class="apidesc"><p>Unload shader program</p></div> +<div class="apii"><code>location = RL.rlGetLocationUniform( int shaderId, string uniformName )</code></div> +<div class="apidesc"><p>Get shader location uniform</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>location = RL.rlGetLocationAttrib( int shaderId, string attribName )</code></div> +<div class="apidesc"><p>Get shader location attribute</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlSetUniform( int locIndex, Buffer value, int uniformType, int count )</code></div> +<div class="apidesc"><p>Set shader value uniform</p></div> +<div class="apii"><code>RL.rlSetUniformMatrix( int locIndex, Matrix mat )</code></div> +<div class="apidesc"><p>Set shader value matrix</p></div> +<div class="apii"><code>RL.rlSetUniformMatrices( int locIndex, Matrix{} mat )</code></div> +<div class="apidesc"><p>Set shader value matrices</p></div> +<div class="apii"><code>RL.rlSetUniformSampler( int locIndex, int textureId )</code></div> +<div class="apidesc"><p>Set shader value sampler</p></div> +<div class="apii"><code>RL.rlSetShader( int id, int{} locs )</code></div> +<div class="apidesc"><p>Set shader currently active (id and locations)</p></div> +<h2 id="rlgl---compute-shader-management">RLGL - Compute shader management</h2> +<div class="apii"><code>programId = RL.rlLoadComputeShaderProgram( int shaderId )</code></div> +<div class="apidesc"><p>Load compute shader program</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlComputeShaderDispatch( int groupX, int groupY, int groupZ )</code></div> +<div class="apidesc"><p>Dispatch compute shader (equivalent to <em>draw</em> for graphics pipeline)</p></div> +<h2 id="rlgl---shader-buffer-storage-object-management-(ssbo)">RLGL - Shader buffer storage object management (ssbo)</h2> +<div class="apii"><code>buffer = RL.rlLoadShaderBuffer( int size, Buffer data, int usageHint )</code></div> +<div class="apidesc"><p>Load shader storage buffer object (SSBO)</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>RL.rlUnloadShaderBuffer( int ssboId )</code></div> +<div class="apidesc"><p>Unload shader storage buffer object (SSBO)</p></div> +<div class="apii"><code>RL.rlUpdateShaderBuffer( int id, Buffer data, int offset )</code></div> +<div class="apidesc"><p>Update SSBO buffer data</p></div> +<div class="apii"><code>RL.rlBindShaderBuffer( int id, int index )</code></div> +<div class="apidesc"><p>Bind SSBO buffer</p></div> +<div class="apii"><code>data = RL.rlReadShaderBuffer( int id, int count, int offset )</code></div> +<div class="apidesc"><p>Read SSBO buffer data (GPU->CPU)</p> +<ul> +<li>Success return Buffer</li> +</ul></div> +<div class="apii"><code>RL.rlCopyShaderBuffer( int destId, int srcId, int destOffset, int srcOffset, int count )</code></div> +<div class="apidesc"><p>Copy SSBO data between buffers</p></div> +<div class="apii"><code>size = RL.rlGetShaderBufferSize( int id )</code></div> +<div class="apidesc"><p>Get SSBO buffer size</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="rlgl---buffer-management">RLGL - Buffer management</h2> +<div class="apii"><code>RL.rlBindImageTexture( int id, int index, int format, bool readonly )</code></div> +<div class="apidesc"><p>Bind image texture</p></div> +<h2 id="rlgl---matrix-state-management">RLGL - Matrix state management</h2> +<div class="apii"><code>modelview = RL.rlGetMatrixModelview()</code></div> +<div class="apidesc"><p>Get internal modelview matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>projection = RL.rlGetMatrixProjection()</code></div> +<div class="apidesc"><p>Get internal projection matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>transform = RL.rlGetMatrixTransform()</code></div> +<div class="apidesc"><p>Get internal accumulated transform matrix</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>projection = RL.rlGetMatrixProjectionStereo( int eye )</code></div> +<div class="apidesc"><p>Get internal projection matrix for stereo render (selected eye)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>viewOffset = RL.rlGetMatrixViewOffsetStereo( int eye )</code></div> +<div class="apidesc"><p>Get internal view offset matrix for stereo render (selected eye)</p> +<ul> +<li>Success return Matrix</li> +</ul></div> +<div class="apii"><code>RL.rlSetMatrixProjection( Matrix proj )</code></div> +<div class="apidesc"><p>Set a custom projection matrix (replaces internal projection matrix)</p></div> +<div class="apii"><code>RL.rlSetMatrixModelview( Matrix view )</code></div> +<div class="apidesc"><p>Set a custom modelview matrix (replaces internal modelview matrix)</p></div> +<div class="apii"><code>RL.rlSetMatrixProjectionStereo( Matrix right, Matrix left )</code></div> +<div class="apidesc"><p>Set eyes projection matrices for stereo rendering</p></div> +<div class="apii"><code>RL.rlSetMatrixViewOffsetStereo( Matrix right, Matrix left )</code></div> +<div class="apidesc"><p>Set eyes view offsets matrices for stereo rendering</p></div> +<h2 id="opengl---rendering">OpenGL - Rendering</h2> +<div class="apii"><code>RL.glClear( int mask )</code></div> +<div class="apidesc"><p>Clear buffers to preset values</p></div> +<h2 id="opengl---frame-buffers">OpenGL - Frame Buffers</h2> +<div class="apii"><code>RL.glBlitFramebuffer( RenderTexture srcTex, RenderTexture dstTex, Rectangle srcRect, Rectangle dstRect, int mask, int filter )</code></div> +<div class="apidesc"><p>Copy a block of pixels from one framebuffer object to another. Use nil RenderTexture for window framebuffer</p></div> +<h2 id="opengl---state-management">OpenGL - State Management</h2> +<div class="apii"><code>RL.glDepthRange( float nearVal, float farVal )</code></div> +<div class="apidesc"><p>Specify mapping of depth values from normalized device coordinates to window coordinates</p></div> +<div class="apii"><code>RL.glEnable( int cap )</code></div> +<div class="apidesc"><p>Enable server-side GL capabilities</p></div> +<div class="apii"><code>RL.glDisable( int cap )</code></div> +<div class="apidesc"><p>Disable server-side GL capabilities</p></div> +<div class="apii"><code>RL.glPolygonOffset( float factor, float units )</code></div> +<div class="apidesc"><p>Set the scale and units used to calculate depth values</p></div> +<div class="apii"><code>RL.glStencilFunc( int func, int ref, int mask )</code></div> +<div class="apidesc"><p>Set front and back function and reference value for stencil testing</p></div> +<div class="apii"><code>RL.glStencilFuncSeparate( int face, int func, int ref, int mask )</code></div> +<div class="apidesc"><p>Set front and/or back function and reference value for stencil testing</p></div> +<div class="apii"><code>RL.glStencilMask( int mask )</code></div> +<div class="apidesc"><p>Control the front and back writing of individual bits in the stencil planes</p></div> +<div class="apii"><code>RL.glStencilMaskSeparate( int face, int mask )</code></div> +<div class="apidesc"><p>Control the front and/or back writing of individual bits in the stencil planes</p></div> +<div class="apii"><code>RL.glStencilOp( int sfail, int dpfail, int dppass )</code></div> +<div class="apidesc"><p>Set front and back stencil test actions</p></div> +<div class="apii"><code>RL.glStencilOpSeparate( int face, int sfail, int dpfail, int dppass )</code></div> +<div class="apidesc"><p>Set front and back stencil test actions</p></div> +<h2 id="opengl---utility">OpenGL - Utility</h2> +<div class="apii"><code>connection = RL.glGetString( int name, int|nil index )</code></div> +<div class="apidesc"><p>Return a string describing the current GL connection. GL_EXTENSIONS returns the extension string supported by the implementation at index</p> +<ul> +<li>Success return string</li> +</ul></div> +<h2 id="easings---linear-easing-functions">Easings - Linear Easing functions</h2> +<div class="apii"><code>value = RL.EaseLinear( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease linear</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---sine-easing-functions">Easings - Sine Easing functions</h2> +<div class="apii"><code>value = RL.EaseSineIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease sine in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseSineOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease sine out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseSineInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease sine in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---circular-easing-functions">Easings - Circular Easing functions</h2> +<div class="apii"><code>value = RL.EaseCircIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease circle in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseCircOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease circle out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseCircInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease circle in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---cubic-easing-functions">Easings - Cubic Easing functions</h2> +<div class="apii"><code>value = RL.EaseCubicIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease cubic in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseCubicOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease cubic out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseCubicInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease cubic in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---quadratic-easing-functions">Easings - Quadratic Easing functions</h2> +<div class="apii"><code>value = RL.EaseQuadIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease quadratic in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseQuadOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease quadratic out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseQuadInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease quadratic in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---exponential-easing-functions">Easings - Exponential Easing functions</h2> +<div class="apii"><code>value = RL.EaseExpoIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease exponential in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseExpoOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease exponential out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseExpoInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease exponential in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---back-easing-functions">Easings - Back Easing functions</h2> +<div class="apii"><code>value = RL.EaseBackIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease back in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseBackOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease back out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseBackInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease back in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---bounce-easing-functions">Easings - Bounce Easing functions</h2> +<div class="apii"><code>value = RL.EaseBounceIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease bounce in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseBounceOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease bounce out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseBounceInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease bounce in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="easings---elastic-easing-functions">Easings - Elastic Easing functions</h2> +<div class="apii"><code>value = RL.EaseElasticIn( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease elastic in</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseElasticOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease elastic out</p> +<ul> +<li>Success return float</li> +</ul></div> +<div class="apii"><code>value = RL.EaseElasticInOut( float t, float b, float c, float d )</code></div> +<div class="apidesc"><p>Ease elastic in out</p> +<ul> +<li>Success return float</li> +</ul></div> +<h2 id="bitwise-operations---arithmetic">Bitwise Operations - Arithmetic</h2> +<div class="apii"><code>result = RL.BitAnd( int a, int b )</code></div> +<div class="apidesc"><p>Equivalent to a & b in C</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.BitOr( int a, int b )</code></div> +<div class="apidesc"><p>Equivalent to a | b in C</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.BitXor( int a, int b )</code></div> +<div class="apidesc"><p>Equivalent to a ^ b in C</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.BitNot( int v )</code></div> +<div class="apidesc"><p>Equivalent to ~v in C</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.BitShiftLeft( int v, int n )</code></div> +<div class="apidesc"><p>Equivalent to v << n in C</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.BitShiftRight( int v, int n )</code></div> +<div class="apidesc"><p>Equivalent to v >> n in C</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>result = RL.BitSet( int v, int i, bool b )</code></div> +<div class="apidesc"><p>Set bit in index i to state b in value v</p> +<ul> +<li>Success return int</li> +</ul></div> +<div class="apii"><code>bit = RL.BitGet( int v, int i )</code></div> +<div class="apidesc"><p>Get bit in index i from value v</p> +<ul> +<li>Success return bool</li> +</ul></div> +<div class="apii"><code>result = RL.BitToggle( int v, int i )</code></div> +<div class="apidesc"><p>Toggle bit in index i in value v</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="glfw-core---input-related-functions:-keyboard">GLFW Core - Input-related functions: keyboard</h2> +<div class="apii"><code>keyName = RL.GetKeyName( int key, int scancode )</code></div> +<div class="apidesc"><p>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.</p> +<ul> +<li>Success return string or nil</li> +</ul></div> +<div class="apii"><code>scancode = RL.GetKeyScancode( int key )</code></div> +<div class="apidesc"><p>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.</p> +<ul> +<li>Success return int</li> +</ul></div> +<h2 id="window-events">Window events</h2> +<div class="apii"><code>GLFWwindowsizeEvent = { int type, int width, int height }</code></div> +<div class="apidesc"><p>Called when the window is resized. Type GLFW_WINDOW_SIZE_EVENT</p></div> +<div class="apii"><code>GLFWwindowmaximizeEvent = { int type, int maximized }</code></div> +<div class="apidesc"><p>Called when the window is maximized or restored. Type GLFW_WINDOW_MAXIMIZE_EVENT</p></div> +<div class="apii"><code>GLFWwindowiconifyEvent = { int type, int iconified }</code></div> +<div class="apidesc"><p>Called when the window is iconified or restored. Type GLFW_WINDOW_ICONYFY_EVENT</p></div> +<div class="apii"><code>GLFWwindowfocusEvent = { int type, int focused }</code></div> +<div class="apidesc"><p>Called when the window gains or loses input focus. Type GLFW_WINDOW_FOCUS_EVENT</p></div> +<div class="apii"><code>GLFWdropEvent = { int type, int count, string{} paths }</code></div> +<div class="apidesc"><p>Called when files are dropped to the window. Type GLFW_WINDOW_DROP_EVENT</p></div> +<h2 id="input-events">Input events</h2> +<div class="apii"><code>GLFWkeyEvent = { int type, int key, int scancode, int action, int mods }</code></div> +<div class="apidesc"><p>Called when a physical key is pressed or released or when it repeats. Type GLFW_KEY_EVENT</p></div> +<div class="apii"><code>GLFWcharEvent = { int type, int key }</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GLFWmousebuttonEvent = { int type, int button, int action, int mods }</code></div> +<div class="apidesc"><p>Called when a mouse button is pressed or released. Type GLFW_MOUSE_BUTTON_EVENT</p></div> +<div class="apii"><code>GLFWcursorposEvent = { int type, float x, float y }</code></div> +<div class="apidesc"><p>Called when the cursor moves over the window. Type GLFW_MOUSE_CURSOR_POS_EVENT</p></div> +<div class="apii"><code>GLFWscrollEvent = { int type, float xoffset, float yoffset }</code></div> +<div class="apidesc"><p>Called when the user scrolls, whether with a mouse wheel or touchpad gesture. Type GLFW_MOUSE_SCROLL_EVENT</p></div> +<div class="apii"><code>GLFWcursorenterEvent = { int type, int enter }</code></div> +<div class="apidesc"><p>Called when the cursor enters or leaves the content area of a window. Type GLFW_CURSOR_ENTER_EVENT</p></div> +<div class="apii"><code>GLFWjoystickEvent = { int type, int jid, int event }</code></div> +<div class="apidesc"><p>Called when a joystick is connected or disconnected. Type GLFW_JOYSTICK_EVENT</p></div> +<div class="apii"><code>GLFWpentabletdataEvent = { int type, float x, float y, float z, float pressure, float pitch, float yaw, float roll }</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GLFWpentabletcursorEvent = { int type, int identifier }</code></div> +<div class="apidesc"><p>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</p></div> +<div class="apii"><code>GLFWpentabletproximityEvent = { int type, int proxState }</code></div> +<div class="apidesc"><p>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</p></div><div class="footer"><p>ReiLua Enhanced · <a href="https://indrajith.dev">indrajith.dev</a></p></div></div></body></html>
\ No newline at end of file diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 0000000..1c0aa20 --- /dev/null +++ b/docs/style.css @@ -0,0 +1,136 @@ +/* ReiLua Documentation - Lua Manual Style */ + +body { + font-family: Helvetica, Arial, sans-serif; + line-height: 1.6; + color: #000000; + background-color: #FFFFFF; + margin: 0; + padding: 0; +} + +.container { + max-width: 800px; + margin: 0 auto; + padding: 20px; +} + +h1 { + font-size: 24px; + font-weight: normal; + margin: 20px 0 10px 0; + color: #000080; + border-bottom: 1px solid #000080; + padding-bottom: 5px; +} + +h2 { + font-size: 20px; + font-weight: normal; + margin: 20px 0 10px 0; + color: #000080; +} + +h3 { + font-size: 16px; + font-weight: bold; + margin: 15px 0 10px 0; +} + +.navigation { + font-size: 12px; + margin: 10px 0; + padding: 10px; + background-color: #F0F0F0; + border: 1px solid #D0D0D0; +} + +.navigation a { + color: #000080; + text-decoration: none; + margin: 0 5px; +} + +.navigation a:hover { + text-decoration: underline; +} + +a { + color: #000080; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +p { + margin: 10px 0; + text-align: justify; +} + +code, tt { + font-family: "Courier New", Courier, monospace; + font-size: 13px; + background-color: #F5F5F5; + padding: 1px 4px; +} + +pre { + font-family: "Courier New", Courier, monospace; + font-size: 13px; + background-color: #F5F5F5; + border: 1px solid #D0D0D0; + padding: 10px; + overflow-x: auto; + margin: 10px 0; +} + +.apii { + font-family: "Courier New", Courier, monospace; + margin: 15px 0 5px 0; + padding: 8px; + background-color: #F0F0F0; + border-left: 3px solid #000080; +} + +.apii code { + background-color: transparent; + font-weight: bold; +} + +.apidesc { + margin: 5px 0 15px 20px; +} + +ul, ol { + margin: 10px 0; + padding-left: 30px; +} + +table { + border-collapse: collapse; + margin: 10px 0; + width: 100%; +} + +th { + background-color: #F0F0F0; + border: 1px solid #D0D0D0; + padding: 8px; + text-align: left; +} + +td { + border: 1px solid #D0D0D0; + padding: 8px; +} + +.footer { + margin-top: 40px; + padding-top: 10px; + border-top: 1px solid #D0D0D0; + font-size: 11px; + color: #666; + text-align: center; +} |
