Results 1 to 4 of 4

Thread: QGraphicsView + opengl + Vsync

  1. #1
    Join Date
    Dec 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsView + opengl + Vsync

    I'm new in GL as well as in UI in general. So it might be a strange question....

    My software uses QGraphicsView with OpenGL view port. I have a lot of animation on the scene and if I do not have Vsynch image does not look good. Before now I forced drivers ( like on NVIDA control panel or ATI try tools ) to force Vsync yo "always on".

    Now I want to do it from software. To enable it I have to call somehow function wglSwapIntervalEXT(1). So I have 2 questions...


    1) Where should I call it ? So far the only place I see I can call it is inside Item's painting routines. But I want it to be global for the whole scene/view ( not a single item ).


    2) How do I handle dual monitor issue ?
    - is it possible to sync with both monitors ?
    - if not how do I control with which one to sync?


    Thanks in advance!

  2. #2
    Join Date
    Dec 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsView + opengl + Vsync

    ok.

    to setup vsync I need

    Qt Code:
    1. QGLFormat glFormat(QGL::SampleBuffers);
    2. glFormat.setSwapInterval(1); // vsync
    3. setViewport(new QGLWidget(glFormat)); //Antialiasing
    To copy to clipboard, switch view to plain text mode 

    But how do I control which monitor to sync with ?

  3. #3
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView + opengl + Vsync

    I am pretty sure that you don't need to worry about that. Each OpenGl context will vsync on the monitor it is shown. Thats done in the driver/hardware.

    Joh

  4. #4
    Join Date
    Dec 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsView + opengl + Vsync

    Must be I have bad drivers on several machine:-)
    But I tried different driver version.

Similar Threads

  1. opengl widget not able to embed in QGraphicsView
    By wagmare in forum Qt Programming
    Replies: 4
    Last Post: 14th December 2010, 07:22
  2. QGraphicsView and Opengl
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 17th April 2010, 23:26
  3. Using OpenGL on QGraphicsView
    By strateng in forum Newbie
    Replies: 0
    Last Post: 30th March 2010, 01:55
  4. QGraphicsView, OpenGL & rotated text
    By anthon in forum Qt Programming
    Replies: 8
    Last Post: 5th December 2009, 17:05
  5. problem in rendering opengl on QGraphicsView
    By Sandip in forum Qt Programming
    Replies: 17
    Last Post: 15th April 2008, 08:27

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.