Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - paladin

Pages: [1]
1
Graphics / Problems using image.LoadFromFile
« on: November 24, 2008, 02:00:10 pm »
I launch it using the Run button of CodeBlocks, but I will try starting the exe directly.

/e: Just tested and it works perfect  :D  :D  Thank you for your help.

2
Graphics / Problems using image.LoadFromFile
« on: November 24, 2008, 01:44:41 pm »
Hi at all,
I'm new to SFML and trying to make a small Pong game with it.

There is only one problem:
I try to load an Image this way:
Code: [Select]
sf::Image image;
if(!image.LoadFromFile("test.png"))
   return EXIT_FAILURE;

But LoadFromFile always returns false and the program exits with
Failed to load image "test.png". Reason: can't fopen

Now I tried
Code: [Select]
if(!image.LoadFromFile("/test.png"))
if(!image.LoadFromFile("./test.png"))

but this doesn't work, too.
The picture is definitely in the same folder as the exe.

Finally I tried this:
Code: [Select]
sf::Image image;
if(!image.LoadFromFile("C:/test/test.png"))
   return EXIT_FAILURE;

So an absolute path works, but not a relative path.

The samples and the tutorials use relative paths and I could not find a solution to this problem in the forum and using google.
Now I would like to ask if this is a "bug" or a "feature" :wink:.

PS: Sorry for bad English, but I'm German and not very good in languages.

Pages: [1]
anything