4 #include "io/resource_loader.h" 5 #include "io/resource_saver.h" 6 #include "os/file_access.h" 7 #include "os/dir_access.h" 9 #include "os/semaphore.h" 17 static void _bind_methods();
24 RES load(
const String &p_path,
const String& p_type_hint=
"",
bool p_no_cache =
false);
26 void set_abort_on_missing_resources(
bool p_abort);
28 bool has(
const String& p_path);
38 static void _bind_methods();
44 FLAG_RELATIVE_PATHS=1,
45 FLAG_BUNDLE_RESOURCES=2,
47 FLAG_OMIT_EDITOR_PROPERTIES=8,
48 FLAG_SAVE_BIG_ENDIAN=16,
54 Error save(
const String &p_path,
const RES& p_resource, uint32_t p_flags);
68 static void _bind_methods();
69 static _OS *singleton;
97 Point2 get_mouse_pos()
const;
98 void set_window_title(
const String& p_title);
99 int get_mouse_button_state()
const;
102 void set_clipboard(
const String& p_text);
103 String get_clipboard()
const;
105 void set_video_mode(
const Size2& p_size,
bool p_fullscreen,
bool p_resizeable,
int p_screen=0);
106 Size2 get_video_mode(
int p_screen=0)
const;
107 bool is_video_mode_fullscreen(
int p_screen=0)
const;
108 bool is_video_mode_resizable(
int p_screen=0)
const;
109 Array get_fullscreen_mode_list(
int p_screen=0)
const;
112 virtual int get_screen_count()
const;
113 virtual int get_current_screen()
const;
114 virtual void set_current_screen(
int p_screen);
115 virtual Point2 get_screen_position(
int p_screen=0)
const;
116 virtual Size2 get_screen_size(
int p_screen=0)
const;
117 virtual Point2 get_window_position()
const;
118 virtual void set_window_position(
const Point2& p_position);
119 virtual Size2 get_window_size()
const;
120 virtual void set_window_size(
const Size2& p_size);
121 virtual void set_window_fullscreen(
bool p_enabled);
122 virtual bool is_window_fullscreen()
const;
123 virtual void set_window_resizable(
bool p_enabled);
124 virtual bool is_window_resizable()
const;
125 virtual void set_window_minimized(
bool p_enabled);
126 virtual bool is_window_minimized()
const;
127 virtual void set_window_maximized(
bool p_enabled);
128 virtual bool is_window_maximized()
const;
131 Error native_video_play(
String p_path,
float p_volume,
String p_audio_track,
String p_subtitle_track);
132 bool native_video_is_playing();
133 void native_video_pause();
134 void native_video_unpause();
135 void native_video_stop();
137 void set_iterations_per_second(
int p_ips);
138 int get_iterations_per_second()
const;
140 void set_target_fps(
int p_fps);
141 float get_target_fps()
const;
143 void set_low_processor_usage_mode(
bool p_enabled);
144 bool is_in_low_processor_usage_mode()
const;
146 String get_executable_path()
const;
149 Error kill(
int p_pid);
150 Error shell_open(
String p_uri);
152 int get_process_ID()
const;
154 bool has_environment(
const String& p_var)
const;
160 String get_locale()
const;
161 String get_model_name()
const;
164 String get_custom_level()
const;
166 float get_frames_per_second()
const;
168 void dump_memory_to_file(
const String& p_file);
169 void dump_resources_to_file(
const String& p_file);
171 void print_resources_in_use(
bool p_short=
false);
172 void print_all_resources(
const String& p_to_file);
173 void print_all_textures_by_size();
176 bool has_touchscreen_ui_hint()
const;
178 bool is_debug_build()
const;
180 String get_unique_ID()
const;
182 String get_scancode_string(uint32_t p_code)
const;
183 bool is_scancode_unicode(uint32_t p_unicode)
const;
184 int find_scancode_from_string(
const String& p_code)
const;
205 void set_use_file_access_save_and_swap(
bool p_enable);
207 void set_icon(
const Image& p_icon);
211 uint64_t get_unix_time()
const;
212 uint64_t get_system_time_secs()
const;
214 int get_static_memory_usage()
const;
215 int get_static_memory_peak_usage()
const;
216 int get_dynamic_memory_usage()
const;
218 void delay_usec(uint32_t p_usec)
const;
219 void delay_msec(uint32_t p_msec)
const;
220 uint32_t get_ticks_msec()
const;
221 uint32_t get_splash_tick_msec()
const;
223 bool can_use_threads()
const;
225 bool can_draw()
const;
227 int get_frames_drawn();
229 bool is_stdout_verbose()
const;
231 int get_processor_count()
const;
236 SYSTEM_DIR_DOCUMENTS,
237 SYSTEM_DIR_DOWNLOADS,
241 SYSTEM_DIR_RINGTONES,
244 enum ScreenOrientation {
246 SCREEN_ORIENTATION_LANDSCAPE,
247 SCREEN_ORIENTATION_PORTRAIT,
248 SCREEN_ORIENTATION_REVERSE_LANDSCAPE,
249 SCREEN_ORIENTATION_REVERSE_PORTRAIT,
250 SCREEN_ORIENTATION_SENSOR_LANDSCAPE,
251 SCREEN_ORIENTATION_SENSOR_PORTRAIT,
252 SCREEN_ORIENTATION_SENSOR,
255 String get_system_dir(SystemDir p_dir)
const;
258 String get_data_dir()
const;
260 void alert(
const String& p_alert,
const String& p_title=
"ALERT!");
263 void set_screen_orientation(ScreenOrientation p_orientation);
264 ScreenOrientation get_screen_orientation()
const;
266 void set_keep_screen_on(
bool p_enabled);
267 bool is_keep_screen_on()
const;
269 void set_time_scale(
float p_scale);
270 float get_time_scale();
272 bool is_ok_left_and_cancel_right()
const;
274 Error set_thread_name(
const String& p_name);
276 static _OS *get_singleton() {
return singleton; }
281 VARIANT_ENUM_CAST(_OS::SystemDir);
282 VARIANT_ENUM_CAST(_OS::ScreenOrientation);
292 static void _bind_methods();
297 DVector<Plane> build_cylinder_planes(
float p_radius,
float p_height,
int p_sides, Vector3::Axis p_axis=Vector3::AXIS_Z);
298 DVector<Plane> build_capsule_planes(
float p_radius,
float p_height,
int p_sides,
int p_lats, Vector3::Axis p_axis=Vector3::AXIS_Z);
310 real_t segment_intersects_circle(
const Vector2& p_from,
const Vector2& p_to,
const Vector2& p_circle_pos, real_t p_circle_radius);
311 int get_uv84_normal_bit(
const Vector3& p_vector);
330 static void _bind_methods();
342 Error open_encrypted_pass(
const String& p_path,
int p_mode_flags,
const String& p_pass);
345 Error open(
const String& p_path,
int p_mode_flags);
347 bool is_open()
const;
349 void seek(int64_t p_position);
350 void seek_end(int64_t p_position=0);
351 int64_t get_pos()
const;
352 int64_t get_len()
const;
354 bool eof_reached()
const;
356 uint8_t get_8()
const;
357 uint16_t get_16()
const;
358 uint32_t get_32()
const;
359 uint64_t get_64()
const;
361 float get_float()
const;
362 double get_double()
const;
363 real_t get_real()
const;
369 String get_as_text()
const;
376 void set_endian_swap(
bool p_swap);
377 bool get_endian_swap();
379 Error get_error()
const;
381 void store_8(uint8_t p_dest);
382 void store_16(uint16_t p_dest);
383 void store_32(uint32_t p_dest);
384 void store_64(uint64_t p_dest);
386 void store_float(
float p_dest);
387 void store_double(
double p_dest);
388 void store_real(real_t p_real);
390 void store_string(
const String& p_string);
391 void store_line(
const String& p_string);
393 virtual void store_pascal_string(
const String& p_string);
394 virtual String get_pascal_string();
401 void store_var(
const Variant& p_var);
403 bool file_exists(
const String& p_name)
const;
416 static void _bind_methods();
419 Error open(
const String& p_path);
421 bool list_dir_begin();
423 bool current_is_dir()
const;
427 int get_drive_count();
428 String get_drive(
int p_drive);
430 Error change_dir(
String p_dir);
433 Error make_dir(
String p_dir);
434 Error make_dir_recursive(
String p_dir);
436 bool file_exists(
String p_file);
437 bool dir_exists(
String p_dir);
439 int get_space_left();
443 Error
remove(
String p_name);
447 virtual ~_Directory();
457 static void _bind_methods();
480 static void _bind_methods();
496 static void _bind_methods();
514 volatile bool active;
518 static void _bind_methods();
519 static void _start_func(
void *ud);
531 bool is_active()
const;
538 #endif // CORE_BIND_H Definition: core_bind.h:323
Definition: reference.h:78
Definition: main_loop.h:38
Definition: core_bind.h:475
Definition: string_db.h:48
Definition: reference.h:40
Definition: core_bind.h:451
Definition: core_bind.h:491
Definition: core_bind.h:63
Definition: dictionary.h:42
Definition: core_bind.h:410
Definition: core_bind.h:285
Definition: core_bind.h:506
Definition: semaphore.h:37
Definition: core_bind.h:33
Definition: core_bind.h:12
Definition: file_access.h:40
Definition: dir_access.h:41