Skip to content
0.2.0-dev Download ZIP
36 lines ·1.9 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="ExternalTexture" inherits="Texture2D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Texture which displays the content of an external buffer.
5 </brief_description>
6 <description>
7 Displays the content of an external buffer provided by the platform.
8 Requires the [url=https://registry.khronos.org/OpenGL/extensions/OES/OES_EGL_image_external.txt]OES_EGL_image_external[/url] extension (OpenGL) or [url=https://registry.khronos.org/vulkan/specs/1.1-extensions/html/vkspec.html#VK_ANDROID_external_memory_android_hardware_buffer]VK_ANDROID_external_memory_android_hardware_buffer[/url] extension (Vulkan).
9 [b]Note:[/b] This is currently only supported in Android builds.
10 </description>
11 <tutorials>
12 </tutorials>
13 <methods>
14 <method name="get_external_texture_id" qualifiers="const">
15 <return type="int" />
16 <description>
17 Returns the external texture ID.
18 Depending on your use case, you may need to pass this to platform APIs, for example, when creating an [code]android.graphics.SurfaceTexture[/code] on Android.
19 </description>
20 </method>
21 <method name="set_external_buffer_id">
22 <return type="void" />
23 <param index="0" name="external_buffer_id" type="int" />
24 <description>
25 Sets the external buffer ID.
26 Depending on your use case, you may need to call this with data received from a platform API, for example, [code]SurfaceTexture.getHardwareBuffer()[/code] on Android.
27 </description>
28 </method>
29 </methods>
30 <members>
31 <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
32 <member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(256, 256)">
33 External texture size.
34 </member>
35 </members>
36</class>