diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-05-03 11:48:46 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-05-23 15:23:18 +0300 |
commit | 628c81d2d9a2cf05541a8d95dd99f6349aca851d (patch) | |
tree | f0063c0a9125e9a6a9562e572429e38efbbb2372 /servers | |
parent | b947c53ddc08d4314b2ce70ca1bc2adb37b83c37 (diff) | |
download | redot-engine-628c81d2d9a2cf05541a8d95dd99f6349aca851d.tar.gz |
[DisplayServer] Add method to check if window transparency is supported and enabled.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/display_server.cpp | 2 | ||||
-rw-r--r-- | servers/display_server.h | 2 | ||||
-rw-r--r-- | servers/rendering/rendering_device.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/rendering_device.h | 2 | ||||
-rw-r--r-- | servers/rendering/rendering_device_driver.h | 2 |
5 files changed, 12 insertions, 0 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 17f1548017..2150a3038e 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -996,6 +996,8 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("tablet_get_current_driver"), &DisplayServer::tablet_get_current_driver); ClassDB::bind_method(D_METHOD("tablet_set_current_driver", "name"), &DisplayServer::tablet_set_current_driver); + ClassDB::bind_method(D_METHOD("is_window_transparency_available"), &DisplayServer::is_window_transparency_available); + #ifndef DISABLE_DEPRECATED BIND_ENUM_CONSTANT(FEATURE_GLOBAL_MENU); #endif diff --git a/servers/display_server.h b/servers/display_server.h index 9a9bb28a06..5224d59c04 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -580,6 +580,8 @@ public: virtual void set_context(Context p_context); + virtual bool is_window_transparency_available() const { return false; } + static void register_create_function(const char *p_name, CreateFunction p_function, GetRenderingDriversFunction p_get_drivers); static int get_create_function_count(); static const char *get_create_function_name(int p_index); diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 15e1731823..98dc9885fc 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -4734,6 +4734,10 @@ String RenderingDevice::get_device_api_name() const { return driver->get_api_name(); } +bool RenderingDevice::is_composite_alpha_supported() const { + return driver->is_composite_alpha_supported(main_queue); +} + String RenderingDevice::get_device_api_version() const { return driver->get_api_version(); } diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 42773fc347..d0fa4ab1fa 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -1360,6 +1360,8 @@ public: String get_device_api_version() const; String get_device_pipeline_cache_uuid() const; + bool is_composite_alpha_supported() const; + uint64_t get_driver_resource(DriverResource p_resource, RID p_rid = RID(), uint64_t p_index = 0); static RenderingDevice *get_singleton(); diff --git a/servers/rendering/rendering_device_driver.h b/servers/rendering/rendering_device_driver.h index e9464ba321..f9a861426a 100644 --- a/servers/rendering/rendering_device_driver.h +++ b/servers/rendering/rendering_device_driver.h @@ -769,6 +769,8 @@ public: virtual String get_pipeline_cache_uuid() const = 0; virtual const Capabilities &get_capabilities() const = 0; + virtual bool is_composite_alpha_supported(CommandQueueID p_queue) const { return false; } + /******************/ virtual ~RenderingDeviceDriver(); |