mirror of
https://github.com/SFML/SFML.git
synced 2024-12-02 00:01:05 +08:00
2f524481c1
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1002 4e206d99-4929-0410-ac5d-dfc041789085
43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
|
|
////////////////////////////////////////////////////////////
|
|
// Headers
|
|
////////////////////////////////////////////////////////////
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
/// Entry point of application
|
|
///
|
|
/// \return Application exit code
|
|
///
|
|
////////////////////////////////////////////////////////////
|
|
int main()
|
|
{
|
|
// Create main window
|
|
sf::RenderWindow App(sf::VideoMode(640, 480), "SFML Graphics");
|
|
|
|
// Start game loop
|
|
while (App.IsOpened())
|
|
{
|
|
// Process events
|
|
sf::Event Event;
|
|
while (App.GetEvent(Event))
|
|
{
|
|
// Close window : exit
|
|
if (Event.Type == sf::Event::Closed)
|
|
App.Close();
|
|
}
|
|
|
|
// Clear screen
|
|
App.Clear();
|
|
|
|
// Draw apredefined shape
|
|
App.Draw(sf::Shape::Circle(200, 200, 100, sf::Color::Yellow, 10, sf::Color::Blue));
|
|
|
|
// Finally, display the rendered frame on screen
|
|
App.Display();
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|