EGLenum eglApi)
: m_eglDisplay(display)
, m_eglApi(eglApi)
- , m_format(format)
+ , m_eglConfig(q_configFromGLFormat(display, format, true))
+ , m_format(q_glFormatFromConfig(display, m_eglConfig))
{
- EGLConfig config = q_configFromGLFormat(display, format, true);
- m_format = q_glFormatFromConfig(display, config);
-
m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : 0;
QVector<EGLint> contextAttrs;
contextAttrs.append(EGL_NONE);
eglBindAPI(m_eglApi);
- m_eglContext = eglCreateContext(m_eglDisplay, config, m_shareContext, contextAttrs.constData());
+ m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, m_shareContext, contextAttrs.constData());
if (m_eglContext == EGL_NO_CONTEXT && m_shareContext != EGL_NO_CONTEXT) {
m_shareContext = 0;
- m_eglContext = eglCreateContext(m_eglDisplay, config, 0, contextAttrs.constData());
+ m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, 0, contextAttrs.constData());
}
}
{
return m_eglContext;
}
+
+EGLDisplay QEGLPlatformContext::eglDisplay() const
+{
+ return m_eglDisplay;
+}
+
+EGLConfig QEGLPlatformContext::eglConfig() const
+{
+ return m_eglConfig;
+}
bool isValid() const { return m_eglContext != EGL_NO_CONTEXT; }
EGLContext eglContext() const;
+ EGLDisplay eglDisplay() const;
+ EGLConfig eglConfig() const;
protected:
virtual EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) = 0;
EGLContext m_shareContext;
EGLDisplay m_eglDisplay;
EGLenum m_eglApi;
-
- QSurfaceFormat m_format;
+ EGLConfig m_eglConfig;
+ const QSurfaceFormat m_format;
};
#endif //QEGLPLATFORMCONTEXT_H