Qt5 OpenGL GLSL version error

前端 未结 3 1248
渐次进展
渐次进展 2020-12-10 20:13

I\'m starting out on using OpenGL with Qt, and with Shaders (I have OpenGL experience, but not with shaders yet)

I\'m following this tutorial: http://releases.qt-pro

3条回答
  •  失恋的感觉
    2020-12-10 20:37

    You should create an QGLFormat object and pass it to the QGLWidget as a constructor parameter. The QGLFormat object should be created as showed in the code below.

    QGLFormat glFormat;
    glFormat.setVersion( 3, 2 );
    glFormat.setProfile( QGLFormat::CoreProfile );
    

提交回复
热议问题