mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
initial sprite batch implementation & testbed
This commit is contained in:
22
Sources/Voxelotl/Renderer/Sprite.swift
Normal file
22
Sources/Voxelotl/Renderer/Sprite.swift
Normal 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>
|
||||
}
|
Reference in New Issue
Block a user