mirror of https://github.com/mgba-emu/mgba.git
Qt: Only close GL context on thread when shutting down
This commit is contained in:
parent
3056655060
commit
1868ccaadd
|
@ -315,18 +315,8 @@ void PainterGL::resizeContext() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_active) {
|
|
||||||
m_gl->makeCurrent(m_surface);
|
|
||||||
#if defined(_WIN32) && defined(USE_EPOXY)
|
|
||||||
epoxy_handle_external_wglMakeCurrent();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize size = m_context->screenDimensions();
|
QSize size = m_context->screenDimensions();
|
||||||
m_backend->setDimensions(m_backend, size.width(), size.height());
|
m_backend->setDimensions(m_backend, size.width(), size.height());
|
||||||
if (!m_active) {
|
|
||||||
m_gl->doneCurrent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PainterGL::setMessagePainter(MessagePainter* messagePainter) {
|
void PainterGL::setMessagePainter(MessagePainter* messagePainter) {
|
||||||
|
@ -493,12 +483,6 @@ void PainterGL::setShaders(struct VDir* dir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef BUILD_GLES2
|
#ifdef BUILD_GLES2
|
||||||
if (!m_active) {
|
|
||||||
m_gl->makeCurrent(m_surface);
|
|
||||||
#if defined(_WIN32) && defined(USE_EPOXY)
|
|
||||||
epoxy_handle_external_wglMakeCurrent();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (m_shader.passes) {
|
if (m_shader.passes) {
|
||||||
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
|
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
|
||||||
mGLES2ShaderFree(&m_shader);
|
mGLES2ShaderFree(&m_shader);
|
||||||
|
@ -507,9 +491,6 @@ void PainterGL::setShaders(struct VDir* dir) {
|
||||||
if (m_started) {
|
if (m_started) {
|
||||||
mGLES2ShaderAttach(reinterpret_cast<mGLES2Context*>(m_backend), static_cast<mGLES2Shader*>(m_shader.passes), m_shader.nPasses);
|
mGLES2ShaderAttach(reinterpret_cast<mGLES2Context*>(m_backend), static_cast<mGLES2Shader*>(m_shader.passes), m_shader.nPasses);
|
||||||
}
|
}
|
||||||
if (!m_active) {
|
|
||||||
m_gl->doneCurrent();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -518,19 +499,10 @@ void PainterGL::clearShaders() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef BUILD_GLES2
|
#ifdef BUILD_GLES2
|
||||||
if (!m_active) {
|
|
||||||
m_gl->makeCurrent(m_surface);
|
|
||||||
#if defined(_WIN32) && defined(USE_EPOXY)
|
|
||||||
epoxy_handle_external_wglMakeCurrent();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (m_shader.passes) {
|
if (m_shader.passes) {
|
||||||
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
|
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
|
||||||
mGLES2ShaderFree(&m_shader);
|
mGLES2ShaderFree(&m_shader);
|
||||||
}
|
}
|
||||||
if (!m_active) {
|
|
||||||
m_gl->doneCurrent();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue