#include <SFML/Graphics.hpp>
int main( int argc, const char* argv[] )
{
sf::RenderWindow App;
sf::Texture titleImage;
titleImage.LoadFromFile("./data/Title.png");
App.Create(sf::VideoMode(800, 600, 32), "Test");
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.PollEvent(Event))
{
// Close window
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Keyboard::Escape))
App.Close();
}
App.Clear();
App.Draw(sf::Sprite(titleImage ));
// Display window contents on screen
App.Display();
}
return 0;
}
Linking with
-lsfml-graphics
-lsfml-window
-lsfml-system