Improved/Fixed Texture class

Allowed move constructor/operator
Fixed Texture::Download/Texture::Update
Made InvalidateMipmaps public


Former-commit-id: b8b6a54bc5d6250f640fed6582dc694df6405f73
This commit is contained in:
Lynix
2015-01-07 21:03:29 +01:00
parent 9293022e71
commit 904319ee90
2 changed files with 35 additions and 31 deletions

View File

@@ -26,11 +26,12 @@ struct NzTextureImpl;
class NAZARA_API NzTexture : public NzAbstractImage, public NzResource, NzNonCopyable
{
friend class NzRenderer;
friend class NzRenderTexture;
public:
NzTexture() = default;
NzTexture(nzImageType type, nzPixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, nzUInt8 levelCount = 1);
explicit NzTexture(const NzImage& image);
NzTexture(NzTexture&& texture);
~NzTexture();
bool Create(nzImageType type, nzPixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, nzUInt8 levelCount = 1);
@@ -55,6 +56,7 @@ class NAZARA_API NzTexture : public NzAbstractImage, public NzResource, NzNonCop
bool HasMipmaps() const;
void InvalidateMipmaps();
bool IsValid() const;
// Load
@@ -92,6 +94,8 @@ class NAZARA_API NzTexture : public NzAbstractImage, public NzResource, NzNonCop
// Fonctions OpenGL
unsigned int GetOpenGLID() const;
NzTexture& operator=(NzTexture&& texture);
static unsigned int GetValidSize(unsigned int size);
static bool IsFormatSupported(nzPixelFormat format);
static bool IsMipmappingSupported();
@@ -99,7 +103,6 @@ class NAZARA_API NzTexture : public NzAbstractImage, public NzResource, NzNonCop
private:
bool CreateTexture(bool proxy);
void InvalidateMipmaps();
NzTextureImpl* m_impl = nullptr;
};