summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-01-14 00:02:38 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-01-17 14:26:43 +0100
commite4d15b41e83d552c64f32541570f9009a6c6ec81 (patch)
treeb7d32a6dad7ce87e94bdf5e2bf850cab3d163756 /src/gui/opengl/qopengltexture.h
parentebdd4a0ba7daf74b11f716d291a97f7cd28c2aca (diff)
QOpenGLTexture: introduce texture comparison support
Shadow sampling is an old OpenGL feature (hello, OpenGL 1.3!), which was missing from QOpenGLTexture. This commit adds the relevant support. Change-Id: I9f6b552d806a356d24ee08121af6bc9ce684f2b5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltexture.h')
-rw-r--r--src/gui/opengl/qopengltexture.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index 1cf5fdc12a..56fdd07f2f 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -346,8 +346,9 @@ public:
NPOTTextures = 0x00000800,
NPOTTextureRepeat = 0x00001000,
Texture1D = 0x00002000,
+ TextureComparisonOperators = 0x00004000,
#ifndef Q_QDOC
- MaxFeatureFlag = 0x00004000
+ MaxFeatureFlag = 0x00008000
#endif
};
Q_DECLARE_FLAGS(Features, Feature)
@@ -488,6 +489,28 @@ public:
void setDepthStencilMode(DepthStencilMode mode);
DepthStencilMode depthStencilMode() const;
+ enum ComparisonFunction {
+ CompareLessEqual = 0x0203, // GL_LEQUAL
+ CompareGreaterEqual = 0x0206, // GL_GEQUAL
+ CompareLess = 0x0201, // GL_LESS
+ CompareGreater = 0x0204, // GL_GREATER
+ CompareEqual = 0x0202, // GL_EQUAL
+ CommpareNotEqual = 0x0205, // GL_NOTEQUAL
+ CompareAlways = 0x0207, // GL_ALWAYS
+ CompareNever = 0x0200 // GL_NEVER
+ };
+
+ void setComparisonFunction(ComparisonFunction function);
+ ComparisonFunction comparisonFunction() const;
+
+ enum ComparisonMode {
+ CompareRefToTexture = 0x884E, // GL_COMPARE_REF_TO_TEXTURE
+ CompareNone = 0x0000 // GL_NONE
+ };
+
+ void setComparisonMode(ComparisonMode mode);
+ ComparisonMode comparisonMode() const;
+
// Sampling Parameters
enum Filter {
Nearest = 0x2600, // GL_NEAREST