Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems with running the OpenGL Core Profile tutorial
Forum Update on Tuesday, May 27th 2025

Problems with running the OpenGL Core Profile tutorial

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eyeck
    wrote on 4 Apr 2012, 06:53 last edited by
    #1

    I downloaded the source code for the tutorial "How to use OpenGL Core Profile with Qt" found "here":http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt and built it without a problem using QtCreator 2.4.1 / Qt 4.8.0 on Linux. However, When I run it as-is I simply get a blank window. as seen "here.":http://i.imgur.com/Rp5Rr.png By changing the call to GlFormat::setVersion() from setVersion( 3, 3 ) to 3, 1 or lower, the problem "disappears.":http://i.imgur.com/NwFjY.png

    My driver seems to support OpenGL 3.3; glxinfo gives me:
    OpenGL version string: 3.3.0 NVIDIA 295.33
    OpenGL shading language version string: 3.30 NVIDIA via Cg compiler

    Any idea what is causing this/how to fix it? Do I simply need to restrict myself to using OpenGL <= 3.1? I have no need for the Core Profile, however the problem persists even when the same code is used with the compatibility profile. I will be starting an OpenGL project soon and would like to get this resolved.

    Does anyone else have the same issue with the code provided in that tutorial?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      eyeck
      wrote on 4 Apr 2012, 17:51 last edited by
      #2

      I'm going to bump this because my post originally had a typo in the link to the tutorial.

      Can anyone please at least try to reproduce this problem and tell me whether or not it's an issue on my end?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        prismatic
        wrote on 12 Jun 2012, 17:00 last edited by
        #3

        Bumping this because I have the exact same issue and no idea how to fix it. I have a similar driver:
        OpenGL version string: 4.2.0 NVIDIA 295.53
        OpenGL shading language version string: 4.20 NVIDIA via Cg compiler

        I'm surprised no one else has run into this.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vAlex_
          wrote on 5 Jul 2012, 14:14 last edited by
          #4

          The tutorial says: "<...> it is required to bind a VAO before setting up the attributes. This behavior is part of the OpenGL 3.3 core profile."

          Add this in initializeGL before m_shader.setAttributeBuffer:

          @uint vao;

          typedef void (APIENTRY _glGenVertexArrays) (GLsizei, GLuint);
          typedef void (APIENTRY *_glBindVertexArray) (GLuint);

          _glGenVertexArrays glGenVertexArrays;
          _glBindVertexArray glBindVertexArray;

          glGenVertexArrays = (_glGenVertexArrays) QGLWidget::context()->getProcAddress("glGenVertexArrays");
          glBindVertexArray = (_glBindVertexArray) QGLWidget::context()->getProcAddress("glBindVertexArray");

          glGenVertexArrays(1, &vao);
          glBindVertexArray(vao);@

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved