OSDN Git Service

[Qt][OpenGL] Don't makeCurrent()/doneCurrent() inside of resizeGL().Fixed crash runni...
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 13 Oct 2019 20:20:39 +0000 (05:20 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 13 Oct 2019 20:20:39 +0000 (05:20 +0900)
source/src/qt/common/qt_utils.cpp
source/src/qt/gui/gl2/qt_glutil_gl2_0.cpp
source/src/qt/gui/gl3/qt_glutil_gl3_0.cpp
source/src/qt/gui/gl4_5/qt_glutil_gl4_5.cpp
source/src/qt/gui/gles2/qt_glutil_gles_2.cpp

index 6f60cb4..cef93c1 100644 (file)
@@ -1255,7 +1255,7 @@ int MainLoop(int argc, char *argv[])
 #endif 
        GLDrawClass *pgl = rMainWindow->getGraphicsView();
        pgl->set_emu_launched();
-       pgl->setFixedSize(pgl->width(), pgl->height());
+//     pgl->setFixedSize(pgl->width(), pgl->height());
        rMainWindow->retranselateUi_Depended_OSD();
        QObject::connect(emu->get_osd(), SIGNAL(sig_update_device_node_name(int, const _TCHAR *)),
                                         rMainWindow, SLOT(do_update_device_node_name(int, const _TCHAR *)));
index 3b3dd8e..c5a7dde 100644 (file)
@@ -1017,7 +1017,6 @@ void GLDraw_2_0::resizeGL_SetVertexs(void)
 void GLDraw_2_0::resizeGL(int width, int height)
 {
        //int side = qMin(width, height);
-       p_wid->makeCurrent();
        extfunc_2->glViewport(0, 0, width, height);
        extfunc_2->glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0, 1.0);
        crt_flag = true;
@@ -1042,7 +1041,6 @@ void GLDraw_2_0::resizeGL(int width, int height)
        if(using_flags->get_max_button() > 0) {
                updateButtonTexture();
        }
-       p_wid->doneCurrent();
 }
 
 void GLDraw_2_0::paintGL(void)
index b7f8403..9d7a71a 100644 (file)
@@ -1537,7 +1537,6 @@ void GLDraw_3_0::resizeGL_Screen(void)
 void GLDraw_3_0::resizeGL(int width, int height)
 {
        //int side = qMin(width, height);
-       p_wid->makeCurrent();
        extfunc->glViewport(0, 0, width, height);
        extfunc->glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0, 1.0);
        crt_flag = true;
@@ -1557,5 +1556,4 @@ void GLDraw_3_0::resizeGL(int width, int height)
        if(using_flags->get_max_button() > 0) {
                updateButtonTexture();
        }
-       p_wid->doneCurrent();
 }
index 505682a..b3be699 100644 (file)
@@ -1619,7 +1619,6 @@ void GLDraw_4_5::resizeGL_Screen(void)
 void GLDraw_4_5::resizeGL(int width, int height)
 {
        //int side = qMin(width, height);
-       p_wid->makeCurrent();
        extfunc->glViewport(0, 0, width, height);
        //extfunc->glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0, 1.0);
        crt_flag = true;
@@ -1639,7 +1638,6 @@ void GLDraw_4_5::resizeGL(int width, int height)
        if(using_flags->get_max_button() > 0) {
                updateButtonTexture();
        }
-       p_wid->doneCurrent();
 }
 
 void GLDraw_4_5::initButtons(void)
index f3f08d7..8a196f6 100644 (file)
@@ -1487,7 +1487,6 @@ void GLDraw_ES_2::resizeGL_Screen(void)
 void GLDraw_ES_2::resizeGL(int width, int height)
 {
        //int side = qMin(width, height);
-       p_wid->makeCurrent();
        extfunc->glViewport(0, 0, width, height);
        //extfunc->glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -1.0, 1.0);
        crt_flag = true;
@@ -1507,7 +1506,6 @@ void GLDraw_ES_2::resizeGL(int width, int height)
        if(using_flags->get_max_button() > 0) {
                updateButtonTexture();
        }
-       p_wid->doneCurrent();
 }
 
 void GLDraw_ES_2::initButtons(void)