summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2020-09-16 21:11:39 -0700
committerclayjohn <claynjohn@gmail.com>2020-09-16 21:11:39 -0700
commit40159244cdf5ae7c0e42a7cc402dc103244442e1 (patch)
treec25a5c24d9a0113ab0b2aeeceec5a158c1b67f69 /servers
parent6ac7b90097bceaaaad7fef3c5eb6eb705929f640 (diff)
expose local RenderingDevice creation to RenderingServer
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering_server.cpp5
-rw-r--r--servers/rendering_server.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp
index 8f863a6fc8..9ad19e4b38 100644
--- a/servers/rendering_server.cpp
+++ b/servers/rendering_server.cpp
@@ -1505,9 +1505,14 @@ ShaderLanguage::DataType RenderingServer::global_variable_type_get_shader_dataty
}
}
+RenderingDevice *RenderingServer::create_local_rendering_device() const {
+ return RenderingDevice::get_singleton()->create_local_device();
+}
+
void RenderingServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("force_sync"), &RenderingServer::sync);
ClassDB::bind_method(D_METHOD("force_draw", "swap_buffers", "frame_step"), &RenderingServer::draw, DEFVAL(true), DEFVAL(0.0));
+ ClassDB::bind_method(D_METHOD("create_local_rendering_device"), &RenderingServer::create_local_rendering_device);
#ifndef _MSC_VER
#warning TODO all texture methods need re-binding
diff --git a/servers/rendering_server.h b/servers/rendering_server.h
index 49f840948f..7dae45f126 100644
--- a/servers/rendering_server.h
+++ b/servers/rendering_server.h
@@ -39,6 +39,7 @@
#include "core/typed_array.h"
#include "core/variant.h"
#include "servers/display_server.h"
+#include "servers/rendering/rendering_device.h"
#include "servers/rendering/shader_language.h"
class RenderingServer : public Object {
@@ -1311,6 +1312,8 @@ public:
virtual bool is_low_end() const = 0;
+ RenderingDevice *create_local_rendering_device() const;
+
bool is_render_loop_enabled() const;
void set_render_loop_enabled(bool p_enabled);