Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 67 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <SFML/Audio.hpp>
  2. #include <SFML/Graphics.hpp>
  3.  
  4. int main()
  5. {
  6.     sf::RenderWindow window(sf::VideoMode(640, 480), "Gamecoding Tutorials - Test Compile");
  7.  
  8.     sf::Texture texture;
  9.     if (!texture.loadFromFile("gfx/gc_tuts.png"))
  10.         return EXIT_FAILURE;
  11.  
  12.     sf::Sprite sprite(texture);
  13.  
  14.     sf::Font font;
  15.     if (!font.loadFromFile("font/coders_crux.ttf"))
  16.         return EXIT_FAILURE;
  17.  
  18.     sf::Text text("Gamecoding Tutorials!", font, 50);
  19.  
  20.     sf::Music music;
  21.     if (!music.openFromFile("sfx/funk.wav"))
  22.         return EXIT_FAILURE;
  23.  
  24.     music.setLoop(true);
  25.  
  26.     music.play();
  27.  
  28.     while (window.isOpen())
  29.     {
  30.         sf::Event event;
  31.         while (window.pollEvent(event))
  32.         {
  33.             if (event.type == sf::Event::Closed)
  34.                 window.close();
  35.         }
  36.  
  37.         window.clear(sf::Color(60, 60, 60));
  38.  
  39.         window.draw(sprite);
  40.  
  41.         window.draw(text);
  42.  
  43.         window.display();
  44.     }
  45.  
  46.     return EXIT_SUCCESS;
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top