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. QGraphicsScene + OpenGL VBO = widgets disappear?
Forum Updated to NodeBB v4.3 + New Features

QGraphicsScene + OpenGL VBO = widgets disappear?

Scheduled Pinned Locked Moved Solved General and Desktop
openglvbo
2 Posts 1 Posters 1.4k Views
  • 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.
  • D Offline
    D Offline
    delt
    wrote on 28 Nov 2015, 02:03 last edited by delt
    #1

    Hello all,

    I'm using a subclass of QGrahicsScene to display normal widgets (via QGraphicsProxyWidgets) on top of a GL scene. This subclass also inherits from QOpenGLFunctions for the glext / GLEW functions.

    Everything is working fine using oldschool OpenGL techniques. Everything also works fine if i use basic modern GL, load shaders to the graphics card, etc....

    The problem appears when i try to use a Vertex Buffer Object (VBO) to store my vertex array in the graphics memory at init, instead of having the vertex array "client side" and sent to the graphics card at each frame. When i do this (use VBO) the overlay/proxy widgets disappear completely.

    I'm following this "modern GL" tutorial
    https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_02
    See section "Using Vertex Buffer Objects (VBO) for efficiency"

    Any idea what can be causing this?? The same problem happens if i use native GLEW, or (as mentioned) if i inherit the functions from QOpenGLFunctions.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      delt
      wrote on 28 Nov 2015, 13:01 last edited by
      #2

      SOLVED - I needed to unbind the vertex buffer at the end of my drawing function.

      [ ... ]
      glDrawArrays(GL_TRIANGLES, 0, 6);
      glDisableVertexAttribArray(attribute_coord2d);
      glBindBuffer (GL_ARRAY_BUFFER, 0);
      
      painter->endNativePainting ();
      
      1 Reply Last reply
      0

      2/2

      28 Nov 2015, 13:01

      • Login

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