Advertisement
Guest User

Ramd First Sfml game

a guest
Sep 4th, 2011
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <SFML/System.hpp>
  2. #include <SFML/Window.hpp>
  3. #include <SFML/Graphics.hpp>
  4.  
  5.  
  6. int main()
  7. {
  8. sf::RenderWindow Screen(sf::VideoMode(800,600, 32), "SFML Graphics");
  9.  
  10. sf::Texture texture;
  11. if (!texture.LoadFromFile("Untitled.png"))
  12. return EXIT_FAILURE;
  13. sf::Sprite sprite(texture);
  14.  
  15. while(Screen.IsOpened())
  16. {
  17. sf::Event Event;
  18. while (Screen.PollEvent (Event))
  19. {
  20. if (Event.Type == sf::Event::Closed)
  21. Screen.Close();
  22. }
  23.  
  24. if ((Event.Type == sf::Event::KeyReleased) && (Event.Key.Code == sf::Keyboard::Escape))
  25. {
  26. Screen.Close();
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33. Screen.Clear(sf::Color(255,255,255));
  34. Screen.Display();
  35. }
  36. return EXIT_SUCCESS;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement