SFML community forums
Help => Graphics => Topic started by: Howitzer21 on February 10, 2012, 05:37:37 am
-
Real simple question: Let's say I've got my executable in C:\Users\username\program\bin\Debug. Let's also say I've got the next bit of code:
space.LoadFromFile("space.png");
where space is an Image. What directory would space.png have to be in for it load properly? Thanks!
-
It will load from the working directory, in the case of visual studio, this is the directory containing the visual studio project. When you open the exe through explorer the working directory will be the directory the exe is in.
-
I've got a copy of the file in <program>, bin, and Debug (see the path above). I've checked on the name of the file, and it matches the string in the code exactly. However it's still crashing for some reason. The IDE by the way is Code::Blocks.
-
Something I probably should've posted on my last reply is that I've also tried feeding it the absolute path and filename, and it still doesn't work. ...Which makes me start to think the path isn't the problem?
-
Uh, sorry guys. Apparently the problem was way off in a completely unrelated part of my code. I don't know how I didn't pick up on that pretty quickly; I guess I probably just changed something else at the same time as adding that LoadFromFile() function in, and then forgot that I had changed it. Still I know how to use a debugger and everything, so it's kind of strange. Sorry about that. Thanks for the help!