couch/core/Scripting/Lua.h

35 lines
745 B
C
Raw Normal View History

#ifndef LUA_H
#define LUA_H
2021-01-26 16:42:28 -06:00
#include "../Input.h"
#ifdef LUA_SCRIPTING
// Lua includes
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
extern "C" int luaopen_couch(lua_State* L);
#endif // LUA_SCRIPTING
#include "ScriptingLanguage.h"
class Lua : public ScriptingLanguage {
public:
void Initialize();
void Update(double delta);
void Close();
2021-01-21 11:12:45 -06:00
static void Error();
2021-01-20 21:42:14 -06:00
bool HasHook(const char *name);
private:
#ifdef LUA_SCRIPTING
static lua_State *L;
2021-03-08 13:50:50 -06:00
static void LuaKeyHandler(int key, int code, int action, int mods);
static void LuaMousePositionHandler(double xpos, double ypos, double xrel, double yrel);
2021-01-30 15:34:27 -06:00
static int LuaExceptionHandler(lua_State *L1);
#endif // LUA_SCRIPTING
};
#endif /* LUA_H */