
Script
cnjet
暂无
展开
-
Calling Lua function from C++
<br /><br />Calling Lua function from c++ is very simple. Value passing between c++ and Lua goes through stack, Lua C API provides a convenience ways for you to call Lua function from C. To call Lua function, you need to specify:<br />1. Function Name.<br原创 2010-09-27 13:41:00 · 947 阅读 · 0 评论 -
Accessing Lua global variables from c++
<br /><br />Calling Lua scripts from c++’s example was written in post How to embed Lua 5.1 in C++. Now, let us look at how to access Lua’s global variables from c++.<br />Value passing between c++ and Lua rely on Lua stack. Stack is a data structure based转载 2010-09-27 13:49:00 · 541 阅读 · 0 评论 -
Lua stack dump for c++
<br /><br />Any interactions between c++ and lua are going through lua stack. Aware of the stack status may help for debugging. I always do that, will a peek of the current Lua stack not only helps me debug my codes but also helps me figure out the ways ho原创 2010-09-27 13:57:00 · 2069 阅读 · 0 评论 -
calling c++ function from Lua, implement sleep function
<br /><br />You can’t call c function directly from Lua, you have to create a wrapper function that allows calling from Lua. In this post, shows a simple example to implement millisecond sleep function to Lua using nanosleep.<br />To allow function call fr转载 2010-09-27 13:51:00 · 675 阅读 · 0 评论 -
How to embed Lua 5.1 in C++
<br /><br />Lua, is a scripting language providing dynamic data structures, maths, io and string manipulations just like any interprete language such as Bash, Python, Ruby etc.<br />What is so special about Lua? <br />Lua is Fast, Light-weight and Embeddab转载 2010-09-27 13:54:00 · 988 阅读 · 0 评论 -
Some ideas to embedding lua into C/C++
<br />1. Two different way<br /> lua_open can create a new lua_State. Every lua_State has its own execute environment. So, we can create more than one lua_State.<br /> Way 1: Create a lua_State, load all lua script in it. Call functions in the lua_原创 2010-09-27 14:39:00 · 600 阅读 · 0 评论 -
基于表的Lua原生支持面向对象编程在GUI中的使用示例
lua真的有很多神奇的用法,下面是一个基于表的形式实现的对于GUI的定义。支持事件响应等。可以在线(http://www.lua.org/cgi-bin/demo)测试运行效果。-- CanvasCanvas = { ["frame_msg.OFrame"] = { skin="Engine//Standard.OSkin1StateFrame", image="Engine//StandardDialog.OTexture2D", left=148原创 2010-10-29 14:38:00 · 1641 阅读 · 0 评论 -
Lua code reading
Online Lua 5.1 source code browserRecommended reading order:lmathlib.c, lstrlib.c: get familiar with the external C API. Don't bother with the pattern matcher though. Just the easy functions转载 2011-11-29 14:56:08 · 828 阅读 · 0 评论