diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-08-01 13:40:00 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-09-25 19:47:07 +0200 |
commit | 41e5902e7799808fc71504d4222ee6363fec1aef (patch) | |
tree | 6bd63b04e2071bb7cee8156aaca9cd8b7eabea26 /src/core/gl_context_qt.cpp | |
parent | f3500da1ff1c7d383386c0197848262d7bedf90e (diff) |
Add Desktop OpenGL backend for Windows
Enabling rendering into a WGL backbuffer, in addition to the EGL/angle
one.
Change-Id: I8f2e3f5ecf52b6db22712b1129059f462725a256
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/gl_context_qt.cpp')
-rw-r--r-- | src/core/gl_context_qt.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp index 6aec2d3b3..e1255219d 100644 --- a/src/core/gl_context_qt.cpp +++ b/src/core/gl_context_qt.cpp @@ -41,11 +41,16 @@ #include <QThread> #include <qpa/qplatformnativeinterface.h> #include "ui/gl/gl_context_egl.h" +#include "ui/gl/gl_implementation.h" #if defined(USE_X11) #include <X11/Xlib.h> #endif +#if defined(OS_WIN) +#include "ui/gl/gl_context_wgl.h" +#endif + QT_BEGIN_NAMESPACE Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); @@ -135,7 +140,16 @@ namespace gfx { scoped_refptr<GLContext> GLContext::CreateGLContext(GLShareGroup* share_group, GLSurface* compatible_surface, GpuPreference gpu_preference) { - scoped_refptr<GLContext> context(new GLContextEGL(share_group)); +#if defined(OS_WIN) + scoped_refptr<GLContext> context; + if (GetGLImplementation() == kGLImplementationDesktopGL) + context = new GLContextWGL(share_group); + else + context = new GLContextEGL(share_group); +#else + scoped_refptr<GLContext> context = new GLContextEGL(share_group); +#endif + if (!GLContextHelper::initializeContext(context.get(), compatible_surface)) return NULL; |