Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Audio.hpp>
- #include <SFML/Graphics.hpp>
- int main()
- {
- sf::RenderWindow window(sf::VideoMode(640, 480), "Gamecoding Tutorials - Test Compile");
- sf::Texture texture;
- if (!texture.loadFromFile("gfx/gc_tuts.png"))
- return EXIT_FAILURE;
- sf::Sprite sprite(texture);
- sf::Font font;
- if (!font.loadFromFile("font/coders_crux.ttf"))
- return EXIT_FAILURE;
- sf::Text text("Gamecoding Tutorials!", font, 50);
- sf::Music music;
- if (!music.openFromFile("sfx/funk.wav"))
- return EXIT_FAILURE;
- music.setLoop(true);
- music.play();
- while (window.isOpen())
- {
- sf::Event event;
- while (window.pollEvent(event))
- {
- if (event.type == sf::Event::Closed)
- window.close();
- }
- window.clear(sf::Color(60, 60, 60));
- window.draw(sprite);
- window.draw(text);
- window.display();
- }
- return EXIT_SUCCESS;
- }
Add Comment
Please, Sign In to add comment