mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-05 22:21:33 +00:00
initial sprite batch implementation & testbed
This commit is contained in:
20
Sources/Voxelotl/Renderer/Metal/RendererTexture2D.swift
Normal file
20
Sources/Voxelotl/Renderer/Metal/RendererTexture2D.swift
Normal file
@ -0,0 +1,20 @@
|
||||
import Metal
|
||||
|
||||
public struct RendererTexture2D: Hashable {
|
||||
internal let _textureBuffer: MTLTexture
|
||||
public let size: Size<Int>
|
||||
|
||||
internal init(metalTexture: MTLTexture, size: Size<Int>) {
|
||||
self._textureBuffer = metalTexture
|
||||
self.size = size
|
||||
}
|
||||
|
||||
public static func == (lhs: Self, rhs: Self) -> Bool {
|
||||
lhs._textureBuffer.gpuResourceID._impl == rhs._textureBuffer.gpuResourceID._impl && lhs.size == rhs.size
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(self._textureBuffer.hash)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user