iOS: Simplify context format setup

Change-Id: I6a6a025410298cecd5f62abd08388a7379359af7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-04-30 11:16:45 +02:00 committed by The Qt Project
parent 6f87ca2908
commit 299154bd65

View File

@ -52,20 +52,16 @@
QIOSContext::QIOSContext(QOpenGLContext *context)
: QPlatformOpenGLContext()
, m_eaglContext([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2])
, m_format(context->format())
{
// Start out with the requested format
QSurfaceFormat format = context->format();
format.setRenderableType(QSurfaceFormat::OpenGLES);
format.setMajorVersion(2);
format.setMinorVersion(0);
m_format.setRenderableType(QSurfaceFormat::OpenGLES);
m_format.setMajorVersion(2);
m_format.setMinorVersion(0);
// Even though iOS internally double-buffers its rendering, we
// report single-buffered here since the buffer remains unchanged
// when swapping unlesss you manually clear it yourself.
format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
m_format = format;
m_format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
}
QIOSContext::~QIOSContext()