From ac8c371219fee52152bcc38a1bbd60ec298e3335 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 11 Oct 2022 02:15:55 -0700 Subject: [PATCH] Qt: Fix logged error when starting on Mac --- src/platform/qt/DisplayGL.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 16dece1b4..9727285b0 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -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(&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(); 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(&reinterpret_cast(m_backend)->initialShader); }