Contents

CGWaitForScreenRefreshRects(_:_:)

Waits for screen refresh operations.

Declaration

func CGWaitForScreenRefreshRects(_ rects: UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, _ count: UnsafeMutablePointer<UInt32>?) -> CGError

Parameters

  • rects:

    A pointer to a CGRect* variable. On return, the variable contains an array of rectangles that bound the refreshed areas, specified in the global display coordinate space. When you no longer need the array, you should deallocate it by calling Cgreleasescreenrefreshrects(_:).

  • count:

    A pointer to a CGRectCount variable. On return, the variable contains the number of entries in the returned array of rectangles.

Return Value

A result code. See Core Graphics Data Types and Constants.

Discussion

In some applications it may be preferable to wait for screen-refresh data synchronously, using this function. You should call this function in a thread other than the main event-processing thread.

As an alternative, Quartz also supports asynchronous notification—see CGRegisterScreenRefreshCallback(_:_:). If refresh callback functions are registered, this function should not be used.

See Also

Functions