2017-05-13 11:55:04 +00:00
|
|
|
#ifndef GODOT_GLOBAL_HPP
|
|
|
|
#define GODOT_GLOBAL_HPP
|
|
|
|
|
2018-03-07 12:21:33 +00:00
|
|
|
#include "Array.hpp"
|
2018-11-23 22:09:41 +00:00
|
|
|
#include "String.hpp"
|
|
|
|
#include <gdnative_api_struct.gen.h>
|
2017-05-13 11:55:04 +00:00
|
|
|
|
|
|
|
namespace godot {
|
|
|
|
|
2017-11-23 11:50:05 +00:00
|
|
|
extern "C" const godot_gdnative_core_api_struct *api;
|
2019-05-22 09:06:01 +00:00
|
|
|
extern "C" const godot_gdnative_core_1_1_api_struct *core_1_1_api;
|
2017-11-23 11:50:05 +00:00
|
|
|
extern "C" const godot_gdnative_ext_nativescript_api_struct *nativescript_api;
|
2018-02-11 14:50:01 +00:00
|
|
|
extern "C" const godot_gdnative_ext_nativescript_1_1_api_struct *nativescript_1_1_api;
|
|
|
|
|
|
|
|
extern "C" const void *gdnlib;
|
2017-10-20 23:42:10 +00:00
|
|
|
|
2017-07-23 15:53:50 +00:00
|
|
|
class Godot {
|
2017-05-13 11:55:04 +00:00
|
|
|
|
|
|
|
public:
|
2018-11-23 22:09:41 +00:00
|
|
|
static void print(const String &message);
|
|
|
|
static void print_warning(const String &description, const String &function, const String &file, int line);
|
|
|
|
static void print_error(const String &description, const String &function, const String &file, int line);
|
2017-05-13 11:55:04 +00:00
|
|
|
|
2018-01-11 16:57:52 +00:00
|
|
|
static void gdnative_init(godot_gdnative_init_options *o);
|
|
|
|
static void gdnative_terminate(godot_gdnative_terminate_options *o);
|
|
|
|
static void nativescript_init(void *handle);
|
2018-02-11 14:50:01 +00:00
|
|
|
static void nativescript_terminate(void *handle);
|
2018-03-07 12:21:33 +00:00
|
|
|
|
2018-08-20 15:18:12 +00:00
|
|
|
static void gdnative_profiling_add_data(const char *p_signature, uint64_t p_time);
|
|
|
|
|
2018-03-07 12:21:33 +00:00
|
|
|
template <class... Args>
|
2018-11-23 22:09:41 +00:00
|
|
|
static void print(const String &fmt, Args... values) {
|
2018-03-07 12:21:33 +00:00
|
|
|
print(fmt.format(Array::make(values...)));
|
|
|
|
}
|
2017-05-13 11:55:04 +00:00
|
|
|
};
|
|
|
|
|
2017-07-24 12:23:09 +00:00
|
|
|
struct _RegisterState {
|
|
|
|
static void *nativescript_handle;
|
2018-02-11 14:50:01 +00:00
|
|
|
static int language_index;
|
2017-07-24 12:23:09 +00:00
|
|
|
};
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
} // namespace godot
|
2017-05-13 11:55:04 +00:00
|
|
|
|
|
|
|
#endif
|