Converted get/set methods pairs to computed properties throughout the Playdate bindings target.

This commit is contained in:
2026-07-26 00:20:19 +02:00
parent 8b002d9be8
commit 2b046005d1
8 changed files with 36 additions and 47 deletions
+4 -6
View File
@@ -13,15 +13,13 @@ extension Display {
/// The display height in pixels, taking the current scale into account.
public static var height: Int { Int(api.pointee.getHeight.unsafelyUnwrapped()) }
/// Sets the nominal refresh rate in frames per second. Pass 0 to update
/// The nominal refresh rate in frames per second. Set to 0 to update
/// as fast as possible (the update callback drives the pace).
public static func setRefreshRate(_ rate: Float) {
api.pointee.setRefreshRate.unsafelyUnwrapped(rate)
public static var refreshRate: Float {
get { api.pointee.getRefreshRate.unsafelyUnwrapped() }
set { api.pointee.setRefreshRate.unsafelyUnwrapped(newValue) }
}
/// The current nominal refresh rate.
public static var refreshRate: Float { api.pointee.getRefreshRate.unsafelyUnwrapped() }
/// The measured average frames per second.
public static var fps: Float { api.pointee.getFPS.unsafelyUnwrapped() }