GodotGlobal.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef GODOT_GLOBAL_HPP
  2. #define GODOT_GLOBAL_HPP
  3. #include "Array.hpp"
  4. #include "String.hpp"
  5. #include <gdnative_api_struct.gen.h>
  6. namespace godot {
  7. extern "C" const godot_gdnative_core_api_struct *api;
  8. extern "C" const godot_gdnative_ext_nativescript_api_struct *nativescript_api;
  9. extern "C" const godot_gdnative_ext_nativescript_1_1_api_struct *nativescript_1_1_api;
  10. extern "C" const void *gdnlib;
  11. class Godot {
  12. public:
  13. static void print(const String &message);
  14. static void print_warning(const String &description, const String &function, const String &file, int line);
  15. static void print_error(const String &description, const String &function, const String &file, int line);
  16. static void gdnative_init(godot_gdnative_init_options *o);
  17. static void gdnative_terminate(godot_gdnative_terminate_options *o);
  18. static void nativescript_init(void *handle);
  19. static void nativescript_terminate(void *handle);
  20. static void gdnative_profiling_add_data(const char *p_signature, uint64_t p_time);
  21. template <class... Args>
  22. static void print(const String &fmt, Args... values) {
  23. print(fmt.format(Array::make(values...)));
  24. }
  25. };
  26. struct _RegisterState {
  27. static void *nativescript_handle;
  28. static int language_index;
  29. };
  30. } // namespace godot
  31. #endif