summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp14
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index fd90582119..0832fbb586 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -33,6 +33,9 @@
#include "qwinrteglcontext.h"
+#define EGL_EGLEXT_PROTOTYPES
+#include "EGL/eglext.h"
+
QT_BEGIN_NAMESPACE
QWinRTEGLContext::QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLSurface surface, EGLConfig config)
@@ -40,6 +43,17 @@ QWinRTEGLContext::QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGL
{
}
+void QWinRTEGLContext::swapBuffers(QPlatformSurface *surface)
+{
+#ifdef Q_OS_WINPHONE
+ const QSize size = surface->surface()->size();
+ eglPostSubBufferNV(eglDisplay(), eglSurfaceForPlatformSurface(surface),
+ 0, 0, size.width(), size.height());
+#else
+ eglSwapBuffers(eglDisplay(), eglSurfaceForPlatformSurface(surface));
+#endif
+}
+
EGLSurface QWinRTEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
{
if (surface->surface()->surfaceClass() == QSurface::Window) {
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h
index bec9c19089..9b1ef37d1b 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.h
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.h
@@ -43,6 +43,7 @@ class QWinRTEGLContext : public QEGLPlatformContext
public:
explicit QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLSurface surface, EGLConfig config);
+ void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
protected: