Error check using IsValid functions and return error unions (#191)

* Verify shaders are valid

* Verify images are valid

* Verify models are valid

* Verify materials are valid

* Verify textures are valid

* Verify render textures are valid

* Verify waves are valid

* Verify sounds are valid

* Verify music is valid

* Verify audio streams are valid

* Verify fonts are valid

* Update examples to handle error unions
This commit is contained in:
vent 2025-01-11 17:07:33 +00:00 committed by GitHub
parent 30ce68004f
commit 41022159ad
Failed to generate hash of commit
8 changed files with 475 additions and 188 deletions

View file

@ -17,7 +17,7 @@ pub fn main() anyerror!void {
defer rl.closeWindow(); // Close window and OpenGL context
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
const scarfy: rl.Texture = rl.Texture.init("resources/textures/scarfy.png"); // Texture loading
const scarfy: rl.Texture = try rl.Texture.init("resources/textures/scarfy.png"); // Texture loading
defer rl.unloadTexture(scarfy); // Texture unloading
const position = rl.Vector2.init(350.0, 280.0);