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. How should I handle two QGLWidgets which only share the same shaders?

How should I handle two QGLWidgets which only share the same shaders?

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

    Hi all!
    I've just added a second QGLWidget to my app (both QGLWidgets inherit from the same class). While the first one still works as expected, the second one raises a GL_OUT_OF_MEMORY, in the glDrawArrays() method of my paintGL()method, whatever the data which filled the buffers

    I manage to solve this in adding the first QGLWidget as a "share widget" when creating the second one: http://doc.qt.io/qt-4.8/qglwidget.html#QGLWidget

    However, now, it seems that the two QGLWidgets are linked/synchronized (especially the camera but only when switching to a widget to another).

    My question is thus more general as I would like to know how I should handle my two QGLWidgets, to avoid conflicts, knowing that they only share the same shaders code (vertex and fragment) but no data (they do not write/read the same buffers).

    EDIT: I use PyQt4

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ccleung
      wrote on last edited by
      #2

      I guess two QGLWidgets cannot share context data with each other. Each QGLWidget should has its own context and shader.

      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