Game.cpp 502 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "lua.hpp"
  2. #include "Device.h"
  3. /*
  4. #include "Game.h"
  5. namespace crown
  6. {
  7. lua_State* state;
  8. void init()
  9. {
  10. state = luaL_newstate();
  11. luaL_openlibs(state);
  12. luaL_loadfile(state, "lua/lua/game.lua.script");
  13. lua_getglobal(state, "init");
  14. lua_pcall(state, 0, 0, 0);
  15. }
  16. void shutdown()
  17. {
  18. lua_getglobal(state, "shutdown");
  19. lua_pcall(state, 0, 0, 0);
  20. lua_close(state);
  21. }
  22. void frame(float dt)
  23. {
  24. lua_getglobal(state, "frame");
  25. lua_pushnumber(state, dt);
  26. lua_pcall(state, 1, 0, 0);
  27. }
  28. }
  29. */