GodotGlobal.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_core_1_1_api_struct *core_1_1_api;
  9. extern "C" const godot_gdnative_core_1_2_api_struct *core_1_2_api;
  10. extern "C" const godot_gdnative_ext_nativescript_api_struct *nativescript_api;
  11. extern "C" const godot_gdnative_ext_nativescript_1_1_api_struct *nativescript_1_1_api;
  12. extern "C" const godot_gdnative_ext_pluginscript_api_struct *pluginscript_api;
  13. extern "C" const godot_gdnative_ext_android_api_struct *android_api;
  14. extern "C" const godot_gdnative_ext_arvr_api_struct *arvr_api;
  15. extern "C" const godot_gdnative_ext_videodecoder_api_struct *videodecoder_api;
  16. extern "C" const godot_gdnative_ext_net_api_struct *net_api;
  17. extern "C" const godot_gdnative_ext_net_3_2_api_struct *net_3_2_api;
  18. extern "C" const void *gdnlib;
  19. class Godot {
  20. public:
  21. static void print(const String &message);
  22. static void print_warning(const String &description, const String &function, const String &file, int line);
  23. static void print_error(const String &description, const String &function, const String &file, int line);
  24. static void gdnative_init(godot_gdnative_init_options *o);
  25. static void gdnative_terminate(godot_gdnative_terminate_options *o);
  26. static void nativescript_init(void *handle);
  27. static void nativescript_terminate(void *handle);
  28. static void gdnative_profiling_add_data(const char *p_signature, uint64_t p_time);
  29. template <class... Args>
  30. static void print(const String &fmt, Args... values) {
  31. print(fmt.format(Array::make(values...)));
  32. }
  33. };
  34. struct _RegisterState {
  35. static void *nativescript_handle;
  36. static int language_index;
  37. };
  38. } // namespace godot
  39. #endif