CADisplayLink Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Synchronization object between your animations and the display refresh.
[Foundation.Register("CADisplayLink", true)]
public class CADisplayLink : Foundation.NSObject
[<Foundation.Register("CADisplayLink", true)>]
type CADisplayLink = class
inherit NSObject
- Inheritance
- Attributes
Remarks
The display link object is a timer that can be used to synchronize your drawing with the screen refresh rate. Once you create your CADisplayLink, you need to add it to a runloop by using the AddToRunLoop(NSRunLoop, NSString) method.
Using the display link ensures that your application will not suffer from display glitches like screen tearing and micro-stuttering.
You can pause the display link by setting the Paused property. And you can remove your display link from any registered run loops by calling the Invalidate() method.
By default the timer is triggered sixty times per second. If your application does not need this level of precision, set the FrameInterval property to skip one or more updates. For example, setting FrameInterval to two, would invoke your target method thirty times per second.
GLKView myGlView;
void Setup ()
{
CADisplayLink displayLink = CADisplayLink.Create (Display);
displayLink.AddToRunLoop (NSRunLoop.Main, NSRunLoop.UITrackingRunLoopMode);
}
void Display ()
{
myGLView.Display ();
}
Constructors
| Name | Description |
|---|---|
| CADisplayLink() |
Creates a new CADisplayLink with default values. |
| CADisplayLink(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| CADisplayLink(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
Properties
| Name | Description |
|---|---|
| AccessibilityAttributedUserInputLabels | (Inherited from NSObject) |
| AccessibilityRespondsToUserInteraction | (Inherited from NSObject) |
| AccessibilityTextualContext | (Inherited from NSObject) |
| AccessibilityUserInputLabels | (Inherited from NSObject) |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| DebugDescription | (Inherited from NSObject) |
| Description | (Inherited from NSObject) |
| Duration |
The time between screen refreshes. |
| ExposedBindings | (Inherited from NSObject) |
| FrameInterval |
Developers should not use this deprecated property. Developers should use 'PreferredFramesPerSecond' property. |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| IsDirectBinding | (Inherited from NSObject) |
| IsProxy | (Inherited from NSObject) |
| Paused |
Whether the notifications between the animation loop and your code are suspended. |
| PreferredFrameRateRange | |
| PreferredFramesPerSecond |
Gets or sets the preferred display rate. |
| RetainCount | (Inherited from NSObject) |
| Self | (Inherited from NSObject) |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| TargetTimestamp |
Gets the time stamp for the desired time to start displaying the target of the display link. |
| Timestamp |
Timestamp for the last frame displayed. |
| Zone | (Inherited from NSObject) |