• Gunnar Sletta's avatar
    Renderloop for Windows · 73d8bcda
    Gunnar Sletta authored
    
    The normal GUI thread render loop has several problems on windows.
    It does not do vsync animations and on some hardware, where the
    vsync delta is higher than the time it takes to fire a 16ms timer,
    the eventloop will always contain at least one event and we never
    return to processing non-client area events, like resize.
    
    Also, threaded OpenGL seems rather unstable, so the threaded renderer
    is not a stable option.
    
    So we introduce a windows based renderloop. It is fully cross platform
    but written to make the most out of the limitations which exist.
    
    The overall goal is:
      - vsync animations when allowed by the system. We get this by
        using an animation driver and advancing in sync with rendering
      - Keep system load low and allow for NC processing. The maybeUpdate
        function will start a short timer which will let the renderloop
        idle for few ms, allowing the eventloop to pick up system events.
        (this is similar to what the threaded renderer also does, btw)
    
    Change-Id: Ic192fd0ed7d5ecdaa2c887c08cbeb42c5de6b8a8
    Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
    Reviewed-by: default avatarSamuel Rødal <samuel.rodal@digia.com>
    73d8bcda