use stderr wrapper for error prints

This commit is contained in:
2024-08-05 20:56:06 +10:00
parent c0393e2687
commit a26d80ea5b
2 changed files with 19 additions and 11 deletions

View File

@ -121,6 +121,7 @@ class Renderer {
}
self.idxBuffer = idxBuffer
// Create a default texture
do {
self.defaultTexture = try Self.loadTexture(device, image2D: Image2D(Data([
0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF,
@ -130,12 +131,13 @@ class Renderer {
throw RendererError.initFailure("Failed to create default texture")
}
// Load texture from a file in the bundle
do {
self.cubeTexture = try Self.loadTexture(device, resourcePath: "test.png")
} catch RendererError.loadFailure(let message) {
print("Failed to load texture image: \(message)")
printErr("Failed to load texture image: \(message)")
} catch {
print("Failed to load texture image: unknown error")
printErr("Failed to load texture image: unknown error")
}
}