【问题标题】:How can I use OpenGL 3.3 Core Profile in Qt 5.4?如何在 Qt 5.4 中使用 OpenGL 3.3 Core Profile?
【发布时间】:2015-09-16 19:25:54
【问题描述】:

我从glxinfo | grep OpenGL 得到以下输出:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.7.0-devel (git-e566e52 2015-06-29 vivid-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.7.0-devel (git-e566e52 2015-06-29 vivid-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 10.7.0-devel (git-e566e52 2015-06-29 vivid-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

以及我的 CG 类的 Qt 5.4 应用程序中的以下内容:

OpenGL Version: 3.0 Mesa 10.7.0-devel (git-e566e52 2015-06-29 vivid-oibaf-ppa)
GLSL Version: 1.30

那么如何使用 OpenGL 的核心配置文件?我真的需要 GLSL 3.3。

【问题讨论】:

    标签: qt opengl glsl


    【解决方案1】:

    我在继承自 QOpenGLWidget 的小部件中执行此操作,如下所示:

    QSurfaceFormat fmt;
    fmt.setVersion( 3, 3 );
    fmt.setProfile( QSurfaceFormat::CoreProfile );
    setFormat( fmt );
    QSurfaceFormat::setDefaultFormat( fmt );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多