Failed to Display with swapBuffers()

  • it says
    QOpenGLContext::swapBuffers() called without corresponding makeCurrent()

    I would like to know where to put the makeCurrent() function...

    Thank you very much.

    By the way, if you have idea about this:
    I will be very appreciated!

  • Lifetime Qt Champion


    generally, on the top of the function where you are doing some OpenGL stuff. Are you trying to do something outside paintGL ?

  • Just before the swapBuffers() function

  • I have the same problem as ykmd and the replies so far haven't helped, unfortunately. I'd make a new thread but this one is not that old, so I think it appropriate to post in here.
    I have the makecurrent() at the beginning of paintGL() and the swapbuffers() call at the very end. However, I only get a flickering screen. That is, the screen in my GLWidget is all black and only goes to my set background color (a kind of light gray) while redrawing, for example if i resize the window.
    Does anyone know why that could be?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.