LuaStack.h 595 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "lua.hpp"
  3. #include "Types.h"
  4. namespace crown
  5. {
  6. class LuaStack
  7. {
  8. public:
  9. LuaStack(lua_State* L);
  10. void push_bool(bool value);
  11. void push_int(int32_t value);
  12. void push_float(float value);
  13. void push_string(const char* str, size_t len);
  14. void push_lightudata(void* ptr);
  15. bool get_bool(int32_t index);
  16. int32_t get_int(int32_t index);
  17. float get_float(int32_t index);
  18. const char* get_string(int32_t index);
  19. const void* get_lightudata(int32_t index);
  20. private:
  21. lua_State* m_state;
  22. };
  23. } // namespace crown