Skip to content

Instantly share code, notes, and snippets.

@Bradshaw
Created November 20, 2012 19:45
Show Gist options
  • Save Bradshaw/4120537 to your computer and use it in GitHub Desktop.
Save Bradshaw/4120537 to your computer and use it in GitHub Desktop.
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include <stdio.h>
void maFonctionC(){
printf("Cool\n");
}
int main(int argc, char** argv, char** env){
lua_State *L = lua_open();
luaL_openlibs(L);
luaL_dofile(L, "script.lua");
static const luaL_reg cfunc[]={
{"func", maFonctionC},
{NULL, NULL}
};
luaL_register(L, "c", renderfunc);
char buff[256];
int error;
while (1){
lua_getfield(L, LUA_GLOBALSINDEX, "update");
lua_call(L, 0, 0);
}
return 0;
}
function update()
c.maFonctionC()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment