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 - Darkying

Pages: [1]
1
Thank you for your tip. Of course the location was wrong, I should have seen that but I guess I was a bit dull today. I tried with an absolute path (got the inspiration from your reply):

And it worked, so now I knew it actually DID load the image, finding out where was was easy. For future reference, images for SFML in MVS projects are placed...

CORRECTLY
  • In the root directory of the project

INCORRECTLY
  • In the root directory of the solution
  • In the output directory
  • In the intermediate directory

2
Graphics / Loading png files in visual studio. Can't find the file
« on: July 14, 2012, 05:26:04 pm »
Hello,
I'm sure I'm making a stupid mistake somewhere, but I can't seem to load a image.png for the "Displaying a sprite" tutorial. I have SFML up and running (I can run some of the other tutorials, like the "Using render windows" tutorial). I'm working with SFML 1.6 and MVS 2008 in Windows 7 64 bits. The only change I've made to the code of the tutorial is putting the name of the image I'm using, instead of the default name the tutorial had.

 if (!Image.LoadFromFile("image.png"))

image.png is this image,  normal 32 bit png, weights 43kB, has nothing strange. And I've tried putting it in the output folder (where the .exe is generated), in the intermediate folder, in the project root, adding it to the "Resource Files" folder inside MVS. And still getting the "Failed to load image "image.png". Reason : Unable to open file" error when I run the example code from the tutorial.

I've tried in release and debug mode, linking the correct libraries in each case, in case it made a difference.

I've tried with a different png image.

Any ideas? Thank you for your time.
Cheers!

Pages: [1]
anything