Josh Posted March 22, 2018 Author Share Posted March 22, 2018 I might have found a good library for the Lua binding that supports shared pointers: https://github.com/SteveKChiu/lua-intf Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2018 Author Share Posted March 24, 2018 Another possibility: https://github.com/lubyk/dub This one looks the most promising: https://github.com/ThePhD/sol2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 24, 2018 Share Posted March 24, 2018 I added a massive amount of generated snippets based on the Leadwerks API. Video and more details here: Quote Link to comment Share on other sites More sharing options...
Josh Posted March 27, 2018 Author Share Posted March 27, 2018 At this point it does not look like sol2 can do the bindings we want due to this issue: https://github.com/ThePhD/sol2/issues/616 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 27, 2018 Author Share Posted March 27, 2018 2 hours ago, Josh said: At this point it does not look like sol2 can do the bindings we want due to this issue: https://github.com/ThePhD/sol2/issues/616 I might have a solution! Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 27, 2018 Author Share Posted March 27, 2018 I have this script working now with sol2: print("Starting...") local window = CreateWindow("My Game",0,0,1024,768) local context = CreateContext(window,0) local world = CreateWorld() local model = CreateBox(world,1,1,1) local camera = CreateCamera(world) local v = Vec3(0,0,-5) camera:SetPosition(v,false) while true do local table = {} table.value = 1 table.test = 3 table.mything = "Hello how are you?" if window:KeyHit(KEY_ESCAPE) then break end if window:KeyHit(KEY_SPACE) then model = nil end if window:KeyHit(KEY_G) then collectgarbage() end world:Render(context) end Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 28, 2018 Share Posted March 28, 2018 Very nice. Is calling the garbage collector something we will have to do or is this handled internally? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 28, 2018 Author Share Posted March 28, 2018 1 hour ago, AggrorJorn said: Very nice. Is calling the garbage collector something we will have to do or is this handled internally? Lua automatically calls the GC when enough memory is accrued, but you can also call it yourself whenever you want. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 28, 2018 Author Share Posted March 28, 2018 I’m at home right now and don’t have my computer here. I am very curious about something. Can someone please run this code in main.lua and telll me what it prints out? v1 = Vec3(1,2,3) v2 = Vec3(1,2,3) v3 = v2 v3.x = 69 print(v1) print(v2) print(v3) Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted March 28, 2018 Share Posted March 28, 2018 1.000000, 2.000000, 3.000000 69.000000, 2.000000, 3.000000 69.000000, 2.000000, 3.000000 If I use System:Print(). 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted March 28, 2018 Author Share Posted March 28, 2018 Thanks. That answers my question here: https://github.com/ThePhD/sol2/issues/621 This is shaping up really nicely. All your guys’ input is definitely appreciated. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.