diff options
Diffstat (limited to 'core/os/os.h')
-rw-r--r-- | core/os/os.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/core/os/os.h b/core/os/os.h index 9152b797ef..af7b40f3ec 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -52,7 +52,6 @@ class OS { int low_processor_usage_mode_sleep_usec = 10000; bool _verbose_stdout = false; bool _debug_stdout = false; - bool _single_window = false; String _local_clipboard; int _exit_code = EXIT_FAILURE; // unexpected exit is marked as failure bool _allow_hidpi = false; @@ -70,6 +69,7 @@ class OS { // so we can retrieve the rendering drivers available int _display_driver_id = -1; String _current_rendering_driver_name; + String _current_rendering_method; protected: void _set_logger(CompositeLogger *p_logger); @@ -99,6 +99,8 @@ protected: virtual void initialize_joypads() = 0; void set_current_rendering_driver_name(String p_driver_name) { _current_rendering_driver_name = p_driver_name; } + void set_current_rendering_method(String p_name) { _current_rendering_method = p_name; } + void set_display_driver_id(int p_display_driver_id) { _display_driver_id = p_display_driver_id; } virtual void set_main_loop(MainLoop *p_main_loop) = 0; @@ -117,8 +119,12 @@ public: static OS *get_singleton(); String get_current_rendering_driver_name() const { return _current_rendering_driver_name; } + String get_current_rendering_method() const { return _current_rendering_method; } + int get_display_driver_id() const { return _display_driver_id; } + virtual Vector<String> get_video_adapter_driver_info() const = 0; + void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR); void print(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3; void print_rich(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3; @@ -162,6 +168,8 @@ public: virtual bool set_environment(const String &p_var, const String &p_value) const = 0; virtual String get_name() const = 0; + virtual String get_distribution_name() const = 0; + virtual String get_version() const = 0; virtual List<String> get_cmdline_args() const { return _cmdline; } virtual List<String> get_cmdline_user_args() const { return _user_args; } virtual List<String> get_cmdline_platform_args() const { return List<String>(); } @@ -203,18 +211,15 @@ public: MONTH_DECEMBER, }; - struct Date { + struct DateTime { int64_t year; Month month; uint8_t day; Weekday weekday; - bool dst; - }; - - struct Time { uint8_t hour; uint8_t minute; uint8_t second; + bool dst; }; struct TimeZoneInfo { @@ -222,8 +227,7 @@ public: String name; }; - virtual Date get_date(bool p_utc = false) const = 0; - virtual Time get_time(bool p_utc = false) const = 0; + virtual DateTime get_datetime(bool utc = false) const = 0; virtual TimeZoneInfo get_time_zone_info() const = 0; virtual double get_unix_time() const; @@ -243,17 +247,10 @@ public: void set_stdout_enabled(bool p_enabled); void set_stderr_enabled(bool p_enabled); - virtual bool is_single_window() const; - virtual void disable_crash_handler() {} virtual bool is_disable_crash_handler() const { return false; } virtual void initialize_debugging() {} - virtual void dump_memory_to_file(const char *p_file); - virtual void dump_resources_to_file(const char *p_file); - virtual void print_resources_in_use(bool p_short = false); - virtual void print_all_resources(String p_to_file = ""); - virtual uint64_t get_static_memory_usage() const; virtual uint64_t get_static_memory_peak_usage() const; virtual uint64_t get_free_static_memory() const; @@ -292,8 +289,6 @@ public: virtual Error move_to_trash(const String &p_path) { return FAILED; } - virtual void debug_break(); - virtual int get_exit_code() const; // `set_exit_code` should only be used from `SceneTree` (or from a similar // level, e.g. from the `Main::start` if leaving without creating a `SceneTree`). @@ -306,8 +301,6 @@ public: virtual String get_unique_id() const; - virtual bool can_use_threads() const; - bool has_feature(const String &p_feature); void set_has_server_feature_callback(HasServerFeatureCallback p_callback); |