Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/System.hpp>
- #include <SFML/Window.hpp>
- #include <SFML/Graphics.hpp>
- int main()
- {
- sf::RenderWindow Screen(sf::VideoMode(800,600, 32), "SFML Graphics");
- sf::Texture texture;
- if (!texture.LoadFromFile("Untitled.png"))
- return EXIT_FAILURE;
- sf::Sprite sprite(texture);
- while(Screen.IsOpened())
- {
- sf::Event Event;
- while (Screen.PollEvent (Event))
- {
- if (Event.Type == sf::Event::Closed)
- Screen.Close();
- }
- if ((Event.Type == sf::Event::KeyReleased) && (Event.Key.Code == sf::Keyboard::Escape))
- {
- Screen.Close();
- }
- Screen.Clear(sf::Color(255,255,255));
- Screen.Display();
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement