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. Crash in swapBuffer with two QWindows

Crash in swapBuffer with two QWindows

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

    Hi I am creating an Qt5 application, having two QWindows with their own QOpenGLContext.
    Window1 is a parent of Window2. Window1 displays an image using a texture, and Window2 displays an overlay with lines, circles using OpenGL. The program works fine until I try to re-render Window1. It crashes on m_context->swapBuffer(), where m_context is the Window1's QOpenGLContext. If I do not re-render Window1 I can re-render , i.e. update Window2 without any problem.
    I am using as a base class for both windows the OpenGLWindow from the openglwindow example.
    Any idea why this happens?
    Will appreciate any design advice. I pretty new to Qt/OpenGL.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kvardin
      wrote on last edited by
      #2

      I fixed the problem.
      m_context->makeCurrent(this) shall be called religiously before and after swapBuffers() !

      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