mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix VAO reinitialization
This commit is contained in:
parent
fa910fc629
commit
07221181ea
|
@ -82,6 +82,8 @@ void mGLWidget::initializeGL() {
|
|||
m_program->setUniformValue("tex", 0);
|
||||
m_positionLocation = m_program->attributeLocation("position");
|
||||
|
||||
m_vaoDone = false;
|
||||
|
||||
connect(&m_refresh, &QTimer::timeout, this, static_cast<void (QWidget::*)()>(&QWidget::update));
|
||||
}
|
||||
|
||||
|
@ -98,6 +100,10 @@ void mGLWidget::finalizeVAO() {
|
|||
}
|
||||
}
|
||||
|
||||
void mGLWidget::reset() {
|
||||
m_vaoDone = false;
|
||||
}
|
||||
|
||||
void mGLWidget::paintGL() {
|
||||
if (!m_vaoDone) {
|
||||
finalizeVAO();
|
||||
|
@ -210,6 +216,7 @@ void DisplayGL::startDrawing(std::shared_ptr<CoreController> controller) {
|
|||
}
|
||||
} else {
|
||||
show();
|
||||
m_gl->reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
void setTex(GLuint tex) { m_tex = tex; }
|
||||
void setVBO(GLuint vbo) { m_vbo = vbo; }
|
||||
void finalizeVAO();
|
||||
void reset();
|
||||
|
||||
protected:
|
||||
void initializeGL() override;
|
||||
|
|
Loading…
Reference in New Issue