GodotGlobal.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_ext_nativescript_api_struct *nativescript_api;
  10. extern "C" const godot_gdnative_ext_nativescript_1_1_api_struct *nativescript_1_1_api;
  11. extern "C" const void *gdnlib;
  12. class Godot {
  13. public:
  14. static void print(const String &message);
  15. static void print_warning(const String &description, const String &function, const String &file, int line);
  16. static void print_error(const String &description, const String &function, const String &file, int line);
  17. static void gdnative_init(godot_gdnative_init_options *o);
  18. static void gdnative_terminate(godot_gdnative_terminate_options *o);
  19. static void nativescript_init(void *handle);
  20. static void nativescript_terminate(void *handle);
  21. static void gdnative_profiling_add_data(const char *p_signature, uint64_t p_time);
  22. template <class... Args>
  23. static void print(const String &fmt, Args... values) {
  24. print(fmt.format(Array::make(values...)));
  25. }
  26. };
  27. struct _RegisterState {
  28. static void *nativescript_handle;
  29. static int language_index;
  30. };
  31. } // namespace godot
  32. #endif