diff options
Diffstat (limited to 'servers/rendering/renderer_viewport.cpp')
-rw-r--r-- | servers/rendering/renderer_viewport.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index d52da5b331..fc3d8a78e7 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -608,19 +608,20 @@ void RendererViewport::draw_viewports() { } } -RID RendererViewport::viewport_create() { - Viewport *viewport = memnew(Viewport); - - RID rid = viewport_owner.make_rid(viewport); +RID RendererViewport::viewport_allocate() { + return viewport_owner.allocate_rid(); +} - viewport->self = rid; +void RendererViewport::viewport_initialize(RID p_rid) { + Viewport *viewport = memnew(Viewport); + viewport->self = p_rid; viewport->hide_scenario = false; viewport->hide_canvas = false; viewport->render_target = RSG::storage->render_target_create(); viewport->shadow_atlas = RSG::scene->shadow_atlas_create(); viewport->viewport_render_direct_to_screen = false; - return rid; + viewport_owner.initialize_rid(p_rid, viewport); } void RendererViewport::viewport_set_use_xr(RID p_viewport, bool p_use_xr) { @@ -1019,5 +1020,10 @@ void RendererViewport::set_default_clear_color(const Color &p_color) { RSG::storage->set_default_clear_color(p_color); } +//workaround for setting this on thread +void RendererViewport::call_set_use_vsync(bool p_enable) { + DisplayServer::get_singleton()->_set_use_vsync(p_enable); +} + RendererViewport::RendererViewport() { } |