So I am trying to teach myself how to program step by step. I started using SFML because of how easy I had heard it was easy to use. I have messed around with the code for awhile now and looked for a bit using search but I found it better just to make my own topic so I apologize if this has been answered(I am sure it has).
I have my program to where all I want it to do is display an image on my screen(starting out real slow). For whatever reason all I get is a white screen instead of the image I am trying to load and I have no idea why this is.
#include <SFML/Graphics.hpp>
int main()
{
//sets screen dimentions and sets bit depth
sf::VideoMode VMode(800, 600, 32);
//creates the window and gives it a name
sf::RenderWindow Window(VMode, "SFML Test");
sf::Texture Texture;
if(!Texture.loadFromFile("Hero.png"))
return 1;
sf::Sprite Sprite;
Sprite.setTexture(Texture);
Sprite.setPosition(100.0f, 30.0f);
//loop for closing the window
while (Window.isOpen())
{
sf::Event Event;
while (Window.pollEvent(Event))
{
switch (Event.type)
{
case sf::Event::Closed:
Window.close();
break;
default:
break;
}
}
}
Window.clear();
Window.draw(Sprite);
Window.display();
return 0;
}
man self learning this is not going to be easy