diff --git a/include/Nazara/Renderer/Texture.hpp b/include/Nazara/Renderer/Texture.hpp index 5920e9e70..d859e424e 100644 --- a/include/Nazara/Renderer/Texture.hpp +++ b/include/Nazara/Renderer/Texture.hpp @@ -44,6 +44,7 @@ class NAZARA_API NzTexture : public NzResource, NzNonCopyable unsigned int GetDepth() const; nzPixelFormat GetFormat() const; unsigned int GetHeight() const; + NzVector2ui GetSize() const; nzImageType GetType() const; unsigned int GetWidth() const; diff --git a/src/Nazara/Renderer/Texture.cpp b/src/Nazara/Renderer/Texture.cpp index 37f416bb2..9775831c2 100644 --- a/src/Nazara/Renderer/Texture.cpp +++ b/src/Nazara/Renderer/Texture.cpp @@ -451,6 +451,19 @@ unsigned int NzTexture::GetHeight() const return m_impl->height; } +NzVector2ui NzTexture::GetSize() const +{ + #if NAZARA_RENDERER_SAFE + if (!m_impl) + { + NazaraError("Texture must be valid"); + return 0; + } + #endif + + return NzVector2ui(m_impl->width, m_impl->height); +} + nzImageType NzTexture::GetType() const { #if NAZARA_RENDERER_SAFE