expose local RenderingDevice creation to RenderingServer

This commit is contained in:
clayjohn 2020-09-16 21:11:39 -07:00
parent 6ac7b90097
commit 40159244cd
2 changed files with 8 additions and 0 deletions

View File

@ -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() { void RenderingServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("force_sync"), &RenderingServer::sync); 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("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 #ifndef _MSC_VER
#warning TODO all texture methods need re-binding #warning TODO all texture methods need re-binding

View File

@ -39,6 +39,7 @@
#include "core/typed_array.h" #include "core/typed_array.h"
#include "core/variant.h" #include "core/variant.h"
#include "servers/display_server.h" #include "servers/display_server.h"
#include "servers/rendering/rendering_device.h"
#include "servers/rendering/shader_language.h" #include "servers/rendering/shader_language.h"
class RenderingServer : public Object { class RenderingServer : public Object {
@ -1311,6 +1312,8 @@ public:
virtual bool is_low_end() const = 0; virtual bool is_low_end() const = 0;
RenderingDevice *create_local_rendering_device() const;
bool is_render_loop_enabled() const; bool is_render_loop_enabled() const;
void set_render_loop_enabled(bool p_enabled); void set_render_loop_enabled(bool p_enabled);