diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-08-03 09:45:27 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-08-03 09:45:27 (GMT) |
commit | 23045677bc466b91619495809c97001f341a3d6c (patch) | |
tree | 2e67df9f3ee44aadb9681f672d9ba5d329b725bf /src/gui/egl/qeglproperties.cpp | |
parent | f9f91a3ce45bb3ae0d1e47337791eaf373a0e734 (diff) | |
download | Qt-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/qeglproperties.cpp')
-rw-r--r-- | src/gui/egl/qeglproperties.cpp | 14 |
1 files changed, 14 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 { |