summaryrefslogtreecommitdiffstats
path: root/src/render/texture/texture_p.h
diff options
context:
space:
mode:
authorMauro Persano <mauro.persano@kdab.com>2016-01-12 10:49:20 -0200
committerSean Harmer <sean.harmer@kdab.com>2016-01-16 15:52:31 +0000
commit634ac2a3c1a7bae9eef6476c37cd68209c28ae4f (patch)
tree270469aeac7988b3534918bedd2becf70cfb8e98 /src/render/texture/texture_p.h
parent43e55cd54635a5ef1eb09fe9cff701f7eb16cd7a (diff)
Support for DDS textures
This commit adds support for DDS textures. It also adds QTextureLoader, a generic texture provider without a texture target. The actual texture target will be based on the properties of the texture loaded from its "source" property. Change-Id: If89cce7a55b3d82355f2da35588a091b7188f36c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/texture/texture_p.h')
-rw-r--r--src/render/texture/texture_p.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/render/texture/texture_p.h b/src/render/texture/texture_p.h
index 71fc3f3ec..a67e759dd 100644
--- a/src/render/texture/texture_p.h
+++ b/src/render/texture/texture_p.h
@@ -99,16 +99,24 @@ public:
void requestTextureDataUpdate();
void addToPendingTextureJobs();
+ void setTarget(QAbstractTextureProvider::Target target);
void setSize(int width, int height, int depth);
void setFormat(QAbstractTextureProvider::TextureFormat format);
+ void setMipLevels(int mipmapLevels);
inline QVector<HTextureImage> textureImages() const { return m_textureImages; }
inline QAbstractTextureProvider::TextureFormat format() const { return m_format; }
+ inline QAbstractTextureProvider::Target target() const { return m_target; }
+ inline bool isAutoMipMapGenerationEnabled() const { return m_generateMipMaps; }
+
+ inline QTextureDataFunctorPtr dataFunctor() const { return m_dataFunctor; }
+ void setTextureDataHandle(HTextureData handle) { m_textureDataHandle = handle; }
private:
QOpenGLTexture *m_gl;
QOpenGLTexture *buildGLTexture();
+ void setToGLTexture(QTexImageData *imgData);
void setToGLTexture(TextureImage *rImg, QTexImageData *imgData);
void updateWrapAndFilters();
@@ -116,6 +124,7 @@ private:
int m_height;
int m_depth;
int m_layers;
+ int m_mipLevels;
bool m_generateMipMaps;
QAbstractTextureProvider::Target m_target;
QAbstractTextureProvider::TextureFormat m_format;
@@ -128,6 +137,9 @@ private:
QAbstractTextureProvider::ComparisonFunction m_comparisonFunction;
QAbstractTextureProvider::ComparisonMode m_comparisonMode;
+ QTextureDataFunctorPtr m_dataFunctor;
+ HTextureData m_textureDataHandle;
+
QVector<HTextureImage> m_textureImages;
bool m_isDirty;