Lua C API tutorial: using the stack and working with tables
Автор: Tyler Neylon
Загружено: 2015-12-05
Просмотров: 15921
This tutorial covers the most fundamental functions of Lua's C API. This will be useful to anyone:
writing a Lua module that needs to run C code,
embedding Lua as a scripting language, or
creating a framework or game engine using Lua.
I don't specifically talk about C++ or Objective-C, but Lua's C API is compatible with those languages as well.
I previously made a video covering how to compile a C module, and how Lua loads C modules: • Essentials of writing a Lua module in C
This video starts out using a some skeleton C code for an example module. That skeleton code can be found here: https://gist.github.com/tylerneylon/5...
In order to compile the skeleton code, you'll need the files lua.h, luaconf.h, and lauxlib.h. Those can be found in any source download of Lua. Check your local Lua version by running "Lua -v" and then download the same-version source from here: http://www.lua.org/ftp/
This video also uses an educational module called apidemo. If you have luarocks, you can install this module by running:
sudo luarocks install apidemo
This module is open source; here is the repo for it:
https://github.com/tylerneylon/lua_ap...
If you like this tutorial, please subscribe to find out when more come out. I also live stream tutorials and game coding sessions: https://www.livecoding.tv/gaarlicbread/
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: