From 2cc1cdc27b77cb883145bf719269233f35f311f3 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Thu, 12 Aug 2021 09:19:43 -0700 Subject: [PATCH] Update external texture flag configuration. --- doc/classes/ExternalTexture.xml | 2 +- scene/resources/texture.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/classes/ExternalTexture.xml b/doc/classes/ExternalTexture.xml index 09e33a5ac71..cf372fbfc71 100644 --- a/doc/classes/ExternalTexture.xml +++ b/doc/classes/ExternalTexture.xml @@ -18,7 +18,7 @@ - + External texture size. diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 092afd3568d..3096baa3652 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2606,15 +2606,14 @@ void ExternalTexture::set_flags(uint32_t p_flags) { } uint32_t ExternalTexture::get_flags() const { - // not supported - return 0; + return Texture::FLAG_VIDEO_SURFACE; } ExternalTexture::ExternalTexture() { size = Size2(1.0, 1.0); texture = VisualServer::get_singleton()->texture_create(); - VisualServer::get_singleton()->texture_allocate(texture, size.width, size.height, 0, Image::FORMAT_RGBA8, VS::TEXTURE_TYPE_EXTERNAL, 0); + VisualServer::get_singleton()->texture_allocate(texture, size.width, size.height, 0, Image::FORMAT_RGBA8, VS::TEXTURE_TYPE_EXTERNAL, Texture::FLAG_VIDEO_SURFACE); _change_notify(); emit_changed(); }