我的博客小站

随笔分类 -  Lua学习

封装GetProcAddress让Lua调用Windows API
摘要:参考了云风的方法,修复了一点bug。DWORD myLoadLibrary(const char *lpFileName){ HMODULE h = GetModuleHandleA(lpFileName); if ( h==NULL ){ h = LoadLibraryA(lpFileName); } return (DWORD)h;}static int CallApi(lua_State* L){ int n = lua_gettop(L); FARPROC fc=(FARPROC)lua_touserdata(L,lua_upvalue... 阅读全文

posted @ 2012-05-14 11:35 BIGSING 阅读(1999) 评论(0) 推荐(0) 编辑

有趣的Lua表
摘要:原文:http://lua-users.org/wiki/FunWithTables题目:输出1到100之间的数哪些能被3整除,哪些能被5整除.常规的做法是做一个从1到100的循环,让数模3和5,使用if else if这样语句进行判断.for i = 1, 100 do if i %3 == 0 and i % 5 == 0 then print(i .. ' is divisible by both 3 and 5!') elseif i % 3 ~= 0 and i % 5 ~= 0 then print(i .. ' is not divisible by ei 阅读全文

posted @ 2011-08-30 16:40 BIGSING 阅读(415) 评论(0) 推荐(0) 编辑

Hello world with LUA
摘要:http://lua.gts-stolberg.de/en/LuaInC1.phpFor those, who will not only use LUA for their game, I would like to show some possibilties to integrate lua in C.The most simple way to embed Lua in C.Integration of libraries #pragma comment(lib, "lib/lua") #pragma comment(lib, "lib/lualib&qu 阅读全文

posted @ 2011-08-30 16:37 BIGSING 阅读(309) 评论(1) 推荐(0) 编辑

导航

我的博客小站
点击右上角即可分享
微信分享提示