From e0eca96a6d251e93d2e0653eba987a783f11df4c Mon Sep 17 00:00:00 2001 From: Astie Teddy Date: Sat, 5 Sep 2020 20:43:51 +0200 Subject: [PATCH 1/3] bool type fix --- src/raylua.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/raylua.c b/src/raylua.c index d7a07ee..72404aa 100644 --- a/src/raylua.c +++ b/src/raylua.c @@ -14,6 +14,8 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + #include #include #include From 9b9e9d3168ce88687b8787ffef3ed9d904644a98 Mon Sep 17 00:00:00 2001 From: Astie Teddy Date: Sat, 5 Sep 2020 20:44:37 +0200 Subject: [PATCH 2/3] Indentation fixes --- examples/core_basic_window.lua | 8 ++++---- examples/shapes_logo_raylib.lua | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/core_basic_window.lua b/examples/core_basic_window.lua index e58cb14..cac157d 100644 --- a/examples/core_basic_window.lua +++ b/examples/core_basic_window.lua @@ -3,12 +3,12 @@ rl.SetConfigFlags(rl.FLAG_VSYNC_HINT) rl.InitWindow(800, 450, "raylib [core] example - basic window") while not rl.WindowShouldClose() do - rl.BeginDrawing() + rl.BeginDrawing() - rl.ClearBackground(rl.RAYWHITE) - rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY) + rl.ClearBackground(rl.RAYWHITE) + rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY) - rl.EndDrawing() + rl.EndDrawing() end rl.CloseWindow() diff --git a/examples/shapes_logo_raylib.lua b/examples/shapes_logo_raylib.lua index 61c344d..e64f24a 100644 --- a/examples/shapes_logo_raylib.lua +++ b/examples/shapes_logo_raylib.lua @@ -17,7 +17,7 @@ while not rl.WindowShouldClose() do rl.DrawText("this is NOT a texture!", 350, 370, 10, rl.GRAY) - rl.EndDrawing() + rl.EndDrawing() end -rl.CloseWindow() +rl.CloseWindow() \ No newline at end of file From b45c75e61167910fe9aa43d0b035681eab1771f0 Mon Sep 17 00:00:00 2001 From: Astie Teddy Date: Sat, 5 Sep 2020 20:44:49 +0200 Subject: [PATCH 3/3] Debugger support part --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index cb5592b..bd34717 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,31 @@ Currently, there is no editor autocompletion/integration support for most editor [third-party autocompletion support](https://github.com/Rabios/raylua/tree/master/zerobrane) for [ZeroBrane Studio](https://studio.zerobrane.com/) by [Rabios](https://github.com/Rabios). +#### Debugging + +You can use [Local Lua Debugger for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode) +to provide debugging support with Visual Studio Code. +You need to add this at the beginning of your code to use it : +```lua +do local f = getmetatable(rl).__index;rawset(rl, "__index", function (_, k) return select(2, pcall(f, _, k)) end) end +package.path = package.path .. os.getenv "LUA_PATH" +local lldebugger = require "lldebugger"; lldebugger.start() +``` +You also need to setup a launch configuration in Visual Studio Code to run raylua_s with debugger attached, e.g +```json +{ + "type": "lua-local", + "request": "launch", + "name": "(Lua) Launch", + "cwd": "${workspaceFolder}", + "program": { "command": "PATH TO raylua_s" }, + "args": [ "main.lua OR ${file} OR WHATEVER" ] +} +``` +This debugger doesn't support pausing, you need to place a breakpoint before executing +to get a actual debug, otherwise, a error needs to be thrown in the application to get the debugging. +This debugger has a significant overhead, expect a performance loss in intensive projects. + ### Other bindings raylib-lua (raylua) is not the only Lua binding for raylib.