Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
ExternalTexture
继承: Texture2D < Texture < Resource < RefCounted < Object
显示外部缓冲区内容的纹理。
描述
显示平台所提供的外部缓冲区的内容。
需要 OES_EGL_image_external 扩展(OpenGL)或 VK_ANDROID_external_memory_android_hardware_buffer 扩展(Vulkan)。
注意:目前仅在 Android 构建中支持。
属性
resource_local_to_scene |
|
|
|
方法
get_external_texture_id() const |
|
void |
set_external_buffer_id(external_buffer_id: int) |
属性说明
Vector2 size = Vector2(256, 256)
🔗
外部纹理大小。
方法说明
int get_external_texture_id() const 🔗
返回外部纹理 ID。
根据你的需求,你可能需要将其传递给平台 API,例如在 Android 上创建 android.graphics.SurfaceTexture
。
void set_external_buffer_id(external_buffer_id: int) 🔗
设置外部纹理 ID。
根据你的需求,你可能需要使用从平台 API 获取的数据调用该方法,例如在 Android 上的 SurfaceTexture.getHardwareBuffer()
。