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:
parent
30ce68004f
commit
41022159ad
8 changed files with 475 additions and 188 deletions
|
|
@ -25,8 +25,8 @@ pub fn main() anyerror!void {
|
|||
|
||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||
|
||||
const image = rl.loadImage("logo/logo.png"); // Loaded in CPU memory (RAM)
|
||||
const texture = rl.loadTextureFromImage(image); // Image converted to texture, GPU memory (VRAM)
|
||||
const image = try rl.loadImage("logo/logo.png"); // Loaded in CPU memory (RAM)
|
||||
const texture = try rl.loadTextureFromImage(image); // Image converted to texture, GPU memory (VRAM)
|
||||
// Once image has been converted to texture and uploaded to VRAM,
|
||||
// it can be unloaded from RAM
|
||||
rl.unloadImage(image);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue