raylib-rs
raylib-rs copied to clipboard
launching with cargo works, but not the executable
I was trying to create a small prototype in raylib, and I came across an issue when running the executable.
it works fine if you run the executable via cargo run, but when launching it via either double clicking it in the file manager or ./<executable>, the window opens then closes immediately with "texture could not be loaded". as to what the issue could be? I have no clue, but it seems like it only happens with textures.
I've attached my code below in case the error I'm experiencing is caused by my code, but keep in mind that the examples that use textures have the same effect, so I doubt it's my code specifically. src.zip
Your code is fine. You need to execute the binary from the right directory.
Your texture is at /project/src/gfx/yui_front.png and you are loading src/gfx/yui_front.png so you need to call the executable from /project so the paths line up.