RobLoach / node-raylib

Node.js bindings for Raylib
https://robloach.github.io/node-raylib/
Other
248 stars 20 forks source link

Add argument orchestrator for 'unsigned char *' #78

Closed eviltreehouse closed 3 years ago

eviltreehouse commented 3 years ago

const texBunny = r.LoadTextureFromImage(imgBunny); if (! texBunny.id) { console.error('failed to load texture!'); process.exit(1); }

/ ... /

r.UnloadTexture(texBunny); r.UnloadImage(imgBunny);


* Considered a wrap to get rid of the somewhat superfluous length parameter but this was quicker -- one can always wrap it on the Node.js side if its bothersome :)
RobLoach commented 3 years ago

This is a good solution, thanks so much! :rocket:

Is there an example or a test you could add for this? Not sure if there's an example that uses LoadTextureFromImage....

eviltreehouse commented 3 years ago

@RobLoach example would be nice :) I added a basic one. I also have a test staged but since it requires a live GL context to function I felt it more similar to an actual "integration" test and didn't bundle it in: on my MBP it doubled the test suite time 🐌

RobLoach commented 3 years ago

Thanks so much! This is great :+1: