Tutorial: Using Lua with C++
This is a detailed walk-through demonstrating how to integrate Lua scripting into a C++ application. You will learn all the steps required to add Lua to your program, from the very basics of including, building, and starting up Lua within your program, to advanced topics such as sharing objects between C++ and Lua through shared pointers and userdata.
Lua is a powerful, efficient, lightweight, embeddable scripting language. It is designed, implemented, and maintained by a team at PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil. You can learn more about Lua on its home page: https://www.lua.org
All of the example source code covered by this tutorial is available on my GitHub: https://github.com/rhymu8354/LuaCppTutorial.git
This is a longer tutorial covering numerous topics. For your convenience, here is an index with timestamps for skipping to specific sections which may interest you:
0:26 - Brief overview of Lua
6:30 - How to get the example code
7:46 - Build system setup
10:16 - Header files
11:07 - Creating and destroying a Lua instance
13:30 - Loading scripts
14:19 - Calling Lua from C++
16:38 - Brief overview of Lua stack
20:09 - Delegates
21:58 - allocator
23:28 - reader
25:55 - protected call message handler
20:42 / 35:01 - Lua standard library
35:54 - Userdata and metatables
37:04 - Value types
48:29 - Objects owned by Lua
54:51 - Objects shared with Lua
1:01:24 - Calling C++ from Lua
1:02:45 - Using the Lua registry for stashing values for later use
The examples in this tutorial include CMake recipes for setting up the build environment for compiling and linking the example source code into working programs. CMake is an open-source, cross-platform family of tools designed to build, test and package software. You can learn more about CMake on its home page: https://cmake.org/
Please also consider my introduction video for Google Test and CMake, which covers how to set up CMake with Visual Studio Code in order to build C++ libraries and programs on various operating systems and environments, as well as giving you a taste of Test Driven Development: https://youtu.be/Lp1ifh9TuFI
Видео Tutorial: Using Lua with C++ канала Rhymu's Videos
Lua is a powerful, efficient, lightweight, embeddable scripting language. It is designed, implemented, and maintained by a team at PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil. You can learn more about Lua on its home page: https://www.lua.org
All of the example source code covered by this tutorial is available on my GitHub: https://github.com/rhymu8354/LuaCppTutorial.git
This is a longer tutorial covering numerous topics. For your convenience, here is an index with timestamps for skipping to specific sections which may interest you:
0:26 - Brief overview of Lua
6:30 - How to get the example code
7:46 - Build system setup
10:16 - Header files
11:07 - Creating and destroying a Lua instance
13:30 - Loading scripts
14:19 - Calling Lua from C++
16:38 - Brief overview of Lua stack
20:09 - Delegates
21:58 - allocator
23:28 - reader
25:55 - protected call message handler
20:42 / 35:01 - Lua standard library
35:54 - Userdata and metatables
37:04 - Value types
48:29 - Objects owned by Lua
54:51 - Objects shared with Lua
1:01:24 - Calling C++ from Lua
1:02:45 - Using the Lua registry for stashing values for later use
The examples in this tutorial include CMake recipes for setting up the build environment for compiling and linking the example source code into working programs. CMake is an open-source, cross-platform family of tools designed to build, test and package software. You can learn more about CMake on its home page: https://cmake.org/
Please also consider my introduction video for Google Test and CMake, which covers how to set up CMake with Visual Studio Code in order to build C++ libraries and programs on various operating systems and environments, as well as giving you a taste of Test Driven Development: https://youtu.be/Lp1ifh9TuFI
Видео Tutorial: Using Lua with C++ канала Rhymu's Videos
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![040 [DataDisintegrator] map references, grammar refinements](https://i.ytimg.com/vi/AhSAeiIqY94/default.jpg)
![029 [DataDisintegrator] test-driven development of my parser](https://i.ytimg.com/vi/q16wpQa3EX4/default.jpg)
![007 [DataDisintegrator] porting my !DSL compiler from C to Rust](https://i.ytimg.com/vi/DTVue4jFaNI/default.jpg)
![Learning wgpu, egui, and rapier (Day 15)](https://i.ytimg.com/vi/eLZfr-wv7TQ/default.jpg)
![I Designed, Built, and Programmed my own Keyboard](https://i.ytimg.com/vi/TqD0wnGAJwk/default.jpg)
![Rusty Keyboard (028) - Programming LEDs](https://i.ytimg.com/vi/9S25MZQ_HU4/default.jpg)
![Rusty Keyboard (027 part 3) - Soldering LEDs onto the bottom of the boards](https://i.ytimg.com/vi/vKQegvVlc6M/default.jpg)
![Rusty Keyboard (027 part 2) - Soldering LEDs onto the bottom of the boards](https://i.ytimg.com/vi/TvZZMULDnpo/default.jpg)
![Rusty Keyboard (026) - Load/save key configs, and then some refactoring](https://i.ytimg.com/vi/ghjqpFkyeY0/default.jpg)
![Rusty Keyboard (025) - One-shot mods, alternate mode for Mac vs. Windows](https://i.ytimg.com/vi/9Q_5CN8FzO8/default.jpg)
![Rusty Keyboard (024) - Keyboard is back! I need layer support...](https://i.ytimg.com/vi/tc4H9F5yXUY/default.jpg)
![Rusty Keyboard (023) - Key configurations and layers](https://i.ytimg.com/vi/GI8c3Ljhnq4/default.jpg)
![Rusty Keyboard (022) - Hold-tap logic, 2nd attempt](https://i.ytimg.com/vi/mfpij8GAH_I/default.jpg)
![Rusty Keyboard (021) - Rewriting key state handling code](https://i.ytimg.com/vi/tZbsz76I0ho/default.jpg)
![Rusty Keyboard (020) - Keyboard case, and mod-tap logic](https://i.ytimg.com/vi/GDONDH88ba4/default.jpg)
![Rusty Keyboard (019) - Place and route right-hand side board](https://i.ytimg.com/vi/WsQ2MnpQvJs/default.jpg)
![Rusty Keyboard (018) - Updating schematic/PCB to 36 keys](https://i.ytimg.com/vi/NJEqf5Bl7Ik/default.jpg)
![Rusty Keyboard (017) - Designing top plate](https://i.ytimg.com/vi/YOYxp5P94_A/default.jpg)
![Rusty Keyboard (016) - Better RAM management](https://i.ytimg.com/vi/V3R_JyVj8JE/default.jpg)
![Rusty Keyboard (015) - Testing/Debugging Inter-Board Protocol](https://i.ytimg.com/vi/8fnTnHlQELs/default.jpg)
![Rusty Keyboard (014) - Better Inter-Board Protocol, Part 2](https://i.ytimg.com/vi/Ddb5vnD0WDM/default.jpg)