Results 1 to 2 of 2

Thread: OpenGLWidget: problem creating OpenGL recources outside of initializeGL

  1. #1
    Join Date
    Mar 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Question OpenGLWidget: problem creating OpenGL recources outside of initializeGL

    I'm on Qt 5.4.0 on Windows. Using QOpenGLWidget, I need to postpone the creation of OpenGL buffers, etc. until after initializeGL has executed.

    I call makeCurrent, then create buffers, etc. which works fine, but when paintGL is called I get OpenGL errors, as if the OpenGL handles I'm using to draw belong to a different context. Note that if exactly the same code executed from within initializeGL, I get no errors in paintGL.

    So I downloaded the source code and traced into makeCurrent (since it is a void function and doesn't indicate success or failure, perhaps this should be added to the API), and observed that everything succeeds; and I've verified that the address of the context object is the same in the code that calls initializeGL and within the makeCurrent call.

    Any idea what could be wrong?

  2. #2
    Join Date
    Mar 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: OpenGLWidget: problem creating OpenGL recources outside of initializeGL

    Answering my own question: it seems like there was some OpenGL client state enabled by the Qt code that calls my OpenGL rendering code, which interfered with my renderer. So, don't assume anything about the current state of the context when Qt calls paintGL.

Similar Threads

  1. Replies: 5
    Last Post: 28th November 2010, 21:04
  2. Creating QUAD Elements would openGL be better than Qt
    By sujan.dasmahapatra in forum General Programming
    Replies: 4
    Last Post: 17th October 2009, 11:49
  3. Problem from OpenGL to QT OpenGL
    By nuts_fever_007 in forum Newbie
    Replies: 5
    Last Post: 15th May 2009, 10:37
  4. paintGL() and initializeGL() help
    By mickey in forum Newbie
    Replies: 14
    Last Post: 26th February 2006, 18:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.