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
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::Image image;
|
|
|
|
/// if (!image.LoadFromFile("cute_image.jpg"))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// return EXIT_FAILURE;
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::Sprite sprite(image);
|
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;
|
|
|
|
/// 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;
|
|
|
|
/// if (!music.OpenFromFile("nice_music.ogg"))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// return EXIT_FAILURE;
|
|
|
|
///
|
|
|
|
/// // Play the music
|
2009-07-12 17:59:21 +08:00
|
|
|
/// music.Play();
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Start the game loop
|
2009-07-12 17:59:21 +08:00
|
|
|
/// while (window.IsOpened())
|
2009-01-29 00:18:34 +08:00
|
|
|
/// {
|
|
|
|
/// // Process events
|
2009-07-12 17:59:21 +08:00
|
|
|
/// sf::Event event;
|
2011-05-12 05:15:58 +08:00
|
|
|
/// while (window.PollEvent(event))
|
2009-01-29 00:18:34 +08:00
|
|
|
/// {
|
|
|
|
/// // Close window : exit
|
2009-07-12 17:59:21 +08:00
|
|
|
/// if (event.Type == sf::Event::Closed)
|
|
|
|
/// window.Close();
|
2009-01-29 00:18:34 +08:00
|
|
|
/// }
|
|
|
|
///
|
|
|
|
/// // Clear screen
|
2009-07-12 17:59:21 +08:00
|
|
|
/// window.Clear();
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Draw the sprite
|
2009-07-12 17:59:21 +08:00
|
|
|
/// window.Draw(sprite);
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Draw the string
|
2009-07-12 17:59:21 +08:00
|
|
|
/// window.Draw(text);
|
2009-01-29 00:18:34 +08:00
|
|
|
///
|
|
|
|
/// // Update the window
|
2009-07-12 17:59:21 +08:00
|
|
|
/// window.Display();
|
2009-01-29 00:18:34 +08:00
|
|
|
/// }
|
|
|
|
///
|
|
|
|
/// return EXIT_SUCCESS;
|
|
|
|
/// }
|
|
|
|
/// \endcode
|
|
|
|
////////////////////////////////////////////////////////////
|