Cached API tables and cut allocations in the PlayDate bindings target.

This commit is contained in:
2026-07-25 10:43:32 +02:00
parent 6594794cec
commit dfeadabfb6
20 changed files with 272 additions and 89 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ internal import CPlaydate
public enum Display {}
extension Display {
private static var api: UnsafePointer<playdate_display> { Playdate.displayAPI }
private static var api: UnsafePointer<playdate_display> { Playdate.displayAPI.unsafelyUnwrapped }
/// The display width in pixels, taking the current scale into account.
public static var width: Int { Int(api.pointee.getWidth.unsafelyUnwrapped()) }