diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-19 17:13:27 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-19 17:13:27 +0200 |
commit | b1b4c5da4b79946e5201c5834e9022af64581b31 (patch) | |
tree | a1f30c60b18bb47e5f0d8284ab8c67ba458dbed0 /servers/rendering_server.cpp | |
parent | 71a7e37a43397e16a0946686a9cfb384c0c91724 (diff) | |
parent | 7d56b09f2375a32e1adbfaa3aca54823abcd2508 (diff) | |
download | redot-engine-b1b4c5da4b79946e5201c5834e9022af64581b31.tar.gz |
Merge pull request #96928 from dsnopek/rename-and-expose-texture-create-external
Expose a function to create textures from a native handle in the compatibility renderer
Diffstat (limited to 'servers/rendering_server.cpp')
-rw-r--r-- | servers/rendering_server.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 020fa94e9d..a1c05fa2e7 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2239,6 +2239,7 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("texture_2d_layered_create", "layers", "layered_type"), &RenderingServer::_texture_2d_layered_create); ClassDB::bind_method(D_METHOD("texture_3d_create", "format", "width", "height", "depth", "mipmaps", "data"), &RenderingServer::_texture_3d_create); ClassDB::bind_method(D_METHOD("texture_proxy_create", "base"), &RenderingServer::texture_proxy_create); + ClassDB::bind_method(D_METHOD("texture_create_from_native_handle", "type", "format", "native_handle", "width", "height", "depth", "layers", "layered_type"), &RenderingServer::texture_create_from_native_handle, DEFVAL(1), DEFVAL(TEXTURE_LAYERED_2D_ARRAY)); ClassDB::bind_method(D_METHOD("texture_2d_update", "texture", "image", "layer"), &RenderingServer::texture_2d_update); ClassDB::bind_method(D_METHOD("texture_3d_update", "texture", "data"), &RenderingServer::_texture_3d_update); @@ -2265,6 +2266,10 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("texture_get_rd_texture", "texture", "srgb"), &RenderingServer::texture_get_rd_texture, DEFVAL(false)); ClassDB::bind_method(D_METHOD("texture_get_native_handle", "texture", "srgb"), &RenderingServer::texture_get_native_handle, DEFVAL(false)); + BIND_ENUM_CONSTANT(TEXTURE_TYPE_2D); + BIND_ENUM_CONSTANT(TEXTURE_TYPE_LAYERED); + BIND_ENUM_CONSTANT(TEXTURE_TYPE_3D); + BIND_ENUM_CONSTANT(TEXTURE_LAYERED_2D_ARRAY); BIND_ENUM_CONSTANT(TEXTURE_LAYERED_CUBEMAP); BIND_ENUM_CONSTANT(TEXTURE_LAYERED_CUBEMAP_ARRAY); |