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. QGLWidget with custom OpenGL context
QtWS25 Last Chance

QGLWidget with custom OpenGL context

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 4.8k 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.
  • M Offline
    M Offline
    matrem
    wrote on last edited by
    #1

    Hello,

    I'm trying to have my custom context creation works with QGLwidget, by creating a custom QGLContext.

    But I'm facing a problem on Linux (so with GLX):
    The visual I get from my FrameBuffer configuration ( glXChooseFBConfig / glXGetVisualFromFBConfig ) is not compatible with the one in the QGWidget.
    And so the glXCreateWindow needed for glXCreateContextAttribsARB, fails.

    I would like to know if it's possible to update or create the QGLWidget from my visual?

    Because it's seems important to match the glx concept :

    • FrameBufferConfiguration creation
    • Visual retrieving
    • XWindow creation from visual ( so my qt widget )
    • GLXWindow creation from FBConfig and XWindow
    • GLXContext creation from GLXWindow & FBConfig
    1 Reply Last reply
    0
    • M Offline
      M Offline
      matrem
      wrote on last edited by
      #2

      I finally solver my problem by :

      • converting my XVisualInfo in a compatible QGLFormat
      • constructing my QGLWidget with this format
      • setDevice to my custom context with the qglwidget instance
      • setContext on the qglwidget with my custom context
      1 Reply Last reply
      0
      • M Offline
        M Offline
        matrem
        wrote on last edited by
        #3

        I wrote a small article to describe that : http://virtrev.blogspot.fr/2012/12/custom-opengl-context-with-qt.html

        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