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

Pages: [1]
1
Graphics / loadfromfile failing to load an image
« on: January 24, 2020, 04:55:08 pm »
Hello!
I'm just starting to learn SFML, but i've stumbled upon a problem that my sprites do not appear in a created window. i thought that this may be because images are just not downloaded from the file and sprites remail blank. Here's how i was doing it.
RenderWindow window(sf::VideoMode(640, 480), "Test");

Texture t;
t.loadFromFile("file_name.png");       

Sprite s;
s.setTexture(t);
s.setPosition(200, 200);

window.draw(s);
window.display();
 
i've tried to call the file by it's full path, but it didn't help, so now i'm wondering what the problem could be.

Pages: [1]