Results 1 to 3 of 3

Thread: OpenGL offscreen rendering in a thread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: OpenGL offscreen rendering in a thread

    show() is called by the main thread, this is true. I don't know what happens to the widget then, but I know for sure that then the run() method starts updating the widget at the rate I wanted and the rendering works fine.
    In the meantime I figured out that if I set these flags in the constructor:

    Qt Code:
    1. SimulatedCamera::SimulatedCamera(QWidget *parent) : QGLViewer(parent)
    2. {
    3. setWindowFlags(Qt::CoverWindow);
    4. setAttribute(Qt::WA_DontShowOnScreen);
    5. setAutoBufferSwap(false);
    6. }
    To copy to clipboard, switch view to plain text mode 

    then the widget is not shown and doesn't spam error messages related to the double buffering. I am not sure how many eyes I made roll with this approach, but it does work perfectly as expected now.
    Last edited by Cruz; 26th November 2020 at 08:53.

Similar Threads

  1. Qwt and Offscreen Rendering (Qt 5)
    By bigjoeystud in forum Qwt
    Replies: 0
    Last Post: 9th June 2016, 22:43
  2. OpenGL rendering in separate thread, Qt 5.0.1
    By jaf in forum Qt Programming
    Replies: 3
    Last Post: 27th October 2015, 23:03
  3. Replies: 0
    Last Post: 26th June 2013, 18:23
  4. Do offscreen render(openGL) with Qt5
    By stereoMatching in forum Qt Programming
    Replies: 4
    Last Post: 26th June 2013, 11:34
  5. Rendering offscreen with QGLWidget
    By jcox23 in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2013, 14:37

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
  •  
Qt is a trademark of The Qt Company.