Qt: Detect presence of GL_ARB_framebuffer_object

This commit is contained in:
Vicki Pfau 2018-10-06 21:06:52 -07:00
parent ab4b730991
commit 01d9c106cb
2 changed files with 9 additions and 5 deletions

View File

@ -131,6 +131,7 @@ Misc:
- Libretro: Reduce rumble callbacks
- Debugger: Minor text fixes
- Qt: Debugger console history
- Qt: Detect presence of GL_ARB_framebuffer_object
0.7 beta 1: (2018-09-24)
- Initial beta for 0.7

View File

@ -193,8 +193,15 @@ PainterGL::PainterGL(int majorVersion, QGLWidget* parent)
mGLES2Context* gl2Backend;
#endif
m_gl->makeCurrent();
#if defined(_WIN32) && defined(USE_EPOXY)
epoxy_handle_external_wglMakeCurrent();
#endif
QStringList extensions = QString(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))).split(' ');
#if !defined(_WIN32) || defined(USE_EPOXY)
if (majorVersion >= 2) {
if (extensions.contains("GL_ARB_framebuffer_object") && majorVersion >= 2) {
gl2Backend = static_cast<mGLES2Context*>(malloc(sizeof(mGLES2Context)));
mGLES2ContextCreate(gl2Backend);
m_backend = &gl2Backend->d;
@ -215,10 +222,6 @@ PainterGL::PainterGL(int majorVersion, QGLWidget* parent)
painter->m_gl->swapBuffers();
};
m_gl->makeCurrent();
#if defined(_WIN32) && defined(USE_EPOXY)
epoxy_handle_external_wglMakeCurrent();
#endif
m_backend->init(m_backend, reinterpret_cast<WHandle>(m_gl->winId()));
#if !defined(_WIN32) || defined(USE_EPOXY)
if (m_supportsShaders) {