all repos — mgba @ 01d9c106cb4aeeb42f35562168b155a8ba457ef8

mGBA Game Boy Advance Emulator

Qt: Detect presence of GL_ARB_framebuffer_object
Vicki Pfau vi@endrift.com
Sat, 06 Oct 2018 21:06:52 -0700
commit

01d9c106cb4aeeb42f35562168b155a8ba457ef8

parent

ab4b730991e53d01737634b225696a2e793f90b1

2 files changed, 9 insertions(+), 5 deletions(-)

jump to
M CHANGESCHANGES

@@ -131,6 +131,7 @@ - GB: Improved SGB2 support

- 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
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -193,8 +193,15 @@ #if !defined(_WIN32) || defined(USE_EPOXY)

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* painter = static_cast<PainterGL*>(v->user);

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) {