Merge pull request #51577 from m4gr3d/update_external_texture_config

Update external texture flag configuration.
This commit is contained in:
Rémi Verschelde 2021-08-12 22:55:15 +02:00 committed by GitHub
commit 4b514bfdff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -18,7 +18,7 @@
</method> </method>
</methods> </methods>
<members> <members>
<member name="flags" type="int" setter="set_flags" getter="get_flags" override="true" default="0" /> <member name="flags" type="int" setter="set_flags" getter="get_flags" override="true" default="2048" />
<member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 1, 1 )"> <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 1, 1 )">
External texture size. External texture size.
</member> </member>

View file

@ -2610,15 +2610,14 @@ void ExternalTexture::set_flags(uint32_t p_flags) {
} }
uint32_t ExternalTexture::get_flags() const { uint32_t ExternalTexture::get_flags() const {
// not supported return Texture::FLAG_VIDEO_SURFACE;
return 0;
} }
ExternalTexture::ExternalTexture() { ExternalTexture::ExternalTexture() {
size = Size2(1.0, 1.0); size = Size2(1.0, 1.0);
texture = VisualServer::get_singleton()->texture_create(); 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(); _change_notify();
emit_changed(); emit_changed();
} }