Closed RobLoach closed 3 years ago
When an object fails to load, return a null object?
const raw = fs.readFileSync('wabbits_alpha.png'); const imgBunny = r.LoadImageFromMemory('png', raw, raw.length); if (! imgBunny.data) { console.error('failed to load image!'); process.exit(1); } const texBunny = r.LoadTextureFromImage(imgBunny); if (! texBunny.id) { console.error('failed to load texture!'); process.exit(1); }
When an object fails to load, return a null object?