Fix for nVidia

This commit is contained in:
2022-04-06 23:21:48 +02:00
parent 023a616fa0
commit bebaa37650
6 changed files with 12 additions and 10 deletions
+2 -1
View File
@@ -173,7 +173,7 @@ void ImageWidget::resizeGL(int w, int h)
void ImageWidget::initializeGL()
{
f = context()->functions();
f = context()->versionFunctions<QOpenGLFunctions_3_0>();
f->glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
m_vao = std::unique_ptr<QOpenGLVertexArrayObject>(new QOpenGLVertexArrayObject);
@@ -209,6 +209,7 @@ void ImageWidget::initializeGL()
m_program = std::unique_ptr<QOpenGLShaderProgram>(new QOpenGLShaderProgram);
m_program->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/shaders/image.vert");
m_program->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shaders/image.frag");
f->glBindFragDataLocation(m_program->programId(), 0, "color");
if(!m_program->link())
{
qDebug() << "Link failed" << m_program->log();