Merge pull request #18495 from Zylann/partial_texture_update
Added partial texture update to VisualServer
This commit is contained in:
@@ -175,6 +175,7 @@ public:
|
||||
virtual RID texture_create() = 0;
|
||||
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT) = 0;
|
||||
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) = 0;
|
||||
virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) = 0;
|
||||
virtual Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const = 0;
|
||||
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
|
||||
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
|
||||
|
||||
@@ -148,6 +148,7 @@ public:
|
||||
BIND0R(RID, texture_create)
|
||||
BIND5(texture_allocate, RID, int, int, Image::Format, uint32_t)
|
||||
BIND3(texture_set_data, RID, const Ref<Image> &, CubeMapSide)
|
||||
BIND10(texture_set_data_partial, RID, const Ref<Image> &, int, int, int, int, int, int, int, CubeMapSide)
|
||||
BIND2RC(Ref<Image>, texture_get_data, RID, CubeMapSide)
|
||||
BIND2(texture_set_flags, RID, uint32_t)
|
||||
BIND1RC(uint32_t, texture_get_flags, RID)
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
FUNCRID(texture)
|
||||
FUNC5(texture_allocate, RID, int, int, Image::Format, uint32_t)
|
||||
FUNC3(texture_set_data, RID, const Ref<Image> &, CubeMapSide)
|
||||
FUNC10(texture_set_data_partial, RID, const Ref<Image> &, int, int, int, int, int, int, int, CubeMapSide)
|
||||
FUNC2RC(Ref<Image>, texture_get_data, RID, CubeMapSide)
|
||||
FUNC2(texture_set_flags, RID, uint32_t)
|
||||
FUNC1RC(uint32_t, texture_get_flags, RID)
|
||||
|
||||
@@ -1528,6 +1528,7 @@ void VisualServer::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("texture_create_from_image", "image", "flags"), &VisualServer::texture_create_from_image, DEFVAL(TEXTURE_FLAGS_DEFAULT));
|
||||
ClassDB::bind_method(D_METHOD("texture_allocate", "texture", "width", "height", "format", "flags"), &VisualServer::texture_allocate, DEFVAL(TEXTURE_FLAGS_DEFAULT));
|
||||
ClassDB::bind_method(D_METHOD("texture_set_data", "texture", "image", "cube_side"), &VisualServer::texture_set_data, DEFVAL(CUBEMAP_LEFT));
|
||||
ClassDB::bind_method(D_METHOD("texture_set_data_partial", "texture", "image", "src_x", "src_y", "src_w", "src_h", "dst_x", "dst_y", "dst_mip", "cube_side"), &VisualServer::texture_set_data_partial, DEFVAL(CUBEMAP_LEFT));
|
||||
ClassDB::bind_method(D_METHOD("texture_get_data", "texture", "cube_side"), &VisualServer::texture_get_data, DEFVAL(CUBEMAP_LEFT));
|
||||
ClassDB::bind_method(D_METHOD("texture_set_flags", "texture", "flags"), &VisualServer::texture_set_flags);
|
||||
ClassDB::bind_method(D_METHOD("texture_get_flags", "texture"), &VisualServer::texture_get_flags);
|
||||
|
||||
@@ -109,6 +109,7 @@ public:
|
||||
RID texture_create_from_image(const Ref<Image> &p_image, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT); // helper
|
||||
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT) = 0;
|
||||
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
|
||||
virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
|
||||
virtual Ref<Image> texture_get_data(RID p_texture, CubeMapSide p_cube_side = CUBEMAP_LEFT) const = 0;
|
||||
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
|
||||
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
|
||||
|
||||
Reference in New Issue
Block a user