From 49d0c6a5c9726e6575acfc29c08f57362a1bbf10 Mon Sep 17 00:00:00 2001 From: Juan Linietsky <reduzio@gmail.com> Date: Sat, 18 Apr 2020 20:30:57 -0300 Subject: Ability to create local RenderingDevice instances. --- servers/rendering/rendering_device.cpp | 4 +++- servers/rendering/rendering_device.h | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'servers') diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index a3799b0e4d..75ef38354a 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -60,5 +60,7 @@ Vector<uint8_t> RenderingDevice::shader_compile_from_source(ShaderStage p_stage, } RenderingDevice::RenderingDevice() { - singleton = this; + if (singleton == nullptr) { // there may be more rendering devices later + singleton = this; + } } diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 97fe417def..6c58b8fd57 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -1024,6 +1024,11 @@ public: virtual uint32_t get_frame_delay() const = 0; + virtual void submit() = 0; + virtual void sync() = 0; + + virtual RenderingDevice *create_local_device() = 0; + static RenderingDevice *get_singleton(); RenderingDevice(); }; -- cgit v1.2.3