summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsurfaceformat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qsurfaceformat.cpp')
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 2c26a172a4..25b603bb9c 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -583,6 +583,30 @@ int QSurfaceFormat::minorVersion() const
}
/*!
+ Returns a QPair<int, int> representing the OpenGL version.
+
+ Useful for version checks, for example format.version() >= qMakePair(3, 2)
+*/
+QPair<int, int> QSurfaceFormat::version() const
+{
+ return qMakePair(d->major, d->minor);
+}
+
+/*!
+ Sets the desired \a major and \a minor OpenGL versions.
+
+ The default version is 2.0.
+*/
+void QSurfaceFormat::setVersion(int major, int minor)
+{
+ if (d->minor != minor || d->major != major) {
+ detach();
+ d->minor = minor;
+ d->major = major;
+ }
+}
+
+/*!
Returns true if all the options of the two QSurfaceFormat objects
\a a and \a b are equal.