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()。