Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. QGLWidget vsync Mac
Forum Updated to NodeBB v4.3 + New Features

QGLWidget vsync Mac

Scheduled Pinned Locked Moved Game Development
3 Posts 2 Posters 3.1k 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.
  • P Offline
    P Offline
    piciji
    wrote on last edited by
    #1

    I am using CGLSetParameter(CGLSetCurrentContext(), kCGLCPSwapInterval, &val ) to activate vsync. It works but only for a few seconds. The animation is smooth at 60 fps for 3 - 5 seconds. Afterwards the framerate drops to 48 - 50 fps for a fraction of a second and runs smooth for the next few seconds and so on. You can notice this stutter in fps and video scrolling. In my opinion its more a Qt and not opengl problem, because in fullscreen all is fine. The only difference to the windowed display is the showFullScreen() call on the widget.

    Anyone an idea what is causing this? I am using a QTimer based event loop.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      piciji
      wrote on last edited by
      #2

      I have tested it under Linux. In a windowed mode, the vsync is not perfect too. Like mac, there is no problem in fullscreen. Using a glFinish() at the end of glPaint() works like a charm for linux in windowed mode.
      Using a glFinish() for mac make the above described problem even worse. Framerate drops to 30 for a fraction of a second.
      So don't know maybe it's a hardware problem with my mac.

      In Windows I am using directx. Never had problems with it in window mode or fullscreen.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        matti-
        wrote on last edited by
        #3

        Would be sweet to have something like CADisplayLink in Qt that would prompt for a redraw as fast as possible. Using a timer seems quite inefficient to me, although I have no idea how it performs under the hood.

        Author of <a href="http://mmark.777-team.org/">MMark13</a>

        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