Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Standard C++ headers
- #include <iostream>
- using namespace std;
- // SFML headers
- #include <SFML/Graphics.hpp>
- #include <SFML/System.hpp>
- using namespace sf;
- int main()
- {
- /* INITIALIZATION */
- Event evt;
- // Create and load textures and sprites
- Texture tex;
- if(!tex.LoadFromFile("data/sprites/UFO/single.png"))
- return EXIT_FAILURE;
- Sprite sprite(tex);
- // Create the render window
- RenderWindow win(VideoMode(800, 600), "ProjectX - development version");
- /* MAIN LOOP */
- while(win.IsOpen())
- {
- // Clear back buffer
- win.Clear();
- // Process events
- while(win.PollEvent(evt))
- {
- // Exit if the user presses ESC or clicks on window close button
- if(evt.Type == Event::Closed || (evt.Type == Event::KeyPressed and evt.Key.Code == Keyboard::Escape))
- win.Close();
- }
- win.Draw(sprite);
- // Display changes
- win.Display();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement