diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-11-11 14:18:10 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-11 14:18:10 -0600 |
commit | 4b447ec4e5d3ecf833e2e81130b3eeaf110dad7b (patch) | |
tree | 776c1a512ab1b4280e920b82979efd2f837121e2 /servers | |
parent | 4e7cf69e6e4fbd1da1a3094cd12a7dcca414a0c4 (diff) | |
parent | 4a70ac29482f552293fcf373760ea102db47069a (diff) | |
download | redot-engine-4b447ec4e5d3ecf833e2e81130b3eeaf110dad7b.tar.gz |
Merge pull request #85430 from Calinou/os-expose-rendering-driver-method
Expose RenderingServer methods to get rendering driver and method name
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering_server.cpp | 13 | ||||
-rw-r--r-- | servers/rendering_server.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 272908aa49..c0c6f1e904 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2067,6 +2067,16 @@ void RenderingServer::_particles_set_trail_bind_poses(RID p_particles, const Typ particles_set_trail_bind_poses(p_particles, tbposes); } +String RenderingServer::get_current_rendering_driver_name() const { + // Needs to remain in OS, since it's actually OS that interacts with it, but it's better exposed here. + return ::OS::get_singleton()->get_current_rendering_driver_name(); +} + +String RenderingServer::get_current_rendering_method() const { + // Needs to remain in OS, since it's actually OS that interacts with it, but it's better exposed here. + return ::OS::get_singleton()->get_current_rendering_method(); +} + Vector<uint8_t> _convert_surface_version_1_to_surface_version_2(uint64_t p_format, Vector<uint8_t> p_vertex_data, uint32_t p_vertex_count, uint32_t p_old_stride, uint32_t p_vertex_size, uint32_t p_normal_size, uint32_t p_position_stride, uint32_t p_normal_tangent_stride) { Vector<uint8_t> new_vertex_data; new_vertex_data.resize(p_vertex_data.size()); @@ -3423,6 +3433,9 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_video_adapter_type"), &RenderingServer::get_video_adapter_type); ClassDB::bind_method(D_METHOD("get_video_adapter_api_version"), &RenderingServer::get_video_adapter_api_version); + ClassDB::bind_method(D_METHOD("get_current_rendering_driver_name"), &RenderingServer::get_current_rendering_driver_name); + ClassDB::bind_method(D_METHOD("get_current_rendering_method"), &RenderingServer::get_current_rendering_method); + ClassDB::bind_method(D_METHOD("make_sphere_mesh", "latitudes", "longitudes", "radius"), &RenderingServer::make_sphere_mesh); ClassDB::bind_method(D_METHOD("get_test_cube"), &RenderingServer::get_test_cube); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 90365a19eb..6de934aaeb 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -1787,6 +1787,9 @@ public: virtual bool is_on_render_thread() = 0; virtual void call_on_render_thread(const Callable &p_callable) = 0; + String get_current_rendering_driver_name() const; + String get_current_rendering_method() const; + #ifdef TOOLS_ENABLED virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override; #endif |