Qt: Fix logged error when starting on Mac

This commit is contained in:
Vicki Pfau 2022-10-11 02:15:55 -07:00
parent d5b66cc7e7
commit ac8c371219
1 changed files with 5 additions and 1 deletions

View File

@ -83,6 +83,7 @@ void mGLWidget::initializeGL() {
m_positionLocation = m_program->attributeLocation("position");
m_vaoDone = false;
m_tex = 0;
connect(&m_refresh, &QTimer::timeout, this, static_cast<void (QWidget::*)()>(&QWidget::update));
}
@ -115,6 +116,10 @@ void mGLWidget::paintGL() {
if (!m_vaoDone && !finalizeVAO()) {
return;
}
if (!m_tex) {
m_refresh.start(10);
return;
}
QOpenGLFunctions_Baseline* fn = context()->versionFunctions<QOpenGLFunctions_Baseline>();
m_program->bind();
m_vao->bind();
@ -520,7 +525,6 @@ void PainterGL::create() {
m_finalTexIdx = 0;
gl2Backend->finalShader.tex = m_finalTex[m_finalTexIdx];
m_widget->setTex(m_finalTex[m_finalTexIdx]);
}
m_shader.preprocessShader = static_cast<void*>(&reinterpret_cast<mGLES2Context*>(m_backend)->initialShader);
}