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. GlGenBuffers() crashes in Release Build
QtWS25 Last Chance

GlGenBuffers() crashes in Release Build

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.9k 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.
  • J Offline
    J Offline
    Jelle
    wrote on last edited by
    #1

    Hello everyone!

    I am facing a very odd problem with the OpenGL function glGenBuffers(). In order to use all OpenGL functions, I defined my class like this:

    @class MyClasss: protected QGLFunctions {
    // ...

    private:
    GLuint vertexBufferObject;
    }@

    I'm writing a fairly simple application in which I use a VBO declared in the following way:
    @
    glGenBuffers(1, &vertexBufferObject);
    // ... load data and render

    // ...and in the destructor:
    glDeleteBuffers(1, &vertexBufferObject);
    @

    This all works perfectly fine in the Debug Build. The data is rendered nicely and all and the programme finishes correctly in the end. However, in Release Build, the glGenBuffers() crashes the programme. It doesn't just return 0 or do nothing, it crashes right at the function call. But since the problem only occurs in Release mode, I can't use the debugger to find out what's going wrong.

    I'm working on a Windows 7 system and developing in Qt 4.8.1. The compiler is the MSVC 2010 (Qt SDK) compiler.

    Does anyone have any suggestions that I might try?

    // Edit:
    And yes, I rebuilt like a hundred times and ran qmake again and again, with no result.
    Also, I put debugging output statements throughout the code to see if this was actually where it went wrong, like this:
    @qDebug() << "GL error:" << glGetError();@

    All return 0, until the programme hit glGenBuffers(), at which point it crashes.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jelle
      wrote on last edited by
      #2

      Ah, I found that it is most likely equivalent to the problem described here:
      http://qt-project.org/forums/viewthread/12794

      It is postulated in this thread that the problem is caused by a bug in the Qt API, this one: https://bugreports.qt-project.org/browse/QTBUG-5729

      I would be grateful if anyone could confirm that - it doesn't completely seem to match up in my mind, although it may well be possible. My current work-around is to use GLEW instead and leave out QGLFunctions, but I would be happy to hear of other (neater) solutions.

      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