Added missing documentation to the source code in the Playdate bindings target.
CI / Build & test (macOS) (push) Has been cancelled
CI / Embedded Swift cross-compile (push) Has been cancelled
Documentation / deploy (push) Has been cancelled

This commit is contained in:
2026-07-25 12:55:53 +02:00
parent b435a6e8bd
commit 91783deb7b
63 changed files with 259 additions and 3 deletions
@@ -39,6 +39,7 @@ extension Graphics {
// MARK: Properties
/// The bitmap's dimensions, row stride, and raw storage.
public var data: Data {
var width: Int32 = 0, height: Int32 = 0, rowBytes: Int32 = 0
var mask: UnsafeMutablePointer<UInt8>?
@@ -61,7 +62,9 @@ extension Graphics {
return size
}
/// The bitmap's width, in pixels.
public var width: Int { size.width }
/// The bitmap's height, in pixels.
public var height: Int { size.height }
/// The color of the pixel at (x, y).
@@ -84,6 +87,7 @@ extension Graphics {
color.withLCDColor { gfx.pointee.clearBitmap.unsafelyUnwrapped(pointer, $0) }
}
/// Returns a new copy of the bitmap.
public func copy() -> Bitmap {
Bitmap(pointer: gfx.pointee.copyBitmap.unsafelyUnwrapped(pointer).unsafelyUnwrapped, isOwned: true)
}
@@ -52,6 +52,7 @@ extension Graphics {
return (Int(count), Int(width))
}
/// The number of bitmaps in the table.
public var count: Int { info.count }
}
}
@@ -1,5 +1,6 @@
internal import CPlaydate
/// The cached `playdate->graphics->videostream` C API table.
private var streamAPI: UnsafePointer<playdate_videostream> { Playdate.videoStreamAPI.unsafelyUnwrapped }
extension Graphics {
@@ -1,5 +1,6 @@
internal import CPlaydate
/// The cached `playdate->graphics->tilemap` C API table.
private var tilemapAPI: UnsafePointer<playdate_tilemap> { Playdate.tilemapAPI.unsafelyUnwrapped }
extension Graphics {
@@ -1,5 +1,6 @@
internal import CPlaydate
/// The cached `playdate->graphics->video` C API table.
private var videoAPI: UnsafePointer<playdate_video> { Playdate.videoAPI.unsafelyUnwrapped }
extension Graphics {