summaryrefslogtreecommitdiffstats
path: root/src/gui/egl
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-08-03 09:45:27 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-08-03 09:45:27 (GMT)
commit23045677bc466b91619495809c97001f341a3d6c (patch)
tree2e67df9f3ee44aadb9681f672d9ba5d329b725bf /src/gui/egl
parentf9f91a3ce45bb3ae0d1e47337791eaf373a0e734 (diff)
downloadQt-23045677bc466b91619495809c97001f341a3d6c.zip
Qt-23045677bc466b91619495809c97001f341a3d6c.tar.gz
Qt-23045677bc466b91619495809c97001f341a3d6c.tar.bz2
Add a constructor to QEglProperties which takes an EGLConfig
The constructor then extracts all the attributes from the config. Useful for dumping all the attributes for a particular config to qDebug().
Diffstat (limited to 'src/gui/egl')
-rw-r--r--src/gui/egl/qeglproperties.cpp14
-rw-r--r--src/gui/egl/qeglproperties_p.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
index e0ae8a6..fefd070 100644
--- a/src/gui/egl/qeglproperties.cpp
+++ b/src/gui/egl/qeglproperties.cpp
@@ -46,12 +46,26 @@ QT_BEGIN_NAMESPACE
#include <QtCore/qdebug.h>
#include <QtCore/qstringlist.h>
+#include "qegl_p.h"
+
+
// Initialize a property block.
QEglProperties::QEglProperties()
{
props.append(EGL_NONE);
}
+QEglProperties::QEglProperties(EGLConfig cfg)
+{
+ props.append(EGL_NONE);
+ for (int name = 0x3020; name <= 0x304F; ++name) {
+ EGLint value;
+ if (name != EGL_NONE && eglGetConfigAttrib(QEglContext::defaultDisplay(0), cfg, name, &value))
+ setValue(name, value);
+ }
+ eglGetError(); // Clear the error state.
+}
+
// Fetch the current value associated with a property.
int QEglProperties::value(int name) const
{
diff --git a/src/gui/egl/qeglproperties_p.h b/src/gui/egl/qeglproperties_p.h
index 81af4cd..bcdc657 100644
--- a/src/gui/egl/qeglproperties_p.h
+++ b/src/gui/egl/qeglproperties_p.h
@@ -107,6 +107,7 @@ class Q_GUI_EXPORT QEglProperties
{
public:
QEglProperties();
+ QEglProperties(EGLConfig);
QEglProperties(const QEglProperties& other) : props(other.props) {}
~QEglProperties() {}