Default to OpenGLES when building with -opengl es2

Fixes the xcb_glx plugin to follow the -opengl configure option for
default surface types. This makes it match closer to xcb_egl behavior
and makes the default match QOpenGLContext::openGLModuleType.

Change-Id: Iea3f8069fffefa46a32945eeeea1312566df129f
Task-number: QTBUG-50015
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Allan Sandfeld Jensen 2015-12-20 00:09:01 +01:00 committed by Allan Sandfeld Jensen
parent 27479c1323
commit b1c156d692

View File

@ -175,7 +175,11 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
{
if (m_format.renderableType() == QSurfaceFormat::DefaultRenderableType)
#if defined(QT_OPENGL_ES_2)
m_format.setRenderableType(QSurfaceFormat::OpenGLES);
#else
m_format.setRenderableType(QSurfaceFormat::OpenGL);
#endif
if (m_format.renderableType() != QSurfaceFormat::OpenGL && m_format.renderableType() != QSurfaceFormat::OpenGLES)
return;