Загрузка страницы

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
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
27 марта 2020 г. 10:59:37
01:08:45
Яндекс.Метрика