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

Author Topic: Can't load texture from file  (Read 1738 times)

0 Members and 1 Guest are viewing this topic.

babichila

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Can't load texture from file
« on: April 30, 2023, 08:56:59 pm »
I tried to load texture from file. I  tryed everething:
I used just name of file, and checking directory in VS project settings
I used full path of file and write it in different ways, such as "D://folder//folder//file", "D:/folder/folder/file",
"D:\folder\folder\file"
I checked path over 10 times, all names are wright.
I was moving these file in different folders.
When i use full path, it writes me "Failed to load image "". Reason: Unable to open file" like it cant reads it's name.
When i use only filename, it says me: Failed to load image "@■Yd╨☺no_texture1.png☼☼╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠А╨► ☺r◄│9Ў⌂►↓└э█ ☺╪\♀♂♥є☼╘╔·⌂Т+·⌂▓9Ў⌂╨☻☺кми°^М╛\Device\HarddiskVolume6\Visual_Studio\VS_projects\Space_Rush\x64\Debug\Space_Rush.exe☺☺♦С+·⌂а∙^М╛╨☺♥р∙^МB╠·⌂ЁЛК¤9Ў⌂♦vБ╩·⌂░aМ╛б&B╠·⌂0√  ш♦0√  ╨♦↓
and same trash symbols. Also, it throws exception in asembler file "memcpy.asm"
I disabled option "Hide extensions for known file types".
Please, help me!

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Can't load texture from file
« Reply #1 on: April 30, 2023, 09:57:37 pm »
Trash symbol in the console when you load a texture is most likely that you're mixing release library with debug compilation. (or vice versa)

If you want to compile in release mode, use the release version of the lib (sfml-graphics etc.)
If you want to compile in debug mode, use the debug version of the lib (sfml-graphics-d etc.)
As written in the VS tutorial

babichila

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Can't load texture from file
« Reply #2 on: April 30, 2023, 10:14:36 pm »
Trash symbol in the console when you load a texture is most likely that you're mixing release library with debug compilation. (or vice versa)

If you want to compile in release mode, use the release version of the lib (sfml-graphics etc.)
If you want to compile in debug mode, use the debug version of the lib (sfml-graphics-d etc.)
As written in the VS tutorial
It solved the problem! Thank you very match!

 

anything