Do not ignore '[[nodiscard]]` functions in example code
This commit is contained in:
parent
a71d6bc078
commit
5cfbf912c7
@ -265,7 +265,10 @@ private:
|
||||
/// \code
|
||||
/// // Declare and load a texture
|
||||
/// sf::Texture texture;
|
||||
/// texture.loadFromFile("texture.png");
|
||||
/// if (!texture.loadFromFile("texture.png"))
|
||||
/// {
|
||||
/// // Handle error...
|
||||
/// }
|
||||
///
|
||||
/// // Create a sprite
|
||||
/// sf::Sprite sprite(texture);
|
||||
|
@ -464,7 +464,10 @@ private:
|
||||
/// \code
|
||||
/// // Declare and load a font
|
||||
/// sf::Font font;
|
||||
/// font.loadFromFile("arial.ttf");
|
||||
/// if (!font.loadFromFile("arial.ttf"))
|
||||
/// {
|
||||
/// // Handle error...
|
||||
/// }
|
||||
///
|
||||
/// // Create a text
|
||||
/// sf::Text text(font, "hello");
|
||||
|
@ -120,8 +120,10 @@ public:
|
||||
/// This function is a shortcut for the following code:
|
||||
/// \code
|
||||
/// sf::Image image;
|
||||
/// image.loadFromFile(filename);
|
||||
/// texture.loadFromImage(image, area);
|
||||
/// if (!image.loadFromFile(filename))
|
||||
/// return false;
|
||||
/// if (!texture.loadFromImage(image, area))
|
||||
/// return false;
|
||||
/// \endcode
|
||||
///
|
||||
/// The \a area argument can be used to load only a sub-rectangle
|
||||
@ -151,8 +153,10 @@ public:
|
||||
/// This function is a shortcut for the following code:
|
||||
/// \code
|
||||
/// sf::Image image;
|
||||
/// image.loadFromMemory(data, size);
|
||||
/// texture.loadFromImage(image, area);
|
||||
/// if (!image.loadFromMemory(data, size))
|
||||
/// return false;
|
||||
/// if (!texture.loadFromImage(image, area))
|
||||
/// return false;
|
||||
/// \endcode
|
||||
///
|
||||
/// The \a area argument can be used to load only a sub-rectangle
|
||||
@ -183,8 +187,10 @@ public:
|
||||
/// This function is a shortcut for the following code:
|
||||
/// \code
|
||||
/// sf::Image image;
|
||||
/// image.loadFromStream(stream);
|
||||
/// texture.loadFromImage(image, area);
|
||||
/// if (!image.loadFromStream(stream))
|
||||
/// return false;
|
||||
/// if (!texture.loadFromImage(image, area))
|
||||
/// return false;
|
||||
/// \endcode
|
||||
///
|
||||
/// The \a area argument can be used to load only a sub-rectangle
|
||||
|
Loading…
Reference in New Issue
Block a user