From de768afbdcf9dd6a588ac975bc56e3fd755091c2 Mon Sep 17 00:00:00 2001 From: MJacred Date: Tue, 11 Oct 2022 12:39:41 +0200 Subject: Fetch video adapter driver name and version from OS on Linux/*BSD and Windows --- core/core_bind.cpp | 6 ++++++ core/core_bind.h | 2 ++ core/os/os.h | 2 ++ 3 files changed, 10 insertions(+) (limited to 'core') diff --git a/core/core_bind.cpp b/core/core_bind.cpp index ba48adff6a..c506403133 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -330,6 +330,10 @@ String OS::get_version() const { return ::OS::get_singleton()->get_version(); } +Vector OS::get_video_adapter_driver_info() const { + return ::OS::get_singleton()->get_video_adapter_driver_info(); +} + Vector OS::get_cmdline_args() { List cmdline = ::OS::get_singleton()->get_cmdline_args(); Vector cmdlinev; @@ -548,6 +552,8 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_cmdline_args"), &OS::get_cmdline_args); ClassDB::bind_method(D_METHOD("get_cmdline_user_args"), &OS::get_cmdline_user_args); + ClassDB::bind_method(D_METHOD("get_video_adapter_driver_info"), &OS::get_video_adapter_driver_info); + ClassDB::bind_method(D_METHOD("set_restart_on_exit", "restart", "arguments"), &OS::set_restart_on_exit, DEFVAL(Vector())); ClassDB::bind_method(D_METHOD("is_restart_on_exit_set"), &OS::is_restart_on_exit_set); ClassDB::bind_method(D_METHOD("get_restart_on_exit_arguments"), &OS::get_restart_on_exit_arguments); diff --git a/core/core_bind.h b/core/core_bind.h index 0f85e473a5..bedfbd4089 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -198,6 +198,8 @@ public: Vector get_cmdline_args(); Vector get_cmdline_user_args(); + Vector get_video_adapter_driver_info() const; + String get_locale() const; String get_locale_language() const; diff --git a/core/os/os.h b/core/os/os.h index 6944d29eeb..c8821d07bf 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -118,6 +118,8 @@ public: String get_current_rendering_driver_name() const { return _current_rendering_driver_name; } int get_display_driver_id() const { return _display_driver_id; } + virtual Vector 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; -- cgit v1.2.3