Added Texture::GetSize()

Former-commit-id: da4b31cf95f605f83da17f63bc9a6dbd1d8b35c6
This commit is contained in:
Lynix 2013-08-28 02:52:47 +02:00
parent f69d2f13e5
commit 866ff64548
2 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,7 @@ class NAZARA_API NzTexture : public NzResource, NzNonCopyable
unsigned int GetDepth() const; unsigned int GetDepth() const;
nzPixelFormat GetFormat() const; nzPixelFormat GetFormat() const;
unsigned int GetHeight() const; unsigned int GetHeight() const;
NzVector2ui GetSize() const;
nzImageType GetType() const; nzImageType GetType() const;
unsigned int GetWidth() const; unsigned int GetWidth() const;

View File

@ -451,6 +451,19 @@ unsigned int NzTexture::GetHeight() const
return m_impl->height; 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 nzImageType NzTexture::GetType() const
{ {
#if NAZARA_RENDERER_SAFE #if NAZARA_RENDERER_SAFE