2009-01-29 00:18:34 +08:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
/// \mainpage
|
|
|
|
///
|
|
|
|
/// \section welcome Welcome
|
|
|
|
/// Welcome to the official SFML documentation. Here you will find a detailed
|
2011-06-14 00:07:01 +08:00
|
|
|
/// view of all the SFML <a href="./annotated.php">classes</a>, as well as source
|
|
|
|
/// <a href="./files.php">files</a>. <br>
|
2009-01-29 00:18:34 +08:00
|
|
|
/// If you are looking for tutorials, you can visit the official website
|
|
|
|
/// at <a href="http://www.sfml-dev.org/tutorials/">www.sfml-dev.org</a>.
|
|
|
|
///
|
|
|
|
/// \section example Short example
|
|
|
|
/// Here is a short example, to show you how simple it is to use SFML :
|
|
|
|
///
|
|
|
|
/// \code
|
|
|
|
///
|
|
|
|
/// #include <SFML/Audio.hpp>
|
|
|
|
/// #include <SFML/Graphics.hpp>
|
|
|
|
///
|
|
|
|
/// int main()
|
|
|
|
/// {
|
|
|
|
/// // Create the main window
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Load a sprite to display
|
2011-08-07 05:15:48 +08:00
|
|
|
/// sf::Texture texture;
|
2012-03-12 02:10:37 +08:00
|
|
|
/// if (!texture.loadFromFile("cute_image.jpg"))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// return EXIT_FAILURE;
|
2011-08-07 05:15:48 +08:00
|
|
|
/// sf::Sprite sprite(texture);
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
2010-07-16 05:13:55 +08:00
|
|
|
/// // Create a graphical text to display
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::Font font;
|
2012-03-12 02:10:37 +08:00
|
|
|
/// if (!font.loadFromFile("arial.ttf"))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// return EXIT_FAILURE;
|
2010-07-16 05:13:55 +08:00
|
|
|
/// sf::Text text("Hello SFML", font, 50);
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Load a music to play
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::Music music;
|
2012-03-12 02:10:37 +08:00
|
|
|
/// if (!music.openFromFile("nice_music.ogg"))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// return EXIT_FAILURE;
|
|
|
|
///
|
|
|
|
/// // Play the music
|
2012-03-12 02:10:37 +08:00
|
|
|
/// music.play();
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Start the game loop
|
2012-03-12 02:10:37 +08:00
|
|
|
/// while (window.isOpen())
|
2009-01-29 00:18:34 +08:00
|
|
|
/// {
|
|
|
|
/// // Process events
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::Event event;
|
2012-03-12 02:10:37 +08:00
|
|
|
/// while (window.pollEvent(event))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// {
|
|
|
|
/// // Close window : exit
|
2012-03-12 02:10:37 +08:00
|
|
|
/// if (event.type == sf::Event::Closed)
|
|
|
|
/// window.close();
|
2009-01-29 00:18:34 +08:00
|
|
|
/// }
|
|
|
|
///
|
|
|
|
/// // Clear screen
|
2012-03-12 02:10:37 +08:00
|
|
|
/// window.clear();
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Draw the sprite
|
2012-03-12 02:10:37 +08:00
|
|
|
/// window.draw(sprite);
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Draw the string
|
2012-03-12 02:10:37 +08:00
|
|
|
/// window.draw(text);
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Update the window
|
2012-03-12 02:10:37 +08:00
|
|
|
/// window.display();
|
2009-01-29 00:18:34 +08:00
|
|
|
/// }
|
|
|
|
///
|
|
|
|
/// return EXIT_SUCCESS;
|
|
|
|
/// }
|
|
|
|
/// \endcode
|
|
|
|
////////////////////////////////////////////////////////////
|