diff options
author | Bastiaan Olij <mux213@gmail.com> | 2023-03-10 21:24:25 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2023-05-09 13:47:22 +1000 |
commit | c328676d960897abe6f00aaceee4c34801415940 (patch) | |
tree | e6bcf62a9af43fedd102626363ad3e1324727f53 /drivers/gles3/storage/texture_storage.cpp | |
parent | 6980b2bf1761b9b980920dc5a4d32f240d88e211 (diff) | |
download | redot-engine-c328676d960897abe6f00aaceee4c34801415940.tar.gz |
For GDExternal use, provides access to internal graphics handles for textures
Diffstat (limited to 'drivers/gles3/storage/texture_storage.cpp')
-rw-r--r-- | drivers/gles3/storage/texture_storage.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index d147cee54f..3fd54e9180 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1140,6 +1140,13 @@ RID TextureStorage::texture_get_rd_texture(RID p_texture, bool p_srgb) const { return RID(); } +uint64_t TextureStorage::texture_get_native_handle(RID p_texture, bool p_srgb) const { + const Texture *texture = texture_owner.get_or_null(p_texture); + ERR_FAIL_COND_V(!texture, 0); + + return texture->tex_id; +} + void TextureStorage::texture_set_data(RID p_texture, const Ref<Image> &p_image, int p_layer) { Texture *texture = texture_owner.get_or_null(p_texture); |