lua_system.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2012-2015 Daniele Bartolini and individual contributors.
  3. * License: https://github.com/taylor001/crown/blob/master/LICENSE
  4. */
  5. #include "types.h"
  6. #include "math_types.h"
  7. #include "lua.hpp"
  8. namespace crown
  9. {
  10. /// Global lua-related functions
  11. namespace lua_globals
  12. {
  13. /// Initializes the lua system.
  14. /// This is the place where to create and initialize per-application objects.
  15. void init();
  16. /// It should reverse the actions performed by lua_globals::init().
  17. void shutdown();
  18. lua_State* state();
  19. /// Clears temporary objects (Vector3, Matrix4x4, ...).
  20. void clear_temporaries();
  21. /// Returns a new temporary Vector2, Vector3, Matrix4x4 or Quaternion
  22. Vector3* next_vector3(const Vector3& v);
  23. Matrix4x4* next_matrix4x4(const Matrix4x4& m);
  24. Quaternion* next_quaternion(const Quaternion& q);
  25. /// Returns whether the object at stack @a index is a Vector3, Matrix4x4 or Quaternion
  26. bool is_vector3(int32_t index);
  27. bool is_matrix4x4(int32_t index);
  28. bool is_quaternion(int32_t index);
  29. } // namespace lua_globals
  30. } // namespace crown