Added texture_get_texid

This commit is contained in:
BastiaanOlij 2017-05-20 10:09:36 +10:00
parent a75623f436
commit c51ce72702
5 changed files with 12 additions and 0 deletions

View file

@ -970,6 +970,14 @@ Image::Format RasterizerStorageGLES3::texture_get_format(RID p_texture) const {
return texture->format; return texture->format;
} }
uint32_t RasterizerStorageGLES3::texture_get_texid(RID p_texture) const {
Texture *texture = texture_owner.get(p_texture);
ERR_FAIL_COND_V(!texture, 0);
return texture->tex_id;
}
uint32_t RasterizerStorageGLES3::texture_get_width(RID p_texture) const { uint32_t RasterizerStorageGLES3::texture_get_width(RID p_texture) const {
Texture *texture = texture_owner.get(p_texture); Texture *texture = texture_owner.get(p_texture);

View file

@ -289,6 +289,7 @@ public:
virtual void texture_set_flags(RID p_texture, uint32_t p_flags); virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
virtual uint32_t texture_get_flags(RID p_texture) const; virtual uint32_t texture_get_flags(RID p_texture) const;
virtual Image::Format texture_get_format(RID p_texture) const; virtual Image::Format texture_get_format(RID p_texture) const;
virtual uint32_t texture_get_texid(RID p_texture) const;
virtual uint32_t texture_get_width(RID p_texture) const; virtual uint32_t texture_get_width(RID p_texture) const;
virtual uint32_t texture_get_height(RID p_texture) const; virtual uint32_t texture_get_height(RID p_texture) const;
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height); virtual void texture_set_size_override(RID p_texture, int p_width, int p_height);

View file

@ -168,6 +168,7 @@ public:
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 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; virtual uint32_t texture_get_flags(RID p_texture) const = 0;
virtual Image::Format texture_get_format(RID p_texture) const = 0; virtual Image::Format texture_get_format(RID p_texture) const = 0;
virtual uint32_t texture_get_texid(RID p_texture) const = 0;
virtual uint32_t texture_get_width(RID p_texture) const = 0; virtual uint32_t texture_get_width(RID p_texture) const = 0;
virtual uint32_t texture_get_height(RID p_texture) const = 0; virtual uint32_t texture_get_height(RID p_texture) const = 0;
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0; virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0;

View file

@ -628,6 +628,7 @@ public:
BIND2(texture_set_flags, RID, uint32_t) BIND2(texture_set_flags, RID, uint32_t)
BIND1RC(uint32_t, texture_get_flags, RID) BIND1RC(uint32_t, texture_get_flags, RID)
BIND1RC(Image::Format, texture_get_format, RID) BIND1RC(Image::Format, texture_get_format, RID)
BIND1RC(uint32_t, texture_get_texid, RID)
BIND1RC(uint32_t, texture_get_width, RID) BIND1RC(uint32_t, texture_get_width, RID)
BIND1RC(uint32_t, texture_get_height, RID) BIND1RC(uint32_t, texture_get_height, RID)
BIND3(texture_set_size_override, RID, int, int) BIND3(texture_set_size_override, RID, int, int)

View file

@ -114,6 +114,7 @@ public:
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 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; virtual uint32_t texture_get_flags(RID p_texture) const = 0;
virtual Image::Format texture_get_format(RID p_texture) const = 0; virtual Image::Format texture_get_format(RID p_texture) const = 0;
virtual uint32_t texture_get_texid(RID p_texture) const = 0;
virtual uint32_t texture_get_width(RID p_texture) const = 0; virtual uint32_t texture_get_width(RID p_texture) const = 0;
virtual uint32_t texture_get_height(RID p_texture) const = 0; virtual uint32_t texture_get_height(RID p_texture) const = 0;
virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0; virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0;