Platforms to show: All Mac Windows Linux Cross-Platform
Back to CADisplayLinkMBS class.
CADisplayLinkMBS.duration as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This value is in an undefined state until the system calls the target’s selector at least once.
You calculate the expected amount of time your app has to render each frame by using targetTimestamp-timestamp. Use targetTimestamp-CACurrentMediaTime to calculate the actual amount of time.
(Read only property)
CADisplayLinkMBS.frameInterval as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ❌ No | ❌ No | ❌ No | ✅ Yes | iOS only |
The default value is 1, which results in the system notifying your app at the refresh rate of the display. If you set the value to a value greater than 1, the display link notifies your app at a fraction of the native refresh rate. For example, setting the interval to 2 causes the display link to fire every other frame, providing half the frame rate.
Setting this value to less than 1 results in undefined behavior and is a programmer error.
(Read and Write property)
CADisplayLinkMBS.Handle as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
(Read and Write property)
CADisplayLinkMBS.paused as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The default value is false. If true, the display link doesn’t send notifications to the target.
This property is thread safe, so you can set it from a thread separate to the one in which the display link runs.
(Read and Write property)
CADisplayLinkMBS.preferredFramesPerSecond as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ❌ No | ❌ No | ❌ No | ✅ Yes | iOS only |
The display link makes a best attempt to invoke your app’s callback at the frequency value you set to this property. However, the system also takes into account the device’s hardware capabilities and the other tasks your game or app is running.
In iOS 15 and later, the system can change the available range of frame rates because it factors in system policies and a person’s preferences. For example, Low Power Mode, critical thermal state, and accessibility settings can affect the system’s frame rate.
The system typically provides a consistent frame rate by choosing one that’s a factor of the display’s maximum refresh rate. For example, a display link could invoke your callback 60 times per second for a display with a refresh rate of 60 hertz. However, the display link could invoke your callback less frequently, such as 30, 20, or 15 times per second, by setting a smaller value.
The property defaults to 0, which is equivalent to the display’s maximum refresh rate, such as a UIScreen instance’s maximumFramesPerSecond property.
(Read and Write property)
CADisplayLinkMBS.tag as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
(Read and Write property)
CADisplayLinkMBS.targetTimestamp as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You can use the target timestamp to cancel or pause long running processes that may overrun the available time between frames in order to maintain a consistent frame rate.
(Read only property)
CADisplayLinkMBS.timestamp as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa | MBS MacCocoa Plugin | 26.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If you need to calculate what to display next, use targetTimestamp instead.
(Read only property)
The items on this page are in the following plugins: MBS MacCocoa Plugin.