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

Author Topic: Issue loading simple texture  (Read 1398 times)

0 Members and 1 Guest are viewing this topic.

ddlutz

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Issue loading simple texture
« on: June 11, 2015, 05:47:57 am »
Hello everybody, I'm using SFML 2.3 on VS2013. I'm just getting started with this today but running into some issues with loading textures. I have a texture in my C: root folder and the image is called 'player.png'. I'm doing
"mTexture.loadFromFile("C:/player.png");" and it always returns false. I've tried various ways of C:\, C:\\, etc and no matter what it always returns false. Anybody have any ideas?

Thanks!

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Issue loading simple texture
« Reply #1 on: June 11, 2015, 07:16:01 am »
Is it an 8bit PNG?  If so, those are not supported.

ddlutz

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Issue loading simple texture
« Reply #2 on: June 11, 2015, 08:52:33 am »
No it's not.

I was able to resolve the issue though somewhat, it works perfectly fine if I set VS to compile it is a release build instead of a debug without changing any code. I can't think of a reason for why the image fails to load only when it's set for debug.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Issue loading simple texture
« Reply #3 on: June 11, 2015, 10:34:32 am »
Could be that you are building your application in debug mode but still link to the release version of the SFML library. You must not mix debug/release since that causes all sort of random runtime errors, you must link to the debug version of SFML in that case.