From 5784941d669b4597ccbb9321059d78fa908112cc Mon Sep 17 00:00:00 2001 From: Connor O'Connor Date: Sun, 13 Sep 2026 13:54:06 -0400 Subject: [PATCH 1/2] upgrade to raylib 6.0 --- .github/workflows/Tests.yml | 25 +- .gitignore | 16 +- CMakeLists.txt | 13 +- bin/CMakeLists.txt | 9 +- bin/raylib-lua-sol.cpp | 2 +- examples/CMakeLists.txt | 2 +- examples/audio/audio_raw_stream.lua | 4 +- examples/core/core_3d_camera_first_person.lua | 3 +- examples/core/core_3d_camera_free.lua | 3 +- examples/core/core_3d_picking.lua | 9 +- examples/core/core_drop_files.lua | 4 +- examples/core/core_input_gamepad.lua | 4 +- examples/core/core_storage_values.lua | 16 +- examples/core/core_vr_simulator.lua | 3 +- examples/core/core_world_screen.lua | 3 +- examples/models/models_billboard.lua | 3 +- examples/models/models_cubicmap.lua | 3 +- examples/models/models_heightmap.lua | 3 +- examples/models/models_mesh_picking.lua | 61 +- examples/shaders/shaders_custom_uniform.lua | 3 +- examples/shaders/shaders_model_shader.lua | 3 +- examples/shaders/shaders_postprocessing.lua | 3 +- examples/text/text_bmfont_ttf.lua | 4 +- examples/text/text_bmfont_unordered.lua | 4 +- examples/text/text_raylib_fonts.lua | 2 +- examples/text/text_sprite_fonts.lua | 6 +- examples/text/text_ttf_loading.lua | 21 +- .../textures/textures_image_processing.lua | 2 +- examples/textures/textures_raw_data.lua | 2 +- examples/textures/textures_to_image.lua | 4 +- include/raylib-lua-sol-raymath.hpp | 78 ++- include/raylib-lua-sol-rlgl.hpp | 147 +++- include/raylib-lua-sol.hpp | 635 +++++++++++------- tests/raylib-lua-sol-tests.lua | 2 +- vendor/raylib | 2 +- 35 files changed, 682 insertions(+), 422 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index d72237a..1d390aa 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -6,11 +6,13 @@ jobs: build-ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Dependencies - run: sudo apt-get install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev + run: | + sudo apt-get update + sudo apt-get install -y libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libxkbcommon-dev libxinerama-dev libxcursor-dev - name: Configure run: cmake -B build . - name: Build @@ -25,22 +27,17 @@ jobs: fail-fast: false max-parallel: 1 matrix: - compiler: [mingw-w64,msvc16] + compiler: [mingw-w64, msvc] include: - compiler: mingw-w64 - PLATFORM_NAME: "MinGW Makefiles" - - compiler: msvc16 - PLATFORM_NAME: "Visual Studio 16 2019" + platform_name: "MinGW Makefiles" + - compiler: msvc + platform_name: "Visual Studio 17 2022" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive - # Setup Visual Studio - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.0.2 - if: matrix.compiler == 'msvc16' - - name: Configure run: cmake -G "${{ matrix.platform_name }}" -B build_${{ matrix.compiler }} . @@ -51,6 +48,6 @@ jobs: run: build_${{ matrix.compiler }}\bin\raylib-lua-sol.exe tests/raylib-lua-sol-tests.lua if: matrix.compiler == 'mingw-w64' - - name: Test (msvc16) + - name: Test (msvc) run: build_${{ matrix.compiler }}\bin\Release\raylib-lua-sol.exe tests/raylib-lua-sol-tests.lua - if: matrix.compiler == 'msvc16' + if: matrix.compiler == 'msvc' diff --git a/.gitignore b/.gitignore index c795b05..2b72aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,15 @@ -build \ No newline at end of file +# CMake / compiler output +build +/build-*/ +/build_*/ +out/ +cmake-build-*/ +.vs/ + +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +CTestTestfile.cmake +Testing/ +compile_commands.json +CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 466ba82..d97e574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.25) project (raylib-lua-sol - VERSION 0.2.2 + VERSION 0.3.0 DESCRIPTION "Lua bindings for raylib" HOMEPAGE_URL "https://github.com/RobLoach/raylib-lua-sol" LANGUAGES C CXX) @@ -34,11 +34,14 @@ add_subdirectory(include) if (BUILD_BIN) # raylib - find_package(raylib 3.0.0) + find_package(raylib 6.0 QUIET) if (NOT raylib_FOUND) - set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples - set(BUILD_GAMES OFF CACHE BOOL "" FORCE) # or games + # raylib uses the same BUILD_EXAMPLES cache option; keep this project's value. + set(_RAYLIB_LUA_SOL_BUILD_EXAMPLES "${BUILD_EXAMPLES}") + set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) add_subdirectory(vendor/raylib) + set(BUILD_EXAMPLES "${_RAYLIB_LUA_SOL_BUILD_EXAMPLES}" CACHE BOOL "" FORCE) + unset(_RAYLIB_LUA_SOL_BUILD_EXAMPLES) endif() # Lua diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index cbb3c3a..9c86a73 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,12 +1,19 @@ add_executable(raylib-lua-sol raylib-lua-sol.cpp) -target_compile_definitions(raylib-lua-sol PUBLIC -DLUA -DPHYSAC_NO_THREADS) +target_compile_definitions(raylib-lua-sol PUBLIC -DLUA) set_target_properties(raylib-lua-sol PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF ) +# GCC 15+ diagnoses uninstantiated sol2 templates as errors (-Wtemplate-body). +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag(-Wno-template-body HAVE_WNO_TEMPLATE_BODY) +if (HAVE_WNO_TEMPLATE_BODY) + target_compile_options(raylib-lua-sol PRIVATE -Wno-template-body) +endif() + target_link_libraries(raylib-lua-sol raylib-lua-sol-hpp raylib diff --git a/bin/raylib-lua-sol.cpp b/bin/raylib-lua-sol.cpp index cb169e6..d55db50 100644 --- a/bin/raylib-lua-sol.cpp +++ b/bin/raylib-lua-sol.cpp @@ -43,7 +43,7 @@ * 3. This notice may not be removed or altered from any source distribution. * ********************************************************************************************/ -#inclde +#include #include #include diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 779fdac..9b8ca5f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,5 @@ # Get the sources together -set(example_dirs audio core models shaders text textures) +set(example_dirs audio core models shaders shapes text textures) set(example_sources) set(example_resources) diff --git a/examples/audio/audio_raw_stream.lua b/examples/audio/audio_raw_stream.lua index 070984f..f80e1d2 100644 --- a/examples/audio/audio_raw_stream.lua +++ b/examples/audio/audio_raw_stream.lua @@ -24,7 +24,7 @@ InitWindow(screenWidth, screenHeight, "raylib [audio] example - raw audio stream InitAudioDevice() -- Initialize audio device -- Init raw audio stream (sample rate: 22050, sample size: 32bit-float, channels: 1-mono) -local stream = InitAudioStream(22050, 32, 1) +local stream = LoadAudioStream(22050, 32, 1) -- Fill audio stream with some samples (sine wave) local data = {} @@ -89,7 +89,7 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -CloseAudioStream(stream) -- Close raw audio stream and delete buffers from RAM +UnloadAudioStream(stream) -- Close raw audio stream and delete buffers from RAM CloseAudioDevice() -- Close audio device (music streaming is automatically stopped) diff --git a/examples/core/core_3d_camera_first_person.lua b/examples/core/core_3d_camera_first_person.lua index 81055c8..abb35ff 100644 --- a/examples/core/core_3d_camera_first_person.lua +++ b/examples/core/core_3d_camera_first_person.lua @@ -34,7 +34,6 @@ end local playerPosition = Vector3(4.0, 2.0, 4.0) -- Define player position -SetCameraMode(camera, CAMERA_FIRST_PERSON) -- Set a first person camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -43,7 +42,7 @@ SetTargetFPS(60) -- Set our game to run at 60 while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_FIRST_PERSON) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/core/core_3d_camera_free.lua b/examples/core/core_3d_camera_free.lua index 938ee15..b8fa96f 100644 --- a/examples/core/core_3d_camera_free.lua +++ b/examples/core/core_3d_camera_free.lua @@ -25,7 +25,6 @@ camera.fovy = 45.0 -- Camera field-of-view Y local cubePosition = Vector3(0.0, 0.0, 0.0) -SetCameraMode(camera, CAMERA_FREE) -- Set a free camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -34,7 +33,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_FREE) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/core/core_3d_picking.lua b/examples/core/core_3d_picking.lua index a436095..bd2a35c 100644 --- a/examples/core/core_3d_picking.lua +++ b/examples/core/core_3d_picking.lua @@ -30,7 +30,6 @@ local ray = Ray() -- Picking line ray local collision = false -SetCameraMode(camera, CAMERA_FREE) -- Set a free camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -39,16 +38,16 @@ SetTargetFPS(60) -- Set our game to run at 60 frames- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_FREE) -- Update camera if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) then -- NOTE: This function is NOT WORKING properly! - ray = GetMouseRay(GetMousePosition(), camera) + ray = GetScreenToWorldRay(GetMousePosition(), camera) -- Check collision between ray and box - collision = CheckCollisionRayBox(ray, + collision = GetRayCollisionBox(ray, BoundingBox(Vector3(cubePosition.x - cubeSize.x/2, cubePosition.y - cubeSize.y/2, cubePosition.z - cubeSize.z/2), - Vector3(cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2))) + Vector3(cubePosition.x + cubeSize.x/2, cubePosition.y + cubeSize.y/2, cubePosition.z + cubeSize.z/2))).hit --print("collision check:", collision) end diff --git a/examples/core/core_drop_files.lua b/examples/core/core_drop_files.lua index 1d27e61..eea6d26 100644 --- a/examples/core/core_drop_files.lua +++ b/examples/core/core_drop_files.lua @@ -29,7 +29,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- if (IsFileDropped()) then - droppedFiles = GetDroppedFiles() + droppedFiles = LoadDroppedFiles() count = #droppedFiles end --------------------------------------------------------------------------------------- @@ -60,7 +60,5 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -ClearDroppedFiles() -- Clear internal buffers - CloseWindow() -- Close window and OpenGL context ------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/examples/core/core_input_gamepad.lua b/examples/core/core_input_gamepad.lua index ade3f00..28d26d4 100644 --- a/examples/core/core_input_gamepad.lua +++ b/examples/core/core_input_gamepad.lua @@ -41,7 +41,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC key if (IsGamepadAvailable(GAMEPAD.PLAYER1)) then DrawText(string.format("GP1: %s", GetGamepadName(GAMEPAD.PLAYER1)), 10, 10, 10, BLACK) - if (IsGamepadName(GAMEPAD.PLAYER1, "Xbox 360 Controller")) then + if (GetGamepadName(GAMEPAD.PLAYER1) == "Xbox 360 Controller") then DrawTexture(texXboxPad, 0, 0, DARKGRAY) -- Draw buttons: xbox home @@ -87,7 +87,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC key --DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_LT)), 10, 40, 10, BLACK) --DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD.PLAYER1, GAMEPAD.XBOX_AXIS_RT)), 10, 60, 10, BLACK) - elseif (IsGamepadName(GAMEPAD.PLAYER1, "PLAYSTATION(R)3 Controller")) then + elseif (GetGamepadName(GAMEPAD.PLAYER1) == "PLAYSTATION(R)3 Controller") then DrawTexture(texPs3Pad, 0, 0, DARKGRAY) -- Draw buttons: ps diff --git a/examples/core/core_storage_values.lua b/examples/core/core_storage_values.lua index 0bbe82f..c7c4c76 100644 --- a/examples/core/core_storage_values.lua +++ b/examples/core/core_storage_values.lua @@ -9,9 +9,7 @@ -- ------------------------------------------------------------------------------------------- --- NOTE: Storage positions must start with 0, directly related to file memory layout -STORAGE_SCORE = 0 -STORAGE_HISCORE = 1 +local STORAGE_FILE = "storage.data" -- Initialization ------------------------------------------------------------------------------------------- @@ -38,12 +36,14 @@ while not WindowShouldClose() do -- Detect window close button or ESC key end if (IsKeyPressed(KEY_ENTER)) then - StorageSaveValue(STORAGE_SCORE, score) - StorageSaveValue(STORAGE_HISCORE, hiscore) + SaveFileText(STORAGE_FILE, string.format("%d\n%d", score, hiscore)) elseif (IsKeyPressed(KEY_SPACE)) then - -- NOTE: If requested position could not be found, value 0 is returned - score = StorageLoadValue(STORAGE_SCORE) - hiscore = StorageLoadValue(STORAGE_HISCORE) + if FileExists(STORAGE_FILE) then + local text = LoadFileText(STORAGE_FILE) + local loadedScore, loadedHiscore = string.match(text, "(%-?%d+)\n(%-?%d+)") + score = tonumber(loadedScore) or 0 + hiscore = tonumber(loadedHiscore) or 0 + end end framesCounter = framesCounter + 1 diff --git a/examples/core/core_vr_simulator.lua b/examples/core/core_vr_simulator.lua index 5ff1ac4..ee7de18 100644 --- a/examples/core/core_vr_simulator.lua +++ b/examples/core/core_vr_simulator.lua @@ -32,7 +32,6 @@ camera.fovy = 60.0 -- Camera field-of-view Y local cubePosition = Vector3(0.0, 0.0, 0.0) -SetCameraMode(CAMERA_FIRST_PERSON); -- Set first person camera mode SetTargetFPS(90) -- Set our game to run at 90 frames-per-second ---------------------------------------------------------------------------------------- @@ -41,7 +40,7 @@ SetTargetFPS(90) -- Set our game to run at 90 frames-per-seco while not WindowShouldClose() do -- Detect window close button or ESC key -- Update ------------------------------------------------------------------------------------ - UpdateCamera(camera); -- Update camera (simulator mode) + UpdateCamera(camera, CAMERA_FIRST_PERSON); -- Update camera (simulator mode) if (IsKeyPressed(KEY_SPACE)) then ToggleVrMode() end -- Toggle VR mode ------------------------------------------------------------------------------------ diff --git a/examples/core/core_world_screen.lua b/examples/core/core_world_screen.lua index bdb3ee5..3f91787 100644 --- a/examples/core/core_world_screen.lua +++ b/examples/core/core_world_screen.lua @@ -21,7 +21,6 @@ local camera = Camera(Vector3(10.0, 10.0, 10.0), Vector3(), Vector3(0.0, 1.0, 0. local cubePosition = Vector3() -SetCameraMode(camera, CAMERA_FREE) -- Set a free camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ---------------------------------------------------------------------------------------- @@ -30,7 +29,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames-per- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update ------------------------------------------------------------------------------------ - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_FREE) -- Update camera -- Calculate cube screen space position (with a little offset to be in top) local cubeScreenPosition = GetWorldToScreen(Vector3(cubePosition.x, cubePosition.y + 2.5, cubePosition.z), camera) diff --git a/examples/models/models_billboard.lua b/examples/models/models_billboard.lua index c62cf29..cb61d2b 100644 --- a/examples/models/models_billboard.lua +++ b/examples/models/models_billboard.lua @@ -22,7 +22,6 @@ local camera = Camera(Vector3(5.0, 4.0, 5.0), Vector3(0.0, 2.0, 0.0), Vector3(0. local bill = LoadTexture("resources/billboard.png") -- Our texture billboard local billPosition = Vector3(0.0, 2.0, 0.0) -- Position where draw billboard -SetCameraMode(camera, CAMERA_ORBITAL) -- Set an orbital camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -31,7 +30,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_ORBITAL) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/models/models_cubicmap.lua b/examples/models/models_cubicmap.lua index 42927b8..507452d 100644 --- a/examples/models/models_cubicmap.lua +++ b/examples/models/models_cubicmap.lua @@ -31,7 +31,6 @@ local mapPosition = Vector3(-16.0, 0.0, -8.0) -- Set model position UnloadImage(image) -- Unload cubesmap image from RAM, already uploaded to VRAM -SetCameraMode(camera, CAMERA_ORBITAL) -- Set an orbital camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -40,7 +39,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_ORBITAL) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/models/models_heightmap.lua b/examples/models/models_heightmap.lua index b44e572..e9d6e3c 100644 --- a/examples/models/models_heightmap.lua +++ b/examples/models/models_heightmap.lua @@ -27,7 +27,6 @@ local mapPosition = Vector3(-8.0, 0.0, -8.0) -- Set model position (d UnloadImage(image) -- Unload heightmap image from RAM, already uploaded to VRAM -SetCameraMode(camera, CAMERA_ORBITAL) -- Set an orbital camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ---------------------------------------------------------------------------------------- @@ -36,7 +35,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_ORBITAL) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/models/models_mesh_picking.lua b/examples/models/models_mesh_picking.lua index 5069f64..56cf87d 100644 --- a/examples/models/models_mesh_picking.lua +++ b/examples/models/models_mesh_picking.lua @@ -24,9 +24,8 @@ local ray = Ray() local tower = LoadModel("resources/tower.obj") -- Load OBJ model local texture = LoadTexture("resources/tower.png") -- Load model texture -dwarf.material.texDiffuse = texture -- Set dwarf model diffuse texture local towerPos = Vector3(0.0, 0.0, 0.0) -- Set model position -local towerBBox = CalculateBoundingBox(tower.mesh) -- Calculate model bounding box +local towerBBox = GetModelBoundingBox(tower) -- Calculate model bounding box local hitMeshBBox = false local hitTriangle = false @@ -38,7 +37,6 @@ local tc = Vector3(-8.0, 6.5, 0.0) local bary = Vector3(0.0, 0.0, 0.0) -SetCameraMode(camera, CAMERA_FREE) -- Set a free camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -47,20 +45,24 @@ SetTargetFPS(60) -- Set our game to run at 60 frames-per-second while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_FREE) -- Update camera -- Display information about closest hit - local nearestHit = RayHitInfo() + local nearestHit = RayCollision() local hitObjectName = "None" - nearestHit.distance = 100000; -- Very far distance... + nearestHit.distance = 100000 -- Very far distance... nearestHit.hit = false cursorColor = WHITE -- Get ray and test against ground, triangle, and mesh - ray = GetMouseRay(GetMousePosition(), camera) + ray = GetScreenToWorldRay(GetMousePosition(), camera) - -- Check ray collision aginst ground plane - local groundHitInfo = GetCollisionRayGround(ray, 0.0) + -- Check ray collision against ground plane + local groundHitInfo = GetRayCollisionQuad(ray, + Vector3(-1000.0, 0.0, -1000.0), + Vector3(-1000.0, 0.0, 1000.0), + Vector3(1000.0, 0.0, 1000.0), + Vector3(1000.0, 0.0, -1000.0)) if ((groundHitInfo.hit) and (groundHitInfo.distance < nearestHit.distance)) then nearestHit = groundHitInfo @@ -69,37 +71,34 @@ while not WindowShouldClose() do -- Detect window close button or ESC end -- Check ray collision against test triangle - local triHitInfo = GetCollisionRayTriangle(ray, ta, tb, tc) + local triHitInfo = GetRayCollisionTriangle(ray, ta, tb, tc) if ((triHitInfo.hit) and (triHitInfo.distance < nearestHit.distance)) then nearestHit = triHitInfo cursorColor = PURPLE hitObjectName = "Triangle" - bary = VectorBarycenter(nearestHit.hitPosition, ta, tb, tc) + bary = Vector3Barycenter(nearestHit.point, ta, tb, tc) hitTriangle = true else hitTriangle = false end - local meshHitInfo = RayHitInfo() + local meshHitInfo = RayCollision() -- Check ray collision against bounding box first, before trying the full ray-mesh test - if (CheckCollisionRayBox(ray, towerBBox)) then + meshHitInfo = GetRayCollisionBox(ray, towerBBox) + if (meshHitInfo.hit) then hitMeshBBox = true - -- Check ray collision against mesh - meshHitInfo = GetCollisionRayMesh(ray, tower.mesh) - if ((meshHitInfo.hit) and (meshHitInfo.distance < nearestHit.distance)) then nearestHit = meshHitInfo cursorColor = ORANGE hitObjectName = "Mesh" end - + else + hitMeshBBox = false end - - hitMeshBBox = false --------------------------------------------------------------------------------------- -- Draw @@ -123,15 +122,15 @@ while not WindowShouldClose() do -- Detect window close button or ESC -- If we hit something, draw the cursor at the hit point if (nearestHit.hit) then - DrawCube(nearestHit.hitPosition, 0.5, 0.5, 0.5, cursorColor) - DrawCubeWires(nearestHit.hitPosition, 0.5, 0.5, 0.5, YELLOW) + DrawCube(nearestHit.point, 0.5, 0.5, 0.5, cursorColor) + DrawCubeWires(nearestHit.point, 0.5, 0.5, 0.5, YELLOW) normalEnd = Vector3(0, 0, 0) - normalEnd.x = nearestHit.hitPosition.x + nearestHit.hitNormal.x - normalEnd.y = nearestHit.hitPosition.y + nearestHit.hitNormal.y - normalEnd.z = nearestHit.hitPosition.z + nearestHit.hitNormal.z + normalEnd.x = nearestHit.point.x + nearestHit.normal.x + normalEnd.y = nearestHit.point.y + nearestHit.normal.y + normalEnd.z = nearestHit.point.z + nearestHit.normal.z - DrawLine3D(nearestHit.hitPosition, normalEnd, YELLOW) + DrawLine3D(nearestHit.point, normalEnd, YELLOW) end DrawRay(ray, MAROON) @@ -148,13 +147,13 @@ while not WindowShouldClose() do -- Detect window close button or ESC DrawText(string.format("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK) DrawText(string.format("Hit Pos: %3.2f %3.2f %3.2f", - nearestHit.hitPosition.x, - nearestHit.hitPosition.y, - nearestHit.hitPosition.z), 10, ypos + 15, 10, BLACK) + nearestHit.point.x, + nearestHit.point.y, + nearestHit.point.z), 10, ypos + 15, 10, BLACK) DrawText(string.format("Hit Norm: %3.2f %3.2f %3.2f", - nearestHit.hitNormal.x, - nearestHit.hitNormal.y, - nearestHit.hitNormal.z), 10, ypos + 30, 10, BLACK) + nearestHit.normal.x, + nearestHit.normal.y, + nearestHit.normal.z), 10, ypos + 30, 10, BLACK) if (hitTriangle) then DrawText(string.format("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK) end end diff --git a/examples/shaders/shaders_custom_uniform.lua b/examples/shaders/shaders_custom_uniform.lua index 7dd9844..072dc34 100644 --- a/examples/shaders/shaders_custom_uniform.lua +++ b/examples/shaders/shaders_custom_uniform.lua @@ -47,7 +47,6 @@ local swirlCenter = { screenWidth/2, screenHeight/2 } local target = LoadRenderTexture(screenWidth, screenHeight) -- Setup orbital camera -SetCameraMode(camera, CAMERA_ORBITAL) -- Set an orbital camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -64,7 +63,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC -- Send new value to the shader to be used on drawing SetShaderValue(shader, swirlCenterLoc, swirlCenter) - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_ORBITAL) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/shaders/shaders_model_shader.lua b/examples/shaders/shaders_model_shader.lua index 4f48c81..dd82f20 100644 --- a/examples/shaders/shaders_model_shader.lua +++ b/examples/shaders/shaders_model_shader.lua @@ -39,7 +39,6 @@ dwarf.material.texDiffuse = texture -- Bind texture to model local position = Vector3(0.0, 0.0, 0.0) -- Set model position -- Setup orbital camera -SetCameraMode(camera, CAMERA_ORBITAL) -- Set an orbital camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -48,7 +47,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames-pe while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_ORBITAL) -- Update camera --------------------------------------------------------------------------------------- -- Draw diff --git a/examples/shaders/shaders_postprocessing.lua b/examples/shaders/shaders_postprocessing.lua index f357bb9..185b12b 100644 --- a/examples/shaders/shaders_postprocessing.lua +++ b/examples/shaders/shaders_postprocessing.lua @@ -91,7 +91,6 @@ local currentShader = FX_GRAYSCALE; local target = LoadRenderTexture(screenWidth, screenHeight) -- Setup orbital camera -SetCameraMode(camera, CAMERA_ORBITAL) -- Set an orbital camera mode SetTargetFPS(60) -- Set our game to run at 60 frames-per-second ------------------------------------------------------------------------------------------- @@ -100,7 +99,7 @@ SetTargetFPS(60) -- Set our game to run at 60 frames- while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- - UpdateCamera(camera) -- Update camera + UpdateCamera(camera, CAMERA_ORBITAL) -- Update camera if (IsKeyPressed(KEY_RIGHT)) then currentShader = currentShader + 1 elseif (IsKeyPressed(KEY_LEFT)) then currentShader = currentShader - 1 end diff --git a/examples/text/text_bmfont_ttf.lua b/examples/text/text_bmfont_ttf.lua index e776959..5a7510f 100644 --- a/examples/text/text_bmfont_ttf.lua +++ b/examples/text/text_bmfont_ttf.lua @@ -52,8 +52,8 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -UnloadSpriteFont(fontBm) -- AngelCode SpriteFont unloading -UnloadSpriteFont(fontTtf) -- TTF SpriteFont unloading +UnloadFont(fontBm) -- AngelCode Font unloading +UnloadFont(fontTtf) -- TTF Font unloading CloseWindow() -- Close window and OpenGL context ------------------------------------------------------------------------------------------- diff --git a/examples/text/text_bmfont_unordered.lua b/examples/text/text_bmfont_unordered.lua index 1216fb4..85f0f8c 100644 --- a/examples/text/text_bmfont_unordered.lua +++ b/examples/text/text_bmfont_unordered.lua @@ -41,7 +41,7 @@ while not WindowShouldClose() do -- Detect window close button or ESC DrawText("Font name: PixAntiqua", 40, 50, 20, GRAY) DrawText(string.format("Font base size: %i", font.baseSize), 40, 80, 20, GRAY) - DrawText(string.format("Font chars number: %i", font.charsCount), 40, 110, 20, GRAY) + DrawText(string.format("Font chars number: %i", font.glyphCount), 40, 110, 20, GRAY) DrawTextEx(font, msg, Vector2(40, 180), font.baseSize, 0, MAROON) @@ -51,7 +51,7 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -UnloadSpriteFont(font) -- AngelCode SpriteFont unloading +UnloadFont(font) -- AngelCode Font unloading CloseWindow() -- Close window and OpenGL context ------------------------------------------------------------------------------------------- diff --git a/examples/text/text_raylib_fonts.lua b/examples/text/text_raylib_fonts.lua index 593d0a9..4b60e36 100644 --- a/examples/text/text_raylib_fonts.lua +++ b/examples/text/text_raylib_fonts.lua @@ -86,7 +86,7 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -for i = 1, 8 do UnloadSpriteFont(fonts[i]) end -- SpriteFont unloading +for i = 1, 8 do UnloadFont(fonts[i]) end -- Font unloading CloseWindow() -- Close window and OpenGL context ------------------------------------------------------------------------------------------- diff --git a/examples/text/text_sprite_fonts.lua b/examples/text/text_sprite_fonts.lua index 5d614f4..9d0ab9a 100644 --- a/examples/text/text_sprite_fonts.lua +++ b/examples/text/text_sprite_fonts.lua @@ -64,9 +64,9 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -UnloadSpriteFont(font1) -- SpriteFont unloading -UnloadSpriteFont(font2) -- SpriteFont unloading -UnloadSpriteFont(font3) -- SpriteFont unloading +UnloadFont(font1) -- Font unloading +UnloadFont(font2) -- Font unloading +UnloadFont(font3) -- Font unloading CloseWindow() -- Close window and OpenGL context ------------------------------------------------------------------------------------------- diff --git a/examples/text/text_ttf_loading.lua b/examples/text/text_ttf_loading.lua index a146453..b4ae20b 100644 --- a/examples/text/text_ttf_loading.lua +++ b/examples/text/text_ttf_loading.lua @@ -31,8 +31,8 @@ local fontSize = font.baseSize local fontPosition = Vector2(40, screenHeight/2 + 50) local textSize -SetTextureFilter(font.texture, FILTER_POINT) -local currentFontFilter = 0 -- Default: FILTER_POINT +SetTextureFilter(font.texture, TEXTURE_FILTER_POINT) +local currentFontFilter = 0 -- Default: TEXTURE_FILTER_POINT local count = 0 local droppedFiles @@ -48,14 +48,14 @@ while not WindowShouldClose() do -- Detect window close button or ESC -- Choose font texture filter method if (IsKeyPressed(KEY_ONE)) then - SetTextureFilter(font.texture, FILTER_POINT) + SetTextureFilter(font.texture, TEXTURE_FILTER_POINT) currentFontFilter = 0 elseif (IsKeyPressed(KEY_TWO)) then - SetTextureFilter(font.texture, FILTER_BILINEAR) + SetTextureFilter(font.texture, TEXTURE_FILTER_BILINEAR) currentFontFilter = 1 elseif (IsKeyPressed(KEY_THREE)) then -- NOTE: Trilinear filter won't be noticed on 2D drawing - SetTextureFilter(font.texture, FILTER_TRILINEAR) + SetTextureFilter(font.texture, TEXTURE_FILTER_TRILINEAR) currentFontFilter = 2 end @@ -67,13 +67,12 @@ while not WindowShouldClose() do -- Detect window close button or ESC -- Load a dropped TTF file dynamically (at current fontSize) if (IsFileDropped()) then - droppedFiles = GetDroppedFiles() + droppedFiles = LoadDroppedFiles() count = #droppedFiles if (count == 1) then -- Only support one ttf file dropped - UnloadSpriteFont(font) - font = LoadFontTTF(droppedFiles[1], fontSize, 0, 0) - ClearDroppedFiles() + UnloadFont(font) + font = LoadFontEx(droppedFiles[1], fontSize) end end --------------------------------------------------------------------------------------- @@ -110,9 +109,7 @@ end -- De-Initialization ------------------------------------------------------------------------------------------- -UnloadSpriteFont(font) -- SpriteFont unloading - -ClearDroppedFiles() -- Clear internal buffers +UnloadFont(font) -- Font unloading CloseWindow() -- Close window and OpenGL context ------------------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_processing.lua b/examples/textures/textures_image_processing.lua index b127c4a..33d0fb5 100644 --- a/examples/textures/textures_image_processing.lua +++ b/examples/textures/textures_image_processing.lua @@ -46,7 +46,7 @@ InitWindow(screenWidth, screenHeight, "raylib [textures] example - image process -- NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) local image = LoadImage("resources/parrots.png") -- Loaded in CPU memory (RAM) -image = ImageFormat(image, UNCOMPRESSED_R8G8B8A8) -- Format image to RGBA 32bit (required for texture update) +ImageFormat(image, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8) -- Format image to RGBA 32bit (required for texture update) local texture = LoadTextureFromImage(image) -- Image converted to texture, GPU memory (VRAM) local currentProcess = COLOR_NONE diff --git a/examples/textures/textures_raw_data.lua b/examples/textures/textures_raw_data.lua index 75615b0..269e571 100644 --- a/examples/textures/textures_raw_data.lua +++ b/examples/textures/textures_raw_data.lua @@ -23,7 +23,7 @@ InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture from -- NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) -- Load RAW image data (512x512, 32bit RGBA, no file header) -local fudesumiRaw = LoadImageRaw("resources/fudesumi.raw", 384, 512, TextureFormat.UNCOMPRESSED_R8G8B8A8, 0) +local fudesumiRaw = LoadImageRaw("resources/fudesumi.raw", 384, 512, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 0) local fudesumi = LoadTextureFromImage(fudesumiRaw) -- Upload CPU (RAM) image to GPU (VRAM) UnloadImage(fudesumiRaw) -- Unload CPU (RAM) image data diff --git a/examples/textures/textures_to_image.lua b/examples/textures/textures_to_image.lua index 2987420..21528c9 100644 --- a/examples/textures/textures_to_image.lua +++ b/examples/textures/textures_to_image.lua @@ -1,6 +1,6 @@ ------------------------------------------------------------------------------------------- -- --- raylib [textures] example - Retrieve image data from texture: GetTextureData() +-- raylib [textures] example - Retrieve image data from texture: LoadImageFromTexture() -- -- NOTE: Images are loaded in CPU memory (RAM) textures are loaded in GPU memory (VRAM) -- @@ -24,7 +24,7 @@ local image = LoadImage("resources/raylib_logo.png") -- Load image data into CP local texture = LoadTextureFromImage(image) -- Image converted to texture, GPU memory (RAM -> VRAM) UnloadImage(image) -- Unload image data from CPU memory (RAM) -image = GetTextureData(texture) -- Retrieve image data from GPU memory (VRAM -> RAM) +image = LoadImageFromTexture(texture) -- Retrieve image data from GPU memory (VRAM -> RAM) UnloadTexture(texture) -- Unload texture from GPU memory (VRAM) texture = LoadTextureFromImage(image) -- Recreate texture from retrieved image data (RAM -> VRAM) diff --git a/include/raylib-lua-sol-raymath.hpp b/include/raylib-lua-sol-raymath.hpp index 7ba46fb..d4ef824 100644 --- a/include/raylib-lua-sol-raymath.hpp +++ b/include/raylib-lua-sol-raymath.hpp @@ -1,19 +1,20 @@ #ifndef RAYLIB_LUA_SOL_RAYMATH_ #define RAYLIB_LUA_SOL_RAYMATH_ +#define RAYMATH_DISABLE_CPP_OPERATORS + #include "raylib.h" #include "sol/sol.hpp" #include "raymath.h" void raylib_lua_sol_raymath(sol::state& lua) { - lua.set_function("Clamp", Clamp); lua.set_function("Lerp", Lerp); lua.set_function("Normalize", Normalize); lua.set_function("Remap", Remap); - //lua.set_function("Wrap", Wrap); - //lua.set_function("FloatEquals", FloatEquals); + lua.set_function("Wrap", Wrap); + lua.set_function("FloatEquals", FloatEquals); lua.set_function("Vector2Zero", Vector2Zero); lua.set_function("Vector2One", Vector2One); @@ -24,23 +25,28 @@ void raylib_lua_sol_raymath(sol::state& lua) { lua.set_function("Vector2Length", Vector2Length); lua.set_function("Vector2LengthSqr", Vector2LengthSqr); lua.set_function("Vector2DotProduct", Vector2DotProduct); + lua.set_function("Vector2CrossProduct", Vector2CrossProduct); lua.set_function("Vector2Distance", Vector2Distance); - //lua.set_function("Vector2DistanceSqr", Vector2DistanceSqr); + lua.set_function("Vector2DistanceSqr", Vector2DistanceSqr); lua.set_function("Vector2Angle", Vector2Angle); + lua.set_function("Vector2LineAngle", Vector2LineAngle); lua.set_function("Vector2Scale", Vector2Scale); lua.set_function("Vector2Multiply", Vector2Multiply); lua.set_function("Vector2Negate", Vector2Negate); lua.set_function("Vector2Divide", Vector2Divide); lua.set_function("Vector2Normalize", Vector2Normalize); - //lua.set_function("Vector2Transform", Vector2Transform); + lua.set_function("Vector2Transform", Vector2Transform); lua.set_function("Vector2Lerp", Vector2Lerp); lua.set_function("Vector2Reflect", Vector2Reflect); + lua.set_function("Vector2Min", Vector2Min); + lua.set_function("Vector2Max", Vector2Max); lua.set_function("Vector2Rotate", Vector2Rotate); lua.set_function("Vector2MoveTowards", Vector2MoveTowards); - //lua.set_function("Vector2Invert", Vector2Invert); - //lua.set_function("Vector2Clamp", Vector2Clamp); - //lua.set_function("Vector2ClampValue", Vector2ClampValue); - //lua.set_function("Vector2Equals", Vector2Equals); + lua.set_function("Vector2Invert", Vector2Invert); + lua.set_function("Vector2Clamp", Vector2Clamp); + lua.set_function("Vector2ClampValue", Vector2ClampValue); + lua.set_function("Vector2Equals", Vector2Equals); + lua.set_function("Vector2Refract", Vector2Refract); lua.set_function("Vector3Zero", Vector3Zero); lua.set_function("Vector3One", Vector3One); @@ -56,27 +62,52 @@ void raylib_lua_sol_raymath(sol::state& lua) { lua.set_function("Vector3LengthSqr", Vector3LengthSqr); lua.set_function("Vector3DotProduct", Vector3DotProduct); lua.set_function("Vector3Distance", Vector3Distance); - //lua.set_function("Vector3DistanceSqr", Vector3DistanceSqr); - //lua.set_function("Vector3Angle", Vector3Angle); + lua.set_function("Vector3DistanceSqr", Vector3DistanceSqr); + lua.set_function("Vector3Angle", Vector3Angle); lua.set_function("Vector3Negate", Vector3Negate); lua.set_function("Vector3Divide", Vector3Divide); lua.set_function("Vector3Normalize", Vector3Normalize); - lua.set_function("Vector3OrthoNormalize", Vector3OrthoNormalize); + lua.set_function("Vector3Project", Vector3Project); + lua.set_function("Vector3Reject", Vector3Reject); lua.set_function("Vector3Transform", Vector3Transform); lua.set_function("Vector3RotateByQuaternion", Vector3RotateByQuaternion); - //lua.set_function("Vector3RotateByAxisAngle", Vector3RotateByAxisAngle); + lua.set_function("Vector3RotateByAxisAngle", Vector3RotateByAxisAngle); + lua.set_function("Vector3MoveTowards", Vector3MoveTowards); lua.set_function("Vector3Lerp", Vector3Lerp); + lua.set_function("Vector3CubicHermite", Vector3CubicHermite); lua.set_function("Vector3Reflect", Vector3Reflect); lua.set_function("Vector3Min", Vector3Min); lua.set_function("Vector3Max", Vector3Max); lua.set_function("Vector3Barycenter", Vector3Barycenter); lua.set_function("Vector3Unproject", Vector3Unproject); - lua.set_function("Vector3ToFloatV", Vector3ToFloatV); - //lua.set_function("Vector3Invert", Vector3Invert); - //lua.set_function("Vector3Clamp", Vector3Clamp); - //lua.set_function("Vector3ClampValue", Vector3ClampValue); - //lua.set_function("Vector3Equals", Vector3Equals); - //lua.set_function("Vector3Refract", Vector3Refract); + lua.set_function("Vector3Invert", Vector3Invert); + lua.set_function("Vector3Clamp", Vector3Clamp); + lua.set_function("Vector3ClampValue", Vector3ClampValue); + lua.set_function("Vector3Equals", Vector3Equals); + lua.set_function("Vector3Refract", Vector3Refract); + + lua.set_function("Vector4Zero", Vector4Zero); + lua.set_function("Vector4One", Vector4One); + lua.set_function("Vector4Add", Vector4Add); + lua.set_function("Vector4AddValue", Vector4AddValue); + lua.set_function("Vector4Subtract", Vector4Subtract); + lua.set_function("Vector4SubtractValue", Vector4SubtractValue); + lua.set_function("Vector4Length", Vector4Length); + lua.set_function("Vector4LengthSqr", Vector4LengthSqr); + lua.set_function("Vector4DotProduct", Vector4DotProduct); + lua.set_function("Vector4Distance", Vector4Distance); + lua.set_function("Vector4DistanceSqr", Vector4DistanceSqr); + lua.set_function("Vector4Scale", Vector4Scale); + lua.set_function("Vector4Multiply", Vector4Multiply); + lua.set_function("Vector4Negate", Vector4Negate); + lua.set_function("Vector4Divide", Vector4Divide); + lua.set_function("Vector4Normalize", Vector4Normalize); + lua.set_function("Vector4Min", Vector4Min); + lua.set_function("Vector4Max", Vector4Max); + lua.set_function("Vector4Lerp", Vector4Lerp); + lua.set_function("Vector4MoveTowards", Vector4MoveTowards); + lua.set_function("Vector4Invert", Vector4Invert); + lua.set_function("Vector4Equals", Vector4Equals); lua.set_function("MatrixDeterminant", MatrixDeterminant); lua.set_function("MatrixTrace", MatrixTrace); @@ -86,6 +117,7 @@ void raylib_lua_sol_raymath(sol::state& lua) { lua.set_function("MatrixAdd", MatrixAdd); lua.set_function("MatrixSubtract", MatrixSubtract); lua.set_function("MatrixMultiply", MatrixMultiply); + lua.set_function("MatrixMultiplyValue", MatrixMultiplyValue); lua.set_function("MatrixTranslate", MatrixTranslate); lua.set_function("MatrixRotate", MatrixRotate); lua.set_function("MatrixRotateX", MatrixRotateX); @@ -98,7 +130,7 @@ void raylib_lua_sol_raymath(sol::state& lua) { lua.set_function("MatrixPerspective", MatrixPerspective); lua.set_function("MatrixOrtho", MatrixOrtho); lua.set_function("MatrixLookAt", MatrixLookAt); - lua.set_function("MatrixToFloatV", MatrixToFloatV); + lua.set_function("MatrixCompose", MatrixCompose); lua.set_function("QuaternionAdd", QuaternionAdd); lua.set_function("QuaternionAddValue", QuaternionAddValue); @@ -114,15 +146,15 @@ void raylib_lua_sol_raymath(sol::state& lua) { lua.set_function("QuaternionLerp", QuaternionLerp); lua.set_function("QuaternionNlerp", QuaternionNlerp); lua.set_function("QuaternionSlerp", QuaternionSlerp); + lua.set_function("QuaternionCubicHermiteSpline", QuaternionCubicHermiteSpline); lua.set_function("QuaternionFromVector3ToVector3", QuaternionFromVector3ToVector3); lua.set_function("QuaternionFromMatrix", QuaternionFromMatrix); lua.set_function("QuaternionToMatrix", QuaternionToMatrix); lua.set_function("QuaternionFromAxisAngle", QuaternionFromAxisAngle); - lua.set_function("QuaternionToAxisAngle", QuaternionToAxisAngle); lua.set_function("QuaternionFromEuler", QuaternionFromEuler); lua.set_function("QuaternionToEuler", QuaternionToEuler); lua.set_function("QuaternionTransform", QuaternionTransform); - //lua.set_function("QuaternionEquals", QuaternionEquals); + lua.set_function("QuaternionEquals", QuaternionEquals); } -#endif \ No newline at end of file +#endif diff --git a/include/raylib-lua-sol-rlgl.hpp b/include/raylib-lua-sol-rlgl.hpp index 04a280d..af5dfaf 100644 --- a/include/raylib-lua-sol-rlgl.hpp +++ b/include/raylib-lua-sol-rlgl.hpp @@ -6,15 +6,18 @@ #include "rlgl.h" +#ifndef RAYLIB_LUA_SOL_ADD_ENUM +#define RAYLIB_LUA_SOL_ADD_ENUM(x) \ + lua[#x] = x +#endif + void raylib_lua_sol_rlgl(sol::state& lua) { - lua["DEFAULT_BATCH_BUFFER_ELEMENTS"] = DEFAULT_BATCH_BUFFER_ELEMENTS; - lua["DEFAULT_BATCH_BUFFERS"] = DEFAULT_BATCH_BUFFERS; - lua["DEFAULT_BATCH_DRAWCALLS"] = DEFAULT_BATCH_DRAWCALLS; - lua["MAX_BATCH_ACTIVE_TEXTURES"] = MAX_BATCH_ACTIVE_TEXTURES; - lua["MAX_MATRIX_STACK_SIZE"] = MAX_MATRIX_STACK_SIZE; - lua["MAX_MESH_VERTEX_BUFFERS"] = MAX_MESH_VERTEX_BUFFERS; - lua["MAX_SHADER_LOCATIONS"] = MAX_SHADER_LOCATIONS; - lua["MAX_MATERIAL_MAPS"] = MAX_MATERIAL_MAPS; + lua["RL_DEFAULT_BATCH_BUFFER_ELEMENTS"] = RL_DEFAULT_BATCH_BUFFER_ELEMENTS; + lua["RL_DEFAULT_BATCH_BUFFERS"] = RL_DEFAULT_BATCH_BUFFERS; + lua["RL_DEFAULT_BATCH_DRAWCALLS"] = RL_DEFAULT_BATCH_DRAWCALLS; + lua["RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS"] = RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS; + lua["RL_MAX_MATRIX_STACK_SIZE"] = RL_MAX_MATRIX_STACK_SIZE; + lua["RL_MAX_SHADER_LOCATIONS"] = RL_MAX_SHADER_LOCATIONS; lua["RL_CULL_DISTANCE_NEAR"] = RL_CULL_DISTANCE_NEAR; lua["RL_CULL_DISTANCE_FAR"] = RL_CULL_DISTANCE_FAR; @@ -24,12 +27,13 @@ void raylib_lua_sol_rlgl(sol::state& lua) { lua["RL_TEXTURE_MIN_FILTER"] = RL_TEXTURE_MIN_FILTER; lua["RL_TEXTURE_FILTER_NEAREST"] = RL_TEXTURE_FILTER_NEAREST; - lua["RL_TEXTURE_FILTER_LINEAR "] = RL_TEXTURE_FILTER_LINEAR ; + lua["RL_TEXTURE_FILTER_LINEAR"] = RL_TEXTURE_FILTER_LINEAR; lua["RL_TEXTURE_FILTER_MIP_NEAREST"] = RL_TEXTURE_FILTER_MIP_NEAREST; lua["RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR"] = RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR; lua["RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST"] = RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST; lua["RL_TEXTURE_FILTER_MIP_LINEAR"] = RL_TEXTURE_FILTER_MIP_LINEAR; lua["RL_TEXTURE_FILTER_ANISOTROPIC"] = RL_TEXTURE_FILTER_ANISOTROPIC; + lua["RL_TEXTURE_MIPMAP_BIAS_RATIO"] = RL_TEXTURE_MIPMAP_BIAS_RATIO; lua["RL_TEXTURE_WRAP_REPEAT"] = RL_TEXTURE_WRAP_REPEAT; lua["RL_TEXTURE_WRAP_CLAMP"] = RL_TEXTURE_WRAP_CLAMP; @@ -47,6 +51,60 @@ void raylib_lua_sol_rlgl(sol::state& lua) { lua["RL_UNSIGNED_BYTE"] = RL_UNSIGNED_BYTE; lua["RL_FLOAT"] = RL_FLOAT; + lua["RL_STREAM_DRAW"] = RL_STREAM_DRAW; + lua["RL_STREAM_READ"] = RL_STREAM_READ; + lua["RL_STREAM_COPY"] = RL_STREAM_COPY; + lua["RL_STATIC_DRAW"] = RL_STATIC_DRAW; + lua["RL_STATIC_READ"] = RL_STATIC_READ; + lua["RL_STATIC_COPY"] = RL_STATIC_COPY; + lua["RL_DYNAMIC_DRAW"] = RL_DYNAMIC_DRAW; + lua["RL_DYNAMIC_READ"] = RL_DYNAMIC_READ; + lua["RL_DYNAMIC_COPY"] = RL_DYNAMIC_COPY; + + lua["RL_FRAGMENT_SHADER"] = RL_FRAGMENT_SHADER; + lua["RL_VERTEX_SHADER"] = RL_VERTEX_SHADER; + lua["RL_COMPUTE_SHADER"] = RL_COMPUTE_SHADER; + + lua["RL_ZERO"] = RL_ZERO; + lua["RL_ONE"] = RL_ONE; + lua["RL_SRC_COLOR"] = RL_SRC_COLOR; + lua["RL_ONE_MINUS_SRC_COLOR"] = RL_ONE_MINUS_SRC_COLOR; + lua["RL_SRC_ALPHA"] = RL_SRC_ALPHA; + lua["RL_ONE_MINUS_SRC_ALPHA"] = RL_ONE_MINUS_SRC_ALPHA; + lua["RL_DST_ALPHA"] = RL_DST_ALPHA; + lua["RL_ONE_MINUS_DST_ALPHA"] = RL_ONE_MINUS_DST_ALPHA; + lua["RL_DST_COLOR"] = RL_DST_COLOR; + lua["RL_ONE_MINUS_DST_COLOR"] = RL_ONE_MINUS_DST_COLOR; + lua["RL_SRC_ALPHA_SATURATE"] = RL_SRC_ALPHA_SATURATE; + lua["RL_CONSTANT_COLOR"] = RL_CONSTANT_COLOR; + lua["RL_ONE_MINUS_CONSTANT_COLOR"] = RL_ONE_MINUS_CONSTANT_COLOR; + lua["RL_CONSTANT_ALPHA"] = RL_CONSTANT_ALPHA; + lua["RL_ONE_MINUS_CONSTANT_ALPHA"] = RL_ONE_MINUS_CONSTANT_ALPHA; + + lua["RL_FUNC_ADD"] = RL_FUNC_ADD; + lua["RL_MIN"] = RL_MIN; + lua["RL_MAX"] = RL_MAX; + lua["RL_FUNC_SUBTRACT"] = RL_FUNC_SUBTRACT; + lua["RL_FUNC_REVERSE_SUBTRACT"] = RL_FUNC_REVERSE_SUBTRACT; + lua["RL_BLEND_EQUATION"] = RL_BLEND_EQUATION; + lua["RL_BLEND_EQUATION_RGB"] = RL_BLEND_EQUATION_RGB; + lua["RL_BLEND_EQUATION_ALPHA"] = RL_BLEND_EQUATION_ALPHA; + lua["RL_BLEND_DST_RGB"] = RL_BLEND_DST_RGB; + lua["RL_BLEND_SRC_RGB"] = RL_BLEND_SRC_RGB; + lua["RL_BLEND_DST_ALPHA"] = RL_BLEND_DST_ALPHA; + lua["RL_BLEND_SRC_ALPHA"] = RL_BLEND_SRC_ALPHA; + lua["RL_BLEND_COLOR"] = RL_BLEND_COLOR; + + lua["RL_READ_FRAMEBUFFER"] = RL_READ_FRAMEBUFFER; + lua["RL_DRAW_FRAMEBUFFER"] = RL_DRAW_FRAMEBUFFER; + + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_SOFTWARE); + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_11); + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_21); + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_33); + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_43); + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_ES_20); + RAYLIB_LUA_SOL_ADD_ENUM(RL_OPENGL_ES_30); lua.set_function("rlMatrixMode", rlMatrixMode); lua.set_function("rlPushMatrix", rlPushMatrix); @@ -55,10 +113,13 @@ void raylib_lua_sol_rlgl(sol::state& lua) { lua.set_function("rlTranslatef", rlTranslatef); lua.set_function("rlRotatef", rlRotatef); lua.set_function("rlScalef", rlScalef); - lua.set_function("rlMultMatrixf", rlMultMatrixf); lua.set_function("rlFrustum", rlFrustum); lua.set_function("rlOrtho", rlOrtho); lua.set_function("rlViewport", rlViewport); + lua.set_function("rlSetClipPlanes", rlSetClipPlanes); + lua.set_function("rlGetCullDistanceNear", rlGetCullDistanceNear); + lua.set_function("rlGetCullDistanceFar", rlGetCullDistanceFar); + lua.set_function("rlBegin", rlBegin); lua.set_function("rlEnd", rlEnd); lua.set_function("rlVertex2i", rlVertex2i); @@ -69,6 +130,7 @@ void raylib_lua_sol_rlgl(sol::state& lua) { lua.set_function("rlColor4ub", rlColor4ub); lua.set_function("rlColor3f", rlColor3f); lua.set_function("rlColor4f", rlColor4f); + lua.set_function("rlEnableVertexArray", rlEnableVertexArray); lua.set_function("rlDisableVertexArray", rlDisableVertexArray); lua.set_function("rlEnableVertexBuffer", rlEnableVertexBuffer); @@ -84,19 +146,35 @@ void raylib_lua_sol_rlgl(sol::state& lua) { lua.set_function("rlEnableTextureCubemap", rlEnableTextureCubemap); lua.set_function("rlDisableTextureCubemap", rlDisableTextureCubemap); lua.set_function("rlTextureParameters", rlTextureParameters); + lua.set_function("rlCubemapParameters", rlCubemapParameters); + lua.set_function("rlEnableShader", rlEnableShader); lua.set_function("rlDisableShader", rlDisableShader); + lua.set_function("rlEnableFramebuffer", rlEnableFramebuffer); lua.set_function("rlDisableFramebuffer", rlDisableFramebuffer); + lua.set_function("rlGetActiveFramebuffer", rlGetActiveFramebuffer); + lua.set_function("rlActiveDrawBuffers", rlActiveDrawBuffers); + lua.set_function("rlBlitFramebuffer", rlBlitFramebuffer); + lua.set_function("rlBindFramebuffer", rlBindFramebuffer); + + lua.set_function("rlEnableColorBlend", rlEnableColorBlend); + lua.set_function("rlDisableColorBlend", rlDisableColorBlend); lua.set_function("rlEnableDepthTest", rlEnableDepthTest); lua.set_function("rlDisableDepthTest", rlDisableDepthTest); lua.set_function("rlEnableDepthMask", rlEnableDepthMask); lua.set_function("rlDisableDepthMask", rlDisableDepthMask); lua.set_function("rlEnableBackfaceCulling", rlEnableBackfaceCulling); lua.set_function("rlDisableBackfaceCulling", rlDisableBackfaceCulling); + lua.set_function("rlColorMask", rlColorMask); + lua.set_function("rlSetCullFace", rlSetCullFace); lua.set_function("rlEnableScissorTest", rlEnableScissorTest); lua.set_function("rlDisableScissorTest", rlDisableScissorTest); lua.set_function("rlScissor", rlScissor); + lua.set_function("rlEnablePointMode", rlEnablePointMode); + lua.set_function("rlDisablePointMode", rlDisablePointMode); + lua.set_function("rlSetPointSize", rlSetPointSize); + lua.set_function("rlGetPointSize", rlGetPointSize); lua.set_function("rlEnableWireMode", rlEnableWireMode); lua.set_function("rlDisableWireMode", rlDisableWireMode); lua.set_function("rlSetLineWidth", rlSetLineWidth); @@ -112,60 +190,59 @@ void raylib_lua_sol_rlgl(sol::state& lua) { lua.set_function("rlCheckErrors", rlCheckErrors); lua.set_function("rlSetBlendMode", rlSetBlendMode); lua.set_function("rlSetBlendFactors", rlSetBlendFactors); + lua.set_function("rlSetBlendFactorsSeparate", rlSetBlendFactorsSeparate); + lua.set_function("rlglInit", rlglInit); lua.set_function("rlglClose", rlglClose); - lua.set_function("rlLoadExtensions", rlLoadExtensions); lua.set_function("rlGetVersion", rlGetVersion); + lua.set_function("rlSetFramebufferWidth", rlSetFramebufferWidth); lua.set_function("rlGetFramebufferWidth", rlGetFramebufferWidth); + lua.set_function("rlSetFramebufferHeight", rlSetFramebufferHeight); lua.set_function("rlGetFramebufferHeight", rlGetFramebufferHeight); - lua.set_function("rlGetShaderDefault", rlGetShaderDefault); - lua.set_function("rlGetTextureDefault", rlGetTextureDefault); - lua.set_function("rlLoadRenderBatch", rlLoadRenderBatch); - lua.set_function("rlUnloadRenderBatch", rlUnloadRenderBatch); - lua.set_function("rlDrawRenderBatch", rlDrawRenderBatch); - lua.set_function("rlSetRenderBatchActive", rlSetRenderBatchActive); + lua.set_function("rlGetTextureIdDefault", rlGetTextureIdDefault); + lua.set_function("rlGetShaderIdDefault", rlGetShaderIdDefault); + lua.set_function("rlDrawRenderBatchActive", rlDrawRenderBatchActive); lua.set_function("rlCheckRenderBatchLimit", rlCheckRenderBatchLimit); lua.set_function("rlSetTexture", rlSetTexture); + lua.set_function("rlLoadVertexArray", rlLoadVertexArray); - lua.set_function("rlLoadVertexBuffer", rlLoadVertexBuffer); - lua.set_function("rlLoadVertexBufferElement", rlLoadVertexBufferElement); - lua.set_function("rlUpdateVertexBuffer", rlUpdateVertexBuffer); lua.set_function("rlUnloadVertexArray", rlUnloadVertexArray); lua.set_function("rlUnloadVertexBuffer", rlUnloadVertexBuffer); lua.set_function("rlSetVertexAttribute", rlSetVertexAttribute); lua.set_function("rlSetVertexAttributeDivisor", rlSetVertexAttributeDivisor); - lua.set_function("rlSetVertexAttributeDefault", rlSetVertexAttributeDefault); lua.set_function("rlDrawVertexArray", rlDrawVertexArray); - lua.set_function("rlDrawVertexArrayElements", rlDrawVertexArrayElements); lua.set_function("rlDrawVertexArrayInstanced", rlDrawVertexArrayInstanced); - lua.set_function("rlDrawVertexArrayElementsInstanced", rlDrawVertexArrayElementsInstanced); -// lua.set_function("rlLoadExtensions", rlLoadExtensions); - lua.set_function("rlLoadTexture", rlLoadTexture); lua.set_function("rlLoadTextureDepth", rlLoadTextureDepth); - lua.set_function("rlLoadTextureCubemap", rlLoadTextureCubemap); - lua.set_function("rlUpdateTexture", rlUpdateTexture); - lua.set_function("rlGetGlTextureFormats", rlGetGlTextureFormats); + lua.set_function("rlGetPixelFormatName", rlGetPixelFormatName); lua.set_function("rlUnloadTexture", rlUnloadTexture); - lua.set_function("rlGenerateMipmaps", rlGenerateMipmaps); - lua.set_function("rlReadTexturePixels", rlReadTexturePixels); - lua.set_function("rlReadScreenPixels", rlReadScreenPixels); + lua.set_function("rlLoadFramebuffer", rlLoadFramebuffer); lua.set_function("rlFramebufferAttach", rlFramebufferAttach); lua.set_function("rlFramebufferComplete", rlFramebufferComplete); lua.set_function("rlUnloadFramebuffer", rlUnloadFramebuffer); - lua.set_function("rlLoadShaderCode", rlLoadShaderCode); - lua.set_function("rlCompileShader", rlCompileShader); + lua.set_function("rlResizeFramebuffer", rlResizeFramebuffer); + + lua.set_function("rlLoadShader", rlLoadShader); lua.set_function("rlLoadShaderProgram", rlLoadShaderProgram); + lua.set_function("rlLoadShaderProgramEx", rlLoadShaderProgramEx); + lua.set_function("rlLoadShaderProgramCompute", rlLoadShaderProgramCompute); + lua.set_function("rlUnloadShader", rlUnloadShader); lua.set_function("rlUnloadShaderProgram", rlUnloadShaderProgram); lua.set_function("rlGetLocationUniform", rlGetLocationUniform); lua.set_function("rlGetLocationAttrib", rlGetLocationAttrib); - lua.set_function("rlSetUniform", rlSetUniform); lua.set_function("rlSetUniformMatrix", rlSetUniformMatrix); lua.set_function("rlSetUniformSampler", rlSetUniformSampler); - lua.set_function("rlSetShader", rlSetShader); + + lua.set_function("rlComputeShaderDispatch", rlComputeShaderDispatch); + lua.set_function("rlUnloadShaderBuffer", rlUnloadShaderBuffer); + lua.set_function("rlBindShaderBuffer", rlBindShaderBuffer); + lua.set_function("rlCopyShaderBuffer", rlCopyShaderBuffer); + lua.set_function("rlGetShaderBufferSize", rlGetShaderBufferSize); + lua.set_function("rlBindImageTexture", rlBindImageTexture); + lua.set_function("rlGetMatrixModelview", rlGetMatrixModelview); lua.set_function("rlGetMatrixProjection", rlGetMatrixProjection); lua.set_function("rlGetMatrixTransform", rlGetMatrixTransform); diff --git a/include/raylib-lua-sol.hpp b/include/raylib-lua-sol.hpp index b28e86c..888c68b 100644 --- a/include/raylib-lua-sol.hpp +++ b/include/raylib-lua-sol.hpp @@ -2,6 +2,10 @@ #define RAYLIB_LUA_SOL_ #include "raylib.h" + +#include +#include + #include "sol/sol.hpp" #include "./raylib-lua-sol-rlgl.hpp" #include "./raylib-lua-sol-raymath.hpp" @@ -72,7 +76,7 @@ void raylib_lua_sol_structs(sol::state& lua) { "g", &Color::g, "b", &Color::b, "a", &Color::a); - lua.new_usertype("Vector2", + lua.new_usertype("Vector2", sol::call_constructor, sol::factories( [](){ return Vector2{}; @@ -81,12 +85,12 @@ void raylib_lua_sol_structs(sol::state& lua) { return Vector2{x, y}; } ), - "x", &Vector2::x, - "y", &Vector2::y, + "x", &Vector2::x, + "y", &Vector2::y, sol::meta_function::to_string, [](Vector2& v) { return TextFormat("{x: %02.02f, y: %02.02f}", v.x, v.y); }); - lua.new_usertype("Vector3", + lua.new_usertype("Vector3", sol::call_constructor, sol::factories( [](){ return Vector3{}; @@ -101,13 +105,13 @@ void raylib_lua_sol_structs(sol::state& lua) { return Vector3{x, y, z}; } ), - "x", &Vector3::x, - "y", &Vector3::y, - "z", &Vector3::z, + "x", &Vector3::x, + "y", &Vector3::y, + "z", &Vector3::z, sol::meta_function::to_string, [](Vector3& v) { return TextFormat("{x: %02.02f, y: %02.02f, z: %02.02f}", v.x, v.y, v.z); }); - lua.new_usertype("Vector4", + lua.new_usertype("Vector4", sol::call_constructor, sol::factories( [](){ return Vector4{}; @@ -125,14 +129,15 @@ void raylib_lua_sol_structs(sol::state& lua) { return Vector4{x, y, z, w}; } ), - "x", &Vector4::x, - "y", &Vector4::y, - "z", &Vector4::z, - "w", &Vector4::w, + "x", &Vector4::x, + "y", &Vector4::y, + "z", &Vector4::z, + "w", &Vector4::w, sol::meta_function::to_string, [](Vector4& v) { return TextFormat("{x: %02.02f, y: %02.02f, z: %02.02f, w: %02.02f}", v.x, v.y, v.z, v.w); }); - lua.new_usertype("Matrix", + lua["Quaternion"] = lua["Vector4"]; + lua.new_usertype("Matrix", sol::call_constructor, sol::factories( [](){ return Matrix{}; @@ -141,38 +146,41 @@ void raylib_lua_sol_structs(sol::state& lua) { return Matrix{_m0,_m1,_m2,_m3,_m4,_m5,_m6,_m7,_m8,_m9,_m10,_m11,_m12,_m13,_m14,_m15}; } ), - "m0", &Matrix::m0, - "m1", &Matrix::m1, - "m2", &Matrix::m2, - "m3", &Matrix::m3, - "m4", &Matrix::m4, - "m5", &Matrix::m5, - "m6", &Matrix::m6, - "m7", &Matrix::m7, - "m8", &Matrix::m8, - "m9", &Matrix::m9, - "m10", &Matrix::m10, - "m11", &Matrix::m11, - "m12", &Matrix::m12, - "m13", &Matrix::m13, - "m14", &Matrix::m14, - "m15", &Matrix::m15); - lua.new_usertype("Image", - "data", &Image::data, - "width", &Image::width, - "height", &Image::height, - "mipmaps", &Image::mipmaps, - "format", &Image::format); - lua.new_usertype("Texture", - "id", &Texture2D::id, - "width", &Texture2D::width, - "height", &Texture2D::height, - "mipmaps", &Texture2D::mipmaps, - "format", &Texture2D::format); - lua.new_usertype("RenderTexture2D", - "id", &RenderTexture2D::id, - "texture", &RenderTexture2D::texture, - "depth", &RenderTexture2D::depth); + "m0", &Matrix::m0, + "m1", &Matrix::m1, + "m2", &Matrix::m2, + "m3", &Matrix::m3, + "m4", &Matrix::m4, + "m5", &Matrix::m5, + "m6", &Matrix::m6, + "m7", &Matrix::m7, + "m8", &Matrix::m8, + "m9", &Matrix::m9, + "m10", &Matrix::m10, + "m11", &Matrix::m11, + "m12", &Matrix::m12, + "m13", &Matrix::m13, + "m14", &Matrix::m14, + "m15", &Matrix::m15); + lua.new_usertype("Image", + "data", &Image::data, + "width", &Image::width, + "height", &Image::height, + "mipmaps", &Image::mipmaps, + "format", &Image::format); + lua.new_usertype("Texture", + "id", &Texture::id, + "width", &Texture::width, + "height", &Texture::height, + "mipmaps", &Texture::mipmaps, + "format", &Texture::format); + lua["Texture2D"] = lua["Texture"]; + lua["TextureCubemap"] = lua["Texture"]; + lua.new_usertype("RenderTexture2D", + "id", &RenderTexture::id, + "texture", &RenderTexture::texture, + "depth", &RenderTexture::depth); + lua["RenderTexture"] = lua["RenderTexture2D"]; lua.new_usertype("NPatchInfo", "source", &NPatchInfo::source, "left", &NPatchInfo::left, @@ -180,31 +188,32 @@ void raylib_lua_sol_structs(sol::state& lua) { "right", &NPatchInfo::right, "bottom", &NPatchInfo::bottom, "layout", &NPatchInfo::layout); - lua.new_usertype("CharInfo", - "value", &CharInfo::value, - "offsetX", &CharInfo::offsetX, - "offsetY", &CharInfo::offsetY, - "advanceX", &CharInfo::advanceX, - "image", &CharInfo::image); + lua.new_usertype("GlyphInfo", + "value", &GlyphInfo::value, + "offsetX", &GlyphInfo::offsetX, + "offsetY", &GlyphInfo::offsetY, + "advanceX", &GlyphInfo::advanceX, + "image", &GlyphInfo::image); lua.new_usertype("Font", "baseSize", &Font::baseSize, - "charsCount", &Font::charsCount, + "glyphCount", &Font::glyphCount, + "glyphPadding", &Font::glyphPadding, "texture", &Font::texture, "recs", &Font::recs, - "chars", &Font::chars); + "glyphs", &Font::glyphs); lua.new_usertype("Camera", sol::call_constructor, sol::factories( [](){ return Camera3D{}; }, - [](Vector3 position, Vector3 target, Vector3 up, float fovy, int type){ - return Camera3D{position, target, up, fovy, type}; + [](Vector3 position, Vector3 target, Vector3 up, float fovy, int projection){ + return Camera3D{position, target, up, fovy, projection}; }, [](Vector3 position, Vector3 target, Vector3 up, float fovy){ - return Camera3D{position, target, up, fovy, 0}; + return Camera3D{position, target, up, fovy, CAMERA_PERSPECTIVE}; }, [](Vector3 position, Vector3 target, Vector3 up){ - return Camera3D{position, target, up, 0, 0}; + return Camera3D{position, target, up, 45.0f, CAMERA_PERSPECTIVE}; } ), "position", &Camera3D::position, @@ -212,16 +221,17 @@ void raylib_lua_sol_structs(sol::state& lua) { "up", &Camera3D::up, "fovy", &Camera3D::fovy, "projection", &Camera3D::projection); + lua["Camera3D"] = lua["Camera"]; lua.new_usertype("Camera2D", sol::call_constructor, sol::factories( [](){ - return Camera2D{}; + return Camera2D{{0.0f, 0.0f}, {0.0f, 0.0f}, 0.0f, 1.0f}; }, [](Vector2 offset, Vector2 target, float rotation, float zoom){ return Camera2D{offset, target, rotation, zoom}; }, [](Vector2 offset, Vector2 target){ - return Camera2D{offset, target, 0, 0}; + return Camera2D{offset, target, 0.0f, 1.0f}; } ), "offset", &Camera2D::offset, @@ -238,10 +248,11 @@ void raylib_lua_sol_structs(sol::state& lua) { "tangents", &Mesh::tangents, "colors", &Mesh::colors, "indices", &Mesh::indices, + "boneCount", &Mesh::boneCount, + "boneIndices", &Mesh::boneIndices, + "boneWeights", &Mesh::boneWeights, "animVertices", &Mesh::animVertices, "animNormals", &Mesh::animNormals, - "boneIds", &Mesh::boneIds, - "boneWeights", &Mesh::boneWeights, "vaoId", &Mesh::vaoId, "vboId", &Mesh::vboId); lua.new_usertype("Shader", @@ -253,37 +264,37 @@ void raylib_lua_sol_structs(sol::state& lua) { "value", &MaterialMap::value); lua.new_usertype("Material", "shader", &Material::shader, - "maps", &Material::maps, - "params", &Material::params); + "maps", &Material::maps); lua.new_usertype("Transform", "translation", &Transform::translation, "rotation", &Transform::rotation, "scale", &Transform::scale); lua.new_usertype("BoneInfo", - "name", &BoneInfo::name, "parent", &BoneInfo::parent); + lua.new_usertype("ModelSkeleton", + "boneCount", &ModelSkeleton::boneCount, + "bones", &ModelSkeleton::bones, + "bindPose", &ModelSkeleton::bindPose); lua.new_usertype("Model", "transform", &Model::transform, "meshCount", &Model::meshCount, - "meshes", &Model::meshes, "materialCount", &Model::materialCount, + "meshes", &Model::meshes, "materials", &Model::materials, "meshMaterial", &Model::meshMaterial, - "boneCount", &Model::boneCount, - "bones", &Model::bones, - "bindPose", &Model::bindPose); + "skeleton", &Model::skeleton, + "currentPose", &Model::currentPose, + "boneMatrices", &Model::boneMatrices); lua.new_usertype("ModelAnimation", "boneCount", &ModelAnimation::boneCount, - "bones", &ModelAnimation::bones, - "frameCount", &ModelAnimation::frameCount); - //"framePoses", &ModelAnimation::framePoses + "keyframeCount", &ModelAnimation::keyframeCount); lua.new_usertype("Ray", sol::call_constructor, sol::factories( [](){ return Ray{}; }, [](Vector3 pos){ - return Ray{pos}; + return Ray{pos, Vector3{0, 0, 0}}; }, [](Vector3 pos, Vector3 dir){ return Ray{pos, dir}; @@ -291,11 +302,16 @@ void raylib_lua_sol_structs(sol::state& lua) { ), "position", &Ray::position, "direction", &Ray::direction); - lua.new_usertype("RayHitInfo", - "hit", &RayHitInfo::hit, - "distance", &RayHitInfo::distance, - "position", &RayHitInfo::position, - "normal", &RayHitInfo::normal); + lua.new_usertype("RayCollision", + sol::call_constructor, sol::factories( + [](){ + return RayCollision{}; + } + ), + "hit", &RayCollision::hit, + "distance", &RayCollision::distance, + "point", &RayCollision::point, + "normal", &RayCollision::normal); lua.new_usertype("BoundingBox", sol::call_constructor, sol::factories( [](){ @@ -308,7 +324,7 @@ void raylib_lua_sol_structs(sol::state& lua) { "min", &BoundingBox::min, "max", &BoundingBox::max); lua.new_usertype("Wave", - "sampleCount", &Wave::sampleCount, + "frameCount", &Wave::frameCount, "sampleRate", &Wave::sampleRate, "sampleSize", &Wave::sampleSize, "channels", &Wave::channels, @@ -317,13 +333,12 @@ void raylib_lua_sol_structs(sol::state& lua) { "sampleRate", &AudioStream::sampleRate, "sampleSize", &AudioStream::sampleSize, "channels", &AudioStream::channels); - //"buffer", &AudioStream::buffer); lua.new_usertype("Sound", - "sampleCount", &Sound::sampleCount, - "stream", &Sound::stream); + "stream", &Sound::stream, + "frameCount", &Sound::frameCount); lua.new_usertype("Music", "stream", &Music::stream, - "sampleCount", &Music::sampleCount, + "frameCount", &Music::frameCount, "looping", &Music::looping, "ctxType", &Music::ctxType, "ctxData", &Music::ctxData); @@ -332,16 +347,25 @@ void raylib_lua_sol_structs(sol::state& lua) { "vResolution", &VrDeviceInfo::vResolution, "hScreenSize", &VrDeviceInfo::hScreenSize, "vScreenSize", &VrDeviceInfo::vScreenSize, - "vScreenCenter", &VrDeviceInfo::vScreenCenter, "eyeToScreenDistance", &VrDeviceInfo::eyeToScreenDistance, "lensSeparationDistance", &VrDeviceInfo::lensSeparationDistance, - "interpupillaryDistance", &VrDeviceInfo::interpupillaryDistance, - "lensDistortionValues", &VrDeviceInfo::lensDistortionValues, - "chromaAbCorrection", &VrDeviceInfo::chromaAbCorrection); + "interpupillaryDistance", &VrDeviceInfo::interpupillaryDistance); + lua.new_usertype("VrStereoConfig"); + lua.new_usertype("FilePathList", + "count", &FilePathList::count); + lua.new_usertype("AutomationEvent", + "frame", &AutomationEvent::frame, + "type", &AutomationEvent::type); + lua.new_usertype("AutomationEventList", + "capacity", &AutomationEventList::capacity, + "count", &AutomationEventList::count, + "events", &AutomationEventList::events); } +#ifndef RAYLIB_LUA_SOL_ADD_ENUM #define RAYLIB_LUA_SOL_ADD_ENUM(x) \ lua[#x] = x +#endif void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(FLAG_VSYNC_HINT); @@ -356,6 +380,8 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(FLAG_WINDOW_ALWAYS_RUN); RAYLIB_LUA_SOL_ADD_ENUM(FLAG_WINDOW_TRANSPARENT); RAYLIB_LUA_SOL_ADD_ENUM(FLAG_WINDOW_HIGHDPI); + RAYLIB_LUA_SOL_ADD_ENUM(FLAG_WINDOW_MOUSE_PASSTHROUGH); + RAYLIB_LUA_SOL_ADD_ENUM(FLAG_BORDERLESS_WINDOWED_MODE); RAYLIB_LUA_SOL_ADD_ENUM(FLAG_MSAA_4X_HINT); RAYLIB_LUA_SOL_ADD_ENUM(FLAG_INTERLACED_HINT); @@ -412,7 +438,10 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(KEY_X); RAYLIB_LUA_SOL_ADD_ENUM(KEY_Y); RAYLIB_LUA_SOL_ADD_ENUM(KEY_Z); - + RAYLIB_LUA_SOL_ADD_ENUM(KEY_LEFT_BRACKET); + RAYLIB_LUA_SOL_ADD_ENUM(KEY_BACKSLASH); + RAYLIB_LUA_SOL_ADD_ENUM(KEY_RIGHT_BRACKET); + RAYLIB_LUA_SOL_ADD_ENUM(KEY_GRAVE); RAYLIB_LUA_SOL_ADD_ENUM(KEY_SPACE); RAYLIB_LUA_SOL_ADD_ENUM(KEY_ESCAPE); RAYLIB_LUA_SOL_ADD_ENUM(KEY_ENTER); @@ -454,10 +483,6 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(KEY_RIGHT_ALT); RAYLIB_LUA_SOL_ADD_ENUM(KEY_RIGHT_SUPER); RAYLIB_LUA_SOL_ADD_ENUM(KEY_KB_MENU); - RAYLIB_LUA_SOL_ADD_ENUM(KEY_LEFT_BRACKET); - RAYLIB_LUA_SOL_ADD_ENUM(KEY_BACKSLASH); - RAYLIB_LUA_SOL_ADD_ENUM(KEY_RIGHT_BRACKET); - RAYLIB_LUA_SOL_ADD_ENUM(KEY_GRAVE); RAYLIB_LUA_SOL_ADD_ENUM(KEY_KP_0); RAYLIB_LUA_SOL_ADD_ENUM(KEY_KP_1); RAYLIB_LUA_SOL_ADD_ENUM(KEY_KP_2); @@ -480,12 +505,19 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(KEY_VOLUME_UP); RAYLIB_LUA_SOL_ADD_ENUM(KEY_VOLUME_DOWN); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_LEFT); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_RIGHT); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_MIDDLE); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_SIDE); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_EXTRA); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_FORWARD); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_BUTTON_BACK); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_LEFT_BUTTON); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_RIGHT_BUTTON); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_MIDDLE_BUTTON); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_CURSOR_DEFAULT); - RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_CURSOR_ARROW ); + RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_CURSOR_ARROW); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_CURSOR_IBEAM); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_CURSOR_CROSSHAIR); RAYLIB_LUA_SOL_ADD_ENUM(MOUSE_CURSOR_POINTING_HAND); @@ -501,21 +533,17 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_LEFT_FACE_RIGHT); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_LEFT_FACE_DOWN); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_LEFT_FACE_LEFT); - RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_FACE_UP); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_FACE_RIGHT); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_FACE_DOWN); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_FACE_LEFT); - RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_LEFT_TRIGGER_1); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_LEFT_TRIGGER_2); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_TRIGGER_1); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_TRIGGER_2); - RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_MIDDLE_LEFT); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_MIDDLE); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_MIDDLE_RIGHT); - RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_LEFT_THUMB); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_BUTTON_RIGHT_THUMB); @@ -525,6 +553,7 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_AXIS_RIGHT_Y); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_AXIS_LEFT_TRIGGER); RAYLIB_LUA_SOL_ADD_ENUM(GAMEPAD_AXIS_RIGHT_TRIGGER); + RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_ALBEDO); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_METALNESS); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_NORMAL); @@ -532,10 +561,13 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_OCCLUSION); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_EMISSION); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_HEIGHT); - RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_BRDG); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_CUBEMAP); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_IRRADIANCE); RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_PREFILTER); + RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_BRDF); + RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_DIFFUSE); + RAYLIB_LUA_SOL_ADD_ENUM(MATERIAL_MAP_SPECULAR); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_VERTEX_POSITION); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_VERTEX_TEXCOORD01); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_VERTEX_TEXCOORD02); @@ -562,16 +594,32 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_MAP_IRRADIANCE); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_MAP_PREFILTER); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_MAP_BRDF); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_VERTEX_BONEIDS); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_VERTEX_BONEWEIGHTS); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_MATRIX_BONETRANSFORMS); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_VERTEX_INSTANCETRANSFORM); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_MAP_DIFFUSE); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_LOC_MAP_SPECULAR); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_FLOAT); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_VEC2); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_VEC3); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_VEC4); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_INT); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_IVEC2); - RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_IVEC2); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_IVEC3); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_IVEC4); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_UINT); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_UIVEC2); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_UIVEC3); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_UIVEC4); RAYLIB_LUA_SOL_ADD_ENUM(SHADER_UNIFORM_SAMPLER2D); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_ATTRIB_FLOAT); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_ATTRIB_VEC2); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_ATTRIB_VEC3); + RAYLIB_LUA_SOL_ADD_ENUM(SHADER_ATTRIB_VEC4); + RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_GRAYSCALE); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R5G6B5); @@ -579,10 +627,12 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R5G5B5A1); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R4G4B4A4); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); - RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R32); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R32G32B32); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R32G32B32A32); + RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R16); + RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R16G16B16); + RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_UNCOMPRESSED_R16G16B16A16); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_COMPRESSED_DXT1_RGB); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_COMPRESSED_DXT1_RGBA); RAYLIB_LUA_SOL_ADD_ENUM(PIXELFORMAT_COMPRESSED_DXT3_RGBA); @@ -612,7 +662,6 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(CUBEMAP_LAYOUT_LINE_HORIZONTAL); RAYLIB_LUA_SOL_ADD_ENUM(CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR); RAYLIB_LUA_SOL_ADD_ENUM(CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE); - RAYLIB_LUA_SOL_ADD_ENUM(CUBEMAP_LAYOUT_PANORAMA); RAYLIB_LUA_SOL_ADD_ENUM(FONT_DEFAULT); RAYLIB_LUA_SOL_ADD_ENUM(FONT_BITMAP); @@ -623,7 +672,9 @@ void raylib_lua_sol_enums(sol::state &lua) { RAYLIB_LUA_SOL_ADD_ENUM(BLEND_MULTIPLIED); RAYLIB_LUA_SOL_ADD_ENUM(BLEND_ADD_COLORS); RAYLIB_LUA_SOL_ADD_ENUM(BLEND_SUBTRACT_COLORS); + RAYLIB_LUA_SOL_ADD_ENUM(BLEND_ALPHA_PREMULTIPLY); RAYLIB_LUA_SOL_ADD_ENUM(BLEND_CUSTOM); + RAYLIB_LUA_SOL_ADD_ENUM(BLEND_CUSTOM_SEPARATE); RAYLIB_LUA_SOL_ADD_ENUM(GESTURE_NONE); RAYLIB_LUA_SOL_ADD_ENUM(GESTURE_TAP); @@ -656,8 +707,8 @@ void raylib_lua_sol_enums(sol::state &lua) { void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(InitWindow); - RAYLIB_LUA_SOL_ADD_FUNCTION(WindowShouldClose); RAYLIB_LUA_SOL_ADD_FUNCTION(CloseWindow); + RAYLIB_LUA_SOL_ADD_FUNCTION(WindowShouldClose); RAYLIB_LUA_SOL_ADD_FUNCTION(IsWindowReady); RAYLIB_LUA_SOL_ADD_FUNCTION(IsWindowFullscreen); RAYLIB_LUA_SOL_ADD_FUNCTION(IsWindowHidden); @@ -669,6 +720,7 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowState); RAYLIB_LUA_SOL_ADD_FUNCTION(ClearWindowState); RAYLIB_LUA_SOL_ADD_FUNCTION(ToggleFullscreen); + RAYLIB_LUA_SOL_ADD_FUNCTION(ToggleBorderlessWindowed); RAYLIB_LUA_SOL_ADD_FUNCTION(MaximizeWindow); RAYLIB_LUA_SOL_ADD_FUNCTION(MinimizeWindow); RAYLIB_LUA_SOL_ADD_FUNCTION(RestoreWindow); @@ -677,10 +729,14 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowPosition); RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowMonitor); RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowMinSize); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowMaxSize); RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowSize); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetWindowHandle); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowOpacity); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetWindowFocused); RAYLIB_LUA_SOL_ADD_FUNCTION(GetScreenWidth); RAYLIB_LUA_SOL_ADD_FUNCTION(GetScreenHeight); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRenderWidth); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRenderHeight); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMonitorCount); RAYLIB_LUA_SOL_ADD_FUNCTION(GetCurrentMonitor); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMonitorPosition); @@ -694,6 +750,9 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(GetMonitorName); RAYLIB_LUA_SOL_ADD_FUNCTION(SetClipboardText); RAYLIB_LUA_SOL_ADD_FUNCTION(GetClipboardText); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetClipboardImage); + RAYLIB_LUA_SOL_ADD_FUNCTION(EnableEventWaiting); + RAYLIB_LUA_SOL_ADD_FUNCTION(DisableEventWaiting); RAYLIB_LUA_SOL_ADD_FUNCTION(ShowCursor); RAYLIB_LUA_SOL_ADD_FUNCTION(HideCursor); @@ -725,85 +784,87 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(LoadShader); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadShaderFromMemory); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsShaderValid); RAYLIB_LUA_SOL_ADD_FUNCTION(GetShaderLocation); RAYLIB_LUA_SOL_ADD_FUNCTION(GetShaderLocationAttrib); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetShaderValue); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetShaderValueV); RAYLIB_LUA_SOL_ADD_FUNCTION(SetShaderValueMatrix); RAYLIB_LUA_SOL_ADD_FUNCTION(SetShaderValueTexture); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadShader); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetMouseRay); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCameraMatrix); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCameraMatrix2D); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetScreenToWorldRay); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetScreenToWorldRayEx); RAYLIB_LUA_SOL_ADD_FUNCTION(GetWorldToScreen); RAYLIB_LUA_SOL_ADD_FUNCTION(GetWorldToScreenEx); RAYLIB_LUA_SOL_ADD_FUNCTION(GetWorldToScreen2D); RAYLIB_LUA_SOL_ADD_FUNCTION(GetScreenToWorld2D); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetCameraMatrix); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetCameraMatrix2D); RAYLIB_LUA_SOL_ADD_FUNCTION(SetTargetFPS); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetFPS); RAYLIB_LUA_SOL_ADD_FUNCTION(GetFrameTime); RAYLIB_LUA_SOL_ADD_FUNCTION(GetTime); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetFPS); + + RAYLIB_LUA_SOL_ADD_FUNCTION(SwapScreenBuffer); + RAYLIB_LUA_SOL_ADD_FUNCTION(PollInputEvents); + RAYLIB_LUA_SOL_ADD_FUNCTION(WaitTime); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetRandomSeed); RAYLIB_LUA_SOL_ADD_FUNCTION(GetRandomValue); + RAYLIB_LUA_SOL_ADD_FUNCTION(TakeScreenshot); RAYLIB_LUA_SOL_ADD_FUNCTION(SetConfigFlags); - - RAYLIB_LUA_SOL_ADD_FUNCTION(TraceLog); + RAYLIB_LUA_SOL_ADD_FUNCTION(OpenURL); RAYLIB_LUA_SOL_ADD_FUNCTION(SetTraceLogLevel); - RAYLIB_LUA_SOL_ADD_FUNCTION(MemAlloc); - RAYLIB_LUA_SOL_ADD_FUNCTION(MemRealloc); - RAYLIB_LUA_SOL_ADD_FUNCTION(MemFree); - -// RAYLIB_LUA_SOL_ADD_FUNCTION(SetTraceLogCallback); -// RAYLIB_LUA_SOL_ADD_FUNCTION(SetLoadFileDataCallback); -// RAYLIB_LUA_SOL_ADD_FUNCTION(SetSaveFileDataCallback); -// RAYLIB_LUA_SOL_ADD_FUNCTION(SetLoadFileTextCallback); -// RAYLIB_LUA_SOL_ADD_FUNCTION(SetSaveFileTextCallback); - - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFileData); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadFileData); - RAYLIB_LUA_SOL_ADD_FUNCTION(SaveFileData); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFileText); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadFileText); RAYLIB_LUA_SOL_ADD_FUNCTION(SaveFileText); + RAYLIB_LUA_SOL_ADD_FUNCTION(FileRename); + RAYLIB_LUA_SOL_ADD_FUNCTION(FileRemove); + RAYLIB_LUA_SOL_ADD_FUNCTION(FileCopy); + RAYLIB_LUA_SOL_ADD_FUNCTION(FileMove); + RAYLIB_LUA_SOL_ADD_FUNCTION(FileTextReplace); + RAYLIB_LUA_SOL_ADD_FUNCTION(FileTextFindIndex); RAYLIB_LUA_SOL_ADD_FUNCTION(FileExists); RAYLIB_LUA_SOL_ADD_FUNCTION(DirectoryExists); RAYLIB_LUA_SOL_ADD_FUNCTION(IsFileExtension); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetFileLength); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetFileModTime); RAYLIB_LUA_SOL_ADD_FUNCTION(GetFileExtension); RAYLIB_LUA_SOL_ADD_FUNCTION(GetFileName); RAYLIB_LUA_SOL_ADD_FUNCTION(GetFileNameWithoutExt); RAYLIB_LUA_SOL_ADD_FUNCTION(GetDirectoryPath); RAYLIB_LUA_SOL_ADD_FUNCTION(GetPrevDirectoryPath); RAYLIB_LUA_SOL_ADD_FUNCTION(GetWorkingDirectory); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetDirectoryFiles); - RAYLIB_LUA_SOL_ADD_FUNCTION(ClearDirectoryFiles); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetApplicationDirectory); + RAYLIB_LUA_SOL_ADD_FUNCTION(MakeDirectory); RAYLIB_LUA_SOL_ADD_FUNCTION(ChangeDirectory); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsPathFile); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsFileNameValid); RAYLIB_LUA_SOL_ADD_FUNCTION(IsFileDropped); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetDroppedFiles); - RAYLIB_LUA_SOL_ADD_FUNCTION(ClearDroppedFiles); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetFileModTime); - - RAYLIB_LUA_SOL_ADD_FUNCTION(CompressData); - RAYLIB_LUA_SOL_ADD_FUNCTION(DecompressData); - - RAYLIB_LUA_SOL_ADD_FUNCTION(SaveStorageValue); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadStorageValue); - - RAYLIB_LUA_SOL_ADD_FUNCTION(OpenURL); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetDirectoryFileCount); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetDirectoryFileCountEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadAutomationEventList); + RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadAutomationEventList); + RAYLIB_LUA_SOL_ADD_FUNCTION(ExportAutomationEventList); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetAutomationEventBaseFrame); + RAYLIB_LUA_SOL_ADD_FUNCTION(StartAutomationEventRecording); + RAYLIB_LUA_SOL_ADD_FUNCTION(StopAutomationEventRecording); + RAYLIB_LUA_SOL_ADD_FUNCTION(PlayAutomationEvent); RAYLIB_LUA_SOL_ADD_FUNCTION(IsKeyPressed); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsKeyPressedRepeat); RAYLIB_LUA_SOL_ADD_FUNCTION(IsKeyDown); RAYLIB_LUA_SOL_ADD_FUNCTION(IsKeyReleased); RAYLIB_LUA_SOL_ADD_FUNCTION(IsKeyUp); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetExitKey); RAYLIB_LUA_SOL_ADD_FUNCTION(GetKeyPressed); RAYLIB_LUA_SOL_ADD_FUNCTION(GetCharPressed); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetKeyName); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetExitKey); RAYLIB_LUA_SOL_ADD_FUNCTION(IsGamepadAvailable); - RAYLIB_LUA_SOL_ADD_FUNCTION(IsGamepadName); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGamepadName); RAYLIB_LUA_SOL_ADD_FUNCTION(IsGamepadButtonPressed); RAYLIB_LUA_SOL_ADD_FUNCTION(IsGamepadButtonDown); @@ -813,6 +874,7 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(GetGamepadAxisCount); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGamepadAxisMovement); RAYLIB_LUA_SOL_ADD_FUNCTION(SetGamepadMappings); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetGamepadVibration); RAYLIB_LUA_SOL_ADD_FUNCTION(IsMouseButtonPressed); RAYLIB_LUA_SOL_ADD_FUNCTION(IsMouseButtonDown); @@ -821,35 +883,32 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(GetMouseX); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMouseY); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMousePosition); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetMouseDelta); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMousePosition); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMouseOffset); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMouseScale); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMouseWheelMove); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetMouseWheelMoveV); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMouseCursor); RAYLIB_LUA_SOL_ADD_FUNCTION(GetTouchX); RAYLIB_LUA_SOL_ADD_FUNCTION(GetTouchY); RAYLIB_LUA_SOL_ADD_FUNCTION(GetTouchPosition); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetTouchPointId); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetTouchPointCount); RAYLIB_LUA_SOL_ADD_FUNCTION(SetGesturesEnabled); RAYLIB_LUA_SOL_ADD_FUNCTION(IsGestureDetected); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGestureDetected); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetTouchPointsCount); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGestureHoldDuration); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGestureDragVector); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGestureDragAngle); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGesturePinchVector); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGesturePinchAngle); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetCameraMode); - RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateCamera); - - RAYLIB_LUA_SOL_ADD_FUNCTION(SetCameraPanControl); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetCameraAltControl); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetCameraSmoothZoomControl); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetCameraMoveControls); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetShapesTexture); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetShapesTexture); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetShapesTextureRectangle); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPixel); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPixelV); @@ -857,16 +916,18 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLineV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLineEx); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLineBezier); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLineBezierQuad); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLineStrip); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLineDashed); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircle); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleV); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleGradient); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleSector); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleSectorLines); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleGradient); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircleLinesV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawEllipse); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawEllipseV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawEllipseLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawEllipseLinesV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRing); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRingLines); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRectangle); @@ -880,42 +941,56 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRectangleLinesEx); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRectangleRounded); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRectangleRoundedLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRectangleRoundedLinesEx); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTriangle); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTriangleLines); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTriangleFan); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTriangleStrip); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPoly); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPolyLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPolyLinesEx); + + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSplineSegmentLinear); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSplineSegmentBasis); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSplineSegmentCatmullRom); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSplineSegmentBezierQuadratic); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSplineSegmentBezierCubic); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetSplinePointLinear); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetSplinePointBasis); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetSplinePointCatmullRom); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetSplinePointBezierQuad); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetSplinePointBezierCubic); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionRecs); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionCircles); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionCircleRec); + RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionCircleLine); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionPointRec); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionPointCircle); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionPointTriangle); - RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionPointLine); RAYLIB_LUA_SOL_ADD_FUNCTION(GetCollisionRec); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImage); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImageRaw); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImageAnim); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImageFromMemory); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImageFromTexture); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImageFromScreen); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsImageValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadImage); RAYLIB_LUA_SOL_ADD_FUNCTION(ExportImage); RAYLIB_LUA_SOL_ADD_FUNCTION(ExportImageAsCode); RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageColor); - RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageGradientV); - RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageGradientH); + RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageGradientLinear); RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageGradientRadial); + RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageGradientSquare); RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageChecked); RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageWhiteNoise); RAYLIB_LUA_SOL_ADD_FUNCTION(GenImagePerlinNoise); RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageCellular); + RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageText); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageCopy); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageFromImage); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageFromChannel); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageText); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageTextEx); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageFormat); @@ -925,6 +1000,7 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(ImageAlphaClear); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageAlphaMask); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageAlphaPremultiply); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageBlurGaussian); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageResize); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageResizeNN); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageResizeCanvas); @@ -932,6 +1008,7 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDither); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageFlipVertical); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageFlipHorizontal); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageRotate); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageRotateCW); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageRotateCCW); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageColorTint); @@ -940,23 +1017,26 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(ImageColorContrast); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageColorBrightness); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageColorReplace); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImageColors); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadImagePalette); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadImageColors); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadImagePalette); RAYLIB_LUA_SOL_ADD_FUNCTION(GetImageAlphaBorder); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetImageColor); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageClearBackground); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawPixel); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawPixelV); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawLine); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawLineV); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawLineEx); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawCircle); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawCircleV); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawCircleLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawCircleLinesV); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawRectangle); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawRectangleV); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawRectangleRec); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawRectangleLines); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawTriangle); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawTriangleEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawTriangleLines); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDraw); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawText); RAYLIB_LUA_SOL_ADD_FUNCTION(ImageDrawTextEx); @@ -965,13 +1045,10 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(LoadTextureFromImage); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadTextureCubemap); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadRenderTexture); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsTextureValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadTexture); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsRenderTextureValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadRenderTexture); - RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateTexture); - RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateTextureRec); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetTextureData); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetScreenData); - RAYLIB_LUA_SOL_ADD_FUNCTION(GenTextureMipmaps); RAYLIB_LUA_SOL_ADD_FUNCTION(SetTextureFilter); RAYLIB_LUA_SOL_ADD_FUNCTION(SetTextureWrap); @@ -980,161 +1057,156 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextureV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextureEx); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextureRec); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextureQuad); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextureTiled); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTexturePro); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextureNPatch); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTexturePoly); + RAYLIB_LUA_SOL_ADD_FUNCTION(ColorIsEqual); RAYLIB_LUA_SOL_ADD_FUNCTION(Fade); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorToInt); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorNormalize); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorFromNormalized); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorToHSV); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorFromHSV); + RAYLIB_LUA_SOL_ADD_FUNCTION(ColorTint); + RAYLIB_LUA_SOL_ADD_FUNCTION(ColorBrightness); + RAYLIB_LUA_SOL_ADD_FUNCTION(ColorContrast); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorAlpha); RAYLIB_LUA_SOL_ADD_FUNCTION(ColorAlphaBlend); + RAYLIB_LUA_SOL_ADD_FUNCTION(ColorLerp); RAYLIB_LUA_SOL_ADD_FUNCTION(GetColor); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetPixelColor); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetPixelColor); RAYLIB_LUA_SOL_ADD_FUNCTION(GetPixelDataSize); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetFontDefault); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFont); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFontEx); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFontFromImage); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFontFromMemory); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadFontData); - RAYLIB_LUA_SOL_ADD_FUNCTION(GenImageFontAtlas); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadFontData); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsFontValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadFont); + RAYLIB_LUA_SOL_ADD_FUNCTION(ExportFontAsCode); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawFPS); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawText); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextEx); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextRec); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextRecEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextPro); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTextCodepoint); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetTextLineSpacing); RAYLIB_LUA_SOL_ADD_FUNCTION(MeasureText); RAYLIB_LUA_SOL_ADD_FUNCTION(MeasureTextEx); RAYLIB_LUA_SOL_ADD_FUNCTION(GetGlyphIndex); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetGlyphInfo); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetGlyphAtlasRec); - RAYLIB_LUA_SOL_ADD_FUNCTION(TextCopy); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetCodepointCount); RAYLIB_LUA_SOL_ADD_FUNCTION(TextIsEqual); RAYLIB_LUA_SOL_ADD_FUNCTION(TextLength); - RAYLIB_LUA_SOL_ADD_FUNCTION(TextFormat); RAYLIB_LUA_SOL_ADD_FUNCTION(TextSubtext); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextRemoveSpaces); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetTextBetween); RAYLIB_LUA_SOL_ADD_FUNCTION(TextReplace); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextReplaceAlloc); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextReplaceBetween); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextReplaceBetweenAlloc); RAYLIB_LUA_SOL_ADD_FUNCTION(TextInsert); - RAYLIB_LUA_SOL_ADD_FUNCTION(TextJoin); - RAYLIB_LUA_SOL_ADD_FUNCTION(TextSplit); - RAYLIB_LUA_SOL_ADD_FUNCTION(TextAppend); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextInsertAlloc); RAYLIB_LUA_SOL_ADD_FUNCTION(TextFindIndex); RAYLIB_LUA_SOL_ADD_FUNCTION(TextToUpper); RAYLIB_LUA_SOL_ADD_FUNCTION(TextToLower); RAYLIB_LUA_SOL_ADD_FUNCTION(TextToPascal); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextToSnake); + RAYLIB_LUA_SOL_ADD_FUNCTION(TextToCamel); RAYLIB_LUA_SOL_ADD_FUNCTION(TextToInteger); - RAYLIB_LUA_SOL_ADD_FUNCTION(TextToUtf8); - - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCodepoints); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCodepointsCount); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetNextCodepoint); - RAYLIB_LUA_SOL_ADD_FUNCTION(CodepointToUtf8); - + RAYLIB_LUA_SOL_ADD_FUNCTION(TextToFloat); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawLine3D); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPoint3D); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCircle3D); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTriangle3D); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawTriangleStrip3D); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCube); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCubeV); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCubeWires); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCubeWiresV); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCubeTexture); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSphere); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSphereEx); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawSphereWires); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCylinder); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCylinderEx); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCylinderWires); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCylinderWiresEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCapsule); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawCapsuleWires); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawPlane); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawRay); RAYLIB_LUA_SOL_ADD_FUNCTION(DrawGrid); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadModel); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadModelFromMesh); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsModelValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadModel); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadModelKeepMeshes); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetModelBoundingBox); + + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModel); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModelEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModelWires); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModelWiresEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBoundingBox); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBillboard); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBillboardRec); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBillboardPro); RAYLIB_LUA_SOL_ADD_FUNCTION(UploadMesh); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawMesh); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawMeshInstanced); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadMesh); + RAYLIB_LUA_SOL_ADD_FUNCTION(DrawMesh); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetMeshBoundingBox); + RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshTangents); RAYLIB_LUA_SOL_ADD_FUNCTION(ExportMesh); + RAYLIB_LUA_SOL_ADD_FUNCTION(ExportMeshAsCode); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadMaterials); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadMaterialDefault); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadMaterial); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetMaterialTexture); - RAYLIB_LUA_SOL_ADD_FUNCTION(SetModelMeshMaterial); - - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadModelAnimations); - RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateModelAnimation); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadModelAnimation); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadModelAnimations); - RAYLIB_LUA_SOL_ADD_FUNCTION(IsModelAnimationValid); - - RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshDefault); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshPoly); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshPlane); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshCube); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshSphere); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshHemiSphere); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshCylinder); + RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshCone); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshTorus); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshKnot); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshHeightmap); RAYLIB_LUA_SOL_ADD_FUNCTION(GenMeshCubicmap); - RAYLIB_LUA_SOL_ADD_FUNCTION(MeshBoundingBox); - RAYLIB_LUA_SOL_ADD_FUNCTION(MeshTangents); - RAYLIB_LUA_SOL_ADD_FUNCTION(MeshBinormals); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadMaterialDefault); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsMaterialValid); + RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadMaterial); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetMaterialTexture); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetModelMeshMaterial); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModel); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModelEx); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModelWires); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawModelWiresEx); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBoundingBox); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBillboard); - RAYLIB_LUA_SOL_ADD_FUNCTION(DrawBillboardRec); + RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateModelAnimation); + RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateModelAnimationEx); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsModelAnimationValid); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionSpheres); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionBoxes); RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionBoxSphere); - RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionRaySphere); - RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionRaySphereEx); - RAYLIB_LUA_SOL_ADD_FUNCTION(CheckCollisionRayBox); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCollisionRayMesh); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCollisionRayModel); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCollisionRayTriangle); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetCollisionRayGround); - + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRayCollisionSphere); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRayCollisionBox); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRayCollisionMesh); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRayCollisionTriangle); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetRayCollisionQuad); RAYLIB_LUA_SOL_ADD_FUNCTION(InitAudioDevice); RAYLIB_LUA_SOL_ADD_FUNCTION(CloseAudioDevice); RAYLIB_LUA_SOL_ADD_FUNCTION(IsAudioDeviceReady); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMasterVolume); + RAYLIB_LUA_SOL_ADD_FUNCTION(GetMasterVolume); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadWave); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadWaveFromMemory); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsWaveValid); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadSound); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadSoundFromWave); - RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateSound); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadSoundAlias); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsSoundValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadWave); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadSound); + RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadSoundAlias); RAYLIB_LUA_SOL_ADD_FUNCTION(ExportWave); RAYLIB_LUA_SOL_ADD_FUNCTION(ExportWaveAsCode); @@ -1142,35 +1214,33 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(StopSound); RAYLIB_LUA_SOL_ADD_FUNCTION(PauseSound); RAYLIB_LUA_SOL_ADD_FUNCTION(ResumeSound); - RAYLIB_LUA_SOL_ADD_FUNCTION(PlaySoundMulti); - RAYLIB_LUA_SOL_ADD_FUNCTION(StopSoundMulti); - RAYLIB_LUA_SOL_ADD_FUNCTION(GetSoundsPlaying); RAYLIB_LUA_SOL_ADD_FUNCTION(IsSoundPlaying); RAYLIB_LUA_SOL_ADD_FUNCTION(SetSoundVolume); RAYLIB_LUA_SOL_ADD_FUNCTION(SetSoundPitch); - RAYLIB_LUA_SOL_ADD_FUNCTION(WaveFormat); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetSoundPan); RAYLIB_LUA_SOL_ADD_FUNCTION(WaveCopy); RAYLIB_LUA_SOL_ADD_FUNCTION(WaveCrop); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadWaveSamples); - RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadWaveSamples); + RAYLIB_LUA_SOL_ADD_FUNCTION(WaveFormat); RAYLIB_LUA_SOL_ADD_FUNCTION(LoadMusicStream); - RAYLIB_LUA_SOL_ADD_FUNCTION(LoadMusicStreamFromMemory); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsMusicValid); RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadMusicStream); RAYLIB_LUA_SOL_ADD_FUNCTION(PlayMusicStream); - RAYLIB_LUA_SOL_ADD_FUNCTION(IsMusicPlaying); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsMusicStreamPlaying); RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateMusicStream); RAYLIB_LUA_SOL_ADD_FUNCTION(StopMusicStream); RAYLIB_LUA_SOL_ADD_FUNCTION(PauseMusicStream); RAYLIB_LUA_SOL_ADD_FUNCTION(ResumeMusicStream); + RAYLIB_LUA_SOL_ADD_FUNCTION(SeekMusicStream); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMusicVolume); RAYLIB_LUA_SOL_ADD_FUNCTION(SetMusicPitch); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetMusicPan); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMusicTimeLength); RAYLIB_LUA_SOL_ADD_FUNCTION(GetMusicTimePlayed); - RAYLIB_LUA_SOL_ADD_FUNCTION(InitAudioStream); - RAYLIB_LUA_SOL_ADD_FUNCTION(UpdateAudioStream); - RAYLIB_LUA_SOL_ADD_FUNCTION(CloseAudioStream); + RAYLIB_LUA_SOL_ADD_FUNCTION(LoadAudioStream); + RAYLIB_LUA_SOL_ADD_FUNCTION(IsAudioStreamValid); + RAYLIB_LUA_SOL_ADD_FUNCTION(UnloadAudioStream); RAYLIB_LUA_SOL_ADD_FUNCTION(IsAudioStreamProcessed); RAYLIB_LUA_SOL_ADD_FUNCTION(PlayAudioStream); RAYLIB_LUA_SOL_ADD_FUNCTION(PauseAudioStream); @@ -1179,15 +1249,92 @@ void raylib_lua_sol_functions(sol::state &lua) { RAYLIB_LUA_SOL_ADD_FUNCTION(StopAudioStream); RAYLIB_LUA_SOL_ADD_FUNCTION(SetAudioStreamVolume); RAYLIB_LUA_SOL_ADD_FUNCTION(SetAudioStreamPitch); + RAYLIB_LUA_SOL_ADD_FUNCTION(SetAudioStreamPan); RAYLIB_LUA_SOL_ADD_FUNCTION(SetAudioStreamBufferSizeDefault); } +static sol::table FilePathListToLuaTable(sol::state& lua, FilePathList list) { + sol::table paths = lua.create_table(); + for (unsigned int i = 0; i < list.count; i++) { + paths[i + 1] = std::string(list.paths[i] ? list.paths[i] : ""); + } + return paths; +} + void TraceLogWrapper(int messageType, const std::string& message) { - TraceLog(messageType, message.c_str()); + TraceLog(messageType, "%s", message.c_str()); } void raylib_lua_sol_function_wrappers(sol::state &lua) { lua.set_function("TraceLog", &TraceLogWrapper); + + lua.set_function("UpdateCamera", [](Camera& camera, int mode) { + UpdateCamera(&camera, mode); + }); + lua.set_function("UpdateCameraPro", [](Camera& camera, Vector3 movement, Vector3 rotation, float zoom) { + UpdateCameraPro(&camera, movement, rotation, zoom); + }); + + lua.set_function("LoadDroppedFiles", [&lua]() { + FilePathList list = LoadDroppedFiles(); + sol::table paths = FilePathListToLuaTable(lua, list); + UnloadDroppedFiles(list); + return paths; + }); + lua.set_function("LoadDirectoryFiles", [&lua](const char* dirPath) { + FilePathList list = LoadDirectoryFiles(dirPath); + sol::table paths = FilePathListToLuaTable(lua, list); + UnloadDirectoryFiles(list); + return paths; + }); + lua.set_function("LoadDirectoryFilesEx", [&lua](const char* basePath, const char* filter, bool scanSubdirs) { + FilePathList list = LoadDirectoryFilesEx(basePath, filter, scanSubdirs); + sol::table paths = FilePathListToLuaTable(lua, list); + UnloadDirectoryFiles(list); + return paths; + }); + + lua.set_function("LoadFontEx", sol::overload( + [](const char* fileName, int fontSize) { + return LoadFontEx(fileName, fontSize, nullptr, 0); + }, + [](const char* fileName, int fontSize, sol::object, int glyphCount) { + return LoadFontEx(fileName, fontSize, nullptr, glyphCount); + } + )); + + lua.set_function("CheckCollisionLines", [](Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2) { + Vector2 collisionPoint{}; + bool collided = CheckCollisionLines(startPos1, endPos1, startPos2, endPos2, &collisionPoint); + return std::tuple(collided, collisionPoint); + }); + + lua.set_function("SetShaderValue", sol::overload( + [](Shader shader, int locIndex, float value) { + SetShaderValue(shader, locIndex, &value, SHADER_UNIFORM_FLOAT); + }, + [](Shader shader, int locIndex, Vector2 value) { + SetShaderValue(shader, locIndex, &value, SHADER_UNIFORM_VEC2); + }, + [](Shader shader, int locIndex, Vector3 value) { + SetShaderValue(shader, locIndex, &value, SHADER_UNIFORM_VEC3); + }, + [](Shader shader, int locIndex, Vector4 value) { + SetShaderValue(shader, locIndex, &value, SHADER_UNIFORM_VEC4); + }, + [](Shader shader, int locIndex, float value, int uniformType) { + SetShaderValue(shader, locIndex, &value, uniformType); + }, + [](Shader shader, int locIndex, Vector2 value, int uniformType) { + SetShaderValue(shader, locIndex, &value, uniformType); + }, + [](Shader shader, int locIndex, Vector3 value, int uniformType) { + SetShaderValue(shader, locIndex, &value, uniformType); + }, + [](Shader shader, int locIndex, Vector4 value, int uniformType) { + SetShaderValue(shader, locIndex, &value, uniformType); + } + )); } void raylib_lua_sol(sol::state& lua) { diff --git a/tests/raylib-lua-sol-tests.lua b/tests/raylib-lua-sol-tests.lua index c9c3910..a92acec 100644 --- a/tests/raylib-lua-sol-tests.lua +++ b/tests/raylib-lua-sol-tests.lua @@ -52,6 +52,6 @@ describe('raylib-lua-sol Tests', function (it) end) it('rlgl', function () - assert(MAX_MATERIAL_MAPS == 12, "MAX_MATERIAL_MAPS should be 12") + assert(RL_MAX_SHADER_LOCATIONS == 32, "RL_MAX_SHADER_LOCATIONS should be 32") end) end) diff --git a/vendor/raylib b/vendor/raylib index 68f664a..dbc56a8 160000 --- a/vendor/raylib +++ b/vendor/raylib @@ -1 +1 @@ -Subproject commit 68f664afa49e4c4f43d93c9ba6b6737b5bc0c326 +Subproject commit dbc56a87da87d973a9c5baa4e7438a9d20121d28 From c5920388381d52035307b078f5a81791c714672f Mon Sep 17 00:00:00 2001 From: Connor O'Connor Date: Sun, 13 Sep 2026 14:16:15 -0400 Subject: [PATCH 2/2] Update Tests.yml --- .github/workflows/Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 1d390aa..7a02f29 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -32,7 +32,7 @@ jobs: - compiler: mingw-w64 platform_name: "MinGW Makefiles" - compiler: msvc - platform_name: "Visual Studio 17 2022" + platform_name: "Visual Studio 18 2026" steps: - uses: actions/checkout@v4 with: