initial sprite batch implementation & testbed

This commit is contained in:
2024-09-13 18:59:14 +10:00
parent c0de651947
commit 79013c24c4
13 changed files with 732 additions and 29 deletions

View File

@ -0,0 +1,22 @@
public struct Sprite {
public struct Flip: OptionSet {
public let rawValue: UInt16
public init(rawValue: UInt16) {
self.rawValue = rawValue
}
public static let none: Self = Self(rawValue: 0)
public static let x: Self = Self(rawValue: 1 << 0)
public static let y: Self = Self(rawValue: 1 << 1)
}
var texture: RendererTexture2D
var position: SIMD2<Float>
var scale: SIMD2<Float>
var origin: SIMD2<Float>
var shear: SIMD2<Float> = .zero
var angle: Float
var depth: Int
var flip: Flip
var color: Color<Float>
}