dev:epic
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dev:epic [2022/10/27 17:07] – lmcrae | dev:epic [2023/05/29 21:04] (current) – removed lmcrae | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== tolua Notes ===== | ||
| - | [[dev: | ||
| - | |||
| - | ===== C++ calling lua ===== | ||
| - | |||
| - | Here is how a C++ class can call into it's lua instance. I think this is where I was confused by what was being asking. Sorry, I don't know why it wasn't apparent to me. | ||
| - | |||
| - | * I have a LuaObject that has access to it's Rtti/ | ||
| - | * I also have my own header parser that generates this code. | ||
| - | * So I have access to the actual class name such as " | ||
| - | * {{: | ||
| - | * Every class has a class metatable that represent that class in lua | ||
| - | * These metatables are created and populated during initialization. | ||
| - | * There is master table stored in the lua registry that has a mapping from class names to metatables. | ||
| - | * There is also a mapping of c++ lightuserdata (pointer/ | ||
| - | * To allow lua full ownership of C++ instances, there is a lua table for garbage collection. | ||
| - | * When a userdata is collected, this list is checked too see if the instance needs collecting. | ||
| - | * If it does, it uses the class destructor if it was exposed in the C++ header. | ||
| - | |||
| - | ===== Editor ===== | ||
| - | This is an example of the forge:: | ||
| - | |||
| - | {{: | ||
| - | |||
| - | ===== lua calling C++ ===== | ||
| - | |||
| - | Here is a stripped down class that shows the basics of how the system calls a C++ function from lua. | ||
| - | |||
| - | **1)** Header files are marked up using comments to expose/ | ||
| - | |||
| - | {{: | ||
| - | |||
| - | **2)** Here is the generated cpp that gets added to the project. | ||
| - | {{: | ||
| - | |||
/home/admin/domains/wiki.d20dungeons.com/public_html/data/attic/dev/epic.1666890441.txt.gz · Last modified: (external edit)
