Yes, I included the file type (png), yes I tried making a sprite, yes I have it in the same folder as the "Source.cpp" file. I am getting so frustrated as I have wasted the past hour or so trying to figure out why it is doing this. I am thinking it might be the way I linked the project? The thing is, though, every other type of code works with these project settings, EXCEPT adding textures.
Any ideas?
Thanks.
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 800), "Good");
sf::Texture texture;
texture.loadFromFile("sfml logo.png");
sf::Sprite sprite;
sprite.setTexture(texture);
sprite.setColor(sf::Color::Red);
while (window.isOpen())
{
sf::Event ev;
while (window.pollEvent(ev))
{
if (ev.type == sf::Event::Closed)
{
window.close();
}
}
window.clear();
window.draw(sprite);
window.display();
}
}