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

Author Topic: Unable to load textures (SFML Game Development, chapter 3)  (Read 1577 times)

0 Members and 2 Guests are viewing this topic.

homik

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to load textures (SFML Game Development, chapter 3)
« on: February 17, 2017, 12:04:09 am »
Hi.
I have some problem with project after chapter 3. When I run application, there is only black screen and white statistics text.
I'm working on:
- Visual Studio Community 2015,
- Windows 10,
- SFML 2.3.2.

When I run it from command line, it shows that program can't load from file Eagle.png, but I check and it shows with every .png files.
Directory is the same as after chapter 2 (which works and displays background and aircraft) - I store all .h, .cpp files and media folder (with font and .png) in folder with .vcxproj.

Code is exactly the same as on github.

I searched in google, this forum and I can't find the right solution  :-\
Sorry for english, if something wrong :)

EGYPTIAN CODER

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Re: Unable to load textures (SFML Game Development, chapter 3)
« Reply #1 on: February 17, 2017, 10:44:36 am »
maybe the files isn't in the working directory
maybe you forgot to add (.png) when you have called loadfromfile function   

homik

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unable to load textures (SFML Game Development, chapter 3)
« Reply #2 on: February 17, 2017, 01:53:46 pm »
When I copy media folder to others and it doesn't change anything, still displays black screen only with statistics.
.png is from beginning  :-\

homik

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unable to load textures (SFML Game Development, chapter 3)
« Reply #3 on: February 18, 2017, 12:54:27 am »
I found the reason... I missed one '!' symbol in FOREACH macro  :P