Use backticks for SFML types in doc comments

This commit is contained in:
Lukas Dürrenberger 2024-09-08 23:53:40 +02:00 committed by Chris Thrasher
parent 5e56f01612
commit 016e201d17
87 changed files with 1653 additions and 1654 deletions

View File

@ -118,7 +118,7 @@ public:
/// ///
/// \param filename Path of the sound file to load /// \param filename Path of the sound file to load
/// ///
/// \return True if the file was successfully opened /// \return `true` if the file was successfully opened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromFile(const std::filesystem::path& filename); [[nodiscard]] bool openFromFile(const std::filesystem::path& filename);
@ -132,7 +132,7 @@ public:
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes /// \param sizeInBytes Size of the data to load, in bytes
/// ///
/// \return True if the file was successfully opened /// \return `true` if the file was successfully opened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromMemory(const void* data, std::size_t sizeInBytes); [[nodiscard]] bool openFromMemory(const void* data, std::size_t sizeInBytes);
@ -145,7 +145,7 @@ public:
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \return True if the file was successfully opened /// \return `true` if the file was successfully opened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromStream(InputStream& stream); [[nodiscard]] bool openFromStream(InputStream& stream);
@ -178,11 +178,11 @@ public:
/// \brief Get the map of position in sample frame to sound channel /// \brief Get the map of position in sample frame to sound channel
/// ///
/// This is used to map a sample in the sample stream to a /// This is used to map a sample in the sample stream to a
/// position during spatialisation. /// position during spatialization.
/// ///
/// \return Map of position in sample frame to sound channel /// \return Map of position in sample frame to sound channel
/// ///
/// \see getSampleRate, getChannelCount, getDuration /// \see `getSampleRate`, `getChannelCount`, `getDuration`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const std::vector<SoundChannel>& getChannelMap() const; [[nodiscard]] const std::vector<SoundChannel>& getChannelMap() const;
@ -301,10 +301,10 @@ private:
/// \ingroup audio /// \ingroup audio
/// ///
/// This class decodes audio samples from a sound file. It is /// This class decodes audio samples from a sound file. It is
/// used internally by higher-level classes such as sf::SoundBuffer /// used internally by higher-level classes such as `sf::SoundBuffer`
/// and sf::Music, but can also be useful if you want to process /// and `sf::Music`, but can also be useful if you want to process
/// or analyze audio files without playing them, or if you want to /// or analyze audio files without playing them, or if you want to
/// implement your own version of sf::Music with more specific /// implement your own version of `sf::Music` with more specific
/// features. /// features.
/// ///
/// Usage example: /// Usage example:
@ -331,6 +331,6 @@ private:
/// while (count > 0); /// while (count > 0);
/// \endcode /// \endcode
/// ///
/// \see sf::SoundFileReader, sf::OutputSoundFile /// \see `sf::SoundFileReader`, `sf::OutputSoundFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -45,9 +45,9 @@ namespace sf::Listener
/// ///
/// Sounds will play at gain 1 when they are positioned /// Sounds will play at gain 1 when they are positioned
/// within the inner angle of the cone. Sounds will play /// within the inner angle of the cone. Sounds will play
/// at outerGain when they are positioned outside the /// at `outerGain` when they are positioned outside the
/// outer angle of the cone. The gain declines linearly /// outer angle of the cone. The gain declines linearly
/// from 1 to outerGain as the sound moves from the inner /// from 1 to `outerGain` as the sound moves from the inner
/// angle to the outer angle. /// angle to the outer angle.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -61,13 +61,13 @@ struct Cone
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Change the global volume of all the sounds and musics /// \brief Change the global volume of all the sounds and musics
/// ///
/// The volume is a number between 0 and 100; it is combined with /// \a `volume` is a number between 0 and 100; it is combined
/// the individual volume of each sound / music. /// with the individual volume of each sound / music.
/// The default value for the volume is 100 (maximum). /// The default value for the volume is 100 (maximum).
/// ///
/// \param volume New global volume, in the range [0, 100] /// \param volume New global volume, in the range [0, 100]
/// ///
/// \see getGlobalVolume /// \see `getGlobalVolume`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_AUDIO_API void setGlobalVolume(float volume); SFML_AUDIO_API void setGlobalVolume(float volume);
@ -77,7 +77,7 @@ SFML_AUDIO_API void setGlobalVolume(float volume);
/// ///
/// \return Current global volume, in the range [0, 100] /// \return Current global volume, in the range [0, 100]
/// ///
/// \see setGlobalVolume /// \see `setGlobalVolume`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API float getGlobalVolume(); [[nodiscard]] SFML_AUDIO_API float getGlobalVolume();
@ -89,7 +89,7 @@ SFML_AUDIO_API void setGlobalVolume(float volume);
/// ///
/// \param position New listener's position /// \param position New listener's position
/// ///
/// \see getPosition, setDirection /// \see `getPosition`, `setDirection`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_AUDIO_API void setPosition(const Vector3f& position); SFML_AUDIO_API void setPosition(const Vector3f& position);
@ -99,7 +99,7 @@ SFML_AUDIO_API void setPosition(const Vector3f& position);
/// ///
/// \return Listener's position /// \return Listener's position
/// ///
/// \see setPosition /// \see `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API Vector3f getPosition(); [[nodiscard]] SFML_AUDIO_API Vector3f getPosition();
@ -116,7 +116,7 @@ SFML_AUDIO_API void setPosition(const Vector3f& position);
/// ///
/// \param direction New listener's direction /// \param direction New listener's direction
/// ///
/// \see getDirection, setUpVector, setPosition /// \see `getDirection`, `setUpVector`, `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_AUDIO_API void setDirection(const Vector3f& direction); SFML_AUDIO_API void setDirection(const Vector3f& direction);
@ -126,7 +126,7 @@ SFML_AUDIO_API void setDirection(const Vector3f& direction);
/// ///
/// \return Listener's forward vector (not normalized) /// \return Listener's forward vector (not normalized)
/// ///
/// \see setDirection /// \see `setDirection`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API Vector3f getDirection(); [[nodiscard]] SFML_AUDIO_API Vector3f getDirection();
@ -138,7 +138,7 @@ SFML_AUDIO_API void setDirection(const Vector3f& direction);
/// ///
/// \param velocity New listener's velocity /// \param velocity New listener's velocity
/// ///
/// \see getVelocity, getDirection, setUpVector, setPosition /// \see `getVelocity`, `getDirection`, `setUpVector`, `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_AUDIO_API void setVelocity(const Vector3f& velocity); SFML_AUDIO_API void setVelocity(const Vector3f& velocity);
@ -148,7 +148,7 @@ SFML_AUDIO_API void setVelocity(const Vector3f& velocity);
/// ///
/// \return Listener's velocity /// \return Listener's velocity
/// ///
/// \see setVelocity /// \see `setVelocity`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API Vector3f getVelocity(); [[nodiscard]] SFML_AUDIO_API Vector3f getVelocity();
@ -157,11 +157,11 @@ SFML_AUDIO_API void setVelocity(const Vector3f& velocity);
/// \brief Set the cone properties of the listener in the audio scene /// \brief Set the cone properties of the listener in the audio scene
/// ///
/// The cone defines how directional attenuation is applied. /// The cone defines how directional attenuation is applied.
/// The default cone of a sound is {2 * PI, 2 * PI, 1}. /// The default cone of a sound is (2 * PI, 2 * PI, 1).
/// ///
/// \param cone Cone properties of the listener in the scene /// \param cone Cone properties of the listener in the scene
/// ///
/// \see getCone /// \see `getCone`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_AUDIO_API void setCone(const Listener::Cone& cone); SFML_AUDIO_API void setCone(const Listener::Cone& cone);
@ -171,7 +171,7 @@ SFML_AUDIO_API void setCone(const Listener::Cone& cone);
/// ///
/// \return Cone properties of the listener /// \return Cone properties of the listener
/// ///
/// \see setCone /// \see `setCone`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API Listener::Cone getCone(); [[nodiscard]] SFML_AUDIO_API Listener::Cone getCone();
@ -188,7 +188,7 @@ SFML_AUDIO_API void setCone(const Listener::Cone& cone);
/// ///
/// \param upVector New listener's up vector /// \param upVector New listener's up vector
/// ///
/// \see getUpVector, setDirection, setPosition /// \see `getUpVector`, `setDirection`, `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_AUDIO_API void setUpVector(const Vector3f& upVector); SFML_AUDIO_API void setUpVector(const Vector3f& upVector);
@ -198,7 +198,7 @@ SFML_AUDIO_API void setUpVector(const Vector3f& upVector);
/// ///
/// \return Listener's upward vector (not normalized) /// \return Listener's upward vector (not normalized)
/// ///
/// \see setUpVector /// \see `setUpVector`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API Vector3f getUpVector(); [[nodiscard]] SFML_AUDIO_API Vector3f getUpVector();
@ -211,11 +211,11 @@ SFML_AUDIO_API void setUpVector(const Vector3f& upVector);
/// ///
/// The audio listener defines the global properties of the /// The audio listener defines the global properties of the
/// audio environment, it defines where and how sounds and musics /// audio environment, it defines where and how sounds and musics
/// are heard. If sf::View is the eyes of the user, then sf::Listener /// are heard. If `sf::View` is the eyes of the user, then
/// is his ears (by the way, they are often linked together -- /// `sf::Listener` are their ears (by the way, they are often linked
/// same position, orientation, etc.). /// together -- same position, orientation, etc.).
/// ///
/// sf::Listener is a simple interface, which allows to setup the /// `sf::Listener` is a simple interface, which allows to setup the
/// listener in the 3D audio environment (position, direction and /// listener in the 3D audio environment (position, direction and
/// up vector), and to adjust the global volume. /// up vector), and to adjust the global volume.
/// ///

View File

@ -77,20 +77,20 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a music from an audio file /// \brief Construct a music from an audio file
/// ///
/// This function doesn't start playing the music (call play() /// This function doesn't start playing the music (call `play()`
/// to do so). /// to do so).
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \warning Since the music is not loaded at once but rather /// \warning Since the music is not loaded at once but rather
/// streamed continuously, the file must remain accessible until /// streamed continuously, the file must remain accessible until
/// the sf::Music object loads a new music or is destroyed. /// the `sf::Music` object loads a new music or is destroyed.
/// ///
/// \param filename Path of the music file to open /// \param filename Path of the music file to open
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see openFromMemory, openFromStream /// \see `openFromMemory`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Music(const std::filesystem::path& filename); Music(const std::filesystem::path& filename);
@ -98,14 +98,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a music from an audio file in memory /// \brief Construct a music from an audio file in memory
/// ///
/// This function doesn't start playing the music (call play() /// This function doesn't start playing the music (call `play()`
/// to do so). /// to do so).
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \warning Since the music is not loaded at once but rather streamed /// \warning Since the music is not loaded at once but rather streamed
/// continuously, the \a data buffer must remain accessible until /// continuously, the \a data buffer must remain accessible until
/// the sf::Music object loads a new music or is destroyed. That is, /// the `sf::Music` object loads a new music or is destroyed. That is,
/// you can't deallocate the buffer right after calling this function. /// you can't deallocate the buffer right after calling this function.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
@ -113,7 +113,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see openFromFile, openFromStream /// \see `openFromFile`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Music(const void* data, std::size_t sizeInBytes); Music(const void* data, std::size_t sizeInBytes);
@ -121,20 +121,20 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a music from an audio file in a custom stream /// \brief Construct a music from an audio file in a custom stream
/// ///
/// This function doesn't start playing the music (call play() /// This function doesn't start playing the music (call `play()`
/// to do so). /// to do so).
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \warning Since the music is not loaded at once but rather /// \warning Since the music is not loaded at once but rather
/// streamed continuously, the \a stream must remain accessible /// streamed continuously, the \a `stream` must remain accessible
/// until the sf::Music object loads a new music or is destroyed. /// until the `sf::Music` object loads a new music or is destroyed.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see openFromFile, openFromMemory /// \see `openFromFile`, `openFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Music(InputStream& stream); Music(InputStream& stream);
@ -160,20 +160,20 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Open a music from an audio file /// \brief Open a music from an audio file
/// ///
/// This function doesn't start playing the music (call play() /// This function doesn't start playing the music (call `play()`
/// to do so). /// to do so).
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \warning Since the music is not loaded at once but rather /// \warning Since the music is not loaded at once but rather
/// streamed continuously, the file must remain accessible until /// streamed continuously, the file must remain accessible until
/// the sf::Music object loads a new music or is destroyed. /// the `sf::Music` object loads a new music or is destroyed.
/// ///
/// \param filename Path of the music file to open /// \param filename Path of the music file to open
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see openFromMemory, openFromStream /// \see `openFromMemory`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromFile(const std::filesystem::path& filename); [[nodiscard]] bool openFromFile(const std::filesystem::path& filename);
@ -181,22 +181,22 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Open a music from an audio file in memory /// \brief Open a music from an audio file in memory
/// ///
/// This function doesn't start playing the music (call play() /// This function doesn't start playing the music (call `play()`
/// to do so). /// to do so).
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \warning Since the music is not loaded at once but rather streamed /// \warning Since the music is not loaded at once but rather streamed
/// continuously, the \a data buffer must remain accessible until /// continuously, the \a `data` buffer must remain accessible until
/// the sf::Music object loads a new music or is destroyed. That is, /// the `sf::Music` object loads a new music or is destroyed. That is,
/// you can't deallocate the buffer right after calling this function. /// you can't deallocate the buffer right after calling this function.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes /// \param sizeInBytes Size of the data to load, in bytes
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see openFromFile, openFromStream /// \see `openFromFile`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromMemory(const void* data, std::size_t sizeInBytes); [[nodiscard]] bool openFromMemory(const void* data, std::size_t sizeInBytes);
@ -204,20 +204,20 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Open a music from an audio file in a custom stream /// \brief Open a music from an audio file in a custom stream
/// ///
/// This function doesn't start playing the music (call play() /// This function doesn't start playing the music (call `play()`
/// to do so). /// to do so).
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \warning Since the music is not loaded at once but rather /// \warning Since the music is not loaded at once but rather
/// streamed continuously, the \a stream must remain accessible /// streamed continuously, the \a `stream` must remain accessible
/// until the sf::Music object loads a new music or is destroyed. /// until the `sf::Music` object loads a new music or is destroyed.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see openFromFile, openFromMemory /// \see `openFromFile`, `openFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromStream(InputStream& stream); [[nodiscard]] bool openFromStream(InputStream& stream);
@ -235,25 +235,25 @@ public:
/// ///
/// \return Loop Time position class. /// \return Loop Time position class.
/// ///
/// \warning Since setLoopPoints() performs some adjustments on the /// \warning Since `setLoopPoints()` performs some adjustments on the
/// provided values and rounds them to internal samples, a call to /// provided values and rounds them to internal samples, a call to
/// getLoopPoints() is not guaranteed to return the same times passed /// `getLoopPoints()` is not guaranteed to return the same times passed
/// into a previous call to setLoopPoints(). However, it is guaranteed /// into a previous call to `setLoopPoints()`. However, it is guaranteed
/// to return times that will map to the valid internal samples of /// to return times that will map to the valid internal samples of
/// this Music if they are later passed to setLoopPoints(). /// this Music if they are later passed to `setLoopPoints()`.
/// ///
/// \see setLoopPoints /// \see `setLoopPoints`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] TimeSpan getLoopPoints() const; [[nodiscard]] TimeSpan getLoopPoints() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Sets the beginning and duration of the sound's looping sequence using sf::Time /// \brief Sets the beginning and duration of the sound's looping sequence using `sf::Time`
/// ///
/// setLoopPoints() allows for specifying the beginning offset and the duration of the loop such that, when the music /// `setLoopPoints()` allows for specifying the beginning offset and the duration of the loop such that,
/// is enabled for looping, it will seamlessly seek to the beginning whenever it /// when the music is enabled for looping, it will seamlessly seek to the beginning whenever it
/// encounters the end of the duration. Valid ranges for timePoints.offset and timePoints.length are /// encounters the end of the duration. Valid ranges for `timePoints.offset` and `timePoints.length` are
/// [0, Dur) and (0, Dur-offset] respectively, where Dur is the value returned by getDuration(). /// [0, Dur) and (0, Dur-offset] respectively, where Dur is the value returned by `getDuration()`.
/// Note that the EOF "loop point" from the end to the beginning of the stream is still honored, /// Note that the EOF "loop point" from the end to the beginning of the stream is still honored,
/// in case the caller seeks to a point after the end of the loop range. This function can be /// in case the caller seeks to a point after the end of the loop range. This function can be
/// safely called at any point after a stream is opened, and will be applied to a playing sound /// safely called at any point after a stream is opened, and will be applied to a playing sound
@ -264,7 +264,7 @@ public:
/// ///
/// \param timePoints The definition of the loop. Can be any time points within the sound's length /// \param timePoints The definition of the loop. Can be any time points within the sound's length
/// ///
/// \see getLoopPoints /// \see `getLoopPoints`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setLoopPoints(TimeSpan timePoints); void setLoopPoints(TimeSpan timePoints);
@ -278,7 +278,7 @@ protected:
/// ///
/// \param data Chunk of data to fill /// \param data Chunk of data to fill
/// ///
/// \return True to continue playback, false to stop /// \return `true` to continue playback, `false` to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool onGetData(Chunk& data) override; [[nodiscard]] bool onGetData(Chunk& data) override;
@ -294,7 +294,7 @@ protected:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Change the current playing position in the stream source to the loop offset /// \brief Change the current playing position in the stream source to the loop offset
/// ///
/// This is called by the underlying SoundStream whenever it needs us to reset /// This is called by the underlying `SoundStream` whenever it needs us to reset
/// the seek position for a loop. We then determine whether we are looping on a /// the seek position for a loop. We then determine whether we are looping on a
/// loop point or the end-of-file, perform the seek, and return the new position. /// loop point or the end-of-file, perform the seek, and return the new position.
/// ///
@ -305,7 +305,7 @@ protected:
private: private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Helper to convert an sf::Time to a sample position /// \brief Helper to convert an `sf::Time` to a sample position
/// ///
/// \param position Time to convert to samples /// \param position Time to convert to samples
/// ///
@ -315,7 +315,7 @@ private:
[[nodiscard]] std::uint64_t timeToSamples(Time position) const; [[nodiscard]] std::uint64_t timeToSamples(Time position) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Helper to convert a sample position to an sf::Time /// \brief Helper to convert a sample position to an `sf::Time`
/// ///
/// \param samples Sample count to convert to Time /// \param samples Sample count to convert to Time
/// ///
@ -345,16 +345,16 @@ private:
/// you avoid saturating the memory and have almost no loading delay. /// you avoid saturating the memory and have almost no loading delay.
/// This implies that the underlying resource (file, stream or /// This implies that the underlying resource (file, stream or
/// memory buffer) must remain valid for the lifetime of the /// memory buffer) must remain valid for the lifetime of the
/// sf::Music object. /// `sf::Music` object.
/// ///
/// Apart from that, a sf::Music has almost the same features as /// Apart from that, a `sf::Music` has almost the same features as
/// the sf::SoundBuffer / sf::Sound pair: you can play/pause/stop /// the `sf::SoundBuffer` / `sf::Sound` pair: you can play/pause/stop
/// it, request its parameters (channels, sample rate), change /// it, request its parameters (channels, sample rate), change
/// the way it is played (pitch, volume, 3D position, ...), etc. /// the way it is played (pitch, volume, 3D position, ...), etc.
/// ///
/// As a sound stream, a music is played in its own thread in order /// As a sound stream, a music is played in its own thread in order
/// not to block the rest of the program. This means that you can /// not to block the rest of the program. This means that you can
/// leave the music alone after calling play(), it will manage itself /// leave the music alone after calling `play()`, it will manage itself
/// very well. /// very well.
/// ///
/// Usage example: /// Usage example:
@ -372,6 +372,6 @@ private:
/// music.play(); /// music.play();
/// \endcode /// \endcode
/// ///
/// \see sf::Sound, sf::SoundStream /// \see `sf::Sound`, `sf::SoundStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -85,7 +85,7 @@ public:
/// \param channelCount Number of channels in the sound /// \param channelCount Number of channels in the sound
/// \param channelMap Map of position in sample frame to sound channel /// \param channelMap Map of position in sample frame to sound channel
/// ///
/// \return True if the file was successfully opened /// \return `true` if the file was successfully opened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromFile(const std::filesystem::path& filename, [[nodiscard]] bool openFromFile(const std::filesystem::path& filename,
@ -123,7 +123,7 @@ private:
/// \ingroup audio /// \ingroup audio
/// ///
/// This class encodes audio samples to a sound file. It is /// This class encodes audio samples to a sound file. It is
/// used internally by higher-level classes such as sf::SoundBuffer, /// used internally by higher-level classes such as `sf::SoundBuffer`,
/// but can also be useful if you want to create audio files from /// but can also be useful if you want to create audio files from
/// custom data sources, like generated audio samples. /// custom data sources, like generated audio samples.
/// ///
@ -142,6 +142,6 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::SoundFileWriter, sf::InputSoundFile /// \see `sf::SoundFileWriter`, `sf::InputSoundFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -83,7 +83,7 @@ namespace sf::PlaybackDevice
/// \brief Set the audio playback device /// \brief Set the audio playback device
/// ///
/// This function sets the audio playback device to the device /// This function sets the audio playback device to the device
/// with the given \a name. It can be called on the fly (i.e: /// with the given \a `name`. It can be called on the fly (i.e:
/// while sounds are playing). /// while sounds are playing).
/// ///
/// If there are sounds playing when the audio playback /// If there are sounds playing when the audio playback
@ -92,9 +92,9 @@ namespace sf::PlaybackDevice
/// ///
/// \param name The name of the audio playback device /// \param name The name of the audio playback device
/// ///
/// \return True, if it was able to set the requested device /// \return `true`, if it was able to set the requested device
/// ///
/// \see getAvailableDevices, getDefaultDevice /// \see `getAvailableDevices`, `getDefaultDevice`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_AUDIO_API bool setDevice(const std::string& name); [[nodiscard]] SFML_AUDIO_API bool setDevice(const std::string& name);

View File

@ -84,7 +84,7 @@ public:
/// This function uses its own thread so that it doesn't block /// This function uses its own thread so that it doesn't block
/// the rest of the program while the sound is played. /// the rest of the program while the sound is played.
/// ///
/// \see pause, stop /// \see `pause`, `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void play() override; void play() override;
@ -95,7 +95,7 @@ public:
/// This function pauses the sound if it was playing, /// This function pauses the sound if it was playing,
/// otherwise (sound already paused or stopped) it has no effect. /// otherwise (sound already paused or stopped) it has no effect.
/// ///
/// \see play, stop /// \see `play`, `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void pause() override; void pause() override;
@ -105,9 +105,9 @@ public:
/// ///
/// This function stops the sound if it was playing or paused, /// This function stops the sound if it was playing or paused,
/// and does nothing if it was already stopped. /// and does nothing if it was already stopped.
/// It also resets the playing position (unlike pause()). /// It also resets the playing position (unlike `pause()`).
/// ///
/// \see play, pause /// \see `play`, `pause`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void stop() override; void stop() override;
@ -116,12 +116,12 @@ public:
/// \brief Set the source buffer containing the audio data to play /// \brief Set the source buffer containing the audio data to play
/// ///
/// It is important to note that the sound buffer is not copied, /// It is important to note that the sound buffer is not copied,
/// thus the sf::SoundBuffer instance must remain alive as long /// thus the `sf::SoundBuffer` instance must remain alive as long
/// as it is attached to the sound. /// as it is attached to the sound.
/// ///
/// \param buffer Sound buffer to attach to the sound /// \param buffer Sound buffer to attach to the sound
/// ///
/// \see getBuffer /// \see `getBuffer`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setBuffer(const SoundBuffer& buffer); void setBuffer(const SoundBuffer& buffer);
@ -137,12 +137,12 @@ public:
/// ///
/// If set, the sound will restart from beginning after /// If set, the sound will restart from beginning after
/// reaching the end and so on, until it is stopped or /// reaching the end and so on, until it is stopped or
/// setLooping(false) is called. /// `setLooping(false)` is called.
/// The default looping state for sound is false. /// The default looping state for sound is `false`.
/// ///
/// \param loop True to play in loop, false to play once /// \param loop `true` to play in loop, `false` to play once
/// ///
/// \see isLooping /// \see `isLooping`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setLooping(bool loop); void setLooping(bool loop);
@ -157,7 +157,7 @@ public:
/// ///
/// \param timeOffset New playing position, from the beginning of the sound /// \param timeOffset New playing position, from the beginning of the sound
/// ///
/// \see getPlayingOffset /// \see `getPlayingOffset`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPlayingOffset(Time timeOffset); void setPlayingOffset(Time timeOffset);
@ -184,9 +184,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether or not the sound is in loop mode /// \brief Tell whether or not the sound is in loop mode
/// ///
/// \return True if the sound is looping, false otherwise /// \return `true` if the sound is looping, `false` otherwise
/// ///
/// \see setLooping /// \see `setLooping`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isLooping() const; [[nodiscard]] bool isLooping() const;
@ -196,7 +196,7 @@ public:
/// ///
/// \return Current playing position, from the beginning of the sound /// \return Current playing position, from the beginning of the sound
/// ///
/// \see setPlayingOffset /// \see `setPlayingOffset`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Time getPlayingOffset() const; [[nodiscard]] Time getPlayingOffset() const;
@ -253,21 +253,21 @@ private:
/// \class sf::Sound /// \class sf::Sound
/// \ingroup audio /// \ingroup audio
/// ///
/// sf::Sound is the class to use to play sounds. /// `sf::Sound` is the class to use to play sounds.
/// It provides: /// It provides:
/// \li Control (play, pause, stop) /// \li Control (play, pause, stop)
/// \li Ability to modify output parameters in real-time (pitch, volume, ...) /// \li Ability to modify output parameters in real-time (pitch, volume, ...)
/// \li 3D spatial features (position, attenuation, ...). /// \li 3D spatial features (position, attenuation, ...).
/// ///
/// sf::Sound is perfect for playing short sounds that can /// `sf::Sound` is perfect for playing short sounds that can
/// fit in memory and require no latency, like foot steps or /// fit in memory and require no latency, like foot steps or
/// gun shots. For longer sounds, like background musics /// gun shots. For longer sounds, like background musics
/// or long speeches, rather see sf::Music (which is based /// or long speeches, rather see `sf::Music` (which is based
/// on streaming). /// on streaming).
/// ///
/// In order to work, a sound must be given a buffer of audio /// In order to work, a sound must be given a buffer of audio
/// data to play. Audio data (samples) is stored in sf::SoundBuffer, /// data to play. Audio data (samples) is stored in `sf::SoundBuffer,`
/// and attached to a sound when it is created or with the setBuffer() function. /// and attached to a sound when it is created or with the `setBuffer()` function.
/// The buffer object attached to a sound must remain alive /// The buffer object attached to a sound must remain alive
/// as long as the sound uses it. Note that multiple sounds /// as long as the sound uses it. Note that multiple sounds
/// can use the same sound buffer at the same time. /// can use the same sound buffer at the same time.
@ -279,6 +279,6 @@ private:
/// sound.play(); /// sound.play();
/// \endcode /// \endcode
/// ///
/// \see sf::SoundBuffer, sf::Music /// \see `sf::SoundBuffer`, `sf::Music`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -74,14 +74,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the sound buffer from a file /// \brief Construct the sound buffer from a file
/// ///
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param filename Path of the sound file to load /// \param filename Path of the sound file to load
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromMemory, loadFromStream, loadFromSamples, saveToFile /// \see `loadFromMemory`, `loadFromStream`, `loadFromSamples`, `saveToFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundBuffer(const std::filesystem::path& filename); SoundBuffer(const std::filesystem::path& filename);
@ -89,7 +89,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the sound buffer from a file in memory /// \brief Construct the sound buffer from a file in memory
/// ///
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
@ -97,7 +97,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromStream, loadFromSamples /// \see `loadFromFile`, `loadFromStream`, `loadFromSamples`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundBuffer(const void* data, std::size_t sizeInBytes); SoundBuffer(const void* data, std::size_t sizeInBytes);
@ -105,14 +105,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the sound buffer from a custom stream /// \brief Construct the sound buffer from a custom stream
/// ///
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromSamples /// \see `loadFromFile`, `loadFromMemory`, `loadFromSamples`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundBuffer(InputStream& stream); SoundBuffer(InputStream& stream);
@ -130,7 +130,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, saveToFile /// \see `loadFromFile`, `loadFromMemory`, `saveToFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundBuffer(const std::int16_t* samples, SoundBuffer(const std::int16_t* samples,
@ -148,14 +148,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a file /// \brief Load the sound buffer from a file
/// ///
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param filename Path of the sound file to load /// \param filename Path of the sound file to load
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromMemory, loadFromStream, loadFromSamples, saveToFile /// \see `loadFromMemory`, `loadFromStream`, `loadFromSamples`, `saveToFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromFile(const std::filesystem::path& filename); [[nodiscard]] bool loadFromFile(const std::filesystem::path& filename);
@ -163,15 +163,15 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a file in memory /// \brief Load the sound buffer from a file in memory
/// ///
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes /// \param sizeInBytes Size of the data to load, in bytes
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromStream, loadFromSamples /// \see `loadFromFile`, `loadFromStream`, `loadFromSamples`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromMemory(const void* data, std::size_t sizeInBytes); [[nodiscard]] bool loadFromMemory(const void* data, std::size_t sizeInBytes);
@ -179,14 +179,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a custom stream /// \brief Load the sound buffer from a custom stream
/// ///
/// See the documentation of sf::InputSoundFile for the list /// See the documentation of `sf::InputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory, loadFromSamples /// \see `loadFromFile`, `loadFromMemory`, `loadFromSamples`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromStream(InputStream& stream); [[nodiscard]] bool loadFromStream(InputStream& stream);
@ -202,9 +202,9 @@ public:
/// \param sampleRate Sample rate (number of samples to play per second) /// \param sampleRate Sample rate (number of samples to play per second)
/// \param channelMap Map of position in sample frame to sound channel /// \param channelMap Map of position in sample frame to sound channel
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory, saveToFile /// \see `loadFromFile`, `loadFromMemory`, `saveToFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromSamples(const std::int16_t* samples, [[nodiscard]] bool loadFromSamples(const std::int16_t* samples,
@ -216,12 +216,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Save the sound buffer to an audio file /// \brief Save the sound buffer to an audio file
/// ///
/// See the documentation of sf::OutputSoundFile for the list /// See the documentation of `sf::OutputSoundFile` for the list
/// of supported formats. /// of supported formats.
/// ///
/// \param filename Path of the sound file to write /// \param filename Path of the sound file to write
/// ///
/// \return True if saving succeeded, false if it failed /// \return `true` if saving succeeded, `false` if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool saveToFile(const std::filesystem::path& filename) const; [[nodiscard]] bool saveToFile(const std::filesystem::path& filename) const;
@ -231,11 +231,11 @@ public:
/// ///
/// The format of the returned samples is 16 bit signed integer. /// The format of the returned samples is 16 bit signed integer.
/// The total number of samples in this array is given by the /// The total number of samples in this array is given by the
/// getSampleCount() function. /// `getSampleCount()` function.
/// ///
/// \return Read-only pointer to the array of sound samples /// \return Read-only pointer to the array of sound samples
/// ///
/// \see getSampleCount /// \see `getSampleCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const std::int16_t* getSamples() const; [[nodiscard]] const std::int16_t* getSamples() const;
@ -243,12 +243,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the number of samples stored in the buffer /// \brief Get the number of samples stored in the buffer
/// ///
/// The array of samples can be accessed with the getSamples() /// The array of samples can be accessed with the `getSamples()`
/// function. /// function.
/// ///
/// \return Number of samples /// \return Number of samples
/// ///
/// \see getSamples /// \see `getSamples`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::uint64_t getSampleCount() const; [[nodiscard]] std::uint64_t getSampleCount() const;
@ -262,7 +262,7 @@ public:
/// ///
/// \return Sample rate (number of samples per second) /// \return Sample rate (number of samples per second)
/// ///
/// \see getChannelCount, getChannelmap, getDuration /// \see `getChannelCount`, `getChannelMap`, `getDuration`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned int getSampleRate() const; [[nodiscard]] unsigned int getSampleRate() const;
@ -275,7 +275,7 @@ public:
/// ///
/// \return Number of channels /// \return Number of channels
/// ///
/// \see getSampleRate, getChannelmap, getDuration /// \see `getSampleRate`, `getChannelMap`, `getDuration`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned int getChannelCount() const; [[nodiscard]] unsigned int getChannelCount() const;
@ -284,11 +284,11 @@ public:
/// \brief Get the map of position in sample frame to sound channel /// \brief Get the map of position in sample frame to sound channel
/// ///
/// This is used to map a sample in the sample stream to a /// This is used to map a sample in the sample stream to a
/// position during spatialisation. /// position during spatialization.
/// ///
/// \return Map of position in sample frame to sound channel /// \return Map of position in sample frame to sound channel
/// ///
/// \see getSampleRate, getChannelCount, getDuration /// \see `getSampleRate`, `getChannelCount`, `getDuration`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::vector<SoundChannel> getChannelMap() const; [[nodiscard]] std::vector<SoundChannel> getChannelMap() const;
@ -298,7 +298,7 @@ public:
/// ///
/// \return Sound duration /// \return Sound duration
/// ///
/// \see getSampleRate, getChannelCount, getChannelmap /// \see `getSampleRate`, `getChannelCount`, `getChannelMap`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Time getDuration() const; [[nodiscard]] Time getDuration() const;
@ -321,7 +321,7 @@ private:
/// ///
/// \param file Sound file providing access to the new loaded sound /// \param file Sound file providing access to the new loaded sound
/// ///
/// \return True on successful initialization, false on failure /// \return `true` on successful initialization, `false` on failure
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool initialize(InputSoundFile& file); [[nodiscard]] bool initialize(InputSoundFile& file);
@ -333,7 +333,7 @@ private:
/// \param sampleRate Sample rate (number of samples per second) /// \param sampleRate Sample rate (number of samples per second)
/// \param channelMap Map of position in sample frame to sound channel /// \param channelMap Map of position in sample frame to sound channel
/// ///
/// \return True on success, false if any error happened /// \return `true` on success, `false` if any error happened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool update(unsigned int channelCount, unsigned int sampleRate, const std::vector<SoundChannel>& channelMap); [[nodiscard]] bool update(unsigned int channelCount, unsigned int sampleRate, const std::vector<SoundChannel>& channelMap);
@ -382,30 +382,30 @@ private:
/// The sound is then reconstituted by playing these samples at /// The sound is then reconstituted by playing these samples at
/// a high rate (for example, 44100 samples per second is the /// a high rate (for example, 44100 samples per second is the
/// standard rate used for playing CDs). In short, audio samples /// standard rate used for playing CDs). In short, audio samples
/// are like texture pixels, and a sf::SoundBuffer is similar to /// are like texture pixels, and a `sf::SoundBuffer` is similar to
/// a sf::Texture. /// a `sf::Texture`.
/// ///
/// A sound buffer can be loaded from a file, from memory, from /// A sound buffer can be loaded from a file, from memory, from
/// a custom stream (see sf::InputStream) or directly from an array /// a custom stream (see `sf::InputStream`) or directly from an array
/// of samples. It can also be saved back to a file. /// of samples. It can also be saved back to a file.
/// ///
/// Sound buffers alone are not very useful: they hold the audio data /// Sound buffers alone are not very useful: they hold the audio data
/// but cannot be played. To do so, you need to use the sf::Sound class, /// but cannot be played. To do so, you need to use the `sf::Sound` class,
/// which provides functions to play/pause/stop the sound as well as /// which provides functions to play/pause/stop the sound as well as
/// changing the way it is outputted (volume, pitch, 3D position, ...). /// changing the way it is outputted (volume, pitch, 3D position, ...).
/// This separation allows more flexibility and better performances: /// This separation allows more flexibility and better performances:
/// indeed a sf::SoundBuffer is a heavy resource, and any operation on it /// indeed a `sf::SoundBuffer` is a heavy resource, and any operation on it
/// is slow (often too slow for real-time applications). On the other /// is slow (often too slow for real-time applications). On the other
/// side, a sf::Sound is a lightweight object, which can use the audio data /// side, a `sf::Sound` is a lightweight object, which can use the audio data
/// of a sound buffer and change the way it is played without actually /// of a sound buffer and change the way it is played without actually
/// modifying that data. Note that it is also possible to bind /// modifying that data. Note that it is also possible to bind
/// several sf::Sound instances to the same sf::SoundBuffer. /// several `sf::Sound` instances to the same `sf::SoundBuffer`.
/// ///
/// It is important to note that the sf::Sound instance doesn't /// It is important to note that the `sf::Sound` instance doesn't
/// copy the buffer that it uses, it only keeps a reference to it. /// copy the buffer that it uses, it only keeps a reference to it.
/// Thus, a sf::SoundBuffer must not be destructed while it is /// Thus, a `sf::SoundBuffer` must not be destructed while it is
/// used by a sf::Sound (i.e. never write a function that /// used by a `sf::Sound` (i.e. never write a function that
/// uses a local sf::SoundBuffer instance for loading a sound). /// uses a local `sf::SoundBuffer` instance for loading a sound).
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -426,6 +426,6 @@ private:
/// sound2.play(); /// sound2.play();
/// \endcode /// \endcode
/// ///
/// \see sf::Sound, sf::SoundBufferRecorder /// \see `sf::Sound`, `sf::SoundBufferRecorder`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -71,7 +71,7 @@ protected:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Start capturing audio data /// \brief Start capturing audio data
/// ///
/// \return True to start the capture, or false to abort it /// \return `true` to start the capture, or `false` to abort it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool onStart() override; [[nodiscard]] bool onStart() override;
@ -82,7 +82,7 @@ protected:
/// \param samples Pointer to the new chunk of recorded samples /// \param samples Pointer to the new chunk of recorded samples
/// \param sampleCount Number of samples pointed by \a samples /// \param sampleCount Number of samples pointed by \a samples
/// ///
/// \return True to continue the capture, or false to stop it /// \return `true` to continue the capture, or `false` to stop it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool onProcessSamples(const std::int16_t* samples, std::size_t sampleCount) override; [[nodiscard]] bool onProcessSamples(const std::int16_t* samples, std::size_t sampleCount) override;
@ -108,16 +108,16 @@ private:
/// \class sf::SoundBufferRecorder /// \class sf::SoundBufferRecorder
/// \ingroup audio /// \ingroup audio
/// ///
/// sf::SoundBufferRecorder allows to access a recorded sound /// `sf::SoundBufferRecorder` allows to access a recorded sound
/// through a sf::SoundBuffer, so that it can be played, saved /// through a `sf::SoundBuffer`, so that it can be played, saved
/// to a file, etc. /// to a file, etc.
/// ///
/// It has the same simple interface as its base class (start(), stop()) /// It has the same simple interface as its base class (`start()`, `stop()`)
/// and adds a function to retrieve the recorded sound buffer /// and adds a function to retrieve the recorded sound buffer
/// (getBuffer()). /// (`getBuffer()`).
/// ///
/// As usual, don't forget to call the isAvailable() function /// As usual, don't forget to call the `isAvailable()` function
/// before using this class (see sf::SoundRecorder for more details /// before using this class (see `sf::SoundRecorder` for more details
/// about this). /// about this).
/// ///
/// Usage example: /// Usage example:
@ -144,6 +144,6 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::SoundRecorder /// \see `sf::SoundRecorder`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -33,9 +33,9 @@ namespace sf
/// In multi-channel audio, each sound channel can be /// In multi-channel audio, each sound channel can be
/// assigned a position. The position of the channel is /// assigned a position. The position of the channel is
/// used to determine where to place a sound when it /// used to determine where to place a sound when it
/// is spatialised. Assigning an incorrect sound channel /// is spatialized. Assigning an incorrect sound channel
/// will result in multi-channel audio being positioned /// will result in multi-channel audio being positioned
/// incorrectly when using spatialisation. /// incorrectly when using spatialization.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
enum class SoundChannel enum class SoundChannel

View File

@ -52,7 +52,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Register a new reader /// \brief Register a new reader
/// ///
/// \see unregisterReader /// \see `unregisterReader`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -61,7 +61,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Unregister a reader /// \brief Unregister a reader
/// ///
/// \see registerReader /// \see `registerReader`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -77,7 +77,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Register a new writer /// \brief Register a new writer
/// ///
/// \see unregisterWriter /// \see `unregisterWriter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -86,7 +86,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Unregister a writer /// \brief Unregister a writer
/// ///
/// \see registerWriter /// \see `registerWriter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -106,7 +106,7 @@ public:
/// ///
/// \return A new sound file reader that can read the given file, or null if no reader can handle it /// \return A new sound file reader that can read the given file, or null if no reader can handle it
/// ///
/// \see createReaderFromMemory, createReaderFromStream /// \see `createReaderFromMemory`, `createReaderFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static std::unique_ptr<SoundFileReader> createReaderFromFilename(const std::filesystem::path& filename); [[nodiscard]] static std::unique_ptr<SoundFileReader> createReaderFromFilename(const std::filesystem::path& filename);
@ -119,7 +119,7 @@ public:
/// ///
/// \return A new sound file codec that can read the given file, or null if no codec can handle it /// \return A new sound file codec that can read the given file, or null if no codec can handle it
/// ///
/// \see createReaderFromFilename, createReaderFromStream /// \see `createReaderFromFilename`, `createReaderFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static std::unique_ptr<SoundFileReader> createReaderFromMemory(const void* data, std::size_t sizeInBytes); [[nodiscard]] static std::unique_ptr<SoundFileReader> createReaderFromMemory(const void* data, std::size_t sizeInBytes);
@ -131,7 +131,7 @@ public:
/// ///
/// \return A new sound file codec that can read the given file, or null if no codec can handle it /// \return A new sound file codec that can read the given file, or null if no codec can handle it
/// ///
/// \see createReaderFromFilename, createReaderFromMemory /// \see `createReaderFromFilename`, `createReaderFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static std::unique_ptr<SoundFileReader> createReaderFromStream(InputStream& stream); [[nodiscard]] static std::unique_ptr<SoundFileReader> createReaderFromStream(InputStream& stream);
@ -178,12 +178,12 @@ private:
/// This class is where all the sound file readers and writers are /// This class is where all the sound file readers and writers are
/// registered. You should normally only need to use its registration /// registered. You should normally only need to use its registration
/// and unregistration functions; readers/writers creation and manipulation /// and unregistration functions; readers/writers creation and manipulation
/// are wrapped into the higher-level classes sf::InputSoundFile and /// are wrapped into the higher-level classes `sf::InputSoundFile` and
/// sf::OutputSoundFile. /// `sf::OutputSoundFile`.
/// ///
/// To register a new reader (writer) use the sf::SoundFileFactory::registerReader /// To register a new reader (writer) use the `sf::SoundFileFactory::registerReader`
/// (registerWriter) static function. You don't have to call the unregisterReader /// (`registerWriter`) static function. You don't have to call the `unregisterReader`
/// (unregisterWriter) function, unless you want to unregister a format before your /// (`unregisterWriter`) function, unless you want to unregister a format before your
/// application ends (typically, when a plugin is unloaded). /// application ends (typically, when a plugin is unloaded).
/// ///
/// Usage example: /// Usage example:
@ -195,6 +195,6 @@ private:
/// assert(sf::SoundFileFactory::isWriterRegistered<MySoundFileWriter>()); /// assert(sf::SoundFileFactory::isWriterRegistered<MySoundFileWriter>());
/// \endcode /// \endcode
/// ///
/// \see sf::InputSoundFile, sf::OutputSoundFile, sf::SoundFileReader, sf::SoundFileWriter /// \see `sf::InputSoundFile`, `sf::OutputSoundFile`, `sf::SoundFileReader`, `sf::SoundFileWriter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -70,7 +70,7 @@ public:
/// \brief Open a sound file for reading /// \brief Open a sound file for reading
/// ///
/// The provided stream reference is valid as long as the /// The provided stream reference is valid as long as the
/// SoundFileReader is alive, so it is safe to use/store it /// `SoundFileReader` is alive, so it is safe to use/store it
/// during the whole lifetime of the reader. /// during the whole lifetime of the reader.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
@ -122,7 +122,7 @@ public:
/// as well as providing a static check function; the latter is used by /// as well as providing a static check function; the latter is used by
/// SFML to find a suitable writer for a given input file. /// SFML to find a suitable writer for a given input file.
/// ///
/// To register a new reader, use the sf::SoundFileFactory::registerReader /// To register a new reader, use the `sf::SoundFileFactory::registerReader`
/// template function. /// template function.
/// ///
/// Usage example: /// Usage example:
@ -162,6 +162,6 @@ public:
/// sf::SoundFileFactory::registerReader<MySoundFileReader>(); /// sf::SoundFileFactory::registerReader<MySoundFileReader>();
/// \endcode /// \endcode
/// ///
/// \see sf::InputSoundFile, sf::SoundFileFactory, sf::SoundFileWriter /// \see `sf::InputSoundFile`, `sf::SoundFileFactory`, `sf::SoundFileWriter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -60,7 +60,7 @@ public:
/// \param channelCount Number of channels of the sound /// \param channelCount Number of channels of the sound
/// \param channelMap Map of position in sample frame to sound channel /// \param channelMap Map of position in sample frame to sound channel
/// ///
/// \return True if the file was successfully opened /// \return `true` if the file was successfully opened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual bool open(const std::filesystem::path& filename, [[nodiscard]] virtual bool open(const std::filesystem::path& filename,
@ -93,7 +93,7 @@ public:
/// as well as providing a static check function; the latter is used by /// as well as providing a static check function; the latter is used by
/// SFML to find a suitable writer for a given filename. /// SFML to find a suitable writer for a given filename.
/// ///
/// To register a new writer, use the sf::SoundFileFactory::registerWriter /// To register a new writer, use the `sf::SoundFileFactory::registerWriter`
/// template function. /// template function.
/// ///
/// Usage example: /// Usage example:
@ -125,6 +125,6 @@ public:
/// sf::SoundFileFactory::registerWriter<MySoundFileWriter>(); /// sf::SoundFileFactory::registerWriter<MySoundFileWriter>();
/// \endcode /// \endcode
/// ///
/// \see sf::OutputSoundFile, sf::SoundFileFactory, sf::SoundFileReader /// \see `sf::OutputSoundFile`, `sf::SoundFileFactory`, `sf::SoundFileReader`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -57,23 +57,23 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Start the capture /// \brief Start the capture
/// ///
/// The \a sampleRate parameter defines the number of audio samples /// The \a `sampleRate` parameter defines the number of audio samples
/// captured per second. The higher, the better the quality /// captured per second. The higher, the better the quality
/// (for example, 44100 samples/sec is CD quality). /// (for example, 44100 samples/sec is CD quality).
/// This function uses its own thread so that it doesn't block /// This function uses its own thread so that it doesn't block
/// the rest of the program while the capture runs. /// the rest of the program while the capture runs.
/// Please note that only one capture can happen at the same time. /// Please note that only one capture can happen at the same time.
/// You can select which capture device will be used by passing /// You can select which capture device will be used by passing
/// the name to the setDevice() method. If none was selected /// the name to the `setDevice()` method. If none was selected
/// before, the default capture device will be used. You can get a /// before, the default capture device will be used. You can get a
/// list of the names of all available capture devices by calling /// list of the names of all available capture devices by calling
/// getAvailableDevices(). /// `getAvailableDevices()`.
/// ///
/// \param sampleRate Desired capture rate, in number of samples per second /// \param sampleRate Desired capture rate, in number of samples per second
/// ///
/// \return True, if start of capture was successful /// \return `true`, if start of capture was successful
/// ///
/// \see stop, getAvailableDevices /// \see `stop`, `getAvailableDevices`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool start(unsigned int sampleRate = 44100); [[nodiscard]] bool start(unsigned int sampleRate = 44100);
@ -81,7 +81,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Stop the capture /// \brief Stop the capture
/// ///
/// \see start /// \see `start`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void stop(); void stop();
@ -125,15 +125,15 @@ public:
/// \brief Set the audio capture device /// \brief Set the audio capture device
/// ///
/// This function sets the audio capture device to the device /// This function sets the audio capture device to the device
/// with the given \a name. It can be called on the fly (i.e: /// with the given \a `name`. It can be called on the fly (i.e:
/// while recording). If you do so while recording and /// while recording). If you do so while recording and
/// opening the device fails, it stops the recording. /// opening the device fails, it stops the recording.
/// ///
/// \param name The name of the audio capture device /// \param name The name of the audio capture device
/// ///
/// \return True, if it was able to set the requested device /// \return `true`, if it was able to set the requested device
/// ///
/// \see getAvailableDevices, getDefaultDevice /// \see `getAvailableDevices`, `getDefaultDevice`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool setDevice(const std::string& name); [[nodiscard]] bool setDevice(const std::string& name);
@ -156,7 +156,7 @@ public:
/// \param channelCount Number of channels. Currently only /// \param channelCount Number of channels. Currently only
/// mono (1) and stereo (2) are supported. /// mono (1) and stereo (2) are supported.
/// ///
/// \see getChannelCount /// \see `getChannelCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setChannelCount(unsigned int channelCount); void setChannelCount(unsigned int channelCount);
@ -169,7 +169,7 @@ public:
/// ///
/// \return Number of channels /// \return Number of channels
/// ///
/// \see setChannelCount /// \see `setChannelCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned int getChannelCount() const; [[nodiscard]] unsigned int getChannelCount() const;
@ -178,7 +178,7 @@ public:
/// \brief Get the map of position in sample frame to sound channel /// \brief Get the map of position in sample frame to sound channel
/// ///
/// This is used to map a sample in the sample stream to a /// This is used to map a sample in the sample stream to a
/// position during spatialisation. /// position during spatialization.
/// ///
/// \return Map of position in sample frame to sound channel /// \return Map of position in sample frame to sound channel
/// ///
@ -189,11 +189,11 @@ public:
/// \brief Check if the system supports audio capture /// \brief Check if the system supports audio capture
/// ///
/// This function should always be called before using /// This function should always be called before using
/// the audio capture features. If it returns false, then /// the audio capture features. If it returns `false`, then
/// any attempt to use sf::SoundRecorder or one of its derived /// any attempt to use `sf::SoundRecorder` or one of its derived
/// classes will fail. /// classes will fail.
/// ///
/// \return True if audio capture is supported, false otherwise /// \return `true` if audio capture is supported, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool isAvailable(); [[nodiscard]] static bool isAvailable();
@ -215,7 +215,7 @@ protected:
/// starts. If not, this function can be ignored; the default /// starts. If not, this function can be ignored; the default
/// implementation does nothing. /// implementation does nothing.
/// ///
/// \return True to start the capture, or false to abort it /// \return `true` to start the capture, or `false` to abort it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool onStart(); virtual bool onStart();
@ -229,9 +229,9 @@ protected:
/// it over the network, etc.). /// it over the network, etc.).
/// ///
/// \param samples Pointer to the new chunk of recorded samples /// \param samples Pointer to the new chunk of recorded samples
/// \param sampleCount Number of samples pointed by \a samples /// \param sampleCount Number of samples pointed by \a `samples`
/// ///
/// \return True to continue the capture, or false to stop it /// \return `true` to continue the capture, or `false` to stop it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual bool onProcessSamples(const std::int16_t* samples, std::size_t sampleCount) = 0; [[nodiscard]] virtual bool onProcessSamples(const std::int16_t* samples, std::size_t sampleCount) = 0;
@ -262,24 +262,24 @@ private:
/// \class sf::SoundRecorder /// \class sf::SoundRecorder
/// \ingroup audio /// \ingroup audio
/// ///
/// sf::SoundBuffer provides a simple interface to access /// `sf::SoundBuffer` provides a simple interface to access
/// the audio recording capabilities of the computer /// the audio recording capabilities of the computer
/// (the microphone). As an abstract base class, it only cares /// (the microphone). As an abstract base class, it only cares
/// about capturing sound samples, the task of making something /// about capturing sound samples, the task of making something
/// useful with them is left to the derived class. Note that /// useful with them is left to the derived class. Note that
/// SFML provides a built-in specialization for saving the /// SFML provides a built-in specialization for saving the
/// captured data to a sound buffer (see sf::SoundBufferRecorder). /// captured data to a sound buffer (see `sf::SoundBufferRecorder`).
/// ///
/// A derived class has only one virtual function to override: /// A derived class has only one virtual function to override:
/// \li onProcessSamples provides the new chunks of audio samples while the capture happens /// \li `onProcessSamples` provides the new chunks of audio samples while the capture happens
/// ///
/// Moreover, two additional virtual functions can be overridden /// Moreover, two additional virtual functions can be overridden
/// as well if necessary: /// as well if necessary:
/// \li onStart is called before the capture happens, to perform custom initializations /// \li `onStart` is called before the capture happens, to perform custom initializations
/// \li onStop is called after the capture ends, to perform custom cleanup /// \li `onStop` is called after the capture ends, to perform custom cleanup
/// ///
/// A derived class can also control the frequency of the onProcessSamples /// A derived class can also control the frequency of the onProcessSamples
/// calls, with the setProcessingInterval protected function. The default /// calls, with the `setProcessingInterval` protected function. The default
/// interval is chosen so that recording thread doesn't consume too much /// interval is chosen so that recording thread doesn't consume too much
/// CPU, but it can be changed to a smaller value if you need to process /// CPU, but it can be changed to a smaller value if you need to process
/// the recorded data in real time, for example. /// the recorded data in real time, for example.
@ -287,13 +287,13 @@ private:
/// The audio capture feature may not be supported or activated /// The audio capture feature may not be supported or activated
/// on every platform, thus it is recommended to check its /// on every platform, thus it is recommended to check its
/// availability with the isAvailable() function. If it returns /// availability with the isAvailable() function. If it returns
/// false, then any attempt to use an audio recorder will fail. /// `false`, then any attempt to use an audio recorder will fail.
/// ///
/// If you have multiple sound input devices connected to your /// If you have multiple sound input devices connected to your
/// computer (for example: microphone, external soundcard, webcam mic, ...) /// computer (for example: microphone, external sound card, webcam mic, ...)
/// you can get a list of all available devices through the /// you can get a list of all available devices through the
/// getAvailableDevices() function. You can then select a device /// `getAvailableDevices()` function. You can then select a device
/// by calling setDevice() with the appropriate device. Otherwise /// by calling `setDevice()` with the appropriate device. Otherwise
/// the default capturing device will be used. /// the default capturing device will be used.
/// ///
/// By default the recording is in 16-bit mono. Using the /// By default the recording is in 16-bit mono. Using the
@ -304,12 +304,12 @@ private:
/// ///
/// It is important to note that the audio capture happens in a /// It is important to note that the audio capture happens in a
/// separate thread, so that it doesn't block the rest of the /// separate thread, so that it doesn't block the rest of the
/// program. In particular, the onProcessSamples virtual function /// program. In particular, the `onProcessSamples` virtual function
/// (but not onStart and not onStop) will be called /// (but not `onStart` and not `onStop`) will be called
/// from this separate thread. It is important to keep this in /// from this separate thread. It is important to keep this in
/// mind, because you may have to take care of synchronization /// mind, because you may have to take care of synchronization
/// issues if you share data between threads. /// issues if you share data between threads.
/// Another thing to bear in mind is that you must call stop() /// Another thing to bear in mind is that you must call `stop()`
/// in the destructor of your derived class, so that the recording /// in the destructor of your derived class, so that the recording
/// thread finishes before your object is destroyed. /// thread finishes before your object is destroyed.
/// ///
@ -363,6 +363,6 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::SoundBufferRecorder /// \see `sf::SoundBufferRecorder`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -63,9 +63,9 @@ public:
/// ///
/// Sounds will play at gain 1 when the listener /// Sounds will play at gain 1 when the listener
/// is positioned within the inner angle of the cone. /// is positioned within the inner angle of the cone.
/// Sounds will play at outerGain when the listener is /// Sounds will play at `outerGain` when the listener is
/// positioned outside the outer angle of the cone. /// positioned outside the outer angle of the cone.
/// The gain declines linearly from 1 to outerGain as the /// The gain declines linearly from 1 to `outerGain` as the
/// listener moves from the inner angle to the outer angle. /// listener moves from the inner angle to the outer angle.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -110,7 +110,7 @@ public:
/// ///
/// It is important to note that the channel count of the /// It is important to note that the channel count of the
/// audio engine currently sourcing data from this sound /// audio engine currently sourcing data from this sound
/// will always be provided in frameChannelCount. This can /// will always be provided in `frameChannelCount`. This can
/// be different from the channel count of the sound source /// be different from the channel count of the sound source
/// so make sure to size necessary processing buffers /// so make sure to size necessary processing buffers
/// according to the engine channel count and not the sound /// according to the engine channel count and not the sound
@ -131,7 +131,7 @@ public:
/// ///
/// If the audio engine determines that no audio data is /// If the audio engine determines that no audio data is
/// available from the data source, the input data frames /// available from the data source, the input data frames
/// pointer is set to nullptr and the input frame count is /// pointer is set to `nullptr` and the input frame count is
/// set to 0. In this case it is up to the function to /// set to 0. In this case it is up to the function to
/// decide how to handle the situation. For specific effects /// decide how to handle the situation. For specific effects
/// e.g. Echo/Delay buffered data might still be able to be /// e.g. Echo/Delay buffered data might still be able to be
@ -143,9 +143,9 @@ public:
/// engine runs on an internal thread of its own, make sure /// engine runs on an internal thread of its own, make sure
/// access to shared data is synchronized appropriately. /// access to shared data is synchronized appropriately.
/// ///
/// Because this function is stored by the SoundSource /// Because this function is stored by the `SoundSource`
/// object it will be able to be called as long as the /// object it will be able to be called as long as the
/// SoundSource object hasn't yet been destroyed. Make sure /// `SoundSource` object hasn't yet been destroyed. Make sure
/// that any data this function references outlives the /// that any data this function references outlives the
/// SoundSource object otherwise use-after-free errors will /// SoundSource object otherwise use-after-free errors will
/// occur. /// occur.
@ -189,7 +189,7 @@ public:
/// ///
/// \param pitch New pitch to apply to the sound /// \param pitch New pitch to apply to the sound
/// ///
/// \see getPitch /// \see `getPitch`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPitch(float pitch); void setPitch(float pitch);
@ -204,7 +204,7 @@ public:
/// ///
/// \param pan New pan to apply to the sound [-1, +1] /// \param pan New pan to apply to the sound [-1, +1]
/// ///
/// \see getPan /// \see `getPan`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPan(float pan); void setPan(float pan);
@ -217,7 +217,7 @@ public:
/// ///
/// \param volume Volume of the sound /// \param volume Volume of the sound
/// ///
/// \see getVolume /// \see `getVolume`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setVolume(float volume); void setVolume(float volume);
@ -230,9 +230,9 @@ public:
/// 3D space and exhibiting various physical phenomena such as /// 3D space and exhibiting various physical phenomena such as
/// directional attenuation and doppler shift. /// directional attenuation and doppler shift.
/// ///
/// \param enabled True to enable spatialization, false to disable /// \param enabled `true` to enable spatialization, `false` to disable
/// ///
/// \see isSpatializationEnabled /// \see `isSpatializationEnabled`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSpatializationEnabled(bool enabled); void setSpatializationEnabled(bool enabled);
@ -246,7 +246,7 @@ public:
/// ///
/// \param position Position of the sound in the scene /// \param position Position of the sound in the scene
/// ///
/// \see getPosition /// \see `getPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPosition(const Vector3f& position); void setPosition(const Vector3f& position);
@ -261,7 +261,7 @@ public:
/// ///
/// \param direction Direction of the sound in the scene /// \param direction Direction of the sound in the scene
/// ///
/// \see getDirection /// \see `getDirection`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setDirection(const Vector3f& direction); void setDirection(const Vector3f& direction);
@ -270,11 +270,11 @@ public:
/// \brief Set the cone properties of the sound in the audio scene /// \brief Set the cone properties of the sound in the audio scene
/// ///
/// The cone defines how directional attenuation is applied. /// The cone defines how directional attenuation is applied.
/// The default cone of a sound is {2 * PI, 2 * PI, 1}. /// The default cone of a sound is (2 * PI, 2 * PI, 1).
/// ///
/// \param cone Cone properties of the sound in the scene /// \param cone Cone properties of the sound in the scene
/// ///
/// \see getCone /// \see `getCone`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setCone(const Cone& cone); void setCone(const Cone& cone);
@ -289,7 +289,7 @@ public:
/// ///
/// \param velocity Velocity of the sound in the scene /// \param velocity Velocity of the sound in the scene
/// ///
/// \see getVelocity /// \see `getVelocity`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setVelocity(const Vector3f& velocity); void setVelocity(const Vector3f& velocity);
@ -302,7 +302,7 @@ public:
/// ///
/// \param factor New doppler factor to apply to the sound /// \param factor New doppler factor to apply to the sound
/// ///
/// \see getDopplerFactor /// \see `getDopplerFactor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setDopplerFactor(float factor); void setDopplerFactor(float factor);
@ -319,7 +319,7 @@ public:
/// ///
/// \param factor New directional attenuation factor to apply to the sound /// \param factor New directional attenuation factor to apply to the sound
/// ///
/// \see getDirectionalAttenuationFactor /// \see `getDirectionalAttenuationFactor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setDirectionalAttenuationFactor(float factor); void setDirectionalAttenuationFactor(float factor);
@ -331,11 +331,11 @@ public:
/// be played the same way regardless of the position of the listener. /// be played the same way regardless of the position of the listener.
/// This can be useful for non-spatialized sounds, sounds that are /// This can be useful for non-spatialized sounds, sounds that are
/// produced by the listener, or sounds attached to it. /// produced by the listener, or sounds attached to it.
/// The default value is false (position is absolute). /// The default value is `false` (position is absolute).
/// ///
/// \param relative True to set the position relative, false to set it absolute /// \param relative `true` to set the position relative, `false` to set it absolute
/// ///
/// \see isRelativeToListener /// \see `isRelativeToListener`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setRelativeToListener(bool relative); void setRelativeToListener(bool relative);
@ -352,7 +352,7 @@ public:
/// ///
/// \param distance New minimum distance of the sound /// \param distance New minimum distance of the sound
/// ///
/// \see getMinDistance, setAttenuation /// \see `getMinDistance`, `setAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMinDistance(float distance); void setMinDistance(float distance);
@ -369,7 +369,7 @@ public:
/// ///
/// \param distance New maximum distance of the sound /// \param distance New maximum distance of the sound
/// ///
/// \see getMaxDistance, setAttenuation /// \see `getMaxDistance`, `setAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMaxDistance(float distance); void setMaxDistance(float distance);
@ -383,7 +383,7 @@ public:
/// ///
/// \param gain New minimum gain of the sound /// \param gain New minimum gain of the sound
/// ///
/// \see getMinGain, setAttenuation /// \see `getMinGain`, `setAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMinGain(float gain); void setMinGain(float gain);
@ -397,7 +397,7 @@ public:
/// ///
/// \param gain New maximum gain of the sound /// \param gain New maximum gain of the sound
/// ///
/// \see getMaxGain, setAttenuation /// \see `getMaxGain`, `setAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMaxGain(float gain); void setMaxGain(float gain);
@ -416,7 +416,7 @@ public:
/// ///
/// \param attenuation New attenuation factor of the sound /// \param attenuation New attenuation factor of the sound
/// ///
/// \see getAttenuation, setMinDistance /// \see `getAttenuation`, `setMinDistance`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setAttenuation(float attenuation); void setAttenuation(float attenuation);
@ -437,7 +437,7 @@ public:
/// ///
/// \return Pitch of the sound /// \return Pitch of the sound
/// ///
/// \see setPitch /// \see `setPitch`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getPitch() const; [[nodiscard]] float getPitch() const;
@ -447,7 +447,7 @@ public:
/// ///
/// \return Pan of the sound /// \return Pan of the sound
/// ///
/// \see setPan /// \see `setPan`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getPan() const; [[nodiscard]] float getPan() const;
@ -457,7 +457,7 @@ public:
/// ///
/// \return Volume of the sound, in the range [0, 100] /// \return Volume of the sound, in the range [0, 100]
/// ///
/// \see setVolume /// \see `setVolume`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getVolume() const; [[nodiscard]] float getVolume() const;
@ -465,9 +465,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether spatialization of the sound is enabled /// \brief Tell whether spatialization of the sound is enabled
/// ///
/// \return True if spatialization is enabled, false if it's disabled /// \return `true` if spatialization is enabled, `false` if it's disabled
/// ///
/// \see setSpatializationEnabled /// \see `setSpatializationEnabled`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSpatializationEnabled() const; [[nodiscard]] bool isSpatializationEnabled() const;
@ -477,7 +477,7 @@ public:
/// ///
/// \return Position of the sound /// \return Position of the sound
/// ///
/// \see setPosition /// \see `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector3f getPosition() const; [[nodiscard]] Vector3f getPosition() const;
@ -487,7 +487,7 @@ public:
/// ///
/// \return Direction of the sound /// \return Direction of the sound
/// ///
/// \see setDirection /// \see `setDirection`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector3f getDirection() const; [[nodiscard]] Vector3f getDirection() const;
@ -497,7 +497,7 @@ public:
/// ///
/// \return Cone properties of the sound /// \return Cone properties of the sound
/// ///
/// \see setCone /// \see `setCone`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Cone getCone() const; [[nodiscard]] Cone getCone() const;
@ -507,7 +507,7 @@ public:
/// ///
/// \return Velocity of the sound /// \return Velocity of the sound
/// ///
/// \see setVelocity /// \see `setVelocity`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector3f getVelocity() const; [[nodiscard]] Vector3f getVelocity() const;
@ -517,7 +517,7 @@ public:
/// ///
/// \return Doppler factor of the sound /// \return Doppler factor of the sound
/// ///
/// \see setDopplerFactor /// \see `setDopplerFactor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getDopplerFactor() const; [[nodiscard]] float getDopplerFactor() const;
@ -527,7 +527,7 @@ public:
/// ///
/// \return Directional attenuation factor of the sound /// \return Directional attenuation factor of the sound
/// ///
/// \see setDirectionalAttenuationFactor /// \see `setDirectionalAttenuationFactor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getDirectionalAttenuationFactor() const; [[nodiscard]] float getDirectionalAttenuationFactor() const;
@ -536,9 +536,9 @@ public:
/// \brief Tell whether the sound's position is relative to the /// \brief Tell whether the sound's position is relative to the
/// listener or is absolute /// listener or is absolute
/// ///
/// \return True if the position is relative, false if it's absolute /// \return `true` if the position is relative, `false` if it's absolute
/// ///
/// \see setRelativeToListener /// \see `setRelativeToListener`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isRelativeToListener() const; [[nodiscard]] bool isRelativeToListener() const;
@ -548,7 +548,7 @@ public:
/// ///
/// \return Minimum distance of the sound /// \return Minimum distance of the sound
/// ///
/// \see setMinDistance, getAttenuation /// \see `setMinDistance`, `getAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getMinDistance() const; [[nodiscard]] float getMinDistance() const;
@ -558,7 +558,7 @@ public:
/// ///
/// \return Maximum distance of the sound /// \return Maximum distance of the sound
/// ///
/// \see setMaxDistance, getAttenuation /// \see `setMaxDistance`, `getAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getMaxDistance() const; [[nodiscard]] float getMaxDistance() const;
@ -568,7 +568,7 @@ public:
/// ///
/// \return Minimum gain of the sound /// \return Minimum gain of the sound
/// ///
/// \see setMinGain, getAttenuation /// \see `setMinGain`, `getAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getMinGain() const; [[nodiscard]] float getMinGain() const;
@ -578,7 +578,7 @@ public:
/// ///
/// \return Maximum gain of the sound /// \return Maximum gain of the sound
/// ///
/// \see setMaxGain, getAttenuation /// \see `setMaxGain`, `getAttenuation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getMaxGain() const; [[nodiscard]] float getMaxGain() const;
@ -588,7 +588,7 @@ public:
/// ///
/// \return Attenuation factor of the sound /// \return Attenuation factor of the sound
/// ///
/// \see setAttenuation, getMinDistance /// \see `setAttenuation`, `getMinDistance`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getAttenuation() const; [[nodiscard]] float getAttenuation() const;
@ -610,7 +610,7 @@ public:
/// it if it was paused, and restarts it from the beginning if /// it if it was paused, and restarts it from the beginning if
/// it was already playing. /// it was already playing.
/// ///
/// \see pause, stop /// \see `pause`, `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void play() = 0; virtual void play() = 0;
@ -621,7 +621,7 @@ public:
/// This function pauses the source if it was playing, /// This function pauses the source if it was playing,
/// otherwise (source already paused or stopped) it has no effect. /// otherwise (source already paused or stopped) it has no effect.
/// ///
/// \see play, stop /// \see `play`, `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void pause() = 0; virtual void pause() = 0;
@ -631,9 +631,9 @@ public:
/// ///
/// This function stops the source if it was playing or paused, /// This function stops the source if it was playing or paused,
/// and does nothing if it was already stopped. /// and does nothing if it was already stopped.
/// It also resets the playing position (unlike pause()). /// It also resets the playing position (unlike `pause()`).
/// ///
/// \see play, pause /// \see `play`, `pause`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void stop() = 0; virtual void stop() = 0;
@ -673,7 +673,7 @@ private:
/// \class sf::SoundSource /// \class sf::SoundSource
/// \ingroup audio /// \ingroup audio
/// ///
/// sf::SoundSource is not meant to be used directly, it /// `sf::SoundSource` is not meant to be used directly, it
/// only serves as a common base for all audio objects /// only serves as a common base for all audio objects
/// that can live in the audio environment. /// that can live in the audio environment.
/// ///
@ -681,6 +681,6 @@ private:
/// volume, position, attenuation, etc. All of them can be /// volume, position, attenuation, etc. All of them can be
/// changed at any time with no impact on performances. /// changed at any time with no impact on performances.
/// ///
/// \see sf::Sound, sf::SoundStream /// \see `sf::Sound`, `sf::SoundStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -88,7 +88,7 @@ public:
/// This function uses its own thread so that it doesn't block /// This function uses its own thread so that it doesn't block
/// the rest of the program while the stream is played. /// the rest of the program while the stream is played.
/// ///
/// \see pause, stop /// \see `pause`, `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void play() override; void play() override;
@ -99,7 +99,7 @@ public:
/// This function pauses the stream if it was playing, /// This function pauses the stream if it was playing,
/// otherwise (stream already paused or stopped) it has no effect. /// otherwise (stream already paused or stopped) it has no effect.
/// ///
/// \see play, stop /// \see `play`, `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void pause() override; void pause() override;
@ -109,9 +109,9 @@ public:
/// ///
/// This function stops the stream if it was playing or paused, /// This function stops the stream if it was playing or paused,
/// and does nothing if it was already stopped. /// and does nothing if it was already stopped.
/// It also resets the playing position (unlike pause()). /// It also resets the playing position (unlike `pause()`).
/// ///
/// \see play, pause /// \see `play`, `pause`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void stop() override; void stop() override;
@ -141,7 +141,7 @@ public:
/// \brief Get the map of position in sample frame to sound channel /// \brief Get the map of position in sample frame to sound channel
/// ///
/// This is used to map a sample in the sample stream to a /// This is used to map a sample in the sample stream to a
/// position during spatialisation. /// position during spatialization.
/// ///
/// \return Map of position in sample frame to sound channel /// \return Map of position in sample frame to sound channel
/// ///
@ -166,7 +166,7 @@ public:
/// ///
/// \param timeOffset New playing position, from the beginning of the stream /// \param timeOffset New playing position, from the beginning of the stream
/// ///
/// \see getPlayingOffset /// \see `getPlayingOffset`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPlayingOffset(Time timeOffset); void setPlayingOffset(Time timeOffset);
@ -176,7 +176,7 @@ public:
/// ///
/// \return Current playing position, from the beginning of the stream /// \return Current playing position, from the beginning of the stream
/// ///
/// \see setPlayingOffset /// \see `setPlayingOffset`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Time getPlayingOffset() const; [[nodiscard]] Time getPlayingOffset() const;
@ -186,12 +186,12 @@ public:
/// ///
/// If set, the stream will restart from beginning after /// If set, the stream will restart from beginning after
/// reaching the end and so on, until it is stopped or /// reaching the end and so on, until it is stopped or
/// setLooping(false) is called. /// `setLooping(false)` is called.
/// The default looping state for streams is false. /// The default looping state for streams is `false`.
/// ///
/// \param loop True to play in loop, false to play once /// \param loop `true` to play in loop, `false` to play once
/// ///
/// \see isLooping /// \see `isLooping`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setLooping(bool loop); void setLooping(bool loop);
@ -199,9 +199,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether or not the stream is in loop mode /// \brief Tell whether or not the stream is in loop mode
/// ///
/// \return True if the stream is looping, false otherwise /// \return `true` if the stream is looping, `false` otherwise
/// ///
/// \see setLooping /// \see `setLooping`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isLooping() const; [[nodiscard]] bool isLooping() const;
@ -231,7 +231,7 @@ protected:
/// ///
/// This function must be called by derived classes as soon /// This function must be called by derived classes as soon
/// as they know the audio settings of the stream to play. /// as they know the audio settings of the stream to play.
/// Any attempt to manipulate the stream (play(), ...) before /// Any attempt to manipulate the stream (`play()`, ...) before
/// calling this function will fail. /// calling this function will fail.
/// It can be called multiple times if the settings of the /// It can be called multiple times if the settings of the
/// audio stream change, but only when the stream is stopped. /// audio stream change, but only when the stream is stopped.
@ -250,14 +250,14 @@ protected:
/// the audio samples to play. It is called continuously by the /// the audio samples to play. It is called continuously by the
/// streaming loop, in a separate thread. /// streaming loop, in a separate thread.
/// The source can choose to stop the streaming loop at any time, by /// The source can choose to stop the streaming loop at any time, by
/// returning false to the caller. /// returning `false` to the caller.
/// If you return true (i.e. continue streaming) it is important that /// If you return `true` (i.e. continue streaming) it is important that
/// the returned array of samples is not empty; this would stop the stream /// the returned array of samples is not empty; this would stop the stream
/// due to an internal limitation. /// due to an internal limitation.
/// ///
/// \param data Chunk of data to fill /// \param data Chunk of data to fill
/// ///
/// \return True to continue playback, false to stop /// \return `true` to continue playback, `false` to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual bool onGetData(Chunk& data) = 0; [[nodiscard]] virtual bool onGetData(Chunk& data) = 0;
@ -278,7 +278,7 @@ protected:
/// ///
/// This function can be overridden by derived classes to /// This function can be overridden by derived classes to
/// allow implementation of custom loop points. Otherwise, /// allow implementation of custom loop points. Otherwise,
/// it just calls onSeek(Time::Zero) and returns 0. /// it just calls `onSeek(Time::Zero)` and returns 0.
/// ///
/// \return The seek position after looping (or `std::nullopt` if there's no loop) /// \return The seek position after looping (or `std::nullopt` if there's no loop)
/// ///
@ -308,7 +308,7 @@ private:
/// \class sf::SoundStream /// \class sf::SoundStream
/// \ingroup audio /// \ingroup audio
/// ///
/// Unlike audio buffers (see sf::SoundBuffer), audio streams /// Unlike audio buffers (see `sf::SoundBuffer`), audio streams
/// are never completely loaded in memory. Instead, the audio /// are never completely loaded in memory. Instead, the audio
/// data is acquired continuously while the stream is playing. /// data is acquired continuously while the stream is playing.
/// This behavior allows to play a sound with no loading delay, /// This behavior allows to play a sound with no loading delay,
@ -319,19 +319,19 @@ private:
/// or files that would take a lot of time to be received /// or files that would take a lot of time to be received
/// (sounds played over the network). /// (sounds played over the network).
/// ///
/// sf::SoundStream is a base class that doesn't care about the /// `sf::SoundStream` is a base class that doesn't care about the
/// stream source, which is left to the derived class. SFML provides /// stream source, which is left to the derived class. SFML provides
/// a built-in specialization for big files (see sf::Music). /// a built-in specialization for big files (see `sf::Music`).
/// No network stream source is provided, but you can write your own /// No network stream source is provided, but you can write your own
/// by combining this class with the network module. /// by combining this class with the network module.
/// ///
/// A derived class has to override two virtual functions: /// A derived class has to override two virtual functions:
/// \li onGetData fills a new chunk of audio data to be played /// \li `onGetData` fills a new chunk of audio data to be played
/// \li onSeek changes the current playing position in the source /// \li `onSeek` changes the current playing position in the source
/// ///
/// It is important to note that each SoundStream is played in its /// It is important to note that each SoundStream is played in its
/// own separate thread, so that the streaming loop doesn't block the /// own separate thread, so that the streaming loop doesn't block the
/// rest of the program. In particular, the OnGetData and OnSeek /// rest of the program. In particular, the `onGetData` and `onSeek`
/// virtual functions may sometimes be called from this separate thread. /// virtual functions may sometimes be called from this separate thread.
/// It is important to keep this in mind, because you may have to take /// It is important to keep this in mind, because you may have to take
/// care of synchronization issues if you share data between threads. /// care of synchronization issues if you share data between threads.
@ -380,6 +380,6 @@ private:
/// stream.play(); /// stream.play();
/// \endcode /// \endcode
/// ///
/// \see sf::Music /// \see `sf::Music`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -51,7 +51,7 @@
/// ///
/// SFML defines a helper macro to easily do this. /// SFML defines a helper macro to easily do this.
/// ///
/// Place SFML_DEFINE_DISCRETE_GPU_PREFERENCE in the /// Place `SFML_DEFINE_DISCRETE_GPU_PREFERENCE` in the
/// global scope of a source file that will be linked into /// global scope of a source file that will be linked into
/// the final executable. Typically it is best to place it /// the final executable. Typically it is best to place it
/// where the main function is also defined. /// where the main function is also defined.

View File

@ -126,24 +126,24 @@ struct SFML_GRAPHICS_API BlendMode
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates BlendMode /// \relates BlendMode
/// \brief Overload of the == operator /// \brief Overload of the `operator==`
/// ///
/// \param left Left operand /// \param left Left operand
/// \param right Right operand /// \param right Right operand
/// ///
/// \return True if blending modes are equal, false if they are different /// \return `true` if blending modes are equal, `false` if they are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_GRAPHICS_API bool operator==(const BlendMode& left, const BlendMode& right); [[nodiscard]] SFML_GRAPHICS_API bool operator==(const BlendMode& left, const BlendMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates BlendMode /// \relates BlendMode
/// \brief Overload of the != operator /// \brief Overload of the `operator!=`
/// ///
/// \param left Left operand /// \param left Left operand
/// \param right Right operand /// \param right Right operand
/// ///
/// \return True if blending modes are different, false if they are equal /// \return `true` if blending modes are different, `false` if they are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_GRAPHICS_API bool operator!=(const BlendMode& left, const BlendMode& right); [[nodiscard]] SFML_GRAPHICS_API bool operator!=(const BlendMode& left, const BlendMode& right);
@ -167,7 +167,7 @@ SFML_GRAPHICS_API extern const BlendMode BlendNone; //!< Overwrite dest with
/// \class sf::BlendMode /// \class sf::BlendMode
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::BlendMode is a class that represents a blend mode. A blend /// `sf::BlendMode` is a class that represents a blend mode. A blend
/// mode determines how the colors of an object you draw are /// mode determines how the colors of an object you draw are
/// mixed with the colors that are already in the buffer. /// mixed with the colors that are already in the buffer.
/// ///
@ -191,7 +191,7 @@ SFML_GRAPHICS_API extern const BlendMode BlendNone; //!< Overwrite dest with
/// ///
/// The blend factors and equations correspond to their OpenGL equivalents. /// The blend factors and equations correspond to their OpenGL equivalents.
/// In general, the color of the resulting pixel is calculated according /// In general, the color of the resulting pixel is calculated according
/// to the following formula (\a src is the color of the source pixel, \a dst /// to the following formula (\a `src` is the color of the source pixel, \a `dst`
/// the color of the destination pixel, the other variables correspond to the /// the color of the destination pixel, the other variables correspond to the
/// public members, with the equations being + or - operators): /// public members, with the equations being + or - operators):
/// \code /// \code
@ -211,10 +211,10 @@ SFML_GRAPHICS_API extern const BlendMode BlendNone; //!< Overwrite dest with
/// sf::BlendMode noBlending = sf::BlendNone; /// sf::BlendMode noBlending = sf::BlendNone;
/// \endcode /// \endcode
/// ///
/// In SFML, a blend mode can be specified every time you draw a sf::Drawable /// In SFML, a blend mode can be specified every time you draw a `sf::Drawable`
/// object to a render target. It is part of the sf::RenderStates compound /// object to a render target. It is part of the `sf::RenderStates` compound
/// that is passed to the member function sf::RenderTarget::draw(). /// that is passed to the member function `sf::RenderTarget::draw()`.
/// ///
/// \see sf::RenderStates, sf::RenderTarget /// \see `sf::RenderStates`, `sf::RenderTarget`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -59,7 +59,7 @@ public:
/// ///
/// \param radius New radius of the circle /// \param radius New radius of the circle
/// ///
/// \see getRadius /// \see `getRadius`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setRadius(float radius); void setRadius(float radius);
@ -69,7 +69,7 @@ public:
/// ///
/// \return Radius of the circle /// \return Radius of the circle
/// ///
/// \see setRadius /// \see `setRadius`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getRadius() const; [[nodiscard]] float getRadius() const;
@ -79,7 +79,7 @@ public:
/// ///
/// \param count New number of points of the circle /// \param count New number of points of the circle
/// ///
/// \see getPointCount /// \see `getPointCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPointCount(std::size_t count); void setPointCount(std::size_t count);
@ -89,7 +89,7 @@ public:
/// ///
/// \return Number of points of the circle /// \return Number of points of the circle
/// ///
/// \see setPointCount /// \see `setPointCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::size_t getPointCount() const override; [[nodiscard]] std::size_t getPointCount() const override;
@ -100,7 +100,7 @@ public:
/// The returned point is in local coordinates, that is, /// The returned point is in local coordinates, that is,
/// the shape's transforms (position, rotation, scale) are /// the shape's transforms (position, rotation, scale) are
/// not taken into account. /// not taken into account.
/// The result is undefined if \a index is out of the valid range. /// The result is undefined if \a `index` is out of the valid range.
/// ///
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1] /// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
/// ///
@ -136,9 +136,9 @@ private:
/// \class sf::CircleShape /// \class sf::CircleShape
/// \ingroup graphics /// \ingroup graphics
/// ///
/// This class inherits all the functions of sf::Transformable /// This class inherits all the functions of `sf::Transformable`
/// (position, rotation, scale, bounds, ...) as well as the /// (position, rotation, scale, bounds, ...) as well as the
/// functions of sf::Shape (outline, color, texture, ...). /// functions of `sf::Shape` (outline, color, texture, ...).
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -153,13 +153,13 @@ private:
/// ///
/// Since the graphics card can't draw perfect circles, we have to /// Since the graphics card can't draw perfect circles, we have to
/// fake them with multiple triangles connected to each other. The /// fake them with multiple triangles connected to each other. The
/// "points count" property of sf::CircleShape defines how many of these /// "points count" property of `sf::CircleShape` defines how many of these
/// triangles to use, and therefore defines the quality of the circle. /// triangles to use, and therefore defines the quality of the circle.
/// ///
/// The number of points can also be used for another purpose; with /// The number of points can also be used for another purpose; with
/// small numbers you can create any regular polygon shape: /// small numbers you can create any regular polygon shape:
/// equilateral triangle, square, pentagon, hexagon, ... /// equilateral triangle, square, pentagon, hexagon, ...
/// ///
/// \see sf::Shape, sf::RectangleShape, sf::ConvexShape /// \see `sf::Shape`, `sf::RectangleShape`, `sf::ConvexShape`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -43,7 +43,7 @@ public:
/// \brief Default constructor /// \brief Default constructor
/// ///
/// Constructs an opaque black color. It is equivalent to /// Constructs an opaque black color. It is equivalent to
/// sf::Color(0, 0, 0, 255). /// `sf::Color(0, 0, 0, 255)`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Color() = default; constexpr Color() = default;
@ -101,35 +101,35 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the == operator /// \brief Overload of the `operator==`
/// ///
/// This operator compares two colors and check if they are equal. /// This operator compares two colors and check if they are equal.
/// ///
/// \param left Left operand /// \param left Left operand
/// \param right Right operand /// \param right Right operand
/// ///
/// \return True if colors are equal, false if they are different /// \return `true` if colors are equal, `false` if they are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator==(Color left, Color right); [[nodiscard]] constexpr bool operator==(Color left, Color right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the != operator /// \brief Overload of the `operator!=`
/// ///
/// This operator compares two colors and check if they are different. /// This operator compares two colors and check if they are different.
/// ///
/// \param left Left operand /// \param left Left operand
/// \param right Right operand /// \param right Right operand
/// ///
/// \return True if colors are different, false if they are equal /// \return `true` if colors are different, `false` if they are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator!=(Color left, Color right); [[nodiscard]] constexpr bool operator!=(Color left, Color right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the binary + operator /// \brief Overload of the binary `operator+`
/// ///
/// This operator returns the component-wise sum of two colors. /// This operator returns the component-wise sum of two colors.
/// Components that exceed 255 are clamped to 255. /// Components that exceed 255 are clamped to 255.
@ -144,7 +144,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the binary - operator /// \brief Overload of the binary `operator-`
/// ///
/// This operator returns the component-wise subtraction of two colors. /// This operator returns the component-wise subtraction of two colors.
/// Components below 0 are clamped to 0. /// Components below 0 are clamped to 0.
@ -159,7 +159,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the binary * operator /// \brief Overload of the binary `operator*`
/// ///
/// This operator returns the component-wise multiplication /// This operator returns the component-wise multiplication
/// (also called "modulation") of two colors. /// (also called "modulation") of two colors.
@ -176,7 +176,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the binary += operator /// \brief Overload of the binary `operator+=`
/// ///
/// This operator computes the component-wise sum of two colors, /// This operator computes the component-wise sum of two colors,
/// and assigns the result to the left operand. /// and assigns the result to the left operand.
@ -192,7 +192,7 @@ constexpr Color& operator+=(Color& left, Color right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the binary -= operator /// \brief Overload of the binary `operator-=`
/// ///
/// This operator computes the component-wise subtraction of two colors, /// This operator computes the component-wise subtraction of two colors,
/// and assigns the result to the left operand. /// and assigns the result to the left operand.
@ -208,7 +208,7 @@ constexpr Color& operator-=(Color& left, Color right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Color /// \relates Color
/// \brief Overload of the binary *= operator /// \brief Overload of the binary `operator*=`
/// ///
/// This operator returns the component-wise multiplication /// This operator returns the component-wise multiplication
/// (also called "modulation") of two colors, and assigns /// (also called "modulation") of two colors, and assigns
@ -233,7 +233,7 @@ constexpr Color& operator*=(Color& left, Color right);
/// \class sf::Color /// \class sf::Color
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Color is a simple color class composed of 4 components: /// `sf::Color` is a simple color class composed of 4 components:
/// \li Red /// \li Red
/// \li Green /// \li Green
/// \li Blue /// \li Blue

View File

@ -56,12 +56,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the number of points of the polygon /// \brief Set the number of points of the polygon
/// ///
/// For the shape to be rendered as expected, \a count must /// For the shape to be rendered as expected, \a `count` must
/// be greater or equal to 3. /// be greater or equal to 3.
/// ///
/// \param count New number of points of the polygon /// \param count New number of points of the polygon
/// ///
/// \see getPointCount /// \see `getPointCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPointCount(std::size_t count); void setPointCount(std::size_t count);
@ -71,7 +71,7 @@ public:
/// ///
/// \return Number of points of the polygon /// \return Number of points of the polygon
/// ///
/// \see setPointCount /// \see `setPointCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::size_t getPointCount() const override; [[nodiscard]] std::size_t getPointCount() const override;
@ -86,12 +86,12 @@ public:
/// when not drawn (e.g. during shape initialization). /// when not drawn (e.g. during shape initialization).
/// ///
/// Point count must be specified beforehand. The behavior is /// Point count must be specified beforehand. The behavior is
/// undefined if \a index is greater than or equal to getPointCount. /// undefined if \a `index` is greater than or equal to getPointCount.
/// ///
/// \param index Index of the point to change, in range [0 .. getPointCount() - 1] /// \param index Index of the point to change, in range [0 .. getPointCount() - 1]
/// \param point New position of the point /// \param point New position of the point
/// ///
/// \see getPoint /// \see `getPoint`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPoint(std::size_t index, Vector2f point); void setPoint(std::size_t index, Vector2f point);
@ -102,13 +102,13 @@ public:
/// The returned point is in local coordinates, that is, /// The returned point is in local coordinates, that is,
/// the shape's transforms (position, rotation, scale) are /// the shape's transforms (position, rotation, scale) are
/// not taken into account. /// not taken into account.
/// The result is undefined if \a index is out of the valid range. /// The result is undefined if \a `index` is out of the valid range.
/// ///
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1] /// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
/// ///
/// \return Position of the index-th point of the polygon /// \return Position of the index-th point of the polygon
/// ///
/// \see setPoint /// \see `setPoint`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getPoint(std::size_t index) const override; [[nodiscard]] Vector2f getPoint(std::size_t index) const override;
@ -127,9 +127,9 @@ private:
/// \class sf::ConvexShape /// \class sf::ConvexShape
/// \ingroup graphics /// \ingroup graphics
/// ///
/// This class inherits all the functions of sf::Transformable /// This class inherits all the functions of `sf::Transformable`
/// (position, rotation, scale, bounds, ...) as well as the /// (position, rotation, scale, bounds, ...) as well as the
/// functions of sf::Shape (outline, color, texture, ...). /// functions of `sf::Shape` (outline, color, texture, ...).
/// ///
/// It is important to keep in mind that a convex shape must /// It is important to keep in mind that a convex shape must
/// always be... convex, otherwise it may not be drawn correctly. /// always be... convex, otherwise it may not be drawn correctly.
@ -150,6 +150,6 @@ private:
/// window.draw(polygon); /// window.draw(polygon);
/// \endcode /// \endcode
/// ///
/// \see sf::Shape, sf::RectangleShape, sf::CircleShape /// \see `sf::Shape`, `sf::RectangleShape`, `sf::CircleShape`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -31,7 +31,7 @@ namespace sf
/// \ingroup graphics /// \ingroup graphics
/// \brief Types of texture coordinates that can be used for rendering /// \brief Types of texture coordinates that can be used for rendering
/// ///
/// \see sf::Texture::bind /// \see `sf::Texture::bind`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
enum class CoordinateType enum class CoordinateType

View File

@ -73,15 +73,15 @@ protected:
/// \class sf::Drawable /// \class sf::Drawable
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Drawable is a very simple base class that allows objects /// `sf::Drawable` is a very simple base class that allows objects
/// of derived classes to be drawn to a sf::RenderTarget. /// of derived classes to be drawn to a `sf::RenderTarget`.
/// ///
/// All you have to do in your derived class is to override the /// All you have to do in your derived class is to override the
/// draw virtual function. /// draw virtual function.
/// ///
/// Note that inheriting from sf::Drawable is not mandatory, /// Note that inheriting from `sf::Drawable` is not mandatory,
/// but it allows this nice syntax "window.draw(object)" rather /// but it allows this nice syntax `window.draw(object)` rather
/// than "object.draw(window)", which is more consistent with other /// than `object.draw(window)`, which is more consistent with other
/// SFML classes. /// SFML classes.
/// ///
/// Example: /// Example:
@ -115,6 +115,6 @@ protected:
/// }; /// };
/// \endcode /// \endcode
/// ///
/// \see sf::RenderTarget /// \see `sf::RenderTarget`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -91,13 +91,13 @@ public:
/// ///
/// \warning SFML cannot preload all the font data in this /// \warning SFML cannot preload all the font data in this
/// function, so the file has to remain accessible until /// function, so the file has to remain accessible until
/// the sf::Font object opens a new font or is destroyed. /// the `sf::Font` object opens a new font or is destroyed.
/// ///
/// \param filename Path of the font file to open /// \param filename Path of the font file to open
/// ///
/// \throws `sf::Exception` if opening was unsuccessful /// \throws `sf::Exception` if opening was unsuccessful
/// ///
/// \see openFromFile, openFromMemory, openFromStream /// \see `openFromFile`, `openFromMemory`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Font(const std::filesystem::path& filename); Font(const std::filesystem::path& filename);
@ -109,8 +109,8 @@ public:
/// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. /// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.
/// ///
/// \warning SFML cannot preload all the font data in this /// \warning SFML cannot preload all the font data in this
/// function, so the buffer pointed by \a data has to remain /// function, so the buffer pointed by \a `data` has to remain
/// valid until the sf::Font object opens a new font or /// valid until the `sf::Font` object opens a new font or
/// is destroyed. /// is destroyed.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
@ -118,7 +118,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see openFromFile, openFromMemory, openFromStream /// \see `openFromFile`, `openFromMemory`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Font(const void* data, std::size_t sizeInBytes); Font(const void* data, std::size_t sizeInBytes);
@ -129,18 +129,18 @@ public:
/// The supported font formats are: TrueType, Type 1, CFF, /// The supported font formats are: TrueType, Type 1, CFF,
/// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. /// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.
/// Warning: SFML cannot preload all the font data in this /// Warning: SFML cannot preload all the font data in this
/// function, so the contents of \a stream have to remain /// function, so the contents of \a `stream` have to remain
/// valid as long as the font is used. /// valid as long as the font is used.
/// ///
/// \warning SFML cannot preload all the font data in this /// \warning SFML cannot preload all the font data in this
/// function, so the stream has to remain accessible until /// function, so the stream has to remain accessible until
/// the sf::Font object opens a new font or is destroyed. /// the `sf::Font` object opens a new font or is destroyed.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see openFromFile, openFromMemory, openFromStream /// \see `openFromFile`, `openFromMemory`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Font(InputStream& stream); Font(InputStream& stream);
@ -156,13 +156,13 @@ public:
/// ///
/// \warning SFML cannot preload all the font data in this /// \warning SFML cannot preload all the font data in this
/// function, so the file has to remain accessible until /// function, so the file has to remain accessible until
/// the sf::Font object opens a new font or is destroyed. /// the `sf::Font` object opens a new font or is destroyed.
/// ///
/// \param filename Path of the font file to load /// \param filename Path of the font file to load
/// ///
/// \return True if opening succeeded, false if it failed /// \return `true` if opening succeeded, `false` if it failed
/// ///
/// \see openFromMemory, openFromStream /// \see `openFromMemory`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromFile(const std::filesystem::path& filename); [[nodiscard]] bool openFromFile(const std::filesystem::path& filename);
@ -174,16 +174,16 @@ public:
/// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. /// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.
/// ///
/// \warning SFML cannot preload all the font data in this /// \warning SFML cannot preload all the font data in this
/// function, so the buffer pointed by \a data has to remain /// function, so the buffer pointed by \a `data` has to remain
/// valid until the sf::Font object opens a new font or /// valid until the `sf::Font` object opens a new font or
/// is destroyed. /// is destroyed.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes /// \param sizeInBytes Size of the data to load, in bytes
/// ///
/// \return True if opening succeeded, false if it failed /// \return `true` if opening succeeded, `false` if it failed
/// ///
/// \see openFromFile, openFromStream /// \see `openFromFile`, `openFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromMemory(const void* data, std::size_t sizeInBytes); [[nodiscard]] bool openFromMemory(const void* data, std::size_t sizeInBytes);
@ -196,13 +196,13 @@ public:
/// ///
/// \warning SFML cannot preload all the font data in this /// \warning SFML cannot preload all the font data in this
/// function, so the stream has to remain accessible until /// function, so the stream has to remain accessible until
/// the sf::Font object opens a new font or is destroyed. /// the `sf::Font` object opens a new font or is destroyed.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \return True if opening succeeded, false if it failed /// \return `true` if opening succeeded, `false` if it failed
/// ///
/// \see openFromFile, openFromMemory /// \see `openFromFile`, `openFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool openFromStream(InputStream& stream); [[nodiscard]] bool openFromStream(InputStream& stream);
@ -222,7 +222,7 @@ public:
/// might be available. If the glyph is not available at the /// might be available. If the glyph is not available at the
/// requested size, an empty glyph is returned. /// requested size, an empty glyph is returned.
/// ///
/// You may want to use \ref hasGlyph to determine if the /// You may want to use `hasGlyph` to determine if the
/// glyph exists before requesting it. If the glyph does not /// glyph exists before requesting it. If the glyph does not
/// exist, a font specific default is returned. /// exist, a font specific default is returned.
/// ///
@ -234,7 +234,7 @@ public:
/// \param bold Retrieve the bold version or the regular one? /// \param bold Retrieve the bold version or the regular one?
/// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled) /// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled)
/// ///
/// \return The glyph corresponding to \a codePoint and \a characterSize /// \return The glyph corresponding to \a `codePoint` and \a `characterSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Glyph& getGlyph(std::uint32_t codePoint, [[nodiscard]] const Glyph& getGlyph(std::uint32_t codePoint,
@ -255,7 +255,7 @@ public:
/// ///
/// \param codePoint Unicode code point to check /// \param codePoint Unicode code point to check
/// ///
/// \return True if the codepoint has a glyph representation, false otherwise /// \return `true` if the codepoint has a glyph representation, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool hasGlyph(std::uint32_t codePoint) const; [[nodiscard]] bool hasGlyph(std::uint32_t codePoint) const;
@ -274,7 +274,7 @@ public:
/// \param characterSize Reference character size /// \param characterSize Reference character size
/// \param bold Retrieve the bold version or the regular one? /// \param bold Retrieve the bold version or the regular one?
/// ///
/// \return Kerning value for \a first and \a second, in pixels /// \return Kerning value for \a `first` and \a `second`, in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getKerning(std::uint32_t first, std::uint32_t second, unsigned int characterSize, bool bold = false) const; [[nodiscard]] float getKerning(std::uint32_t first, std::uint32_t second, unsigned int characterSize, bool bold = false) const;
@ -302,7 +302,7 @@ public:
/// ///
/// \return Underline position, in pixels /// \return Underline position, in pixels
/// ///
/// \see getUnderlineThickness /// \see `getUnderlineThickness`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getUnderlinePosition(unsigned int characterSize) const; [[nodiscard]] float getUnderlinePosition(unsigned int characterSize) const;
@ -316,7 +316,7 @@ public:
/// ///
/// \return Underline thickness, in pixels /// \return Underline thickness, in pixels
/// ///
/// \see getUnderlinePosition /// \see `getUnderlinePosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getUnderlineThickness(unsigned int characterSize) const; [[nodiscard]] float getUnderlineThickness(unsigned int characterSize) const;
@ -326,7 +326,7 @@ public:
/// ///
/// The contents of the returned texture changes as more glyphs /// The contents of the returned texture changes as more glyphs
/// are requested, thus it is not very relevant. It is mainly /// are requested, thus it is not very relevant. It is mainly
/// used internally by sf::Text. /// used internally by `sf::Text`.
/// ///
/// \param characterSize Reference character size /// \param characterSize Reference character size
/// ///
@ -344,9 +344,9 @@ public:
/// you should disable it. /// you should disable it.
/// The smooth filter is enabled by default. /// The smooth filter is enabled by default.
/// ///
/// \param smooth True to enable smoothing, false to disable it /// \param smooth `true` to enable smoothing, `false` to disable it
/// ///
/// \see isSmooth /// \see `isSmooth`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSmooth(bool smooth); void setSmooth(bool smooth);
@ -354,9 +354,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not /// \brief Tell whether the smooth filter is enabled or not
/// ///
/// \return True if smoothing is enabled, false if it is disabled /// \return `true` if smoothing is enabled, `false` if it is disabled
/// ///
/// \see setSmooth /// \see `setSmooth`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSmooth() const; [[nodiscard]] bool isSmooth() const;
@ -420,7 +420,7 @@ private:
/// \param bold Retrieve the bold version or the regular one? /// \param bold Retrieve the bold version or the regular one?
/// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled) /// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled)
/// ///
/// \return The glyph corresponding to \a codePoint and \a characterSize /// \return The glyph corresponding to \a `codePoint` and \a `characterSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Glyph loadGlyph(std::uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness) const; Glyph loadGlyph(std::uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness) const;
@ -441,7 +441,7 @@ private:
/// ///
/// \param characterSize Reference character size /// \param characterSize Reference character size
/// ///
/// \return True on success, false if any error happened /// \return `true` on success, `false` if any error happened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool setCurrentSize(unsigned int characterSize) const; [[nodiscard]] bool setCurrentSize(unsigned int characterSize) const;
@ -476,7 +476,7 @@ private:
/// stream, and supports the most common types of fonts. See /// stream, and supports the most common types of fonts. See
/// the openFromFile function for the complete list of supported formats. /// the openFromFile function for the complete list of supported formats.
/// ///
/// Once it is opened, a sf::Font instance provides three /// Once it is opened, a `sf::Font` instance provides three
/// types of information about the font: /// types of information about the font:
/// \li Global metrics, such as the line spacing /// \li Global metrics, such as the line spacing
/// \li Per-glyph metrics, such as bounding box or kerning /// \li Per-glyph metrics, such as bounding box or kerning
@ -484,23 +484,23 @@ private:
/// ///
/// Fonts alone are not very useful: they hold the font data /// Fonts alone are not very useful: they hold the font data
/// but cannot make anything useful of it. To do so you need to /// but cannot make anything useful of it. To do so you need to
/// use the sf::Text class, which is able to properly output text /// use the `sf::Text` class, which is able to properly output text
/// with several options such as character size, style, color, /// with several options such as character size, style, color,
/// position, rotation, etc. /// position, rotation, etc.
/// This separation allows more flexibility and better performances: /// This separation allows more flexibility and better performances:
/// indeed a sf::Font is a heavy resource, and any operation on it /// indeed a `sf::Font` is a heavy resource, and any operation on it
/// is slow (often too slow for real-time applications). On the other /// is slow (often too slow for real-time applications). On the other
/// side, a sf::Text is a lightweight object which can combine the /// side, a `sf::Text` is a lightweight object which can combine the
/// glyphs data and metrics of a sf::Font to display any text on a /// glyphs data and metrics of a `sf::Font` to display any text on a
/// render target. /// render target.
/// Note that it is also possible to bind several sf::Text instances /// Note that it is also possible to bind several `sf::Text` instances
/// to the same sf::Font. /// to the same `sf::Font`.
/// ///
/// It is important to note that the sf::Text instance doesn't /// It is important to note that the `sf::Text` instance doesn't
/// copy the font that it uses, it only keeps a reference to it. /// copy the font that it uses, it only keeps a reference to it.
/// Thus, a sf::Font must not be destructed while it is /// Thus, a `sf::Font` must not be destructed while it is
/// used by a sf::Text (i.e. never write a function that /// used by a `sf::Text` (i.e. never write a function that
/// uses a local sf::Font instance for creating a text). /// uses a local `sf::Font` instance for creating a text).
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -519,16 +519,16 @@ private:
/// \endcode /// \endcode
/// ///
/// Apart from opening font files, and passing them to instances /// Apart from opening font files, and passing them to instances
/// of sf::Text, you should normally not have to deal directly /// of `sf::Text`, you should normally not have to deal directly
/// with this class. However, it may be useful to access the /// with this class. However, it may be useful to access the
/// font metrics or rasterized glyphs for advanced usage. /// font metrics or rasterized glyphs for advanced usage.
/// ///
/// Note that if the font is a bitmap font, it is not scalable, /// Note that if the font is a bitmap font, it is not scalable,
/// thus not all requested sizes will be available to use. This /// thus not all requested sizes will be available to use. This
/// needs to be taken into consideration when using sf::Text. /// needs to be taken into consideration when using `sf::Text`.
/// If you need to display text of a certain size, make sure the /// If you need to display text of a certain size, make sure the
/// corresponding bitmap font that supports that size is used. /// corresponding bitmap font that supports that size is used.
/// ///
/// \see sf::Text /// \see `sf::Text`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -95,7 +95,7 @@ using Bvec3 = Vector3<bool>;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief 4D float vector (\p vec4 in GLSL) /// \brief 4D float vector (\p vec4 in GLSL)
/// ///
/// 4D float vectors can be implicitly converted from sf::Color /// 4D float vectors can be implicitly converted from `sf::Color`
/// instances. Each color channel is normalized from integers /// instances. Each color channel is normalized from integers
/// in [0, 255] to floating point values in [0, 1]. /// in [0, 255] to floating point values in [0, 1].
/// \code /// \code
@ -109,7 +109,7 @@ using Vec4 = ImplementationDefined;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief 4D int vector (\p ivec4 in GLSL) /// \brief 4D int vector (\p ivec4 in GLSL)
/// ///
/// 4D int vectors can be implicitly converted from sf::Color /// 4D int vectors can be implicitly converted from `sf::Color`
/// instances. Each color channel remains unchanged inside /// instances. Each color channel remains unchanged inside
/// the integer interval [0, 255]. /// the integer interval [0, 255].
/// \code /// \code
@ -143,7 +143,7 @@ using Bvec4 = ImplementationDefined;
/// sf::Glsl::Mat3 matrix(array); /// sf::Glsl::Mat3 matrix(array);
/// \endcode /// \endcode
/// ///
/// Mat3 can also be implicitly converted from sf::Transform: /// Mat3 can also be implicitly converted from `sf::Transform`:
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
/// sf::Glsl::Mat3 matrix = transform; /// sf::Glsl::Mat3 matrix = transform;
@ -169,7 +169,7 @@ using Mat3 = ImplementationDefined;
/// sf::Glsl::Mat4 matrix(array); /// sf::Glsl::Mat4 matrix(array);
/// \endcode /// \endcode
/// ///
/// Mat4 can also be implicitly converted from sf::Transform: /// Mat4 can also be implicitly converted from `sf::Transform`:
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
/// sf::Glsl::Mat4 matrix = transform; /// sf::Glsl::Mat4 matrix = transform;
@ -197,15 +197,15 @@ using Mat4 = priv::Matrix<4, 4>;
/// \namespace sf::Glsl /// \namespace sf::Glsl
/// \ingroup graphics /// \ingroup graphics
/// ///
/// \details The sf::Glsl namespace contains types that match /// \details The `sf::Glsl` namespace contains types that match
/// their equivalents in GLSL, the OpenGL shading language. /// their equivalents in GLSL, the OpenGL shading language.
/// These types are exclusively used by the sf::Shader class. /// These types are exclusively used by the `sf::Shader` class.
/// ///
/// Types that already exist in SFML, such as \ref sf::Vector2<T> /// Types that already exist in SFML, such as `sf::Vector2<T>`
/// and \ref sf::Vector3<T>, are reused as type aliases, so you can use /// and `sf::Vector3<T>`, are reused as type aliases, so you
/// the types in this namespace as well as the original ones. /// can use the types in this namespace as well as the original ones.
/// Others are newly defined, such as Glsl::Vec4 or Glsl::Mat3. Their /// Others are newly defined, such as `Glsl::Vec4` or `Glsl::Mat3`.
/// actual type is an implementation detail and should not be used. /// Their actual type is an implementation detail and should not be used.
/// ///
/// All vector types support a default constructor that /// All vector types support a default constructor that
/// initializes every component to zero, in addition to a /// initializes every component to zero, in addition to a
@ -213,12 +213,12 @@ using Mat4 = priv::Matrix<4, 4>;
/// The components are stored in member variables called /// The components are stored in member variables called
/// x, y, z, and w. /// x, y, z, and w.
/// ///
/// All matrix types support a constructor with a float* /// All matrix types support a constructor with a `float*`
/// parameter that points to a float array of the appropriate /// parameter that points to a float array of the appropriate
/// size (that is, 9 in a 3x3 matrix, 16 in a 4x4 matrix). /// size (that is, 9 in a 3x3 matrix, 16 in a 4x4 matrix).
/// Furthermore, they can be converted from sf::Transform /// Furthermore, they can be converted from `sf::Transform`
/// objects. /// objects.
/// ///
/// \see sf::Shader /// \see `sf::Shader`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -41,7 +41,7 @@ class Transform;
namespace sf::priv namespace sf::priv
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Helper functions to copy sf::Transform to sf::Glsl::Mat3/4 /// \brief Helper functions to copy `sf::Transform` to `sf::Glsl::Mat3/4`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SFML_GRAPHICS_API copyMatrix(const Transform& source, Matrix<3, 3>& dest); void SFML_GRAPHICS_API copyMatrix(const Transform& source, Matrix<3, 3>& dest);

View File

@ -56,12 +56,12 @@ struct SFML_GRAPHICS_API Glyph
/// ///
/// A glyph is the visual representation of a character. /// A glyph is the visual representation of a character.
/// ///
/// The sf::Glyph structure provides the information needed /// The `sf::Glyph` structure provides the information needed
/// to handle the glyph: /// to handle the glyph:
/// \li its coordinates in the font's texture /// \li its coordinates in the font's texture
/// \li its bounding rectangle /// \li its bounding rectangle
/// \li the offset to apply to get the starting position of the next glyph /// \li the offset to apply to get the starting position of the next glyph
/// ///
/// \see sf::Font /// \see `sf::Font`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -59,7 +59,7 @@ public:
/// ///
/// Constructs an image with width 0 and height 0. /// Constructs an image with width 0 and height 0.
/// ///
/// \see resize /// \see `resize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image() = default; Image() = default;
@ -76,10 +76,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the image from an array of pixels /// \brief Construct the image from an array of pixels
/// ///
/// The \a pixel array is assumed to contain 32-bits RGBA pixels, /// The pixel array is assumed to contain 32-bits RGBA pixels,
/// and have the given \a width and \a height. If not, this is /// and have the given \a `size`. If not, this is an undefined behavior.
/// an undefined behavior. /// If \a `pixels` is `nullptr`, an empty image is created.
/// If \a pixels is null, an empty image is created.
/// ///
/// \param size Width and height of the image /// \param size Width and height of the image
/// \param pixels Array of pixels to copy to the image /// \param pixels Array of pixels to copy to the image
@ -98,7 +97,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit Image(const std::filesystem::path& filename); explicit Image(const std::filesystem::path& filename);
@ -115,7 +114,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image(const void* data, std::size_t size); Image(const void* data, std::size_t size);
@ -131,7 +130,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit Image(InputStream& stream); explicit Image(InputStream& stream);
@ -148,10 +147,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Resize the image from an array of pixels /// \brief Resize the image from an array of pixels
/// ///
/// The \a pixel array is assumed to contain 32-bits RGBA pixels, /// The pixel array is assumed to contain 32-bits RGBA pixels,
/// and have the given \a width and \a height. If not, this is /// and have the given \a `size`. If not, this is an undefined behavior.
/// an undefined behavior. /// If \a `pixels` is `nullptr`, an empty image is created.
/// If \a pixels is null, an empty image is created.
/// ///
/// \param size Width and height of the image /// \param size Width and height of the image
/// \param pixels Array of pixels to copy to the image /// \param pixels Array of pixels to copy to the image
@ -169,9 +167,9 @@ public:
/// ///
/// \param filename Path of the image file to load /// \param filename Path of the image file to load
/// ///
/// \return True if loading was successful /// \return `true` if loading was successful
/// ///
/// \see loadFromMemory, loadFromStream, saveToFile /// \see `loadFromMemory`, `loadFromStream`, `saveToFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromFile(const std::filesystem::path& filename); [[nodiscard]] bool loadFromFile(const std::filesystem::path& filename);
@ -187,9 +185,9 @@ public:
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param size Size of the data to load, in bytes /// \param size Size of the data to load, in bytes
/// ///
/// \return True if loading was successful /// \return `true` if loading was successful
/// ///
/// \see loadFromFile, loadFromStream, saveToMemory /// \see `loadFromFile`, `loadFromStream`, `saveToMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromMemory(const void* data, std::size_t size); [[nodiscard]] bool loadFromMemory(const void* data, std::size_t size);
@ -204,9 +202,9 @@ public:
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
/// \return True if loading was successful /// \return `true` if loading was successful
/// ///
/// \see loadFromFile, loadFromMemory /// \see `loadFromFile`, `loadFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromStream(InputStream& stream); [[nodiscard]] bool loadFromStream(InputStream& stream);
@ -221,9 +219,9 @@ public:
/// ///
/// \param filename Path of the file to save /// \param filename Path of the file to save
/// ///
/// \return True if saving was successful /// \return `true` if saving was successful
/// ///
/// \see saveToMemory, loadFromFile /// \see `saveToMemory`, `loadFromFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool saveToFile(const std::filesystem::path& filename) const; [[nodiscard]] bool saveToFile(const std::filesystem::path& filename) const;
@ -241,7 +239,7 @@ public:
/// \return Buffer with encoded data if saving was successful, /// \return Buffer with encoded data if saving was successful,
/// otherwise `std::nullopt` /// otherwise `std::nullopt`
/// ///
/// \see saveToFile, loadFromMemory /// \see `saveToFile`, `loadFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::optional<std::vector<std::uint8_t>> saveToMemory(std::string_view format) const; [[nodiscard]] std::optional<std::vector<std::uint8_t>> saveToMemory(std::string_view format) const;
@ -258,7 +256,7 @@ public:
/// \brief Create a transparency mask from a specified color-key /// \brief Create a transparency mask from a specified color-key
/// ///
/// This function sets the alpha value of every pixel matching /// This function sets the alpha value of every pixel matching
/// the given color to \a alpha (0 by default), so that they /// the given color to \a `alpha` (0 by default), so that they
/// become transparent. /// become transparent.
/// ///
/// \param color Color to make transparent /// \param color Color to make transparent
@ -273,20 +271,20 @@ public:
/// This function does a slow pixel copy and should not be /// This function does a slow pixel copy and should not be
/// used intensively. It can be used to prepare a complex /// used intensively. It can be used to prepare a complex
/// static image from several others, but if you need this /// static image from several others, but if you need this
/// kind of feature in real-time you'd better use sf::RenderTexture. /// kind of feature in real-time you'd better use `sf::RenderTexture`.
/// ///
/// If \a sourceRect is empty, the whole image is copied. /// If \a `sourceRect` is empty, the whole image is copied.
/// If \a applyAlpha is set to true, alpha blending is /// If \a `applyAlpha` is set to `true`, alpha blending is
/// applied from the source pixels to the destination pixels /// applied from the source pixels to the destination pixels
/// using the \b over operator. If it is false, the source /// using the \b over operator. If it is `false`, the source
/// pixels are copied unchanged with their alpha value. /// pixels are copied unchanged with their alpha value.
/// ///
/// See https://en.wikipedia.org/wiki/Alpha_compositing for /// See https://en.wikipedia.org/wiki/Alpha_compositing for
/// details on the \b over operator. /// details on the \b over operator.
/// ///
/// Note that this function can fail if either image is invalid /// Note that this function can fail if either image is invalid
/// (i.e. zero-sized width or height), or if \a sourceRect is /// (i.e. zero-sized width or height), or if \a `sourceRect` is
/// not within the boundaries of the \a source parameter, or /// not within the boundaries of the \a `source` parameter, or
/// if the destination area is out of the boundaries of this image. /// if the destination area is out of the boundaries of this image.
/// ///
/// On failure, the destination image is left unchanged. /// On failure, the destination image is left unchanged.
@ -296,7 +294,7 @@ public:
/// \param sourceRect Sub-rectangle of the source image to copy /// \param sourceRect Sub-rectangle of the source image to copy
/// \param applyAlpha Should the copy take into account the source transparency? /// \param applyAlpha Should the copy take into account the source transparency?
/// ///
/// \return True if the operation was successful, false otherwise /// \return `true` if the operation was successful, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool copy(const Image& source, Vector2u dest, const IntRect& sourceRect = {}, bool applyAlpha = false); [[nodiscard]] bool copy(const Image& source, Vector2u dest, const IntRect& sourceRect = {}, bool applyAlpha = false);
@ -311,7 +309,7 @@ public:
/// \param coords Coordinates of pixel to change /// \param coords Coordinates of pixel to change
/// \param color New color of the pixel /// \param color New color of the pixel
/// ///
/// \see getPixel /// \see `getPixel`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPixel(Vector2u coords, Color color); void setPixel(Vector2u coords, Color color);
@ -327,7 +325,7 @@ public:
/// ///
/// \return Color of the pixel at given coordinates /// \return Color of the pixel at given coordinates
/// ///
/// \see setPixel /// \see `setPixel`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Color getPixel(Vector2u coords) const; [[nodiscard]] Color getPixel(Vector2u coords) const;
@ -337,7 +335,7 @@ public:
/// ///
/// The returned value points to an array of RGBA pixels made of /// The returned value points to an array of RGBA pixels made of
/// 8 bit integer components. The size of the array is /// 8 bit integer components. The size of the array is
/// width * height * 4 (getSize().x * getSize().y * 4). /// `width * height * 4 (getSize().x * getSize().y * 4)`.
/// Warning: the returned pointer may become invalid if you /// Warning: the returned pointer may become invalid if you
/// modify the image, so you should never store it for too long. /// modify the image, so you should never store it for too long.
/// If the image is empty, a null pointer is returned. /// If the image is empty, a null pointer is returned.
@ -374,21 +372,21 @@ private:
/// \class sf::Image /// \class sf::Image
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Image is an abstraction to manipulate images /// `sf::Image` is an abstraction to manipulate images
/// as bidimensional arrays of pixels. The class provides /// as bi-dimensional arrays of pixels. The class provides
/// functions to load, read, write and save pixels, as well /// functions to load, read, write and save pixels, as well
/// as many other useful functions. /// as many other useful functions.
/// ///
/// sf::Image can handle a unique internal representation of /// `sf::Image` can handle a unique internal representation of
/// pixels, which is RGBA 32 bits. This means that a pixel /// pixels, which is RGBA 32 bits. This means that a pixel
/// must be composed of 8 bit red, green, blue and alpha /// must be composed of 8 bit red, green, blue and alpha
/// channels -- just like a sf::Color. /// channels -- just like a `sf::Color`.
/// All the functions that return an array of pixels follow /// All the functions that return an array of pixels follow
/// this rule, and all parameters that you pass to sf::Image /// this rule, and all parameters that you pass to `sf::Image`
/// functions (such as loadFromMemory) must use this /// functions (such as `loadFromMemory`) must use this
/// representation as well. /// representation as well.
/// ///
/// A sf::Image can be copied, but it is a heavy resource and /// A `sf::Image` can be copied, but it is a heavy resource and
/// if possible you should always use [const] references to /// if possible you should always use [const] references to
/// pass or return them to avoid useless copies. /// pass or return them to avoid useless copies.
/// ///
@ -414,6 +412,6 @@ private:
/// return -1; /// return -1;
/// \endcode /// \endcode
/// ///
/// \see sf::Texture /// \see `sf::Texture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -28,7 +28,7 @@ namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \ingroup graphics /// \ingroup graphics
/// \brief Types of primitives that a sf::VertexArray can render /// \brief Types of primitives that a `sf::VertexArray` can render
/// ///
/// Points and lines have no area, therefore their thickness /// Points and lines have no area, therefore their thickness
/// will always be 1 pixel, regardless the current transform /// will always be 1 pixel, regardless the current transform

View File

@ -46,7 +46,7 @@ public:
/// \brief Default constructor /// \brief Default constructor
/// ///
/// Creates an empty rectangle (it is equivalent to calling /// Creates an empty rectangle (it is equivalent to calling
/// Rect({0, 0}, {0, 0})). /// `Rect({0, 0}, {0, 0})`).
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Rect() = default; constexpr Rect() = default;
@ -81,13 +81,13 @@ public:
/// \brief Check if a point is inside the rectangle's area /// \brief Check if a point is inside the rectangle's area
/// ///
/// This check is non-inclusive. If the point lies on the /// This check is non-inclusive. If the point lies on the
/// edge of the rectangle, this function will return false. /// edge of the rectangle, this function will return `false`.
/// ///
/// \param point Point to test /// \param point Point to test
/// ///
/// \return True if the point is inside, false otherwise /// \return `true` if the point is inside, `false` otherwise
/// ///
/// \see findIntersection /// \see `findIntersection`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool contains(Vector2<T> point) const; [[nodiscard]] constexpr bool contains(Vector2<T> point) const;
@ -99,7 +99,7 @@ public:
/// ///
/// \return Intersection rectangle if intersecting, `std::nullopt` otherwise /// \return Intersection rectangle if intersecting, `std::nullopt` otherwise
/// ///
/// \see contains /// \see `contains`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr std::optional<Rect<T>> findIntersection(const Rect<T>& rectangle) const; [[nodiscard]] constexpr std::optional<Rect<T>> findIntersection(const Rect<T>& rectangle) const;
@ -121,14 +121,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Rect /// \relates Rect
/// \brief Overload of binary operator == /// \brief Overload of binary `operator==`
/// ///
/// This operator compares strict equality between two rectangles. /// This operator compares strict equality between two rectangles.
/// ///
/// \param lhs Left operand (a rectangle) /// \param lhs Left operand (a rectangle)
/// \param rhs Right operand (a rectangle) /// \param rhs Right operand (a rectangle)
/// ///
/// \return True if \a lhs is equal to \a rhs /// \return `true` if \a lhs is equal to \a rhs
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -136,14 +136,14 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Rect /// \relates Rect
/// \brief Overload of binary operator != /// \brief Overload of binary `operator!=`
/// ///
/// This operator compares strict difference between two rectangles. /// This operator compares strict difference between two rectangles.
/// ///
/// \param lhs Left operand (a rectangle) /// \param lhs Left operand (a rectangle)
/// \param rhs Right operand (a rectangle) /// \param rhs Right operand (a rectangle)
/// ///
/// \return True if \a lhs is not equal to \a rhs /// \return `true` if \a lhs is not equal to \a rhs
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -166,24 +166,24 @@ using FloatRect = Rect<float>;
/// It is a very simple class defined for convenience, so /// It is a very simple class defined for convenience, so
/// its member variables (position and size) are public /// its member variables (position and size) are public
/// and can be accessed directly, just like the vector classes /// and can be accessed directly, just like the vector classes
/// (Vector2 and Vector3). /// (`Vector2` and `Vector3`).
/// ///
/// To keep things simple, sf::Rect doesn't define /// To keep things simple, `sf::Rect` doesn't define
/// functions to emulate the properties that are not directly /// functions to emulate the properties that are not directly
/// members (such as right, bottom, etc.), it rather /// members (such as right, bottom, etc.), it rather
/// only provides intersection functions. /// only provides intersection functions.
/// ///
/// sf::Rect uses the usual rules for its boundaries: /// `sf::Rect` uses the usual rules for its boundaries:
/// \li The left and top edges are included in the rectangle's area /// \li The left and top edges are included in the rectangle's area
/// \li The right and bottom edges are excluded from the rectangle's area /// \li The right and bottom edges are excluded from the rectangle's area
/// ///
/// This means that sf::IntRect({0, 0}, {1, 1}) and sf::IntRect({1, 1}, {1, 1}) /// This means that `sf::IntRect({0, 0}, {1, 1})` and `sf::IntRect({1, 1}, {1, 1})`
/// don't intersect. /// don't intersect.
/// ///
/// sf::Rect is a template and may be used with any numeric type, but /// `sf::Rect` is a template and may be used with any numeric type, but
/// for simplicity type aliases for the instantiations used by SFML are given: /// for simplicity type aliases for the instantiations used by SFML are given:
/// \li sf::Rect<int> is sf::IntRect /// \li `sf::Rect<int>` is `sf::IntRect`
/// \li sf::Rect<float> is sf::FloatRect /// \li `sf::Rect<float>` is `sf::FloatRect`
/// ///
/// So that you don't have to care about the template syntax. /// So that you don't have to care about the template syntax.
/// ///

View File

@ -58,7 +58,7 @@ public:
/// ///
/// \param size New size of the rectangle /// \param size New size of the rectangle
/// ///
/// \see getSize /// \see `getSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSize(Vector2f size); void setSize(Vector2f size);
@ -68,7 +68,7 @@ public:
/// ///
/// \return Size of the rectangle /// \return Size of the rectangle
/// ///
/// \see setSize /// \see `setSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getSize() const; [[nodiscard]] Vector2f getSize() const;
@ -88,7 +88,7 @@ public:
/// The returned point is in local coordinates, that is, /// The returned point is in local coordinates, that is,
/// the shape's transforms (position, rotation, scale) are /// the shape's transforms (position, rotation, scale) are
/// not taken into account. /// not taken into account.
/// The result is undefined if \a index is out of the valid range. /// The result is undefined if \a `index` is out of the valid range.
/// ///
/// \param index Index of the point to get, in range [0 .. 3] /// \param index Index of the point to get, in range [0 .. 3]
/// ///
@ -123,9 +123,9 @@ private:
/// \class sf::RectangleShape /// \class sf::RectangleShape
/// \ingroup graphics /// \ingroup graphics
/// ///
/// This class inherits all the functions of sf::Transformable /// This class inherits all the functions of `sf::Transformable`
/// (position, rotation, scale, bounds, ...) as well as the /// (position, rotation, scale, bounds, ...) as well as the
/// functions of sf::Shape (outline, color, texture, ...). /// functions of `sf::Shape` (outline, color, texture, ...).
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -138,6 +138,6 @@ private:
/// window.draw(rectangle); /// window.draw(rectangle);
/// \endcode /// \endcode
/// ///
/// \see sf::Shape, sf::CircleShape, sf::ConvexShape /// \see `sf::Shape`, `sf::CircleShape`, `sf::ConvexShape`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -41,7 +41,7 @@ class Shader;
class Texture; class Texture;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Define the states used for drawing to a RenderTarget /// \brief Define the states used for drawing to a `RenderTarget`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct SFML_GRAPHICS_API RenderStates struct SFML_GRAPHICS_API RenderStates
@ -50,13 +50,13 @@ struct SFML_GRAPHICS_API RenderStates
/// \brief Default constructor /// \brief Default constructor
/// ///
/// Constructing a default set of render states is equivalent /// Constructing a default set of render states is equivalent
/// to using sf::RenderStates::Default. /// to using `sf::RenderStates::Default`.
/// The default set defines: /// The default set defines:
/// \li the BlendAlpha blend mode /// \li the `BlendAlpha` blend mode
/// \li the default StencilMode (no stencil) /// \li the default `StencilMode` (no stencil)
/// \li the identity transform /// \li the identity transform
/// \li a null texture /// \li a `nullptr` texture
/// \li a null shader /// \li a `nullptr` shader
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderStates() = default; RenderStates() = default;
@ -172,20 +172,20 @@ struct SFML_GRAPHICS_API RenderStates
/// ///
/// If you want to use a single specific render state, /// If you want to use a single specific render state,
/// for example a shader, you can pass it directly to the Draw /// for example a shader, you can pass it directly to the Draw
/// function: sf::RenderStates has an implicit one-argument /// function: `sf::RenderStates` has an implicit one-argument
/// constructor for each state. /// constructor for each state.
/// \code /// \code
/// window.draw(sprite, shader); /// window.draw(sprite, shader);
/// \endcode /// \endcode
/// ///
/// When you're inside the Draw function of a drawable /// When you're inside the Draw function of a drawable
/// object (inherited from sf::Drawable), you can /// object (inherited from `sf::Drawable`), you can
/// either pass the render states unmodified, or change /// either pass the render states unmodified, or change
/// some of them. /// some of them.
/// For example, a transformable object will combine the /// For example, a transformable object will combine the
/// current transform with its own transform. A sprite will /// current transform with its own transform. A sprite will
/// set its texture. Etc. /// set its texture. Etc.
/// ///
/// \see sf::RenderTarget, sf::Drawable /// \see `sf::RenderTarget`, `sf::Drawable`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -138,11 +138,11 @@ public:
/// so it is not necessary to keep the original one alive /// so it is not necessary to keep the original one alive
/// after calling this function. /// after calling this function.
/// To restore the original view of the target, you can pass /// To restore the original view of the target, you can pass
/// the result of getDefaultView() to this function. /// the result of `getDefaultView()` to this function.
/// ///
/// \param view New view to use /// \param view New view to use
/// ///
/// \see getView, getDefaultView /// \see `getView`, `getDefaultView`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setView(const View& view); void setView(const View& view);
@ -152,7 +152,7 @@ public:
/// ///
/// \return The view object that is currently used /// \return The view object that is currently used
/// ///
/// \see setView, getDefaultView /// \see `setView`, `getDefaultView`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const View& getView() const; [[nodiscard]] const View& getView() const;
@ -165,7 +165,7 @@ public:
/// ///
/// \return The default view of the render target /// \return The default view of the render target
/// ///
/// \see setView, getView /// \see `setView`, `getView`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const View& getDefaultView() const; [[nodiscard]] const View& getDefaultView() const;
@ -215,7 +215,7 @@ public:
/// ///
/// \return The converted point, in "world" coordinates /// \return The converted point, in "world" coordinates
/// ///
/// \see mapCoordsToPixel /// \see `mapCoordsToPixel`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f mapPixelToCoords(Vector2i point) const; [[nodiscard]] Vector2f mapPixelToCoords(Vector2i point) const;
@ -230,7 +230,7 @@ public:
/// ///
/// Initially, both coordinate systems (world units and target pixels) /// Initially, both coordinate systems (world units and target pixels)
/// match perfectly. But if you define a custom view or resize your /// match perfectly. But if you define a custom view or resize your
/// render target, this assertion is not true anymore, i.e. a point /// render target, this assertion is not `true` anymore, i.e. a point
/// located at (10, 50) in your render target may map to the point /// located at (10, 50) in your render target may map to the point
/// (150, 75) in your 2D world -- if the view is translated by (140, 25). /// (150, 75) in your 2D world -- if the view is translated by (140, 25).
/// ///
@ -246,7 +246,7 @@ public:
/// ///
/// \return The converted point, in "world" units /// \return The converted point, in "world" units
/// ///
/// \see mapCoordsToPixel /// \see `mapCoordsToPixel`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f mapPixelToCoords(Vector2i point, const View& view) const; [[nodiscard]] Vector2f mapPixelToCoords(Vector2i point, const View& view) const;
@ -255,7 +255,7 @@ public:
/// \brief Convert a point from world coordinates to target /// \brief Convert a point from world coordinates to target
/// coordinates, using the current view /// coordinates, using the current view
/// ///
/// This function is an overload of the mapCoordsToPixel /// This function is an overload of the `mapCoordsToPixel`
/// function that implicitly uses the current view. /// function that implicitly uses the current view.
/// It is equivalent to: /// It is equivalent to:
/// \code /// \code
@ -266,7 +266,7 @@ public:
/// ///
/// \return The converted point, in target coordinates (pixels) /// \return The converted point, in target coordinates (pixels)
/// ///
/// \see mapPixelToCoords /// \see `mapPixelToCoords`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2i mapCoordsToPixel(Vector2f point) const; [[nodiscard]] Vector2i mapCoordsToPixel(Vector2f point) const;
@ -280,7 +280,7 @@ public:
/// ///
/// Initially, both coordinate systems (world units and target pixels) /// Initially, both coordinate systems (world units and target pixels)
/// match perfectly. But if you define a custom view or resize your /// match perfectly. But if you define a custom view or resize your
/// render target, this assertion is not true anymore, i.e. a point /// render target, this assertion is not `true` anymore, i.e. a point
/// located at (150, 75) in your 2D world may map to the pixel /// located at (150, 75) in your 2D world may map to the pixel
/// (10, 50) of your render target -- if the view is translated by (140, 25). /// (10, 50) of your render target -- if the view is translated by (140, 25).
/// ///
@ -293,7 +293,7 @@ public:
/// ///
/// \return The converted point, in target coordinates (pixels) /// \return The converted point, in target coordinates (pixels)
/// ///
/// \see mapPixelToCoords /// \see `mapPixelToCoords`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2i mapCoordsToPixel(Vector2f point, const View& view) const; [[nodiscard]] Vector2i mapCoordsToPixel(Vector2f point, const View& view) const;
@ -355,7 +355,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell if the render target will use sRGB encoding when drawing on it /// \brief Tell if the render target will use sRGB encoding when drawing on it
/// ///
/// \return True if the render target use sRGB encoding, false otherwise /// \return `true` if the render target use sRGB encoding, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual bool isSrgb() const; [[nodiscard]] virtual bool isSrgb() const;
@ -375,9 +375,9 @@ public:
/// target will automatically deactivate the previously active /// target will automatically deactivate the previously active
/// context (if any). /// context (if any).
/// ///
/// \param active True to activate, false to deactivate /// \param active `true` to activate, `false` to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return `true` if operation was successful, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual bool setActive(bool active = true); [[nodiscard]] virtual bool setActive(bool active = true);
@ -392,7 +392,7 @@ public:
/// \li your OpenGL states are not modified by a call to a SFML function /// \li your OpenGL states are not modified by a call to a SFML function
/// ///
/// More specifically, it must be used around code that /// More specifically, it must be used around code that
/// calls Draw functions. Example: /// calls `draw` functions. Example:
/// \code /// \code
/// // OpenGL code here... /// // OpenGL code here...
/// window.pushGLStates(); /// window.pushGLStates();
@ -411,7 +411,7 @@ public:
/// saved and restored). Take a look at the resetGLStates /// saved and restored). Take a look at the resetGLStates
/// function if you do so. /// function if you do so.
/// ///
/// \see popGLStates /// \see `popGLStates`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void pushGLStates(); void pushGLStates();
@ -419,10 +419,10 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Restore the previously saved OpenGL render states and matrices /// \brief Restore the previously saved OpenGL render states and matrices
/// ///
/// See the description of pushGLStates to get a detailed /// See the description of `pushGLStates` to get a detailed
/// description of these functions. /// description of these functions.
/// ///
/// \see pushGLStates /// \see `pushGLStates`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void popGLStates(); void popGLStates();
@ -432,8 +432,8 @@ public:
/// ///
/// This function can be used when you mix SFML drawing /// This function can be used when you mix SFML drawing
/// and direct OpenGL rendering, if you choose not to use /// and direct OpenGL rendering, if you choose not to use
/// pushGLStates/popGLStates. It makes sure that all OpenGL /// `pushGLStates`/`popGLStates`. It makes sure that all OpenGL
/// states needed by SFML are set, so that subsequent draw() /// states needed by SFML are set, so that subsequent `draw()`
/// calls will work as expected. /// calls will work as expected.
/// ///
/// Example: /// Example:
@ -556,7 +556,7 @@ private:
StencilMode lastStencilMode; //!< Cached stencil StencilMode lastStencilMode; //!< Cached stencil
std::uint64_t lastTextureId{}; //!< Cached texture std::uint64_t lastTextureId{}; //!< Cached texture
CoordinateType lastCoordinateType{}; //!< Texture coordinate type CoordinateType lastCoordinateType{}; //!< Texture coordinate type
bool texCoordsArrayEnabled{}; //!< Is GL_TEXTURE_COORD_ARRAY client state enabled? bool texCoordsArrayEnabled{}; //!< Is `GL_TEXTURE_COORD_ARRAY` client state enabled?
bool useVertexCache{}; //!< Did we previously use the vertex cache? bool useVertexCache{}; //!< Did we previously use the vertex cache?
std::array<Vertex, 4> vertexCache{}; //!< Pre-transformed vertices cache std::array<Vertex, 4> vertexCache{}; //!< Pre-transformed vertices cache
}; };
@ -577,23 +577,23 @@ private:
/// \class sf::RenderTarget /// \class sf::RenderTarget
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::RenderTarget defines the common behavior of all the /// `sf::RenderTarget` defines the common behavior of all the
/// 2D render targets usable in the graphics module. It makes /// 2D render targets usable in the graphics module. It makes
/// it possible to draw 2D entities like sprites, shapes, text /// it possible to draw 2D entities like sprites, shapes, text
/// without using any OpenGL command directly. /// without using any OpenGL command directly.
/// ///
/// A sf::RenderTarget is also able to use views (sf::View), /// A `sf::RenderTarget` is also able to use views (`sf::View`),
/// which are a kind of 2D cameras. With views you can globally /// which are a kind of 2D cameras. With views you can globally
/// scroll, rotate or zoom everything that is drawn, /// scroll, rotate or zoom everything that is drawn,
/// without having to transform every single entity. See the /// without having to transform every single entity. See the
/// documentation of sf::View for more details and sample pieces of /// documentation of `sf::View` for more details and sample pieces of
/// code about this class. /// code about this class.
/// ///
/// On top of that, render targets are still able to render direct /// On top of that, render targets are still able to render direct
/// OpenGL stuff. It is even possible to mix together OpenGL calls /// OpenGL stuff. It is even possible to mix together OpenGL calls
/// and regular SFML drawing commands. When doing so, make sure that /// and regular SFML drawing commands. When doing so, make sure that
/// OpenGL states are not messed up by calling the /// OpenGL states are not messed up by calling the
/// pushGLStates/popGLStates functions. /// `pushGLStates`/`popGLStates` functions.
/// ///
/// While render targets are moveable, it is not valid to move them /// While render targets are moveable, it is not valid to move them
/// between threads. This will cause your program to crash. The /// between threads. This will cause your program to crash. The
@ -601,6 +601,6 @@ private:
/// works in multithreaded environments. Please ensure you only move /// works in multithreaded environments. Please ensure you only move
/// render targets within the same thread. /// render targets within the same thread.
/// ///
/// \see sf::RenderWindow, sf::RenderTexture, sf::View /// \see `sf::RenderWindow`, `sf::RenderTexture`, `sf::View`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -58,7 +58,7 @@ public:
/// ///
/// Constructs a render-texture with width 0 and height 0. /// Constructs a render-texture with width 0 and height 0.
/// ///
/// \see resize /// \see `resize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderTexture(); RenderTexture();
@ -66,7 +66,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a render-texture /// \brief Construct a render-texture
/// ///
/// The last parameter, \a settings, is useful if you want to enable /// The last parameter, \a `settings`, is useful if you want to enable
/// multi-sampling or use the render-texture for OpenGL rendering that /// multi-sampling or use the render-texture for OpenGL rendering that
/// requires a depth or stencil buffer. Otherwise it is unnecessary, and /// requires a depth or stencil buffer. Otherwise it is unnecessary, and
/// you should leave this parameter at its default value. /// you should leave this parameter at its default value.
@ -115,7 +115,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Resize the render-texture /// \brief Resize the render-texture
/// ///
/// The last parameter, \a settings, is useful if you want to enable /// The last parameter, \a `settings`, is useful if you want to enable
/// multi-sampling or use the render-texture for OpenGL rendering that /// multi-sampling or use the render-texture for OpenGL rendering that
/// requires a depth or stencil buffer. Otherwise it is unnecessary, and /// requires a depth or stencil buffer. Otherwise it is unnecessary, and
/// you should leave this parameter at its default value. /// you should leave this parameter at its default value.
@ -126,7 +126,7 @@ public:
/// \param size Width and height of the render-texture /// \param size Width and height of the render-texture
/// \param settings Additional settings for the underlying OpenGL texture and context /// \param settings Additional settings for the underlying OpenGL texture and context
/// ///
/// \return True if resizing has been successful, false if it failed /// \return `true` if resizing has been successful, `false` if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool resize(Vector2u size, const ContextSettings& settings = {}); [[nodiscard]] bool resize(Vector2u size, const ContextSettings& settings = {});
@ -142,12 +142,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Enable or disable texture smoothing /// \brief Enable or disable texture smoothing
/// ///
/// This function is similar to Texture::setSmooth. /// This function is similar to `Texture::setSmooth`.
/// This parameter is disabled by default. /// This parameter is disabled by default.
/// ///
/// \param smooth True to enable smoothing, false to disable it /// \param smooth `true` to enable smoothing, `false` to disable it
/// ///
/// \see isSmooth /// \see `isSmooth`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSmooth(bool smooth); void setSmooth(bool smooth);
@ -155,9 +155,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filtering is enabled or not /// \brief Tell whether the smooth filtering is enabled or not
/// ///
/// \return True if texture smoothing is enabled /// \return `true` if texture smoothing is enabled
/// ///
/// \see setSmooth /// \see `setSmooth`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSmooth() const; [[nodiscard]] bool isSmooth() const;
@ -165,12 +165,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Enable or disable texture repeating /// \brief Enable or disable texture repeating
/// ///
/// This function is similar to Texture::setRepeated. /// This function is similar to `Texture::setRepeated`.
/// This parameter is disabled by default. /// This parameter is disabled by default.
/// ///
/// \param repeated True to enable repeating, false to disable it /// \param repeated `true` to enable repeating, `false` to disable it
/// ///
/// \see isRepeated /// \see `isRepeated`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setRepeated(bool repeated); void setRepeated(bool repeated);
@ -178,9 +178,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the texture is repeated or not /// \brief Tell whether the texture is repeated or not
/// ///
/// \return True if texture is repeated /// \return `true` if texture is repeated
/// ///
/// \see setRepeated /// \see `setRepeated`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isRepeated() const; [[nodiscard]] bool isRepeated() const;
@ -188,7 +188,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Generate a mipmap using the current texture data /// \brief Generate a mipmap using the current texture data
/// ///
/// This function is similar to Texture::generateMipmap and operates /// This function is similar to `Texture::generateMipmap` and operates
/// on the texture used as the target for drawing. /// on the texture used as the target for drawing.
/// Be aware that any draw operation may modify the base level image data. /// Be aware that any draw operation may modify the base level image data.
/// For this reason, calling this function only makes sense after all /// For this reason, calling this function only makes sense after all
@ -196,7 +196,7 @@ public:
/// after subsequent drawing will lead to undefined behavior if a mipmap /// after subsequent drawing will lead to undefined behavior if a mipmap
/// had been previously generated. /// had been previously generated.
/// ///
/// \return True if mipmap generation was successful, false if unsuccessful /// \return `true` if mipmap generation was successful, `false` if unsuccessful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool generateMipmap(); [[nodiscard]] bool generateMipmap();
@ -211,9 +211,9 @@ public:
/// want to draw OpenGL geometry to another render target /// want to draw OpenGL geometry to another render target
/// (like a RenderWindow) don't forget to activate it again. /// (like a RenderWindow) don't forget to activate it again.
/// ///
/// \param active True to activate, false to deactivate /// \param active `true` to activate, `false` to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return `true` if operation was successful, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool setActive(bool active = true) override; [[nodiscard]] bool setActive(bool active = true) override;
@ -244,9 +244,9 @@ public:
/// \brief Tell if the render-texture will use sRGB encoding when drawing on it /// \brief Tell if the render-texture will use sRGB encoding when drawing on it
/// ///
/// You can request sRGB encoding for a render-texture /// You can request sRGB encoding for a render-texture
/// by having the sRgbCapable flag set for the context parameter of create() method /// by having the sRgbCapable flag set for the context parameter of `create()` method
/// ///
/// \return True if the render-texture use sRGB encoding, false otherwise /// \return `true` if the render-texture use sRGB encoding, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSrgb() const override; [[nodiscard]] bool isSrgb() const override;
@ -257,7 +257,7 @@ public:
/// After drawing to the render-texture and calling Display, /// After drawing to the render-texture and calling Display,
/// you can retrieve the updated texture using this function, /// you can retrieve the updated texture using this function,
/// and draw it using a sprite (for example). /// and draw it using a sprite (for example).
/// The internal sf::Texture of a render-texture is always the /// The internal `sf::Texture` of a render-texture is always the
/// same instance, so that it is possible to call this function /// same instance, so that it is possible to call this function
/// once and keep a reference to the texture even after it is /// once and keep a reference to the texture even after it is
/// modified. /// modified.
@ -282,9 +282,9 @@ private:
/// \class sf::RenderTexture /// \class sf::RenderTexture
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::RenderTexture is the little brother of sf::RenderWindow. /// `sf::RenderTexture` is the little brother of `sf::RenderWindow`.
/// It implements the same 2D drawing and OpenGL-related functions /// It implements the same 2D drawing and OpenGL-related functions
/// (see their base class sf::RenderTarget for more details), /// (see their base class `sf::RenderTarget` for more details),
/// the difference is that the result is stored in an off-screen /// the difference is that the result is stored in an off-screen
/// texture rather than being show in a window. /// texture rather than being show in a window.
/// ///
@ -332,11 +332,11 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// Like sf::RenderWindow, sf::RenderTexture is still able to render direct /// Like `sf::RenderWindow`, `sf::RenderTexture` is still able to render direct
/// OpenGL stuff. It is even possible to mix together OpenGL calls /// OpenGL stuff. It is even possible to mix together OpenGL calls
/// and regular SFML drawing commands. If you need a depth buffer for /// and regular SFML drawing commands. If you need a depth buffer for
/// 3D rendering, don't forget to request it when calling RenderTexture::create. /// 3D rendering, don't forget to request it when calling `RenderTexture::create`.
/// ///
/// \see sf::RenderTarget, sf::RenderWindow, sf::View, sf::Texture /// \see `sf::RenderTarget`, `sf::RenderWindow`, `sf::View`, `sf::Texture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -58,7 +58,7 @@ public:
/// \brief Default constructor /// \brief Default constructor
/// ///
/// This constructor doesn't actually create the window, /// This constructor doesn't actually create the window,
/// use the other constructors or call create() to do so. /// use the other constructors or call `create()` to do so.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderWindow() = default; RenderWindow() = default;
@ -67,18 +67,18 @@ public:
/// \brief Construct a new window /// \brief Construct a new window
/// ///
/// This constructor creates the window with the size and pixel /// This constructor creates the window with the size and pixel
/// depth defined in \a mode. An optional style can be passed to /// depth defined in \a `mode`. An optional style can be passed to
/// customize the look and behavior of the window (borders, /// customize the look and behavior of the window (borders,
/// title bar, resizable, closable, ...). /// title bar, resizable, closable, ...).
/// ///
/// The last parameter is an optional structure specifying /// The last parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. You shouldn't care about these /// depth-buffer bits, etc. You shouldn't care about these
/// parameters for a regular usage of the graphics module. /// parameters for a regular usage of the graphics module.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
/// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param style %Window style, a bitwise OR combination of `sf::Style` enumerators
/// \param state %Window state /// \param state %Window state
/// \param settings Additional settings for the underlying OpenGL context /// \param settings Additional settings for the underlying OpenGL context
/// ///
@ -93,11 +93,11 @@ public:
/// \brief Construct a new window /// \brief Construct a new window
/// ///
/// This constructor creates the window with the size and pixel /// This constructor creates the window with the size and pixel
/// depth defined in \a mode. If \a state is State::Fullscreen, /// depth defined in \a `mode`. If \a `state` is `State::Fullscreen`,
/// then \a mode must be a valid video mode. /// then \a `mode` must be a valid video mode.
/// ///
/// The last parameter is an optional structure specifying /// The last parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. /// depth-buffer bits, etc.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
@ -115,7 +115,7 @@ public:
/// rendering area into an already existing control. /// rendering area into an already existing control.
/// ///
/// The second parameter is an optional structure specifying /// The second parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. You shouldn't care about these /// depth-buffer bits, etc. You shouldn't care about these
/// parameters for a regular usage of the graphics module. /// parameters for a regular usage of the graphics module.
/// ///
@ -153,9 +153,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell if the window will use sRGB encoding when drawing on it /// \brief Tell if the window will use sRGB encoding when drawing on it
/// ///
/// You can request sRGB encoding for a window by having the sRgbCapable flag set in the ContextSettings /// You can request sRGB encoding for a window by having the sRgbCapable flag set in the `ContextSettings`
/// ///
/// \return True if the window use sRGB encoding, false otherwise /// \return `true` if the window use sRGB encoding, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSrgb() const override; [[nodiscard]] bool isSrgb() const override;
@ -169,11 +169,11 @@ public:
/// on the previous thread first if it was active. /// on the previous thread first if it was active.
/// Only one window can be active on a thread at a time, thus /// Only one window can be active on a thread at a time, thus
/// the window previously active (if any) automatically gets deactivated. /// the window previously active (if any) automatically gets deactivated.
/// This is not to be confused with requestFocus(). /// This is not to be confused with `requestFocus()`.
/// ///
/// \param active True to activate, false to deactivate /// \param active `true` to activate, `false` to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return `true` if operation was successful, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool setActive(bool active = true) override; [[nodiscard]] bool setActive(bool active = true) override;
@ -212,19 +212,19 @@ private:
/// \class sf::RenderWindow /// \class sf::RenderWindow
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::RenderWindow is the main class of the Graphics module. /// `sf::RenderWindow` is the main class of the Graphics module.
/// It defines an OS window that can be painted using the other /// It defines an OS window that can be painted using the other
/// classes of the graphics module. /// classes of the graphics module.
/// ///
/// sf::RenderWindow is derived from sf::Window, thus it inherits /// `sf::RenderWindow` is derived from `sf::Window`, thus it inherits
/// all its features: events, window management, OpenGL rendering, /// all its features: events, window management, OpenGL rendering,
/// etc. See the documentation of sf::Window for a more complete /// etc. See the documentation of `sf::Window` for a more complete
/// description of all these features, as well as code examples. /// description of all these features, as well as code examples.
/// ///
/// On top of that, sf::RenderWindow adds more features related to /// On top of that, `sf::RenderWindow` adds more features related to
/// 2D drawing with the graphics module (see its base class /// 2D drawing with the graphics module (see its base class
/// sf::RenderTarget for more details). /// `sf::RenderTarget` for more details).
/// Here is a typical rendering and event loop with a sf::RenderWindow: /// Here is a typical rendering and event loop with a `sf::RenderWindow`:
/// ///
/// \code /// \code
/// // Declare and create a new render-window /// // Declare and create a new render-window
@ -257,7 +257,7 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// Like sf::Window, sf::RenderWindow is still able to render direct /// Like `sf::Window`, `sf::RenderWindow` is still able to render direct
/// OpenGL stuff. It is even possible to mix together OpenGL calls /// OpenGL stuff. It is even possible to mix together OpenGL calls
/// and regular SFML drawing commands. /// and regular SFML drawing commands.
/// ///
@ -303,6 +303,6 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::Window, sf::RenderTarget, sf::RenderTexture, sf::View /// \see `sf::Window`, `sf::RenderTarget`, `sf::RenderTexture`, `sf::View`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -68,7 +68,7 @@ public:
/// \brief Special type that can be passed to setUniform(), /// \brief Special type that can be passed to setUniform(),
/// and that represents the texture of the object being drawn /// and that represents the texture of the object being drawn
/// ///
/// \see setUniform(const std::string&, CurrentTextureType) /// \see `setUniform(const std::string&, CurrentTextureType)`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct CurrentTextureType struct CurrentTextureType
@ -78,7 +78,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Represents the texture of the object being drawn /// \brief Represents the texture of the object being drawn
/// ///
/// \see setUniform(const std::string&, CurrentTextureType) /// \see `setUniform(const std::string&, CurrentTextureType)`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// NOLINTNEXTLINE(readability-identifier-naming) // NOLINTNEXTLINE(readability-identifier-naming)
@ -141,7 +141,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(const std::filesystem::path& filename, Type type); Shader(const std::filesystem::path& filename, Type type);
@ -162,7 +162,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(const std::filesystem::path& vertexShaderFilename, const std::filesystem::path& fragmentShaderFilename); Shader(const std::filesystem::path& vertexShaderFilename, const std::filesystem::path& fragmentShaderFilename);
@ -184,7 +184,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(const std::filesystem::path& vertexShaderFilename, Shader(const std::filesystem::path& vertexShaderFilename,
@ -206,7 +206,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(std::string_view shader, Type type); Shader(std::string_view shader, Type type);
@ -227,7 +227,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(std::string_view vertexShader, std::string_view fragmentShader); Shader(std::string_view vertexShader, std::string_view fragmentShader);
@ -249,7 +249,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(std::string_view vertexShader, std::string_view geometryShader, std::string_view fragmentShader); Shader(std::string_view vertexShader, std::string_view geometryShader, std::string_view fragmentShader);
@ -269,7 +269,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(InputStream& stream, Type type); Shader(InputStream& stream, Type type);
@ -290,7 +290,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(InputStream& vertexShaderStream, InputStream& fragmentShaderStream); Shader(InputStream& vertexShaderStream, InputStream& fragmentShaderStream);
@ -312,7 +312,7 @@ public:
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(InputStream& vertexShaderStream, InputStream& geometryShaderStream, InputStream& fragmentShaderStream); Shader(InputStream& vertexShaderStream, InputStream& geometryShaderStream, InputStream& fragmentShaderStream);
@ -331,9 +331,9 @@ public:
/// \param filename Path of the vertex, geometry or fragment shader file to load /// \param filename Path of the vertex, geometry or fragment shader file to load
/// \param type Type of shader (vertex, geometry or fragment) /// \param type Type of shader (vertex, geometry or fragment)
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromMemory, loadFromStream /// \see `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromFile(const std::filesystem::path& filename, Type type); [[nodiscard]] bool loadFromFile(const std::filesystem::path& filename, Type type);
@ -352,9 +352,9 @@ public:
/// \param vertexShaderFilename Path of the vertex shader file to load /// \param vertexShaderFilename Path of the vertex shader file to load
/// \param fragmentShaderFilename Path of the fragment shader file to load /// \param fragmentShaderFilename Path of the fragment shader file to load
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromMemory, loadFromStream /// \see `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromFile(const std::filesystem::path& vertexShaderFilename, [[nodiscard]] bool loadFromFile(const std::filesystem::path& vertexShaderFilename,
@ -375,9 +375,9 @@ public:
/// \param geometryShaderFilename Path of the geometry shader file to load /// \param geometryShaderFilename Path of the geometry shader file to load
/// \param fragmentShaderFilename Path of the fragment shader file to load /// \param fragmentShaderFilename Path of the fragment shader file to load
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromMemory, loadFromStream /// \see `loadFromMemory`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromFile(const std::filesystem::path& vertexShaderFilename, [[nodiscard]] bool loadFromFile(const std::filesystem::path& vertexShaderFilename,
@ -397,9 +397,9 @@ public:
/// \param shader String containing the source code of the shader /// \param shader String containing the source code of the shader
/// \param type Type of shader (vertex, geometry or fragment) /// \param type Type of shader (vertex, geometry or fragment)
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromStream /// \see `loadFromFile`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromMemory(std::string_view shader, Type type); [[nodiscard]] bool loadFromMemory(std::string_view shader, Type type);
@ -418,9 +418,9 @@ public:
/// \param vertexShader String containing the source code of the vertex shader /// \param vertexShader String containing the source code of the vertex shader
/// \param fragmentShader String containing the source code of the fragment shader /// \param fragmentShader String containing the source code of the fragment shader
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromStream /// \see `loadFromFile`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromMemory(std::string_view vertexShader, std::string_view fragmentShader); [[nodiscard]] bool loadFromMemory(std::string_view vertexShader, std::string_view fragmentShader);
@ -440,9 +440,9 @@ public:
/// \param geometryShader String containing the source code of the geometry shader /// \param geometryShader String containing the source code of the geometry shader
/// \param fragmentShader String containing the source code of the fragment shader /// \param fragmentShader String containing the source code of the fragment shader
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromStream /// \see `loadFromFile`, `loadFromStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromMemory(std::string_view vertexShader, [[nodiscard]] bool loadFromMemory(std::string_view vertexShader,
@ -462,9 +462,9 @@ public:
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// \param type Type of shader (vertex, geometry or fragment) /// \param type Type of shader (vertex, geometry or fragment)
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory /// \see `loadFromFile`, `loadFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromStream(InputStream& stream, Type type); [[nodiscard]] bool loadFromStream(InputStream& stream, Type type);
@ -483,9 +483,9 @@ public:
/// \param vertexShaderStream Source stream to read the vertex shader from /// \param vertexShaderStream Source stream to read the vertex shader from
/// \param fragmentShaderStream Source stream to read the fragment shader from /// \param fragmentShaderStream Source stream to read the fragment shader from
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory /// \see `loadFromFile`, `loadFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromStream(InputStream& vertexShaderStream, InputStream& fragmentShaderStream); [[nodiscard]] bool loadFromStream(InputStream& vertexShaderStream, InputStream& fragmentShaderStream);
@ -505,9 +505,9 @@ public:
/// \param geometryShaderStream Source stream to read the geometry shader from /// \param geometryShaderStream Source stream to read the geometry shader from
/// \param fragmentShaderStream Source stream to read the fragment shader from /// \param fragmentShaderStream Source stream to read the fragment shader from
/// ///
/// \return True if loading succeeded, false if it failed /// \return `true` if loading succeeded, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory /// \see `loadFromFile`, `loadFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromStream(InputStream& vertexShaderStream, [[nodiscard]] bool loadFromStream(InputStream& vertexShaderStream,
@ -544,14 +544,14 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Specify value for \p vec4 uniform /// \brief Specify value for \p vec4 uniform
/// ///
/// This overload can also be called with sf::Color objects /// This overload can also be called with `sf::Color` objects
/// that are converted to sf::Glsl::Vec4. /// that are converted to `sf::Glsl::Vec4`.
/// ///
/// It is important to note that the components of the color are /// It is important to note that the components of the color are
/// normalized before being passed to the shader. Therefore, /// normalized before being passed to the shader. Therefore,
/// they are converted from range [0 .. 255] to range [0 .. 1]. /// they are converted from range [0 .. 255] to range [0 .. 1].
/// For example, a sf::Color(255, 127, 0, 255) will be transformed /// For example, a `sf::Color(255, 127, 0, 255)` will be transformed
/// to a vec4(1.0, 0.5, 0.0, 1.0) in the shader. /// to a `vec4(1.0, 0.5, 0.0, 1.0)` in the shader.
/// ///
/// \param name Name of the uniform variable in GLSL /// \param name Name of the uniform variable in GLSL
/// \param vector Value of the vec4 vector /// \param vector Value of the vec4 vector
@ -589,13 +589,13 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Specify value for \p ivec4 uniform /// \brief Specify value for \p ivec4 uniform
/// ///
/// This overload can also be called with sf::Color objects /// This overload can also be called with `sf::Color` objects
/// that are converted to sf::Glsl::Ivec4. /// that are converted to `sf::Glsl::Ivec4`.
/// ///
/// If color conversions are used, the ivec4 uniform in GLSL /// If color conversions are used, the ivec4 uniform in GLSL
/// will hold the same values as the original sf::Color /// will hold the same values as the original `sf::Color`
/// instance. For example, sf::Color(255, 127, 0, 255) is /// instance. For example, `sf::Color(255, 127, 0, 255)` is
/// mapped to ivec4(255, 127, 0, 255). /// mapped to `ivec4(255, 127, 0, 255)`.
/// ///
/// \param name Name of the uniform variable in GLSL /// \param name Name of the uniform variable in GLSL
/// \param vector Value of the ivec4 vector /// \param vector Value of the ivec4 vector
@ -673,12 +673,12 @@ public:
/// ... /// ...
/// shader.setUniform("the_texture", texture); /// shader.setUniform("the_texture", texture);
/// \endcode /// \endcode
/// It is important to note that \a texture must remain alive as long /// It is important to note that \a `texture` must remain alive as long
/// as the shader uses it, no copy is made internally. /// as the shader uses it, no copy is made internally.
/// ///
/// To use the texture of the object being drawn, which cannot be /// To use the texture of the object being drawn, which cannot be
/// known in advance, you can pass the special value /// known in advance, you can pass the special value
/// sf::Shader::CurrentTexture: /// `sf::Shader::CurrentTexture`:
/// \code /// \code
/// shader.setUniform("the_texture", sf::Shader::CurrentTexture). /// shader.setUniform("the_texture", sf::Shader::CurrentTexture).
/// \endcode /// \endcode
@ -701,7 +701,7 @@ public:
/// This overload maps a shader texture variable to the /// This overload maps a shader texture variable to the
/// texture of the object being drawn, which cannot be /// texture of the object being drawn, which cannot be
/// known in advance. The second argument must be /// known in advance. The second argument must be
/// sf::Shader::CurrentTexture. /// `sf::Shader::CurrentTexture`.
/// The corresponding parameter in the shader must be a 2D texture /// The corresponding parameter in the shader must be a 2D texture
/// (\p sampler2D GLSL type). /// (\p sampler2D GLSL type).
/// ///
@ -795,7 +795,7 @@ public:
/// ///
/// This function is not part of the graphics API, it mustn't be /// This function is not part of the graphics API, it mustn't be
/// used when drawing SFML entities. It must be used only if you /// used when drawing SFML entities. It must be used only if you
/// mix sf::Shader with OpenGL code. /// mix `sf::Shader` with OpenGL code.
/// ///
/// \code /// \code
/// sf::Shader s1, s2; /// sf::Shader s1, s2;
@ -817,10 +817,10 @@ public:
/// \brief Tell whether or not the system supports shaders /// \brief Tell whether or not the system supports shaders
/// ///
/// This function should always be called before using /// This function should always be called before using
/// the shader features. If it returns false, then /// the shader features. If it returns `false`, then
/// any attempt to use sf::Shader will fail. /// any attempt to use `sf::Shader` will fail.
/// ///
/// \return True if shaders are supported, false otherwise /// \return `true` if shaders are supported, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool isAvailable(); [[nodiscard]] static bool isAvailable();
@ -829,17 +829,17 @@ public:
/// \brief Tell whether or not the system supports geometry shaders /// \brief Tell whether or not the system supports geometry shaders
/// ///
/// This function should always be called before using /// This function should always be called before using
/// the geometry shader features. If it returns false, then /// the geometry shader features. If it returns `false`, then
/// any attempt to use sf::Shader geometry shader features will fail. /// any attempt to use `sf::Shader` geometry shader features will fail.
/// ///
/// This function can only return true if isAvailable() would also /// This function can only return `true` if isAvailable() would also
/// return true, since shaders in general have to be supported in /// return `true`, since shaders in general have to be supported in
/// order for geometry shaders to be supported as well. /// order for geometry shaders to be supported as well.
/// ///
/// Note: The first call to this function, whether by your /// Note: The first call to this function, whether by your
/// code or SFML will result in a context switch. /// code or SFML will result in a context switch.
/// ///
/// \return True if geometry shaders are supported, false otherwise /// \return `true` if geometry shaders are supported, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool isGeometryAvailable(); [[nodiscard]] static bool isGeometryAvailable();
@ -855,7 +855,7 @@ private:
/// \param geometryShaderCode Source code of the geometry shader /// \param geometryShaderCode Source code of the geometry shader
/// \param fragmentShaderCode Source code of the fragment shader /// \param fragmentShaderCode Source code of the fragment shader
/// ///
/// \return True on success, false if any error happened /// \return `true` on success, `false` if any error happened
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool compile(std::string_view vertexShaderCode, [[nodiscard]] bool compile(std::string_view vertexShaderCode,
@ -921,7 +921,7 @@ private:
/// \li Geometry shaders, that process primitives /// \li Geometry shaders, that process primitives
/// \li Fragment (pixel) shaders, that process pixels /// \li Fragment (pixel) shaders, that process pixels
/// ///
/// A sf::Shader can be composed of either a vertex shader /// A `sf::Shader` can be composed of either a vertex shader
/// alone, a geometry shader alone, a fragment shader alone, /// alone, a geometry shader alone, a fragment shader alone,
/// or any combination of them. (see the variants of the /// or any combination of them. (see the variants of the
/// load functions). /// load functions).
@ -932,19 +932,19 @@ private:
/// for SFML. /// for SFML.
/// ///
/// Like any C/C++ program, a GLSL shader has its own variables /// Like any C/C++ program, a GLSL shader has its own variables
/// called \a uniforms that you can set from your C++ application. /// called \a `uniforms` that you can set from your C++ application.
/// sf::Shader handles different types of uniforms: /// `sf::Shader` handles different types of uniforms:
/// \li scalars: \p float, \p int, \p bool /// \li scalars: \p float, \p int, \p bool
/// \li vectors (2, 3 or 4 components) /// \li vectors (2, 3 or 4 components)
/// \li matrices (3x3 or 4x4) /// \li matrices (3x3 or 4x4)
/// \li samplers (textures) /// \li samplers (textures)
/// ///
/// Some SFML-specific types can be converted: /// Some SFML-specific types can be converted:
/// \li sf::Color as a 4D vector (\p vec4) /// \li `sf::Color` as a 4D vector (\p vec4)
/// \li sf::Transform as matrices (\p mat3 or \p mat4) /// \li `sf::Transform` as matrices (\p mat3 or \p mat4)
/// ///
/// Every uniform variable in a shader can be set through one of the /// Every uniform variable in a shader can be set through one of the
/// setUniform() or setUniformArray() overloads. For example, if you /// `setUniform()` or `setUniformArray()` overloads. For example, if you
/// have a shader with the following uniforms: /// have a shader with the following uniforms:
/// \code /// \code
/// uniform float offset; /// uniform float offset;
@ -955,7 +955,7 @@ private:
/// uniform sampler2D current; /// uniform sampler2D current;
/// \endcode /// \endcode
/// You can set their values from C++ code as follows, using the types /// You can set their values from C++ code as follows, using the types
/// defined in the sf::Glsl namespace: /// defined in the `sf::Glsl` namespace:
/// \code /// \code
/// shader.setUniform("offset", 2.f); /// shader.setUniform("offset", 2.f);
/// shader.setUniform("point", sf::Vector3f(0.5f, 0.8f, 0.3f)); /// shader.setUniform("point", sf::Vector3f(0.5f, 0.8f, 0.3f));
@ -965,12 +965,12 @@ private:
/// shader.setUniform("current", sf::Shader::CurrentTexture); /// shader.setUniform("current", sf::Shader::CurrentTexture);
/// \endcode /// \endcode
/// ///
/// The special Shader::CurrentTexture argument maps the /// The special `Shader::CurrentTexture` argument maps the
/// given \p sampler2D uniform to the current texture of the /// given \p sampler2D uniform to the current texture of the
/// object being drawn (which cannot be known in advance). /// object being drawn (which cannot be known in advance).
/// ///
/// To apply a shader to a drawable, you must pass it as an /// To apply a shader to a drawable, you must pass it as an
/// additional parameter to the \ref RenderWindow::draw function: /// additional parameter to the `RenderWindow::draw` function:
/// \code /// \code
/// window.draw(sprite, &shader); /// window.draw(sprite, &shader);
/// \endcode /// \endcode
@ -986,22 +986,22 @@ private:
/// be null (which means "no shader"). /// be null (which means "no shader").
/// ///
/// Shaders can be used on any drawable, but some combinations are /// Shaders can be used on any drawable, but some combinations are
/// not interesting. For example, using a vertex shader on a sf::Sprite /// not interesting. For example, using a vertex shader on a `sf::Sprite`
/// is limited because there are only 4 vertices, the sprite would /// is limited because there are only 4 vertices, the sprite would
/// have to be subdivided in order to apply wave effects. /// have to be subdivided in order to apply wave effects.
/// Another bad example is a fragment shader with sf::Text: the texture /// Another bad example is a fragment shader with `sf::Text`: the texture
/// of the text is not the actual text that you see on screen, it is /// of the text is not the actual text that you see on screen, it is
/// a big texture containing all the characters of the font in an /// a big texture containing all the characters of the font in an
/// arbitrary order; thus, texture lookups on pixels other than the /// arbitrary order; thus, texture lookups on pixels other than the
/// current one may not give you the expected result. /// current one may not give you the expected result.
/// ///
/// Shaders can also be used to apply global post-effects to the /// Shaders can also be used to apply global post-effects to the
/// current contents of the target (like the old sf::PostFx class /// current contents of the target.
/// in SFML 1). This can be done in two different ways: /// This can be done in two different ways:
/// \li draw everything to a sf::RenderTexture, then draw it to /// \li draw everything to a `sf::RenderTexture`, then draw it to
/// the main target using the shader /// the main target using the shader
/// \li draw everything directly to the main target, then use /// \li draw everything directly to the main target, then use
/// sf::Texture::update(Window&) to copy its contents to a texture /// `sf::Texture::update(Window&)` to copy its contents to a texture
/// and draw it to the main target using the shader /// and draw it to the main target using the shader
/// ///
/// The first technique is more optimized because it doesn't involve /// The first technique is more optimized because it doesn't involve
@ -1009,8 +1009,8 @@ private:
/// second one doesn't impact the rendering process and can be /// second one doesn't impact the rendering process and can be
/// easily inserted anywhere without impacting all the code. /// easily inserted anywhere without impacting all the code.
/// ///
/// Like sf::Texture that can be used as a raw OpenGL texture, /// Like `sf::Texture` that can be used as a raw OpenGL texture,
/// sf::Shader can also be used directly as a raw shader for /// `sf::Shader` can also be used directly as a raw shader for
/// custom OpenGL geometry. /// custom OpenGL geometry.
/// \code /// \code
/// sf::Shader::bind(&shader); /// sf::Shader::bind(&shader);
@ -1018,6 +1018,6 @@ private:
/// sf::Shader::bind(nullptr); /// sf::Shader::bind(nullptr);
/// \endcode /// \endcode
/// ///
/// \see sf::Glsl /// \see `sf::Glsl`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -57,21 +57,21 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Change the source texture of the shape /// \brief Change the source texture of the shape
/// ///
/// The \a texture argument refers to a texture that must /// The \a `texture` argument refers to a texture that must
/// exist as long as the shape uses it. Indeed, the shape /// exist as long as the shape uses it. Indeed, the shape
/// doesn't store its own copy of the texture, but rather keeps /// doesn't store its own copy of the texture, but rather keeps
/// a pointer to the one that you passed to this function. /// a pointer to the one that you passed to this function.
/// If the source texture is destroyed and the shape tries to /// If the source texture is destroyed and the shape tries to
/// use it, the behavior is undefined. /// use it, the behavior is undefined.
/// \a texture can be a null pointer to disable texturing. /// \a `texture` can be a null pointer to disable texturing.
/// If \a resetRect is true, the TextureRect property of /// If \a `resetRect` is `true`, the `TextureRect` property of
/// the shape is automatically adjusted to the size of the new /// the shape is automatically adjusted to the size of the new
/// texture. If it is false, the texture rect is left unchanged. /// texture. If it is `false`, the texture rect is left unchanged.
/// ///
/// \param texture New texture /// \param texture New texture
/// \param resetRect Should the texture rect be reset to the size of the new texture? /// \param resetRect Should the texture rect be reset to the size of the new texture?
/// ///
/// \see getTexture, setTextureRect /// \see `getTexture`, `setTextureRect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setTexture(const Texture* texture, bool resetRect = false); void setTexture(const Texture* texture, bool resetRect = false);
@ -85,7 +85,7 @@ public:
/// ///
/// \param rect Rectangle defining the region of the texture to display /// \param rect Rectangle defining the region of the texture to display
/// ///
/// \see getTextureRect, setTexture /// \see `getTextureRect`, `setTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setTextureRect(const IntRect& rect); void setTextureRect(const IntRect& rect);
@ -96,13 +96,13 @@ public:
/// This color is modulated (multiplied) with the shape's /// This color is modulated (multiplied) with the shape's
/// texture if any. It can be used to colorize the shape, /// texture if any. It can be used to colorize the shape,
/// or change its global opacity. /// or change its global opacity.
/// You can use sf::Color::Transparent to make the inside of /// You can use `sf::Color::Transparent to make the inside of
/// the shape transparent, and have the outline alone. /// the shape transparent, and have the outline alone.
/// By default, the shape's fill color is opaque white. /// By default, the shape's fill color is opaque white.
/// ///
/// \param color New color of the shape /// \param color New color of the shape
/// ///
/// \see getFillColor, setOutlineColor /// \see `getFillColor`, `setOutlineColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setFillColor(Color color); void setFillColor(Color color);
@ -114,7 +114,7 @@ public:
/// ///
/// \param color New outline color of the shape /// \param color New outline color of the shape
/// ///
/// \see getOutlineColor, setFillColor /// \see `getOutlineColor`, `setFillColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setOutlineColor(Color color); void setOutlineColor(Color color);
@ -129,7 +129,7 @@ public:
/// ///
/// \param thickness New outline thickness /// \param thickness New outline thickness
/// ///
/// \see getOutlineThickness /// \see `getOutlineThickness`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setOutlineThickness(float thickness); void setOutlineThickness(float thickness);
@ -137,13 +137,13 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the source texture of the shape /// \brief Get the source texture of the shape
/// ///
/// If the shape has no source texture, a null pointer is returned. /// If the shape has no source texture, a `nullptr` is returned.
/// The returned pointer is const, which means that you can't /// The returned pointer is const, which means that you can't
/// modify the texture when you retrieve it with this function. /// modify the texture when you retrieve it with this function.
/// ///
/// \return Pointer to the shape's texture /// \return Pointer to the shape's texture
/// ///
/// \see setTexture /// \see `setTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Texture* getTexture() const; [[nodiscard]] const Texture* getTexture() const;
@ -153,7 +153,7 @@ public:
/// ///
/// \return Texture rectangle of the shape /// \return Texture rectangle of the shape
/// ///
/// \see setTextureRect /// \see `setTextureRect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const IntRect& getTextureRect() const; [[nodiscard]] const IntRect& getTextureRect() const;
@ -163,7 +163,7 @@ public:
/// ///
/// \return Fill color of the shape /// \return Fill color of the shape
/// ///
/// \see setFillColor /// \see `setFillColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Color getFillColor() const; [[nodiscard]] Color getFillColor() const;
@ -173,7 +173,7 @@ public:
/// ///
/// \return Outline color of the shape /// \return Outline color of the shape
/// ///
/// \see setOutlineColor /// \see `setOutlineColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Color getOutlineColor() const; [[nodiscard]] Color getOutlineColor() const;
@ -183,7 +183,7 @@ public:
/// ///
/// \return Outline thickness of the shape /// \return Outline thickness of the shape
/// ///
/// \see setOutlineThickness /// \see `setOutlineThickness`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getOutlineThickness() const; [[nodiscard]] float getOutlineThickness() const;
@ -193,7 +193,7 @@ public:
/// ///
/// \return Number of points of the shape /// \return Number of points of the shape
/// ///
/// \see getPoint /// \see `getPoint`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual std::size_t getPointCount() const = 0; [[nodiscard]] virtual std::size_t getPointCount() const = 0;
@ -204,13 +204,13 @@ public:
/// The returned point is in local coordinates, that is, /// The returned point is in local coordinates, that is,
/// the shape's transforms (position, rotation, scale) are /// the shape's transforms (position, rotation, scale) are
/// not taken into account. /// not taken into account.
/// The result is undefined if \a index is out of the valid range. /// The result is undefined if \a `index` is out of the valid range.
/// ///
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1] /// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
/// ///
/// \return index-th point of the shape /// \return index-th point of the shape
/// ///
/// \see getPointCount /// \see `getPointCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] virtual Vector2f getPoint(std::size_t index) const = 0; [[nodiscard]] virtual Vector2f getPoint(std::size_t index) const = 0;
@ -250,7 +250,7 @@ public:
/// In other words, this function returns the bounds of the /// In other words, this function returns the bounds of the
/// shape in the global 2D world's coordinate system. /// shape in the global 2D world's coordinate system.
/// ///
/// This function does not necessarily return the \a minimal /// This function does not necessarily return the \a `minimal`
/// bounding rectangle. It merely ensures that the returned /// bounding rectangle. It merely ensures that the returned
/// rectangle covers all the vertices (but possibly more). /// rectangle covers all the vertices (but possibly more).
/// This allows for a fast approximation of the bounds as a /// This allows for a fast approximation of the bounds as a
@ -328,7 +328,7 @@ private:
/// \class sf::Shape /// \class sf::Shape
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Shape is a drawable class that allows to define and /// `sf::Shape` is a drawable class that allows to define and
/// display a custom convex shape on a render target. /// display a custom convex shape on a render target.
/// It's only an abstract base, it needs to be specialized for /// It's only an abstract base, it needs to be specialized for
/// concrete types of shapes (circle, rectangle, convex polygon, /// concrete types of shapes (circle, rectangle, convex polygon,
@ -344,7 +344,7 @@ private:
/// ///
/// Each feature is optional, and can be disabled easily: /// Each feature is optional, and can be disabled easily:
/// \li the texture can be null /// \li the texture can be null
/// \li the fill/outline colors can be sf::Color::Transparent /// \li the fill/outline colors can be `sf::Color::Transparent`
/// \li the outline thickness can be zero /// \li the outline thickness can be zero
/// ///
/// You can write your own derived shape class, there are only /// You can write your own derived shape class, there are only
@ -352,6 +352,6 @@ private:
/// \li getPointCount must return the number of points of the shape /// \li getPointCount must return the number of points of the shape
/// \li getPoint must return the points of the shape /// \li getPoint must return the points of the shape
/// ///
/// \see sf::RectangleShape, sf::CircleShape, sf::ConvexShape, sf::Transformable /// \see `sf::RectangleShape`, `sf::CircleShape`, `sf::ConvexShape`, `sf::Transformable`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -55,7 +55,7 @@ public:
/// ///
/// \param texture Source texture /// \param texture Source texture
/// ///
/// \see setTexture /// \see `setTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit Sprite(const Texture& texture); explicit Sprite(const Texture& texture);
@ -72,7 +72,7 @@ public:
/// \param texture Source texture /// \param texture Source texture
/// \param rectangle Sub-rectangle of the texture to assign to the sprite /// \param rectangle Sub-rectangle of the texture to assign to the sprite
/// ///
/// \see setTexture, setTextureRect /// \see `setTexture`, `setTextureRect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sprite(const Texture& texture, const IntRect& rectangle); Sprite(const Texture& texture, const IntRect& rectangle);
@ -86,20 +86,20 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Change the source texture of the sprite /// \brief Change the source texture of the sprite
/// ///
/// The \a texture argument refers to a texture that must /// The \a `texture` argument refers to a texture that must
/// exist as long as the sprite uses it. Indeed, the sprite /// exist as long as the sprite uses it. Indeed, the sprite
/// doesn't store its own copy of the texture, but rather keeps /// doesn't store its own copy of the texture, but rather keeps
/// a pointer to the one that you passed to this function. /// a pointer to the one that you passed to this function.
/// If the source texture is destroyed and the sprite tries to /// If the source texture is destroyed and the sprite tries to
/// use it, the behavior is undefined. /// use it, the behavior is undefined.
/// If \a resetRect is true, the TextureRect property of /// If \a `resetRect` is `true`, the `TextureRect` property of
/// the sprite is automatically adjusted to the size of the new /// the sprite is automatically adjusted to the size of the new
/// texture. If it is false, the texture rect is left unchanged. /// texture. If it is `false`, the texture rect is left unchanged.
/// ///
/// \param texture New texture /// \param texture New texture
/// \param resetRect Should the texture rect be reset to the size of the new texture? /// \param resetRect Should the texture rect be reset to the size of the new texture?
/// ///
/// \see getTexture, setTextureRect /// \see `getTexture`, `setTextureRect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setTexture(const Texture& texture, bool resetRect = false); void setTexture(const Texture& texture, bool resetRect = false);
@ -119,7 +119,7 @@ public:
/// ///
/// \param rectangle Rectangle defining the region of the texture to display /// \param rectangle Rectangle defining the region of the texture to display
/// ///
/// \see getTextureRect, setTexture /// \see `getTextureRect`, `setTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setTextureRect(const IntRect& rectangle); void setTextureRect(const IntRect& rectangle);
@ -134,7 +134,7 @@ public:
/// ///
/// \param color New color of the sprite /// \param color New color of the sprite
/// ///
/// \see getColor /// \see `getColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setColor(Color color); void setColor(Color color);
@ -147,7 +147,7 @@ public:
/// ///
/// \return Reference to the sprite's texture /// \return Reference to the sprite's texture
/// ///
/// \see setTexture /// \see `setTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Texture& getTexture() const; [[nodiscard]] const Texture& getTexture() const;
@ -157,7 +157,7 @@ public:
/// ///
/// \return Texture rectangle of the sprite /// \return Texture rectangle of the sprite
/// ///
/// \see setTextureRect /// \see `setTextureRect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const IntRect& getTextureRect() const; [[nodiscard]] const IntRect& getTextureRect() const;
@ -167,7 +167,7 @@ public:
/// ///
/// \return Global color of the sprite /// \return Global color of the sprite
/// ///
/// \see setColor /// \see `setColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Color getColor() const; [[nodiscard]] Color getColor() const;
@ -231,32 +231,32 @@ private:
/// \class sf::Sprite /// \class sf::Sprite
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Sprite is a drawable class that allows to easily display /// `sf::Sprite` is a drawable class that allows to easily display
/// a texture (or a part of it) on a render target. /// a texture (or a part of it) on a render target.
/// ///
/// It inherits all the functions from sf::Transformable: /// It inherits all the functions from `sf::Transformable`:
/// position, rotation, scale, origin. It also adds sprite-specific /// position, rotation, scale, origin. It also adds sprite-specific
/// properties such as the texture to use, the part of it to display, /// properties such as the texture to use, the part of it to display,
/// and some convenience functions to change the overall color of the /// and some convenience functions to change the overall color of the
/// sprite, or to get its bounding rectangle. /// sprite, or to get its bounding rectangle.
/// ///
/// sf::Sprite works in combination with the sf::Texture class, which /// `sf::Sprite` works in combination with the `sf::Texture` class, which
/// loads and provides the pixel data of a given texture. /// loads and provides the pixel data of a given texture.
/// ///
/// The separation of sf::Sprite and sf::Texture allows more flexibility /// The separation of `sf::Sprite` and `sf::Texture` allows more flexibility
/// and better performances: indeed a sf::Texture is a heavy resource, /// and better performances: indeed a `sf::Texture` is a heavy resource,
/// and any operation on it is slow (often too slow for real-time /// and any operation on it is slow (often too slow for real-time
/// applications). On the other side, a sf::Sprite is a lightweight /// applications). On the other side, a `sf::Sprite` is a lightweight
/// object which can use the pixel data of a sf::Texture and draw /// object which can use the pixel data of a `sf::Texture` and draw
/// it with its own transformation/color/blending attributes. /// it with its own transformation/color/blending attributes.
/// ///
/// It is important to note that the sf::Sprite instance doesn't /// It is important to note that the `sf::Sprite` instance doesn't
/// copy the texture that it uses, it only keeps a reference to it. /// copy the texture that it uses, it only keeps a reference to it.
/// Thus, a sf::Texture must not be destroyed while it is /// Thus, a `sf::Texture` must not be destroyed while it is
/// used by a sf::Sprite (i.e. never write a function that /// used by a `sf::Sprite` (i.e. never write a function that
/// uses a local sf::Texture instance for creating a sprite). /// uses a local `sf::Texture` instance for creating a sprite).
/// ///
/// See also the note on coordinates and undistorted rendering in sf::Transformable. /// See also the note on coordinates and undistorted rendering in `sf::Transformable`.
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -273,6 +273,6 @@ private:
/// window.draw(sprite); /// window.draw(sprite);
/// \endcode /// \endcode
/// ///
/// \see sf::Texture, sf::Transformable /// \see `sf::Texture`, `sf::Transformable`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -37,7 +37,7 @@ namespace sf
/// \brief Enumeration of the stencil test comparisons that can be performed /// \brief Enumeration of the stencil test comparisons that can be performed
/// ///
/// The comparisons are mapped directly to their OpenGL equivalents, /// The comparisons are mapped directly to their OpenGL equivalents,
/// specified by glStencilFunc(). /// specified by `glStencilFunc()`.
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
enum class StencilComparison enum class StencilComparison
{ {
@ -47,7 +47,7 @@ enum class StencilComparison
Greater, //!< The stencil test passes if the new value is greater than the value in the stencil buffer Greater, //!< The stencil test passes if the new value is greater than the value in the stencil buffer
GreaterEqual, //!< The stencil test passes if the new value is greater than or equal to the value in the stencil buffer GreaterEqual, //!< The stencil test passes if the new value is greater than or equal to the value in the stencil buffer
Equal, //!< The stencil test passes if the new value is strictly equal to the value in the stencil buffer Equal, //!< The stencil test passes if the new value is strictly equal to the value in the stencil buffer
NotEqual, //!< The stencil test passes if the new value is strictly inequal to the value in the stencil buffer NotEqual, //!< The stencil test passes if the new value is strictly unequal to the value in the stencil buffer
Always //!< The stencil test always passes Always //!< The stencil test always passes
}; };
@ -55,7 +55,7 @@ enum class StencilComparison
/// \brief Enumeration of the stencil buffer update operations /// \brief Enumeration of the stencil buffer update operations
/// ///
/// The update operations are mapped directly to their OpenGL equivalents, /// The update operations are mapped directly to their OpenGL equivalents,
/// specified by glStencilOp(). /// specified by `glStencilOp()`.
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
enum class StencilUpdateOperation enum class StencilUpdateOperation
{ {
@ -115,24 +115,24 @@ struct SFML_GRAPHICS_API StencilMode
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates StencilMode /// \relates StencilMode
/// \brief Overload of the == operator /// \brief Overload of the `operator==`
/// ///
/// \param left Left operand /// \param left Left operand
/// \param right Right operand /// \param right Right operand
/// ///
/// \return True if stencil modes are equal, false if they are different /// \return `true` if stencil modes are equal, `false` if they are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_GRAPHICS_API bool operator==(const StencilMode& left, const StencilMode& right); [[nodiscard]] SFML_GRAPHICS_API bool operator==(const StencilMode& left, const StencilMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates StencilMode /// \relates StencilMode
/// \brief Overload of the != operator /// \brief Overload of the `operator!=`
/// ///
/// \param left Left operand /// \param left Left operand
/// \param right Right operand /// \param right Right operand
/// ///
/// \return True if stencil modes are different, false if they are equal /// \return `true` if stencil modes are different, `false` if they are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_GRAPHICS_API bool operator!=(const StencilMode& left, const StencilMode& right); [[nodiscard]] SFML_GRAPHICS_API bool operator!=(const StencilMode& left, const StencilMode& right);
@ -144,7 +144,7 @@ struct SFML_GRAPHICS_API StencilMode
/// \class sf::StencilMode /// \class sf::StencilMode
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::StencilMode is a class that controls stencil testing. /// `sf::StencilMode` is a class that controls stencil testing.
/// ///
/// In addition to drawing to the visible portion of a render target, /// In addition to drawing to the visible portion of a render target,
/// there is the possibility to "draw" to a so-called stencil buffer. /// there is the possibility to "draw" to a so-called stencil buffer.
@ -154,23 +154,23 @@ struct SFML_GRAPHICS_API StencilMode
/// value that can be represented depends on what is supported by the system. /// value that can be represented depends on what is supported by the system.
/// Typically support for a 8-bit stencil buffer should always be available. /// Typically support for a 8-bit stencil buffer should always be available.
/// This will also have to be requested when creating a render target via /// This will also have to be requested when creating a render target via
/// the sf::ContextSettings that is passed during creation. Stencil testing /// the `sf::ContextSettings` that is passed during creation. Stencil testing
/// will not work if there is no stencil buffer available in the target /// will not work if there is no stencil buffer available in the target
/// that is being drawn to. /// that is being drawn to.
/// ///
/// Initially, just like with the visible color buffer, the stencil value of /// Initially, just like with the visible color buffer, the stencil value of
/// each pixel is set to an undefined value. Calling sf::RenderTarget::clear /// each pixel is set to an undefined value. Calling `sf::RenderTarget::clear`
/// will set each pixel's stencil value to 0. sf::RenderTarget::clear can be /// will set each pixel's stencil value to 0. `sf::RenderTarget::clear` can be
/// called at any time to reset the stencil values back to 0. /// called at any time to reset the stencil values back to 0.
/// ///
/// When drawing an object, before each pixel of the color buffer is updated /// When drawing an object, before each pixel of the color buffer is updated
/// with its new color value, the stencil test is performed. During this test /// with its new color value, the stencil test is performed. During this test
/// 2 values are compared with each other: the reference value that is passed /// 2 values are compared with each other: the reference value that is passed
/// via sf::StencilMode and the value that is currently in the stencil buffer. /// via `sf::StencilMode` and the value that is currently in the stencil buffer.
/// The arithmetic comparison that is performed on the 2 values can also be /// The arithmetic comparison that is performed on the 2 values can also be
/// controlled via sf::StencilMode. Depending on whether the test passes i.e. /// controlled via `sf::StencilMode`. Depending on whether the test passes i.e.
/// the comparison yields true, the color buffer is updated with its new RGBA /// the comparison yields `true`, the color buffer is updated with its new RGBA
/// value and if set in sf::StencilMode the stencil buffer is updated /// value and if set in `sf::StencilMode` the stencil buffer is updated
/// accordingly. The new stencil value will be used during stencil testing the /// accordingly. The new stencil value will be used during stencil testing the
/// next time the pixel is drawn to. /// next time the pixel is drawn to.
/// ///
@ -183,7 +183,7 @@ struct SFML_GRAPHICS_API StencilMode
/// \li Stencil Only Update (\ref stencilOnly) /// \li Stencil Only Update (\ref stencilOnly)
/// ///
/// The stencil comparison specifies the comparison that is performed between /// The stencil comparison specifies the comparison that is performed between
/// the reference value of the currently active sf::StencilMode and the value /// the reference value of the currently active `sf::StencilMode` and the value
/// that is currently in the stencil buffer. This comparison determines whether /// that is currently in the stencil buffer. This comparison determines whether
/// the stencil test passes or fails. /// the stencil test passes or fails.
/// ///
@ -207,9 +207,9 @@ struct SFML_GRAPHICS_API StencilMode
/// buffer and not the color buffer during a draw. The written stencil buffer /// buffer and not the color buffer during a draw. The written stencil buffer
/// value can then be used in subsequent draws as a masking region. /// value can then be used in subsequent draws as a masking region.
/// ///
/// In SFML, a stencil mode can be specified every time you draw a sf::Drawable /// In SFML, a stencil mode can be specified every time you draw a `sf::Drawable`
/// object to a render target. It is part of the sf::RenderStates compound /// object to a render target. It is part of the `sf::RenderStates` compound
/// that is passed to the member function sf::RenderTarget::draw(). /// that is passed to the member function `sf::RenderTarget::draw()`.
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -251,6 +251,6 @@ struct SFML_GRAPHICS_API StencilMode
/// window.draw(right, sf::StencilMode{sf::StencilComparison::NotEqual, sf::StencilUpdateOperation::Keep, 1, 0xFF, false}); /// window.draw(right, sf::StencilMode{sf::StencilComparison::NotEqual, sf::StencilUpdateOperation::Keep, 1, 0xFF, false});
/// \endcode /// \endcode
/// ///
/// \see sf::RenderStates, sf::RenderTarget /// \see `sf::RenderStates`, `sf::RenderTarget`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -95,7 +95,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the text's string /// \brief Set the text's string
/// ///
/// The \a string argument is a sf::String, which can /// The \a `string` argument is a `sf::String`, which can
/// automatically be constructed from standard string types. /// automatically be constructed from standard string types.
/// So, the following calls are all valid: /// So, the following calls are all valid:
/// \code /// \code
@ -108,7 +108,7 @@ public:
/// ///
/// \param string New string /// \param string New string
/// ///
/// \see getString /// \see `getString`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setString(const String& string); void setString(const String& string);
@ -116,7 +116,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the text's font /// \brief Set the text's font
/// ///
/// The \a font argument refers to a font that must /// The \a `font` argument refers to a font that must
/// exist as long as the text uses it. Indeed, the text /// exist as long as the text uses it. Indeed, the text
/// doesn't store its own copy of the font, but rather keeps /// doesn't store its own copy of the font, but rather keeps
/// a pointer to the one that you passed to this function. /// a pointer to the one that you passed to this function.
@ -125,7 +125,7 @@ public:
/// ///
/// \param font New font /// \param font New font
/// ///
/// \see getFont /// \see `getFont`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setFont(const Font& font); void setFont(const Font& font);
@ -150,7 +150,7 @@ public:
/// ///
/// \param size New character size, in pixels /// \param size New character size, in pixels
/// ///
/// \see getCharacterSize /// \see `getCharacterSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setCharacterSize(unsigned int size); void setCharacterSize(unsigned int size);
@ -164,7 +164,7 @@ public:
/// ///
/// \param spacingFactor New line spacing factor /// \param spacingFactor New line spacing factor
/// ///
/// \see getLineSpacing /// \see `getLineSpacing`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setLineSpacing(float spacingFactor); void setLineSpacing(float spacingFactor);
@ -183,7 +183,7 @@ public:
/// ///
/// \param spacingFactor New letter spacing factor /// \param spacingFactor New letter spacing factor
/// ///
/// \see getLetterSpacing /// \see `getLetterSpacing`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setLetterSpacing(float spacingFactor); void setLetterSpacing(float spacingFactor);
@ -192,12 +192,12 @@ public:
/// \brief Set the text's style /// \brief Set the text's style
/// ///
/// You can pass a combination of one or more styles, for /// You can pass a combination of one or more styles, for
/// example sf::Text::Bold | sf::Text::Italic. /// example `sf::Text::Bold | sf::Text::Italic`.
/// The default style is sf::Text::Regular. /// The default style is `sf::Text::Regular`.
/// ///
/// \param style New style /// \param style New style
/// ///
/// \see getStyle /// \see `getStyle`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setStyle(std::uint32_t style); void setStyle(std::uint32_t style);
@ -211,7 +211,7 @@ public:
/// ///
/// \param color New fill color of the text /// \param color New fill color of the text
/// ///
/// \see getFillColor /// \see `getFillColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setFillColor(Color color); void setFillColor(Color color);
@ -223,7 +223,7 @@ public:
/// ///
/// \param color New outline color of the text /// \param color New outline color of the text
/// ///
/// \see getOutlineColor /// \see `getOutlineColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setOutlineColor(Color color); void setOutlineColor(Color color);
@ -238,7 +238,7 @@ public:
/// ///
/// \param thickness New outline thickness, in pixels /// \param thickness New outline thickness, in pixels
/// ///
/// \see getOutlineThickness /// \see `getOutlineThickness`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setOutlineThickness(float thickness); void setOutlineThickness(float thickness);
@ -246,7 +246,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the text's string /// \brief Get the text's string
/// ///
/// The returned string is a sf::String, which can automatically /// The returned string is a `sf::String`, which can automatically
/// be converted to standard string types. So, the following /// be converted to standard string types. So, the following
/// lines of code are all valid: /// lines of code are all valid:
/// \code /// \code
@ -257,7 +257,7 @@ public:
/// ///
/// \return Text's string /// \return Text's string
/// ///
/// \see setString /// \see `setString`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const String& getString() const; [[nodiscard]] const String& getString() const;
@ -270,7 +270,7 @@ public:
/// ///
/// \return Reference to the text's font /// \return Reference to the text's font
/// ///
/// \see setFont /// \see `setFont`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Font& getFont() const; [[nodiscard]] const Font& getFont() const;
@ -280,7 +280,7 @@ public:
/// ///
/// \return Size of the characters, in pixels /// \return Size of the characters, in pixels
/// ///
/// \see setCharacterSize /// \see `setCharacterSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned int getCharacterSize() const; [[nodiscard]] unsigned int getCharacterSize() const;
@ -290,7 +290,7 @@ public:
/// ///
/// \return Size of the letter spacing factor /// \return Size of the letter spacing factor
/// ///
/// \see setLetterSpacing /// \see `setLetterSpacing`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getLetterSpacing() const; [[nodiscard]] float getLetterSpacing() const;
@ -300,7 +300,7 @@ public:
/// ///
/// \return Size of the line spacing factor /// \return Size of the line spacing factor
/// ///
/// \see setLineSpacing /// \see `setLineSpacing`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getLineSpacing() const; [[nodiscard]] float getLineSpacing() const;
@ -310,7 +310,7 @@ public:
/// ///
/// \return Text's style /// \return Text's style
/// ///
/// \see setStyle /// \see `setStyle`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::uint32_t getStyle() const; [[nodiscard]] std::uint32_t getStyle() const;
@ -320,7 +320,7 @@ public:
/// ///
/// \return Fill color of the text /// \return Fill color of the text
/// ///
/// \see setFillColor /// \see `setFillColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Color getFillColor() const; [[nodiscard]] Color getFillColor() const;
@ -330,7 +330,7 @@ public:
/// ///
/// \return Outline color of the text /// \return Outline color of the text
/// ///
/// \see setOutlineColor /// \see `setOutlineColor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Color getOutlineColor() const; [[nodiscard]] Color getOutlineColor() const;
@ -340,19 +340,19 @@ public:
/// ///
/// \return Outline thickness of the text, in pixels /// \return Outline thickness of the text, in pixels
/// ///
/// \see setOutlineThickness /// \see `setOutlineThickness`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] float getOutlineThickness() const; [[nodiscard]] float getOutlineThickness() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Return the position of the \a index-th character /// \brief Return the position of the \a `index`-th character
/// ///
/// This function computes the visual position of a character /// This function computes the visual position of a character
/// from its index in the string. The returned position is /// from its index in the string. The returned position is
/// in global coordinates (translation, rotation, scale and /// in global coordinates (translation, rotation, scale and
/// origin are applied). /// origin are applied).
/// If \a index is out of range, the position of the end of /// If \a `index` is out of range, the position of the end of
/// the string is returned. /// the string is returned.
/// ///
/// \param index Index of the character /// \param index Index of the character
@ -435,10 +435,10 @@ private:
/// \class sf::Text /// \class sf::Text
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Text is a drawable class that allows to easily display /// `sf::Text` is a drawable class that allows to easily display
/// some text with custom style and color on a render target. /// some text with custom style and color on a render target.
/// ///
/// It inherits all the functions from sf::Transformable: /// It inherits all the functions from `sf::Transformable`:
/// position, rotation, scale, origin. It also adds text-specific /// position, rotation, scale, origin. It also adds text-specific
/// properties such as the font to use, the character size, /// properties such as the font to use, the character size,
/// the font style (bold, italic, underlined and strike through), the /// the font style (bold, italic, underlined and strike through), the
@ -448,23 +448,23 @@ private:
/// graphical size of the text, or to get the global position /// graphical size of the text, or to get the global position
/// of a given character. /// of a given character.
/// ///
/// sf::Text works in combination with the sf::Font class, which /// `sf::Text` works in combination with the `sf::Font` class, which
/// loads and provides the glyphs (visual characters) of a given font. /// loads and provides the glyphs (visual characters) of a given font.
/// ///
/// The separation of sf::Font and sf::Text allows more flexibility /// The separation of `sf::Font` and `sf::Text` allows more flexibility
/// and better performances: indeed a sf::Font is a heavy resource, /// and better performances: indeed a `sf::Font` is a heavy resource,
/// and any operation on it is slow (often too slow for real-time /// and any operation on it is slow (often too slow for real-time
/// applications). On the other side, a sf::Text is a lightweight /// applications). On the other side, a `sf::Text` is a lightweight
/// object which can combine the glyphs data and metrics of a sf::Font /// object which can combine the glyphs data and metrics of a `sf::Font`
/// to display any text on a render target. /// to display any text on a render target.
/// ///
/// It is important to note that the sf::Text instance doesn't /// It is important to note that the `sf::Text` instance doesn't
/// copy the font that it uses, it only keeps a reference to it. /// copy the font that it uses, it only keeps a reference to it.
/// Thus, a sf::Font must not be destructed while it is /// Thus, a `sf::Font` must not be destructed while it is
/// used by a sf::Text (i.e. never write a function that /// used by a `sf::Text` (i.e. never write a function that
/// uses a local sf::Font instance for creating a text). /// uses a local `sf::Font` instance for creating a text).
/// ///
/// See also the note on coordinates and undistorted rendering in sf::Transformable. /// See also the note on coordinates and undistorted rendering in `sf::Transformable`.
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -481,6 +481,6 @@ private:
/// window.draw(text); /// window.draw(text);
/// \endcode /// \endcode
/// ///
/// \see sf::Font, sf::Transformable /// \see `sf::Font`, `sf::Transformable`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -60,7 +60,7 @@ public:
/// ///
/// Creates a texture with width 0 and height 0. /// Creates a texture with width 0 and height 0.
/// ///
/// \see resize /// \see `resize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Texture(); Texture();
@ -104,11 +104,11 @@ public:
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the getMaximumSize function.
/// ///
/// \param filename Path of the image file to load /// \param filename Path of the image file to load
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit Texture(const std::filesystem::path& filename, bool sRgb = false); explicit Texture(const std::filesystem::path& filename, bool sRgb = false);
@ -116,22 +116,22 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the texture from a sub-rectangle of a file on disk /// \brief Construct the texture from a sub-rectangle of a file on disk
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param filename Path of the image file to load /// \param filename Path of the image file to load
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Texture(const std::filesystem::path& filename, bool sRgb, const IntRect& area); Texture(const std::filesystem::path& filename, bool sRgb, const IntRect& area);
@ -140,15 +140,15 @@ public:
/// \brief Construct the texture from a file in memory /// \brief Construct the texture from a file in memory
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param size Size of the data to load, in bytes /// \param size Size of the data to load, in bytes
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Texture(const void* data, std::size_t size, bool sRgb = false); Texture(const void* data, std::size_t size, bool sRgb = false);
@ -156,23 +156,23 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the texture from a sub-rectangle of a file in memory /// \brief Construct the texture from a sub-rectangle of a file in memory
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param size Size of the data to load, in bytes /// \param size Size of the data to load, in bytes
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Texture(const void* data, std::size_t size, bool sRgb, const IntRect& area); Texture(const void* data, std::size_t size, bool sRgb, const IntRect& area);
@ -181,14 +181,14 @@ public:
/// \brief Construct the texture from a custom stream /// \brief Construct the texture from a custom stream
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit Texture(InputStream& stream, bool sRgb = false); explicit Texture(InputStream& stream, bool sRgb = false);
@ -196,22 +196,22 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the texture from a sub-rectangle of a custom stream /// \brief Construct the texture from a sub-rectangle of a custom stream
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Texture(InputStream& stream, bool sRgb, const IntRect& area); Texture(InputStream& stream, bool sRgb, const IntRect& area);
@ -220,14 +220,14 @@ public:
/// \brief Construct the texture from an image /// \brief Construct the texture from an image
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param image Image to load into the texture /// \param image Image to load into the texture
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit Texture(const Image& image, bool sRgb = false); explicit Texture(const Image& image, bool sRgb = false);
@ -235,21 +235,21 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the texture from a sub-rectangle of an image /// \brief Construct the texture from a sub-rectangle of an image
/// ///
/// The \a area argument is used to load only a sub-rectangle /// The \a `area` argument is used to load only a sub-rectangle
/// of the whole image. /// of the whole image.
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// \param image Image to load into the texture /// \param image Image to load into the texture
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \throws `sf::Exception` if loading was unsuccessful /// \throws `sf::Exception` if loading was unsuccessful
/// ///
/// \see loadFromFile, loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Texture(const Image& image, bool sRgb, const IntRect& area); Texture(const Image& image, bool sRgb, const IntRect& area);
@ -258,7 +258,7 @@ public:
/// \brief Construct the texture with a given size /// \brief Construct the texture with a given size
/// ///
/// \param size Width and height of the texture /// \param size Width and height of the texture
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// ///
/// \throws `sf::Exception` if construction was unsuccessful /// \throws `sf::Exception` if construction was unsuccessful
/// ///
@ -271,9 +271,9 @@ public:
/// If this function fails, the texture is left unchanged. /// If this function fails, the texture is left unchanged.
/// ///
/// \param size Width and height of the texture /// \param size Width and height of the texture
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// ///
/// \return True if resizing was successful, false if it failed /// \return `true` if resizing was successful, `false` if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool resize(Vector2u size, bool sRgb = false); [[nodiscard]] bool resize(Vector2u size, bool sRgb = false);
@ -281,24 +281,24 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the texture from a file on disk /// \brief Load the texture from a file on disk
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// If this function fails, the texture is left unchanged. /// If this function fails, the texture is left unchanged.
/// ///
/// \param filename Path of the image file to load /// \param filename Path of the image file to load
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \return True if loading was successful, false if it failed /// \return `true` if loading was successful, `false` if it failed
/// ///
/// \see loadFromMemory, loadFromStream, loadFromImage /// \see `loadFromMemory`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromFile(const std::filesystem::path& filename, bool sRgb = false, const IntRect& area = {}); [[nodiscard]] bool loadFromFile(const std::filesystem::path& filename, bool sRgb = false, const IntRect& area = {});
@ -306,25 +306,25 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the texture from a file in memory /// \brief Load the texture from a file in memory
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// If this function fails, the texture is left unchanged. /// If this function fails, the texture is left unchanged.
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param size Size of the data to load, in bytes /// \param size Size of the data to load, in bytes
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \return True if loading was successful, false if it failed /// \return `true` if loading was successful, `false` if it failed
/// ///
/// \see loadFromFile, loadFromStream, loadFromImage /// \see `loadFromFile`, `loadFromStream`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromMemory(const void* data, std::size_t size, bool sRgb = false, const IntRect& area = {}); [[nodiscard]] bool loadFromMemory(const void* data, std::size_t size, bool sRgb = false, const IntRect& area = {});
@ -332,24 +332,24 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the texture from a custom stream /// \brief Load the texture from a custom stream
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// If this function fails, the texture is left unchanged. /// If this function fails, the texture is left unchanged.
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \return True if loading was successful, false if it failed /// \return `true` if loading was successful, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory, loadFromImage /// \see `loadFromFile`, `loadFromMemory`, `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromStream(InputStream& stream, bool sRgb = false, const IntRect& area = {}); [[nodiscard]] bool loadFromStream(InputStream& stream, bool sRgb = false, const IntRect& area = {});
@ -357,24 +357,24 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Load the texture from an image /// \brief Load the texture from an image
/// ///
/// The \a area argument can be used to load only a sub-rectangle /// The \a `area` argument can be used to load only a sub-rectangle
/// of the whole image. If you want the entire image then leave /// of the whole image. If you want the entire image then leave
/// the default value (which is an empty IntRect). /// the default value (which is an empty `IntRect`).
/// If the \a area rectangle crosses the bounds of the image, it /// If the \a `area` rectangle crosses the bounds of the image, it
/// is adjusted to fit the image size. /// is adjusted to fit the image size.
/// ///
/// The maximum size for a texture depends on the graphics /// The maximum size for a texture depends on the graphics
/// driver and can be retrieved with the getMaximumSize function. /// driver and can be retrieved with the `getMaximumSize` function.
/// ///
/// If this function fails, the texture is left unchanged. /// If this function fails, the texture is left unchanged.
/// ///
/// \param image Image to load into the texture /// \param image Image to load into the texture
/// \param sRgb True to enable sRGB conversion, false to disable it /// \param sRgb `true` to enable sRGB conversion, `false` to disable it
/// \param area Area of the image to load /// \param area Area of the image to load
/// ///
/// \return True if loading was successful, false if it failed /// \return `true` if loading was successful, `false` if it failed
/// ///
/// \see loadFromFile, loadFromMemory /// \see `loadFromFile`, `loadFromMemory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool loadFromImage(const Image& image, bool sRgb = false, const IntRect& area = {}); [[nodiscard]] bool loadFromImage(const Image& image, bool sRgb = false, const IntRect& area = {});
@ -397,7 +397,7 @@ public:
/// ///
/// \return Image containing the texture's pixels /// \return Image containing the texture's pixels
/// ///
/// \see loadFromImage /// \see `loadFromImage`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Image copyToImage() const; [[nodiscard]] Image copyToImage() const;
@ -405,15 +405,15 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Update the whole texture from an array of pixels /// \brief Update the whole texture from an array of pixels
/// ///
/// The \a pixel array is assumed to have the same size as /// The pixel array is assumed to have the same size as
/// the \a area rectangle, and to contain 32-bits RGBA pixels. /// the \a `area` rectangle, and to contain 32-bits RGBA pixels.
/// ///
/// No additional check is performed on the size of the pixel /// No additional check is performed on the size of the pixel
/// array. Passing invalid arguments will lead to an undefined /// array. Passing invalid arguments will lead to an undefined
/// behavior. /// behavior.
/// ///
/// This function does nothing if \a pixels is null or if the /// This function does nothing if \a `pixels` is `nullptr`
/// texture was not previously created. /// or if the texture was not previously created.
/// ///
/// \param pixels Array of pixels to copy to the texture /// \param pixels Array of pixels to copy to the texture
/// ///
@ -423,18 +423,18 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Update a part of the texture from an array of pixels /// \brief Update a part of the texture from an array of pixels
/// ///
/// The size of the \a pixel array must match the \a width and /// The size of the pixel array must match the \a `size` argument,
/// \a height arguments, and it must contain 32-bits RGBA pixels. /// and it must contain 32-bits RGBA pixels.
/// ///
/// No additional check is performed on the size of the pixel /// No additional check is performed on the size of the pixel
/// array or the bounds of the area to update. Passing invalid /// array or the bounds of the area to update. Passing invalid
/// arguments will lead to an undefined behavior. /// arguments will lead to an undefined behavior.
/// ///
/// This function does nothing if \a pixels is null or if the /// This function does nothing if \a `pixels` is null or if the
/// texture was not previously created. /// texture was not previously created.
/// ///
/// \param pixels Array of pixels to copy to the texture /// \param pixels Array of pixels to copy to the texture
/// \param size Width and height of the pixel region contained in \a pixels /// \param size Width and height of the pixel region contained in \a `pixels`
/// \param dest Coordinates of the destination position /// \param dest Coordinates of the destination position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -560,9 +560,9 @@ public:
/// you should leave it disabled. /// you should leave it disabled.
/// The smooth filter is disabled by default. /// The smooth filter is disabled by default.
/// ///
/// \param smooth True to enable smoothing, false to disable it /// \param smooth `true` to enable smoothing, `false` to disable it
/// ///
/// \see isSmooth /// \see `isSmooth`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSmooth(bool smooth); void setSmooth(bool smooth);
@ -570,9 +570,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not /// \brief Tell whether the smooth filter is enabled or not
/// ///
/// \return True if smoothing is enabled, false if it is disabled /// \return `true` if smoothing is enabled, `false` if it is disabled
/// ///
/// \see setSmooth /// \see `setSmooth`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSmooth() const; [[nodiscard]] bool isSmooth() const;
@ -580,9 +580,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the texture source is converted from sRGB or not /// \brief Tell whether the texture source is converted from sRGB or not
/// ///
/// \return True if the texture source is converted from sRGB, false if not /// \return `true` if the texture source is converted from sRGB, `false` if not
/// ///
/// \see setSrgb /// \see `setSrgb`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isSrgb() const; [[nodiscard]] bool isSrgb() const;
@ -604,9 +604,9 @@ public:
/// dimensions (such as 256x128). /// dimensions (such as 256x128).
/// Repeating is disabled by default. /// Repeating is disabled by default.
/// ///
/// \param repeated True to repeat the texture, false to disable repeating /// \param repeated `true` to repeat the texture, `false` to disable repeating
/// ///
/// \see isRepeated /// \see `isRepeated`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setRepeated(bool repeated); void setRepeated(bool repeated);
@ -614,9 +614,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the texture is repeated or not /// \brief Tell whether the texture is repeated or not
/// ///
/// \return True if repeat mode is enabled, false if it is disabled /// \return `true` if repeat mode is enabled, `false` if it is disabled
/// ///
/// \see setRepeated /// \see `setRepeated`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isRepeated() const; [[nodiscard]] bool isRepeated() const;
@ -636,12 +636,12 @@ public:
/// ///
/// Mipmap generation relies on the necessary OpenGL extension being /// Mipmap generation relies on the necessary OpenGL extension being
/// available. If it is unavailable or generation fails due to another /// available. If it is unavailable or generation fails due to another
/// reason, this function will return false. Mipmap data is only valid from /// reason, this function will return `false`. Mipmap data is only valid from
/// the time it is generated until the next time the base level image is /// the time it is generated until the next time the base level image is
/// modified, at which point this function will have to be called again to /// modified, at which point this function will have to be called again to
/// regenerate it. /// regenerate it.
/// ///
/// \return True if mipmap generation was successful, false if unsuccessful /// \return `true` if mipmap generation was successful, `false` if unsuccessful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool generateMipmap(); [[nodiscard]] bool generateMipmap();
@ -671,7 +671,7 @@ public:
/// ///
/// This function is not part of the graphics API, it mustn't be /// This function is not part of the graphics API, it mustn't be
/// used when drawing SFML entities. It must be used only if you /// used when drawing SFML entities. It must be used only if you
/// mix sf::Texture with OpenGL code. /// mix `sf::Texture` with OpenGL code.
/// ///
/// \code /// \code
/// sf::Texture t1, t2; /// sf::Texture t1, t2;
@ -684,7 +684,7 @@ public:
/// // draw OpenGL stuff that use no texture... /// // draw OpenGL stuff that use no texture...
/// \endcode /// \endcode
/// ///
/// The \a coordinateType argument controls how texture /// The \a `coordinateType` argument controls how texture
/// coordinates will be interpreted. If Normalized (the default), they /// coordinates will be interpreted. If Normalized (the default), they
/// must be in range [0 .. 1], which is the default way of handling /// must be in range [0 .. 1], which is the default way of handling
/// texture coordinates with OpenGL. If Pixels, they must be given /// texture coordinates with OpenGL. If Pixels, they must be given
@ -771,18 +771,18 @@ SFML_GRAPHICS_API void swap(Texture& left, Texture& right) noexcept;
/// \class sf::Texture /// \class sf::Texture
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::Texture stores pixels that can be drawn, with a sprite /// `sf::Texture` stores pixels that can be drawn, with a sprite
/// for example. A texture lives in the graphics card memory, /// for example. A texture lives in the graphics card memory,
/// therefore it is very fast to draw a texture to a render target, /// therefore it is very fast to draw a texture to a render target,
/// or copy a render target to a texture (the graphics card can /// or copy a render target to a texture (the graphics card can
/// access both directly). /// access both directly).
/// ///
/// Being stored in the graphics card memory has some drawbacks. /// Being stored in the graphics card memory has some drawbacks.
/// A texture cannot be manipulated as freely as a sf::Image, /// A texture cannot be manipulated as freely as a `sf::Image`,
/// you need to prepare the pixels first and then upload them /// you need to prepare the pixels first and then upload them
/// to the texture in a single operation (see Texture::update). /// to the texture in a single operation (see `Texture::update`).
/// ///
/// sf::Texture makes it easy to convert from/to sf::Image, but /// `sf::Texture` makes it easy to convert from/to `sf::Image`, but
/// keep in mind that these calls require transfers between /// keep in mind that these calls require transfers between
/// the graphics card and the central memory, therefore they are /// the graphics card and the central memory, therefore they are
/// slow operations. /// slow operations.
@ -792,8 +792,8 @@ SFML_GRAPHICS_API void swap(Texture& left, Texture& right) noexcept;
/// so that you don't need an image first for the most common cases. /// so that you don't need an image first for the most common cases.
/// However, if you want to perform some modifications on the pixels /// However, if you want to perform some modifications on the pixels
/// before creating the final texture, you can load your file to a /// before creating the final texture, you can load your file to a
/// sf::Image, do whatever you need with the pixels, and then call /// `sf::Image`, do whatever you need with the pixels, and then call
/// Texture(const Image&). /// `Texture(const Image&)`.
/// ///
/// Since they live in the graphics card memory, the pixels of a texture /// Since they live in the graphics card memory, the pixels of a texture
/// cannot be accessed without a slow copy first. And they cannot be /// cannot be accessed without a slow copy first. And they cannot be
@ -802,10 +802,10 @@ SFML_GRAPHICS_API void swap(Texture& left, Texture& right) noexcept;
/// store the collision information separately, for example in an array /// store the collision information separately, for example in an array
/// of booleans. /// of booleans.
/// ///
/// Like sf::Image, sf::Texture can handle a unique internal /// Like `sf::Image`, `sf::Texture` can handle a unique internal
/// representation of pixels, which is RGBA 32 bits. This means /// representation of pixels, which is RGBA 32 bits. This means
/// that a pixel must be composed of 8 bit red, green, blue and /// that a pixel must be composed of 8 bit red, green, blue and
/// alpha channels -- just like a sf::Color. /// alpha channels -- just like a `sf::Color`.
/// ///
/// When providing texture data from an image file or memory, it can /// When providing texture data from an image file or memory, it can
/// either be stored in a linear color space or an sRGB color space. /// either be stored in a linear color space or an sRGB color space.
@ -860,8 +860,8 @@ SFML_GRAPHICS_API void swap(Texture& left, Texture& right) noexcept;
/// ///
/// \endcode /// \endcode
/// ///
/// Like sf::Shader that can be used as a raw OpenGL shader, /// Like `sf::Shader` that can be used as a raw OpenGL shader,
/// sf::Texture can also be used directly as a raw texture for /// `sf::Texture` can also be used directly as a raw texture for
/// custom OpenGL geometry. /// custom OpenGL geometry.
/// \code /// \code
/// sf::Texture::bind(&texture); /// sf::Texture::bind(&texture);
@ -869,6 +869,6 @@ SFML_GRAPHICS_API void swap(Texture& left, Texture& right) noexcept;
/// sf::Texture::bind(nullptr); /// sf::Texture::bind(nullptr);
/// \endcode /// \endcode
/// ///
/// \see sf::Sprite, sf::Image, sf::RenderTexture /// \see `sf::Sprite`, `sf::Image`, `sf::RenderTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -135,8 +135,8 @@ public:
/// \brief Combine the current transform with another one /// \brief Combine the current transform with another one
/// ///
/// The result is a transform that is equivalent to applying /// The result is a transform that is equivalent to applying
/// \a transform followed by *this. Mathematically, it is /// \a `transform` followed by `*this`. Mathematically, it is
/// equivalent to a matrix multiplication (*this) * transform. /// equivalent to a matrix multiplication `(*this) * transform`.
/// ///
/// These two statements are equivalent: /// These two statements are equivalent:
/// \code /// \code
@ -146,7 +146,7 @@ public:
/// ///
/// \param transform Transform to combine with this transform /// \param transform Transform to combine with this transform
/// ///
/// \return Reference to *this /// \return Reference to `*this`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Transform& combine(const Transform& transform); constexpr Transform& combine(const Transform& transform);
@ -154,7 +154,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a translation /// \brief Combine the current transform with a translation
/// ///
/// This function returns a reference to *this, so that calls /// This function returns a reference to `*this`, so that calls
/// can be chained. /// can be chained.
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
@ -163,9 +163,9 @@ public:
/// ///
/// \param offset Translation offset to apply /// \param offset Translation offset to apply
/// ///
/// \return Reference to *this /// \return Reference to `*this`
/// ///
/// \see rotate, scale /// \see `rotate`, `scale`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Transform& translate(Vector2f offset); constexpr Transform& translate(Vector2f offset);
@ -173,7 +173,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a rotation /// \brief Combine the current transform with a rotation
/// ///
/// This function returns a reference to *this, so that calls /// This function returns a reference to `*this`, so that calls
/// can be chained. /// can be chained.
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
@ -182,9 +182,9 @@ public:
/// ///
/// \param angle Rotation angle /// \param angle Rotation angle
/// ///
/// \return Reference to *this /// \return Reference to `*this`
/// ///
/// \see translate, scale /// \see `translate`, `scale`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_GRAPHICS_API Transform& rotate(Angle angle); SFML_GRAPHICS_API Transform& rotate(Angle angle);
@ -195,9 +195,9 @@ public:
/// The center of rotation is provided for convenience as a second /// The center of rotation is provided for convenience as a second
/// argument, so that you can build rotations around arbitrary points /// argument, so that you can build rotations around arbitrary points
/// more easily (and efficiently) than the usual /// more easily (and efficiently) than the usual
/// translate(-center).rotate(angle).translate(center). /// `translate(-center).rotate(angle).translate(center)`.
/// ///
/// This function returns a reference to *this, so that calls /// This function returns a reference to `*this`, so that calls
/// can be chained. /// can be chained.
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
@ -207,9 +207,9 @@ public:
/// \param angle Rotation angle /// \param angle Rotation angle
/// \param center Center of rotation /// \param center Center of rotation
/// ///
/// \return Reference to *this /// \return Reference to `*this`
/// ///
/// \see translate, scale /// \see `translate`, `scale`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_GRAPHICS_API Transform& rotate(Angle angle, Vector2f center); SFML_GRAPHICS_API Transform& rotate(Angle angle, Vector2f center);
@ -217,7 +217,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a scaling /// \brief Combine the current transform with a scaling
/// ///
/// This function returns a reference to *this, so that calls /// This function returns a reference to `*this`, so that calls
/// can be chained. /// can be chained.
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
@ -226,9 +226,9 @@ public:
/// ///
/// \param factors Scaling factors /// \param factors Scaling factors
/// ///
/// \return Reference to *this /// \return Reference to `*this`
/// ///
/// \see translate, rotate /// \see `translate`, `rotate`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Transform& scale(Vector2f factors); constexpr Transform& scale(Vector2f factors);
@ -239,9 +239,9 @@ public:
/// The center of scaling is provided for convenience as a second /// The center of scaling is provided for convenience as a second
/// argument, so that you can build scaling around arbitrary points /// argument, so that you can build scaling around arbitrary points
/// more easily (and efficiently) than the usual /// more easily (and efficiently) than the usual
/// translate(-center).scale(factors).translate(center). /// `translate(-center).scale(factors).translate(center)`.
/// ///
/// This function returns a reference to *this, so that calls /// This function returns a reference to `*this`, so that calls
/// can be chained. /// can be chained.
/// \code /// \code
/// sf::Transform transform; /// sf::Transform transform;
@ -251,9 +251,9 @@ public:
/// \param factors Scaling factors /// \param factors Scaling factors
/// \param center Center of scaling /// \param center Center of scaling
/// ///
/// \return Reference to *this /// \return Reference to `*this`
/// ///
/// \see translate, rotate /// \see `translate`, `rotate`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Transform& scale(Vector2f factors, Vector2f center); constexpr Transform& scale(Vector2f factors, Vector2f center);
@ -277,10 +277,10 @@ private:
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Transform /// \relates `sf::Transform`
/// \brief Overload of binary operator * to combine two transforms /// \brief Overload of binary `operator*` to combine two transforms
/// ///
/// This call is equivalent to calling Transform(left).combine(right). /// This call is equivalent to calling `Transform(left).combine(right)`.
/// ///
/// \param left Left operand (the first transform) /// \param left Left operand (the first transform)
/// \param right Right operand (the second transform) /// \param right Right operand (the second transform)
@ -291,10 +291,10 @@ private:
[[nodiscard]] constexpr Transform operator*(const Transform& left, const Transform& right); [[nodiscard]] constexpr Transform operator*(const Transform& left, const Transform& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Transform /// \relates `sf::Transform`
/// \brief Overload of binary operator *= to combine two transforms /// \brief Overload of binary `operator*=` to combine two transforms
/// ///
/// This call is equivalent to calling left.combine(right). /// This call is equivalent to calling `left.combine(right)`.
/// ///
/// \param left Left operand (the first transform) /// \param left Left operand (the first transform)
/// \param right Right operand (the second transform) /// \param right Right operand (the second transform)
@ -305,10 +305,10 @@ private:
constexpr Transform& operator*=(Transform& left, const Transform& right); constexpr Transform& operator*=(Transform& left, const Transform& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Transform /// \relates `sf::Transform`
/// \brief Overload of binary operator * to transform a point /// \brief Overload of binary `operator*` to transform a point
/// ///
/// This call is equivalent to calling left.transformPoint(right). /// This call is equivalent to calling `left.transformPoint(right)`.
/// ///
/// \param left Left operand (the transform) /// \param left Left operand (the transform)
/// \param right Right operand (the point to transform) /// \param right Right operand (the point to transform)
@ -319,8 +319,8 @@ constexpr Transform& operator*=(Transform& left, const Transform& right);
[[nodiscard]] constexpr Vector2f operator*(const Transform& left, Vector2f right); [[nodiscard]] constexpr Vector2f operator*(const Transform& left, Vector2f right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Transform /// \relates `sf::Transform`
/// \brief Overload of binary operator == to compare two transforms /// \brief Overload of binary `operator==` to compare two transforms
/// ///
/// Performs an element-wise comparison of the elements of the /// Performs an element-wise comparison of the elements of the
/// left transform with the elements of the right transform. /// left transform with the elements of the right transform.
@ -328,21 +328,21 @@ constexpr Transform& operator*=(Transform& left, const Transform& right);
/// \param left Left operand (the first transform) /// \param left Left operand (the first transform)
/// \param right Right operand (the second transform) /// \param right Right operand (the second transform)
/// ///
/// \return true if the transforms are equal, false otherwise /// \return `true` if the transforms are equal, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator==(const Transform& left, const Transform& right); [[nodiscard]] constexpr bool operator==(const Transform& left, const Transform& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Transform /// \relates `sf::Transform`
/// \brief Overload of binary operator != to compare two transforms /// \brief Overload of binary `operator!=` to compare two transforms
/// ///
/// This call is equivalent to !(left == right). /// This call is equivalent to `!(left == right)`.
/// ///
/// \param left Left operand (the first transform) /// \param left Left operand (the first transform)
/// \param right Right operand (the second transform) /// \param right Right operand (the second transform)
/// ///
/// \return true if the transforms are not equal, false otherwise /// \return `true` if the transforms are not equal, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator!=(const Transform& left, const Transform& right); [[nodiscard]] constexpr bool operator!=(const Transform& left, const Transform& right);
@ -356,7 +356,7 @@ constexpr Transform& operator*=(Transform& left, const Transform& right);
/// \class sf::Transform /// \class sf::Transform
/// \ingroup graphics /// \ingroup graphics
/// ///
/// A sf::Transform specifies how to translate, rotate, scale, /// A `sf::Transform` specifies how to translate, rotate, scale,
/// shear, project, whatever things. In mathematical terms, it defines /// shear, project, whatever things. In mathematical terms, it defines
/// how to transform a coordinate system into another. /// how to transform a coordinate system into another.
/// ///
@ -388,6 +388,6 @@ constexpr Transform& operator*=(Transform& left, const Transform& right);
/// sf::FloatRect rect = transform.transformRect(sf::FloatRect({0, 0}, {10, 100})); /// sf::FloatRect rect = transform.transformRect(sf::FloatRect({0, 0}, {10, 100}));
/// \endcode /// \endcode
/// ///
/// \see sf::Transformable, sf::RenderStates /// \see `sf::Transformable`, `sf::RenderStates`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -64,7 +64,7 @@ public:
/// ///
/// \param position New position /// \param position New position
/// ///
/// \see move, getPosition /// \see `move`, `getPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPosition(Vector2f position); void setPosition(Vector2f position);
@ -78,7 +78,7 @@ public:
/// ///
/// \param angle New rotation /// \param angle New rotation
/// ///
/// \see rotate, getRotation /// \see `rotate`, `getRotation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setRotation(Angle angle); void setRotation(Angle angle);
@ -92,7 +92,7 @@ public:
/// ///
/// \param factors New scale factors /// \param factors New scale factors
/// ///
/// \see scale, getScale /// \see `scale`, `getScale`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setScale(Vector2f factors); void setScale(Vector2f factors);
@ -109,7 +109,7 @@ public:
/// ///
/// \param origin New origin /// \param origin New origin
/// ///
/// \see getOrigin /// \see `getOrigin`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setOrigin(Vector2f origin); void setOrigin(Vector2f origin);
@ -119,7 +119,7 @@ public:
/// ///
/// \return Current position /// \return Current position
/// ///
/// \see setPosition /// \see `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getPosition() const; [[nodiscard]] Vector2f getPosition() const;
@ -131,7 +131,7 @@ public:
/// ///
/// \return Current rotation /// \return Current rotation
/// ///
/// \see setRotation /// \see `setRotation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Angle getRotation() const; [[nodiscard]] Angle getRotation() const;
@ -141,7 +141,7 @@ public:
/// ///
/// \return Current scale factors /// \return Current scale factors
/// ///
/// \see setScale /// \see `setScale`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getScale() const; [[nodiscard]] Vector2f getScale() const;
@ -151,7 +151,7 @@ public:
/// ///
/// \return Current origin /// \return Current origin
/// ///
/// \see setOrigin /// \see `setOrigin`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getOrigin() const; [[nodiscard]] Vector2f getOrigin() const;
@ -160,7 +160,7 @@ public:
/// \brief Move the object by a given offset /// \brief Move the object by a given offset
/// ///
/// This function adds to the current position of the object, /// This function adds to the current position of the object,
/// unlike setPosition which overwrites it. /// unlike `setPosition` which overwrites it.
/// Thus, it is equivalent to the following code: /// Thus, it is equivalent to the following code:
/// \code /// \code
/// object.setPosition(object.getPosition() + offset); /// object.setPosition(object.getPosition() + offset);
@ -168,7 +168,7 @@ public:
/// ///
/// \param offset Offset /// \param offset Offset
/// ///
/// \see setPosition /// \see `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void move(Vector2f offset); void move(Vector2f offset);
@ -177,7 +177,7 @@ public:
/// \brief Rotate the object /// \brief Rotate the object
/// ///
/// This function adds to the current rotation of the object, /// This function adds to the current rotation of the object,
/// unlike setRotation which overwrites it. /// unlike `setRotation` which overwrites it.
/// Thus, it is equivalent to the following code: /// Thus, it is equivalent to the following code:
/// \code /// \code
/// object.setRotation(object.getRotation() + angle); /// object.setRotation(object.getRotation() + angle);
@ -192,7 +192,7 @@ public:
/// \brief Scale the object /// \brief Scale the object
/// ///
/// This function multiplies the current scale of the object, /// This function multiplies the current scale of the object,
/// unlike setScale which overwrites it. /// unlike `setScale` which overwrites it.
/// Thus, it is equivalent to the following code: /// Thus, it is equivalent to the following code:
/// \code /// \code
/// sf::Vector2f scale = object.getScale(); /// sf::Vector2f scale = object.getScale();
@ -201,7 +201,7 @@ public:
/// ///
/// \param factor Scale factors /// \param factor Scale factors
/// ///
/// \see setScale /// \see `setScale`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void scale(Vector2f factor); void scale(Vector2f factor);
@ -211,7 +211,7 @@ public:
/// ///
/// \return Transform combining the position/rotation/scale/origin of the object /// \return Transform combining the position/rotation/scale/origin of the object
/// ///
/// \see getInverseTransform /// \see `getInverseTransform`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Transform& getTransform() const; [[nodiscard]] const Transform& getTransform() const;
@ -221,7 +221,7 @@ public:
/// ///
/// \return Inverse of the combined transformations applied to the object /// \return Inverse of the combined transformations applied to the object
/// ///
/// \see getTransform /// \see `getTransform`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Transform& getInverseTransform() const; [[nodiscard]] const Transform& getInverseTransform() const;
@ -247,9 +247,9 @@ private:
/// \class sf::Transformable /// \class sf::Transformable
/// \ingroup graphics /// \ingroup graphics
/// ///
/// This class is provided for convenience, on top of sf::Transform. /// This class is provided for convenience, on top of `sf::Transform`.
/// ///
/// sf::Transform, as a low-level class, offers a great level of /// `sf::Transform`, as a low-level class, offers a great level of
/// flexibility but it is not always convenient to manage. Indeed, /// flexibility but it is not always convenient to manage. Indeed,
/// one can easily combine any kind of operation, such as a translation /// one can easily combine any kind of operation, such as a translation
/// followed by a rotation followed by a scaling, but once the result /// followed by a rotation followed by a scaling, but once the result
@ -261,13 +261,13 @@ private:
/// rotation. This is a tedious operation, and it requires to store /// rotation. This is a tedious operation, and it requires to store
/// all the individual components of the final transform. /// all the individual components of the final transform.
/// ///
/// That's exactly what sf::Transformable was written for: it hides /// That's exactly what `sf::Transformable` was written for: it hides
/// these variables and the composed transform behind an easy to use /// these variables and the composed transform behind an easy to use
/// interface. You can set or get any of the individual components /// interface. You can set or get any of the individual components
/// without worrying about the others. It also provides the composed /// without worrying about the others. It also provides the composed
/// transform (as a sf::Transform), and keeps it up-to-date. /// transform (as a `sf::Transform`), and keeps it up-to-date.
/// ///
/// In addition to the position, rotation and scale, sf::Transformable /// In addition to the position, rotation and scale, `sf::Transformable`
/// provides an "origin" component, which represents the local origin /// provides an "origin" component, which represents the local origin
/// of the three other components. Let's take an example with a 10x10 /// of the three other components. Let's take an example with a 10x10
/// pixels sprite. By default, the sprite is positioned/rotated/scaled /// pixels sprite. By default, the sprite is positioned/rotated/scaled
@ -277,13 +277,13 @@ private:
/// we set the origin to (10, 10), it will be transformed around its /// we set the origin to (10, 10), it will be transformed around its
/// bottom-right corner. /// bottom-right corner.
/// ///
/// To keep the sf::Transformable class simple, there's only one /// To keep the `sf::Transformable` class simple, there's only one
/// origin for all the components. You cannot position the sprite /// origin for all the components. You cannot position the sprite
/// relatively to its top-left corner while rotating it around its /// relatively to its top-left corner while rotating it around its
/// center, for example. To do such things, use sf::Transform directly. /// center, for example. To do such things, use `sf::Transform` directly.
/// ///
/// sf::Transformable can be used as a base class. It is often /// `sf::Transformable` can be used as a base class. It is often
/// combined with sf::Drawable -- that's what SFML's sprites, /// combined with `sf::Drawable` -- that's what SFML's sprites,
/// texts and shapes do. /// texts and shapes do.
/// \code /// \code
/// class MyEntity : public sf::Transformable, public sf::Drawable /// class MyEntity : public sf::Transformable, public sf::Drawable
@ -328,13 +328,13 @@ private:
/// such as sprites or texts when rendering. While this allows transitions /// such as sprites or texts when rendering. While this allows transitions
/// like slow movements or rotations to appear smoothly, it can lead to /// like slow movements or rotations to appear smoothly, it can lead to
/// unwanted results in some cases, for example blurred or distorted objects. /// unwanted results in some cases, for example blurred or distorted objects.
/// In order to render a sf::Drawable object pixel-perfectly, make sure /// In order to render a `sf::Drawable` object pixel-perfectly, make sure
/// the involved coordinates allow a 1:1 mapping of pixels in the window /// the involved coordinates allow a 1:1 mapping of pixels in the window
/// to texels (pixels in the texture). More specifically, this means: /// to texels (pixels in the texture). More specifically, this means:
/// * The object's position, origin and scale have no fractional part /// * The object's position, origin and scale have no fractional part
/// * The object's and the view's rotation are a multiple of 90 degrees /// * The object's and the view's rotation are a multiple of 90 degrees
/// * The view's center and size have no fractional part /// * The view's center and size have no fractional part
/// ///
/// \see sf::Transform /// \see `sf::Transform`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -113,10 +113,10 @@ struct Vertex
/// \endcode /// \endcode
/// ///
/// ///
/// Note: although texture coordinates are supposed to be an integer /// Note: Although texture coordinates are supposed to be an integer
/// amount of pixels, their type is float because of some buggy graphics /// amount of pixels, their type is float because of some buggy graphics
/// drivers that are not able to process integer coordinates correctly. /// drivers that are not able to process integer coordinates correctly.
/// ///
/// \see sf::VertexArray /// \see `sf::VertexArray`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -79,15 +79,15 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get a read-write access to a vertex by its index /// \brief Get a read-write access to a vertex by its index
/// ///
/// This function doesn't check \a index, it must be in range /// This function doesn't check \a `index`, it must be in range
/// [0, getVertexCount() - 1]. The behavior is undefined /// [0, `getVertexCount()` - 1]. The behavior is undefined
/// otherwise. /// otherwise.
/// ///
/// \param index Index of the vertex to get /// \param index Index of the vertex to get
/// ///
/// \return Reference to the index-th vertex /// \return Reference to the index-th vertex
/// ///
/// \see getVertexCount /// \see `getVertexCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vertex& operator[](std::size_t index); [[nodiscard]] Vertex& operator[](std::size_t index);
@ -95,15 +95,15 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get a read-only access to a vertex by its index /// \brief Get a read-only access to a vertex by its index
/// ///
/// This function doesn't check \a index, it must be in range /// This function doesn't check \a `index`, it must be in range
/// [0, getVertexCount() - 1]. The behavior is undefined /// [0, `getVertexCount()` - 1]. The behavior is undefined
/// otherwise. /// otherwise.
/// ///
/// \param index Index of the vertex to get /// \param index Index of the vertex to get
/// ///
/// \return Const reference to the index-th vertex /// \return Const reference to the index-th vertex
/// ///
/// \see getVertexCount /// \see `getVertexCount`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Vertex& operator[](std::size_t index) const; [[nodiscard]] const Vertex& operator[](std::size_t index) const;
@ -122,10 +122,10 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Resize the vertex array /// \brief Resize the vertex array
/// ///
/// If \a vertexCount is greater than the current size, the previous /// If \a `vertexCount` is greater than the current size, the previous
/// vertices are kept and new (default-constructed) vertices are /// vertices are kept and new (default-constructed) vertices are
/// added. /// added.
/// If \a vertexCount is less than the current size, existing vertices /// If \a `vertexCount` is less than the current size, existing vertices
/// are removed from the array. /// are removed from the array.
/// ///
/// \param vertexCount New size of the array (number of vertices) /// \param vertexCount New size of the array (number of vertices)
@ -149,7 +149,7 @@ public:
/// \li As points /// \li As points
/// \li As lines /// \li As lines
/// \li As triangles /// \li As triangles
/// The default primitive type is sf::PrimitiveType::Points. /// The default primitive type is `sf::PrimitiveType::Points`.
/// ///
/// \param type Type of primitive /// \param type Type of primitive
/// ///
@ -199,10 +199,10 @@ private:
/// \class sf::VertexArray /// \class sf::VertexArray
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::VertexArray is a very simple wrapper around a dynamic /// `sf::VertexArray` is a very simple wrapper around a dynamic
/// array of vertices and a primitives type. /// array of vertices and a primitives type.
/// ///
/// It inherits sf::Drawable, but unlike other drawables it /// It inherits `sf::Drawable`, but unlike other drawables it
/// is not transformable. /// is not transformable.
/// ///
/// Example: /// Example:
@ -216,6 +216,6 @@ private:
/// window.draw(lines); /// window.draw(lines);
/// \endcode /// \endcode
/// ///
/// \see sf::Vertex /// \see `sf::Vertex`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -76,7 +76,7 @@ public:
VertexBuffer() = default; VertexBuffer() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a VertexBuffer with a specific PrimitiveType /// \brief Construct a `VertexBuffer` with a specific `PrimitiveType`
/// ///
/// Creates an empty vertex buffer and sets its primitive type to \p type. /// Creates an empty vertex buffer and sets its primitive type to \p type.
/// ///
@ -86,7 +86,7 @@ public:
explicit VertexBuffer(PrimitiveType type); explicit VertexBuffer(PrimitiveType type);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a VertexBuffer with a specific usage specifier /// \brief Construct a `VertexBuffer` with a specific usage specifier
/// ///
/// Creates an empty vertex buffer and sets its usage to \p usage. /// Creates an empty vertex buffer and sets its usage to \p usage.
/// ///
@ -96,7 +96,7 @@ public:
explicit VertexBuffer(Usage usage); explicit VertexBuffer(Usage usage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a VertexBuffer with a specific PrimitiveType and usage specifier /// \brief Construct a `VertexBuffer` with a specific `PrimitiveType` and usage specifier
/// ///
/// Creates an empty vertex buffer and sets its primitive type /// Creates an empty vertex buffer and sets its primitive type
/// to \p type and usage to \p usage. /// to \p type and usage to \p usage.
@ -125,16 +125,16 @@ public:
/// \brief Create the vertex buffer /// \brief Create the vertex buffer
/// ///
/// Creates the vertex buffer and allocates enough graphics /// Creates the vertex buffer and allocates enough graphics
/// memory to hold \p vertexCount vertices. Any previously /// memory to hold \a `vertexCount` vertices. Any previously
/// allocated memory is freed in the process. /// allocated memory is freed in the process.
/// ///
/// In order to deallocate previously allocated memory pass 0 /// In order to deallocate previously allocated memory pass 0
/// as \p vertexCount. Don't forget to recreate with a non-zero /// as \a `vertexCount`. Don't forget to recreate with a non-zero
/// value when graphics memory should be allocated again. /// value when graphics memory should be allocated again.
/// ///
/// \param vertexCount Number of vertices worth of memory to allocate /// \param vertexCount Number of vertices worth of memory to allocate
/// ///
/// \return True if creation was successful /// \return `true` if creation was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool create(std::size_t vertexCount); [[nodiscard]] bool create(std::size_t vertexCount);
@ -150,19 +150,19 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Update the whole buffer from an array of vertices /// \brief Update the whole buffer from an array of vertices
/// ///
/// The \a vertex array is assumed to have the same size as /// The vertex array is assumed to have the same size as
/// the \a created buffer. /// the created buffer.
/// ///
/// No additional check is performed on the size of the vertex /// No additional check is performed on the size of the vertex
/// array. Passing invalid arguments will lead to undefined /// array. Passing invalid arguments will lead to undefined
/// behavior. /// behavior.
/// ///
/// This function does nothing if \a vertices is null or if the /// This function does nothing if \a `vertices` is null or if the
/// buffer was not previously created. /// buffer was not previously created.
/// ///
/// \param vertices Array of vertices to copy to the buffer /// \param vertices Array of vertices to copy to the buffer
/// ///
/// \return True if the update was successful /// \return `true` if the update was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool update(const Vertex* vertices); [[nodiscard]] bool update(const Vertex* vertices);
@ -170,21 +170,21 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Update a part of the buffer from an array of vertices /// \brief Update a part of the buffer from an array of vertices
/// ///
/// \p offset is specified as the number of vertices to skip /// \a `offset` is specified as the number of vertices to skip
/// from the beginning of the buffer. /// from the beginning of the buffer.
/// ///
/// If \p offset is 0 and \p vertexCount is equal to the size of /// If \a `offset` is 0 and \a `vertexCount` is equal to the size of
/// the currently created buffer, its whole contents are replaced. /// the currently created buffer, its whole contents are replaced.
/// ///
/// If \p offset is 0 and \p vertexCount is greater than the /// If \a `offset` is 0 and \a `vertexCount` is greater than the
/// size of the currently created buffer, a new buffer is created /// size of the currently created buffer, a new buffer is created
/// containing the vertex data. /// containing the vertex data.
/// ///
/// If \p offset is 0 and \p vertexCount is less than the size of /// If \a `offset` is 0 and \a `vertexCount` is less than the size of
/// the currently created buffer, only the corresponding region /// the currently created buffer, only the corresponding region
/// is updated. /// is updated.
/// ///
/// If \p offset is not 0 and \p offset + \p vertexCount is greater /// If \a `offset` is not 0 and \a `offset` + \a `vertexCount` is greater
/// than the size of the currently created buffer, the update fails. /// than the size of the currently created buffer, the update fails.
/// ///
/// No additional check is performed on the size of the vertex /// No additional check is performed on the size of the vertex
@ -195,7 +195,7 @@ public:
/// \param vertexCount Number of vertices to copy /// \param vertexCount Number of vertices to copy
/// \param offset Offset in the buffer to copy to /// \param offset Offset in the buffer to copy to
/// ///
/// \return True if the update was successful /// \return `true` if the update was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool update(const Vertex* vertices, std::size_t vertexCount, unsigned int offset); [[nodiscard]] bool update(const Vertex* vertices, std::size_t vertexCount, unsigned int offset);
@ -205,7 +205,7 @@ public:
/// ///
/// \param vertexBuffer Vertex buffer whose contents to copy into this vertex buffer /// \param vertexBuffer Vertex buffer whose contents to copy into this vertex buffer
/// ///
/// \return True if the copy was successful /// \return `true` if the copy was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool update(const VertexBuffer& vertexBuffer); [[nodiscard]] bool update(const VertexBuffer& vertexBuffer);
@ -246,7 +246,7 @@ public:
/// This function defines how the vertices must be interpreted /// This function defines how the vertices must be interpreted
/// when it's time to draw them. /// when it's time to draw them.
/// ///
/// The default primitive type is sf::PrimitiveType::Points. /// The default primitive type is `sf::PrimitiveType::Points`.
/// ///
/// \param type Type of primitive /// \param type Type of primitive
/// ///
@ -271,7 +271,7 @@ public:
/// to be updated with new data for the usage specifier to /// to be updated with new data for the usage specifier to
/// take effect. /// take effect.
/// ///
/// The default usage type is sf::VertexBuffer::Usage::Stream. /// The default usage type is `sf::VertexBuffer::Usage::Stream`.
/// ///
/// \param usage Usage specifier /// \param usage Usage specifier
/// ///
@ -291,7 +291,7 @@ public:
/// ///
/// This function is not part of the graphics API, it mustn't be /// This function is not part of the graphics API, it mustn't be
/// used when drawing SFML entities. It must be used only if you /// used when drawing SFML entities. It must be used only if you
/// mix sf::VertexBuffer with OpenGL code. /// mix `sf::VertexBuffer` with OpenGL code.
/// ///
/// \code /// \code
/// sf::VertexBuffer vb1, vb2; /// sf::VertexBuffer vb1, vb2;
@ -313,10 +313,10 @@ public:
/// \brief Tell whether or not the system supports vertex buffers /// \brief Tell whether or not the system supports vertex buffers
/// ///
/// This function should always be called before using /// This function should always be called before using
/// the vertex buffer features. If it returns false, then /// the vertex buffer features. If it returns `false`, then
/// any attempt to use sf::VertexBuffer will fail. /// any attempt to use `sf::VertexBuffer` will fail.
/// ///
/// \return True if vertex buffers are supported, false otherwise /// \return `true` if vertex buffers are supported, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool isAvailable(); [[nodiscard]] static bool isAvailable();
@ -356,21 +356,21 @@ SFML_GRAPHICS_API void swap(VertexBuffer& left, VertexBuffer& right) noexcept;
/// \class sf::VertexBuffer /// \class sf::VertexBuffer
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::VertexBuffer is a simple wrapper around a dynamic /// `sf::VertexBuffer` is a simple wrapper around a dynamic
/// buffer of vertices and a primitives type. /// buffer of vertices and a primitives type.
/// ///
/// Unlike sf::VertexArray, the vertex data is stored in /// Unlike `sf::VertexArray`, the vertex data is stored in
/// graphics memory. /// graphics memory.
/// ///
/// In situations where a large amount of vertex data would /// In situations where a large amount of vertex data would
/// have to be transferred from system memory to graphics memory /// have to be transferred from system memory to graphics memory
/// every frame, using sf::VertexBuffer can help. By using a /// every frame, using `sf::VertexBuffer` can help. By using a
/// sf::VertexBuffer, data that has not been changed between frames /// `sf::VertexBuffer`, data that has not been changed between frames
/// does not have to be re-transferred from system to graphics /// does not have to be re-transferred from system to graphics
/// memory as would be the case with sf::VertexArray. If data transfer /// memory as would be the case with `sf::VertexArray`. If data transfer
/// is a bottleneck, this can lead to performance gains. /// is a bottleneck, this can lead to performance gains.
/// ///
/// Using sf::VertexBuffer, the user also has the ability to only modify /// Using `sf::VertexBuffer`, the user also has the ability to only modify
/// a portion of the buffer in graphics memory. This way, a large buffer /// a portion of the buffer in graphics memory. This way, a large buffer
/// can be allocated at the start of the application and only the /// can be allocated at the start of the application and only the
/// applicable portions of it need to be updated during the course of /// applicable portions of it need to be updated during the course of
@ -395,7 +395,7 @@ SFML_GRAPHICS_API void swap(VertexBuffer& left, VertexBuffer& right) noexcept;
/// pending data transfers complete before the vertex buffer is sourced /// pending data transfers complete before the vertex buffer is sourced
/// by the rendering pipeline. /// by the rendering pipeline.
/// ///
/// It inherits sf::Drawable, but unlike other drawables it /// It inherits `sf::Drawable`, but unlike other drawables it
/// is not transformable. /// is not transformable.
/// ///
/// Example: /// Example:
@ -409,6 +409,6 @@ SFML_GRAPHICS_API void swap(VertexBuffer& left, VertexBuffer& right) noexcept;
/// window.draw(triangles); /// window.draw(triangles);
/// \endcode /// \endcode
/// ///
/// \see sf::Vertex, sf::VertexArray /// \see `sf::Vertex`, `sf::VertexArray`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -75,7 +75,7 @@ public:
/// ///
/// \param center New center /// \param center New center
/// ///
/// \see setSize, getCenter /// \see `setSize`, `getCenter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setCenter(Vector2f center); void setCenter(Vector2f center);
@ -85,7 +85,7 @@ public:
/// ///
/// \param size New size /// \param size New size
/// ///
/// \see setCenter, getCenter /// \see `setCenter`, `getCenter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSize(Vector2f size); void setSize(Vector2f size);
@ -97,7 +97,7 @@ public:
/// ///
/// \param angle New angle /// \param angle New angle
/// ///
/// \see getRotation /// \see `getRotation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setRotation(Angle angle); void setRotation(Angle angle);
@ -109,12 +109,12 @@ public:
/// view are displayed, expressed as a factor (between 0 and 1) /// view are displayed, expressed as a factor (between 0 and 1)
/// of the size of the RenderTarget to which the view is applied. /// of the size of the RenderTarget to which the view is applied.
/// For example, a view which takes the left side of the target would /// For example, a view which takes the left side of the target would
/// be defined with View.setViewport(sf::FloatRect({0.f, 0.f}, {0.5f, 1.f})). /// be defined with `view.setViewport(sf::FloatRect({0.f, 0.f}, {0.5f, 1.f}))`.
/// By default, a view has a viewport which covers the entire target. /// By default, a view has a viewport which covers the entire target.
/// ///
/// \param viewport New viewport rectangle /// \param viewport New viewport rectangle
/// ///
/// \see getViewport /// \see `getViewport`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setViewport(const FloatRect& viewport); void setViewport(const FloatRect& viewport);
@ -129,7 +129,7 @@ public:
/// not be modified by draw or clear operations. /// not be modified by draw or clear operations.
/// For example, a scissor rectangle which only allows modifications /// For example, a scissor rectangle which only allows modifications
/// to the right side of the target would be defined /// to the right side of the target would be defined
/// with View.setScissor(sf::FloatRect({0.5f, 0.f}, {0.5f, 1.f})). /// with `view.setScissor(sf::FloatRect({0.5f, 0.f}, {0.5f, 1.f}))`.
/// By default, a view has a scissor rectangle which allows /// By default, a view has a scissor rectangle which allows
/// modifications to the entire target. This is equivalent to /// modifications to the entire target. This is equivalent to
/// disabling the scissor test entirely. Passing the default /// disabling the scissor test entirely. Passing the default
@ -138,7 +138,7 @@ public:
/// ///
/// \param scissor New scissor rectangle /// \param scissor New scissor rectangle
/// ///
/// \see getScissor /// \see `getScissor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setScissor(const FloatRect& scissor); void setScissor(const FloatRect& scissor);
@ -148,7 +148,7 @@ public:
/// ///
/// \return Center of the view /// \return Center of the view
/// ///
/// \see getSize, setCenter /// \see `getSize`, `setCenter`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getCenter() const; [[nodiscard]] Vector2f getCenter() const;
@ -158,7 +158,7 @@ public:
/// ///
/// \return Size of the view /// \return Size of the view
/// ///
/// \see getCenter, setSize /// \see `getCenter`, `setSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2f getSize() const; [[nodiscard]] Vector2f getSize() const;
@ -168,7 +168,7 @@ public:
/// ///
/// \return Rotation angle of the view /// \return Rotation angle of the view
/// ///
/// \see setRotation /// \see `setRotation`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Angle getRotation() const; [[nodiscard]] Angle getRotation() const;
@ -178,7 +178,7 @@ public:
/// ///
/// \return Viewport rectangle, expressed as a factor of the target size /// \return Viewport rectangle, expressed as a factor of the target size
/// ///
/// \see setViewport /// \see `setViewport`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const FloatRect& getViewport() const; [[nodiscard]] const FloatRect& getViewport() const;
@ -188,7 +188,7 @@ public:
/// ///
/// \return Scissor rectangle, expressed as a factor of the target size /// \return Scissor rectangle, expressed as a factor of the target size
/// ///
/// \see setScissor /// \see `setScissor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const FloatRect& getScissor() const; [[nodiscard]] const FloatRect& getScissor() const;
@ -198,7 +198,7 @@ public:
/// ///
/// \param offset Move offset /// \param offset Move offset
/// ///
/// \see setCenter, rotate, zoom /// \see `setCenter`, `rotate`, `zoom`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void move(Vector2f offset); void move(Vector2f offset);
@ -208,7 +208,7 @@ public:
/// ///
/// \param angle Angle to rotate /// \param angle Angle to rotate
/// ///
/// \see setRotation, move, zoom /// \see `setRotation`, `move`, `zoom`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void rotate(Angle angle); void rotate(Angle angle);
@ -225,7 +225,7 @@ public:
/// ///
/// \param factor Zoom factor to apply /// \param factor Zoom factor to apply
/// ///
/// \see setSize, move, rotate /// \see `setSize`, `move`, `rotate`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void zoom(float factor); void zoom(float factor);
@ -237,7 +237,7 @@ public:
/// ///
/// \return Projection transform defining the view /// \return Projection transform defining the view
/// ///
/// \see getInverseTransform /// \see `getInverseTransform`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Transform& getTransform() const; [[nodiscard]] const Transform& getTransform() const;
@ -249,7 +249,7 @@ public:
/// ///
/// \return Inverse of the projection transform defining the view /// \return Inverse of the projection transform defining the view
/// ///
/// \see getTransform /// \see `getTransform`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const Transform& getInverseTransform() const; [[nodiscard]] const Transform& getInverseTransform() const;
@ -276,7 +276,7 @@ private:
/// \class sf::View /// \class sf::View
/// \ingroup graphics /// \ingroup graphics
/// ///
/// sf::View defines a camera in the 2D scene. This is a /// `sf::View` defines a camera in the 2D scene. This is a
/// very powerful concept: you can scroll, rotate or zoom /// very powerful concept: you can scroll, rotate or zoom
/// the entire scene without altering the way that your /// the entire scene without altering the way that your
/// drawable objects are drawn. /// drawable objects are drawn.
@ -350,8 +350,8 @@ private:
/// window.draw(someText); /// window.draw(someText);
/// \endcode /// \endcode
/// ///
/// See also the note on coordinates and undistorted rendering in sf::Transformable. /// See also the note on coordinates and undistorted rendering in `sf::Transformable`.
/// ///
/// \see sf::RenderWindow, sf::RenderTexture /// \see `sf::RenderWindow`, `sf::RenderTexture`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -151,7 +151,7 @@ public:
/// This function is defined for convenience, it is /// This function is defined for convenience, it is
/// equivalent to testing if the status code is < 400. /// equivalent to testing if the status code is < 400.
/// ///
/// \return True if the status is a success, false if it is a failure /// \return `true` if the status is a success, `false` if it is a failure
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isOk() const; [[nodiscard]] bool isOk() const;
@ -213,7 +213,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Specialization of FTP response returning a /// \brief Specialization of FTP response returning a
/// filename listing /// file name listing
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_NETWORK_API ListingResponse : public Response class SFML_NETWORK_API ListingResponse : public Response
{ {
@ -278,7 +278,7 @@ public:
/// This function tries to connect to the server so it may take /// This function tries to connect to the server so it may take
/// a while to complete, especially if the server is not /// a while to complete, especially if the server is not
/// reachable. To avoid blocking your application for too long, /// reachable. To avoid blocking your application for too long,
/// you can use a timeout. The default value, Time::Zero, means that the /// you can use a timeout. The default value, `Time::Zero`, means that the
/// system timeout will be used (which is usually pretty long). /// system timeout will be used (which is usually pretty long).
/// ///
/// \param server Name or address of the FTP server to connect to /// \param server Name or address of the FTP server to connect to
@ -287,7 +287,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see disconnect /// \see `disconnect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response connect(IpAddress server, unsigned short port = 21, Time timeout = Time::Zero); [[nodiscard]] Response connect(IpAddress server, unsigned short port = 21, Time timeout = Time::Zero);
@ -297,7 +297,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see connect /// \see `connect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response disconnect(); [[nodiscard]] Response disconnect();
@ -346,7 +346,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see getDirectoryListing, changeDirectory, parentDirectory /// \see `getDirectoryListing`, `changeDirectory`, `parentDirectory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] DirectoryResponse getWorkingDirectory(); [[nodiscard]] DirectoryResponse getWorkingDirectory();
@ -356,14 +356,14 @@ public:
/// ///
/// This function retrieves the sub-directories and files /// This function retrieves the sub-directories and files
/// contained in the given directory. It is not recursive. /// contained in the given directory. It is not recursive.
/// The \a directory parameter is relative to the current /// The \a `directory` parameter is relative to the current
/// working directory. /// working directory.
/// ///
/// \param directory Directory to list /// \param directory Directory to list
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see getWorkingDirectory, changeDirectory, parentDirectory /// \see `getWorkingDirectory`, `changeDirectory`, `parentDirectory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] ListingResponse getDirectoryListing(const std::string& directory = ""); [[nodiscard]] ListingResponse getDirectoryListing(const std::string& directory = "");
@ -377,7 +377,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see getWorkingDirectory, getDirectoryListing, parentDirectory /// \see `getWorkingDirectory`, `getDirectoryListing`, `parentDirectory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response changeDirectory(const std::string& directory); [[nodiscard]] Response changeDirectory(const std::string& directory);
@ -387,7 +387,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see getWorkingDirectory, getDirectoryListing, changeDirectory /// \see `getWorkingDirectory`, `getDirectoryListing`, `changeDirectory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response parentDirectory(); [[nodiscard]] Response parentDirectory();
@ -402,7 +402,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see deleteDirectory /// \see `deleteDirectory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response createDirectory(const std::string& name); [[nodiscard]] Response createDirectory(const std::string& name);
@ -419,7 +419,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see createDirectory /// \see `createDirectory`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response deleteDirectory(const std::string& name); [[nodiscard]] Response deleteDirectory(const std::string& name);
@ -427,7 +427,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Rename an existing file /// \brief Rename an existing file
/// ///
/// The filenames must be relative to the current working /// The file names must be relative to the current working
/// directory. /// directory.
/// ///
/// \param file File to rename /// \param file File to rename
@ -435,7 +435,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see deleteFile /// \see `deleteFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response renameFile(const std::filesystem::path& file, const std::filesystem::path& newName); [[nodiscard]] Response renameFile(const std::filesystem::path& file, const std::filesystem::path& newName);
@ -452,7 +452,7 @@ public:
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see renameFile /// \see `renameFile`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response deleteFile(const std::filesystem::path& name); [[nodiscard]] Response deleteFile(const std::filesystem::path& name);
@ -460,21 +460,21 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Download a file from the server /// \brief Download a file from the server
/// ///
/// The filename of the distant file is relative to the /// The file name of the distant file is relative to the
/// current working directory of the server, and the local /// current working directory of the server, and the local
/// destination path is relative to the current directory /// destination path is relative to the current directory
/// of your application. /// of your application.
/// If a file with the same filename as the distant file /// If a file with the same file name as the distant file
/// already exists in the local destination path, it will /// already exists in the local destination path, it will
/// be overwritten. /// be overwritten.
/// ///
/// \param remoteFile Filename of the distant file to download /// \param remoteFile File name of the distant file to download
/// \param localPath The directory in which to put the file on the local computer /// \param localPath The directory in which to put the file on the local computer
/// \param mode Transfer mode /// \param mode Transfer mode
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see upload /// \see `upload`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response download(const std::filesystem::path& remoteFile, [[nodiscard]] Response download(const std::filesystem::path& remoteFile,
@ -495,11 +495,11 @@ public:
/// \param localFile Path of the local file to upload /// \param localFile Path of the local file to upload
/// \param remotePath The directory in which to put the file on the server /// \param remotePath The directory in which to put the file on the server
/// \param mode Transfer mode /// \param mode Transfer mode
/// \param append Pass true to append to or false to overwrite the remote file if it already exists /// \param append Pass `true` to append to or `false` to overwrite the remote file if it already exists
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
/// \see download /// \see `download`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Response upload(const std::filesystem::path& localFile, [[nodiscard]] Response upload(const std::filesystem::path& localFile,
@ -511,11 +511,11 @@ public:
/// \brief Send a command to the FTP server /// \brief Send a command to the FTP server
/// ///
/// While the most often used commands are provided as member /// While the most often used commands are provided as member
/// functions in the sf::Ftp class, this method can be used /// functions in the `sf::Ftp` class, this method can be used
/// to send any FTP command to the server. If the command /// to send any FTP command to the server. If the command
/// requires one or more parameters, they can be specified /// requires one or more parameters, they can be specified
/// in \a parameter. If the server returns information, you /// in \a `parameter`. If the server returns information, you
/// can extract it from the response using Response::getMessage(). /// can extract it from the response using `Response::getMessage()`.
/// ///
/// \param command Command to send /// \param command Command to send
/// \param parameter Command parameter /// \param parameter Command parameter
@ -530,7 +530,7 @@ private:
/// \brief Receive a response from the server /// \brief Receive a response from the server
/// ///
/// This function must be called after each call to /// This function must be called after each call to
/// sendCommand that expects a response. /// `sendCommand` that expects a response.
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
@ -560,7 +560,7 @@ private:
/// \class sf::Ftp /// \class sf::Ftp
/// \ingroup network /// \ingroup network
/// ///
/// sf::Ftp is a very simple FTP client that allows you /// `sf::Ftp` is a very simple FTP client that allows you
/// to communicate with a FTP server. The FTP protocol allows /// to communicate with a FTP server. The FTP protocol allows
/// you to manipulate a remote file system (list files, /// you to manipulate a remote file system (list files,
/// upload, download, create, remove, ...). /// upload, download, create, remove, ...).
@ -573,11 +573,11 @@ private:
/// ///
/// Every command returns a FTP response, which contains the /// Every command returns a FTP response, which contains the
/// status code as well as a message from the server. Some /// status code as well as a message from the server. Some
/// commands such as getWorkingDirectory() and getDirectoryListing() /// commands such as `getWorkingDirectory()` and `getDirectoryListing()`
/// return additional data, and use a class derived from /// return additional data, and use a class derived from
/// sf::Ftp::Response to provide this data. The most often used /// `sf::Ftp::Response` to provide this data. The most often used
/// commands are directly provided as member functions, but it is /// commands are directly provided as member functions, but it is
/// also possible to use specific commands with the sendCommand() function. /// also possible to use specific commands with the `sendCommand()` function.
/// ///
/// Note that response statuses >= 1000 are not part of the FTP standard, /// Note that response statuses >= 1000 are not part of the FTP standard,
/// they are generated by SFML when an internal error occurs. /// they are generated by SFML when an internal error occurs.

View File

@ -102,7 +102,7 @@ public:
/// ///
/// See the Method enumeration for a complete list of all /// See the Method enumeration for a complete list of all
/// the available methods. /// the available methods.
/// The method is Http::Request::Method::Get by default. /// The method is `Http::Request::Method::Get` by default.
/// ///
/// \param method Method to use for the request /// \param method Method to use for the request
/// ///
@ -165,7 +165,7 @@ public:
/// ///
/// \param field Name of the field to test /// \param field Name of the field to test
/// ///
/// \return True if the field exists, false otherwise /// \return `true` if the field exists, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool hasField(const std::string& field) const; [[nodiscard]] bool hasField(const std::string& field) const;
@ -236,7 +236,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the value of a field /// \brief Get the value of a field
/// ///
/// If the field \a field is not found in the response header, /// If the field \a `field` is not found in the response header,
/// the empty string is returned. This function uses /// the empty string is returned. This function uses
/// case-insensitive comparisons. /// case-insensitive comparisons.
/// ///
@ -265,7 +265,7 @@ public:
/// ///
/// \return Major HTTP version number /// \return Major HTTP version number
/// ///
/// \see getMinorHttpVersion /// \see `getMinorHttpVersion`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned int getMajorHttpVersion() const; [[nodiscard]] unsigned int getMajorHttpVersion() const;
@ -275,7 +275,7 @@ public:
/// ///
/// \return Minor HTTP version number /// \return Minor HTTP version number
/// ///
/// \see getMajorHttpVersion /// \see `getMajorHttpVersion`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned int getMinorHttpVersion() const; [[nodiscard]] unsigned int getMinorHttpVersion() const;
@ -300,7 +300,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the header from a response string /// \brief Construct the header from a response string
/// ///
/// This function is used by Http to build the response /// This function is used by `Http` to build the response
/// of a request. /// of a request.
/// ///
/// \param data Content of the response to parse /// \param data Content of the response to parse
@ -312,7 +312,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Read values passed in the answer header /// \brief Read values passed in the answer header
/// ///
/// This function is used by Http to extract values passed /// This function is used by `Http` to extract values passed
/// in the response. /// in the response.
/// ///
/// \param in String stream containing the header values /// \param in String stream containing the header values
@ -344,7 +344,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the HTTP client with the target host /// \brief Construct the HTTP client with the target host
/// ///
/// This is equivalent to calling setHost(host, port). /// This is equivalent to calling `setHost(host, port)`.
/// The port has a default value of 0, which means that the /// The port has a default value of 0, which means that the
/// HTTP client will use the right port according to the /// HTTP client will use the right port according to the
/// protocol used (80 for HTTP). You should leave it like /// protocol used (80 for HTTP). You should leave it like
@ -389,13 +389,13 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Send a HTTP request and return the server's response. /// \brief Send a HTTP request and return the server's response.
/// ///
/// You must have a valid host before sending a request (see setHost). /// You must have a valid host before sending a request (see `setHost`).
/// Any missing mandatory header field in the request will be added /// Any missing mandatory header field in the request will be added
/// with an appropriate value. /// with an appropriate value.
/// Warning: this function waits for the server's response and may /// Warning: this function waits for the server's response and may
/// not return instantly; use a thread if you don't want to block your /// not return instantly; use a thread if you don't want to block your
/// application, or use a timeout to limit the time to wait. A value /// application, or use a timeout to limit the time to wait. A value
/// of Time::Zero means that the client will use the system default timeout /// of `Time::Zero` means that the client will use the system default timeout
/// (which is usually pretty long). /// (which is usually pretty long).
/// ///
/// \param request Request to send /// \param request Request to send
@ -423,32 +423,32 @@ private:
/// \class sf::Http /// \class sf::Http
/// \ingroup network /// \ingroup network
/// ///
/// sf::Http is a very simple HTTP client that allows you /// `sf::Http` is a very simple HTTP client that allows you
/// to communicate with a web server. You can retrieve /// to communicate with a web server. You can retrieve
/// web pages, send data to an interactive resource, /// web pages, send data to an interactive resource,
/// download a remote file, etc. The HTTPS protocol is /// download a remote file, etc. The HTTPS protocol is
/// not supported. /// not supported.
/// ///
/// The HTTP client is split into 3 classes: /// The HTTP client is split into 3 classes:
/// \li sf::Http::Request /// \li `sf::Http::Request`
/// \li sf::Http::Response /// \li `sf::Http::Response`
/// \li sf::Http /// \li `sf::Http`
/// ///
/// sf::Http::Request builds the request that will be /// `sf::Http::Request` builds the request that will be
/// sent to the server. A request is made of: /// sent to the server. A request is made of:
/// \li a method (what you want to do) /// \li a method (what you want to do)
/// \li a target URI (usually the name of the web page or file) /// \li a target URI (usually the name of the web page or file)
/// \li one or more header fields (options that you can pass to the server) /// \li one or more header fields (options that you can pass to the server)
/// \li an optional body (for POST requests) /// \li an optional body (for POST requests)
/// ///
/// sf::Http::Response parse the response from the web server /// `sf::Http::Response` parse the response from the web server
/// and provides getters to read them. The response contains: /// and provides getters to read them. The response contains:
/// \li a status code /// \li a status code
/// \li header fields (that may be answers to the ones that you requested) /// \li header fields (that may be answers to the ones that you requested)
/// \li a body, which contains the contents of the requested resource /// \li a body, which contains the contents of the requested resource
/// ///
/// sf::Http provides a simple function, SendRequest, to send a /// `sf::Http` provides a simple function, SendRequest, to send a
/// sf::Http::Request and return the corresponding sf::Http::Response /// `sf::Http::Request` and return the corresponding `sf::Http::Response`
/// from the server. /// from the server.
/// ///
/// Usage example: /// Usage example:

View File

@ -64,8 +64,8 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the address from 4 bytes /// \brief Construct the address from 4 bytes
/// ///
/// Calling IpAddress(a, b, c, d) is equivalent to calling /// Calling `IpAddress(a, b, c, d)` is equivalent to calling
/// IpAddress::resolve("a.b.c.d"), but safer as it doesn't /// `IpAddress::resolve("a.b.c.d")`, but safer as it doesn't
/// have to parse a string to get the address components. /// have to parse a string to get the address components.
/// ///
/// \param byte0 First byte of the address /// \param byte0 First byte of the address
@ -82,11 +82,11 @@ public:
/// This constructor uses the internal representation of /// This constructor uses the internal representation of
/// the address directly. It should be used for optimization /// the address directly. It should be used for optimization
/// purposes, and only if you got that representation from /// purposes, and only if you got that representation from
/// IpAddress::toInteger(). /// `IpAddress::toInteger()`.
/// ///
/// \param address 4 bytes of the address packed into a 32-bits integer /// \param address 4 bytes of the address packed into a 32-bits integer
/// ///
/// \see toInteger /// \see `toInteger`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit IpAddress(std::uint32_t address); explicit IpAddress(std::uint32_t address);
@ -100,7 +100,7 @@ public:
/// ///
/// \return String representation of the address /// \return String representation of the address
/// ///
/// \see toInteger /// \see `toInteger`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::string toString() const; [[nodiscard]] std::string toString() const;
@ -112,11 +112,11 @@ public:
/// address, and should be used for optimization purposes only /// address, and should be used for optimization purposes only
/// (like sending the address through a socket). /// (like sending the address through a socket).
/// The integer produced by this function can then be converted /// The integer produced by this function can then be converted
/// back to a sf::IpAddress with the proper constructor. /// back to a `sf::IpAddress` with the proper constructor.
/// ///
/// \return 32-bits unsigned integer representation of the address /// \return 32-bits unsigned integer representation of the address
/// ///
/// \see toString /// \see `toString`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::uint32_t toInteger() const; [[nodiscard]] std::uint32_t toInteger() const;
@ -132,7 +132,7 @@ public:
/// ///
/// \return Local IP address of the computer on success, `std::nullopt` otherwise /// \return Local IP address of the computer on success, `std::nullopt` otherwise
/// ///
/// \see getPublicAddress /// \see `getPublicAddress`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static std::optional<IpAddress> getLocalAddress(); [[nodiscard]] static std::optional<IpAddress> getLocalAddress();
@ -156,7 +156,7 @@ public:
/// ///
/// \return Public IP address of the computer on success, `std::nullopt` otherwise /// \return Public IP address of the computer on success, `std::nullopt` otherwise
/// ///
/// \see getLocalAddress /// \see `getLocalAddress`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static std::optional<IpAddress> getPublicAddress(Time timeout = Time::Zero); [[nodiscard]] static std::optional<IpAddress> getPublicAddress(Time timeout = Time::Zero);
@ -180,73 +180,73 @@ private:
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of == operator to compare two IP addresses /// \brief Overload of `operator==` to compare two IP addresses
/// ///
/// \param left Left operand (a IP address) /// \param left Left operand (a IP address)
/// \param right Right operand (a IP address) /// \param right Right operand (a IP address)
/// ///
/// \return True if both addresses are equal /// \return `true` if both addresses are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_NETWORK_API bool operator==(IpAddress left, IpAddress right); [[nodiscard]] SFML_NETWORK_API bool operator==(IpAddress left, IpAddress right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of != operator to compare two IP addresses /// \brief Overload of `operator!=` to compare two IP addresses
/// ///
/// \param left Left operand (a IP address) /// \param left Left operand (a IP address)
/// \param right Right operand (a IP address) /// \param right Right operand (a IP address)
/// ///
/// \return True if both addresses are different /// \return `true` if both addresses are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_NETWORK_API bool operator!=(IpAddress left, IpAddress right); [[nodiscard]] SFML_NETWORK_API bool operator!=(IpAddress left, IpAddress right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of < operator to compare two IP addresses /// \brief Overload of `operator<` to compare two IP addresses
/// ///
/// \param left Left operand (a IP address) /// \param left Left operand (a IP address)
/// \param right Right operand (a IP address) /// \param right Right operand (a IP address)
/// ///
/// \return True if \a left is lesser than \a right /// \return `true` if \a `left` is lesser than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_NETWORK_API bool operator<(IpAddress left, IpAddress right); [[nodiscard]] SFML_NETWORK_API bool operator<(IpAddress left, IpAddress right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of > operator to compare two IP addresses /// \brief Overload of `operator>` to compare two IP addresses
/// ///
/// \param left Left operand (a IP address) /// \param left Left operand (a IP address)
/// \param right Right operand (a IP address) /// \param right Right operand (a IP address)
/// ///
/// \return True if \a left is greater than \a right /// \return `true` if \a `left` is greater than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_NETWORK_API bool operator>(IpAddress left, IpAddress right); [[nodiscard]] SFML_NETWORK_API bool operator>(IpAddress left, IpAddress right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of <= operator to compare two IP addresses /// \brief Overload of `operator<=` to compare two IP addresses
/// ///
/// \param left Left operand (a IP address) /// \param left Left operand (a IP address)
/// \param right Right operand (a IP address) /// \param right Right operand (a IP address)
/// ///
/// \return True if \a left is lesser or equal than \a right /// \return `true` if \a left is lesser or equal than \a right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_NETWORK_API bool operator<=(IpAddress left, IpAddress right); [[nodiscard]] SFML_NETWORK_API bool operator<=(IpAddress left, IpAddress right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of >= operator to compare two IP addresses /// \brief Overload of `operator>=` to compare two IP addresses
/// ///
/// \param left Left operand (a IP address) /// \param left Left operand (a IP address)
/// \param right Right operand (a IP address) /// \param right Right operand (a IP address)
/// ///
/// \return True if \a left is greater or equal than \a right /// \return `true` if \a `left` is greater or equal than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_NETWORK_API bool operator>=(IpAddress left, IpAddress right); [[nodiscard]] SFML_NETWORK_API bool operator>=(IpAddress left, IpAddress right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of >> operator to extract an IP address from an input stream /// \brief Overload of `operator>>` to extract an IP address from an input stream
/// ///
/// \param stream Input stream /// \param stream Input stream
/// \param address IP address to extract /// \param address IP address to extract
@ -257,7 +257,7 @@ private:
SFML_NETWORK_API std::istream& operator>>(std::istream& stream, std::optional<IpAddress>& address); SFML_NETWORK_API std::istream& operator>>(std::istream& stream, std::optional<IpAddress>& address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of << operator to print an IP address to an output stream /// \brief Overload of `operator<<` to print an IP address to an output stream
/// ///
/// \param stream Output stream /// \param stream Output stream
/// \param address IP address to print /// \param address IP address to print
@ -274,7 +274,7 @@ SFML_NETWORK_API std::ostream& operator<<(std::ostream& stream, IpAddress addres
/// \class sf::IpAddress /// \class sf::IpAddress
/// \ingroup network /// \ingroup network
/// ///
/// sf::IpAddress is a utility class for manipulating network /// `sf::IpAddress` is a utility class for manipulating network
/// addresses. It provides a set a implicit constructors and /// addresses. It provides a set a implicit constructors and
/// conversion functions to easily build or transform an IP /// conversion functions to easily build or transform an IP
/// address from/to various representations. /// address from/to various representations.
@ -291,7 +291,7 @@ SFML_NETWORK_API std::ostream& operator<<(std::ostream& stream, IpAddress addres
/// auto a9 = sf::IpAddress::getPublicAddress(); // my address on the internet /// auto a9 = sf::IpAddress::getPublicAddress(); // my address on the internet
/// \endcode /// \endcode
/// ///
/// Note that sf::IpAddress currently doesn't support IPv6 /// Note that `sf::IpAddress` currently doesn't support IPv6
/// nor other types of network addresses. /// nor other types of network addresses.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -92,8 +92,8 @@ public:
/// \param data Pointer to the sequence of bytes to append /// \param data Pointer to the sequence of bytes to append
/// \param sizeInBytes Number of bytes to append /// \param sizeInBytes Number of bytes to append
/// ///
/// \see clear /// \see `clear`
/// \see getReadPosition /// \see `getReadPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void append(const void* data, std::size_t sizeInBytes); void append(const void* data, std::size_t sizeInBytes);
@ -105,7 +105,7 @@ public:
/// ///
/// \return The byte offset of the current read position /// \return The byte offset of the current read position
/// ///
/// \see append /// \see `append`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::size_t getReadPosition() const; [[nodiscard]] std::size_t getReadPosition() const;
@ -115,7 +115,7 @@ public:
/// ///
/// After calling Clear, the packet is empty. /// After calling Clear, the packet is empty.
/// ///
/// \see append /// \see `append`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void clear(); void clear();
@ -126,11 +126,11 @@ public:
/// Warning: the returned pointer may become invalid after /// Warning: the returned pointer may become invalid after
/// you append data to the packet, therefore it should never /// you append data to the packet, therefore it should never
/// be stored. /// be stored.
/// The return pointer is a null pointer if the packet is empty. /// The return pointer is a `nullptr` if the packet is empty.
/// ///
/// \return Pointer to the data /// \return Pointer to the data
/// ///
/// \see getDataSize /// \see `getDataSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] const void* getData() const; [[nodiscard]] const void* getData() const;
@ -139,11 +139,11 @@ public:
/// \brief Get the size of the data contained in the packet /// \brief Get the size of the data contained in the packet
/// ///
/// This function returns the number of bytes pointed to by /// This function returns the number of bytes pointed to by
/// what getData returns. /// what `getData` returns.
/// ///
/// \return Data size, in bytes /// \return Data size, in bytes
/// ///
/// \see getData /// \see `getData`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::size_t getDataSize() const; [[nodiscard]] std::size_t getDataSize() const;
@ -155,9 +155,9 @@ public:
/// This function is useful to know if there is some data /// This function is useful to know if there is some data
/// left to be read, without actually reading it. /// left to be read, without actually reading it.
/// ///
/// \return True if all data was read, false otherwise /// \return `true` if all data was read, `false` otherwise
/// ///
/// \see operator bool /// \see `operator` bool
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool endOfPacket() const; [[nodiscard]] bool endOfPacket() const;
@ -195,15 +195,15 @@ public:
/// it disallows unwanted implicit conversions to integer or /// it disallows unwanted implicit conversions to integer or
/// pointer types. /// pointer types.
/// ///
/// \return True if last data extraction from packet was successful /// \return `true` if last data extraction from packet was successful
/// ///
/// \see endOfPacket /// \see `endOfPacket`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
explicit operator bool() const; explicit operator bool() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Overload of operator >> to read data from the packet /// Overload of `operator>>` to read data from the packet
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet& operator>>(bool& data); Packet& operator>>(bool& data);
@ -284,7 +284,7 @@ public:
Packet& operator>>(String& data); Packet& operator>>(String& data);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Overload of operator << to write data into the packet /// Overload of `operator<<` to write data into the packet
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet& operator<<(bool data); Packet& operator<<(bool data);
@ -383,7 +383,7 @@ protected:
/// ///
/// \return Pointer to the array of bytes to send /// \return Pointer to the array of bytes to send
/// ///
/// \see onReceive /// \see `onReceive`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual const void* onSend(std::size_t& size); virtual const void* onSend(std::size_t& size);
@ -402,7 +402,7 @@ protected:
/// \param data Pointer to the received bytes /// \param data Pointer to the received bytes
/// \param size Number of bytes /// \param size Number of bytes
/// ///
/// \see onSend /// \see `onSend`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void onReceive(const void* data, std::size_t size); virtual void onReceive(const void* data, std::size_t size);
@ -415,7 +415,7 @@ private:
/// ///
/// \param size Size to check /// \param size Size to check
/// ///
/// \return True if \a size bytes can be read from the packet /// \return `true` if \a size bytes can be read from the packet
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool checkSize(std::size_t size); bool checkSize(std::size_t size);
@ -438,14 +438,14 @@ private:
/// ///
/// Packets provide a safe and easy way to serialize data, /// Packets provide a safe and easy way to serialize data,
/// in order to send it over the network using sockets /// in order to send it over the network using sockets
/// (sf::TcpSocket, sf::UdpSocket). /// (`sf::TcpSocket`, `sf::UdpSocket`).
/// ///
/// Packets solve 2 fundamental problems that arise when /// Packets solve 2 fundamental problems that arise when
/// transferring data over the network: /// transferring data over the network:
/// \li data is interpreted correctly according to the endianness /// \li data is interpreted correctly according to the endianness
/// \li the bounds of the packet are preserved (one send == one receive) /// \li the bounds of the packet are preserved (one send == one receive)
/// ///
/// The sf::Packet class provides both input and output modes. /// The `sf::Packet` class provides both input and output modes.
/// It is designed to follow the behavior of standard C++ streams, /// It is designed to follow the behavior of standard C++ streams,
/// using operators >> and << to extract and insert data. /// using operators >> and << to extract and insert data.
/// ///
@ -483,7 +483,7 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// Packets have built-in operator >> and << overloads for /// Packets have built-in `operator>>` and << overloads for
/// standard types: /// standard types:
/// \li `bool` /// \li `bool`
/// \li fixed-size integer types (`int[8|16|32]_t`, `uint[8|16|32]_t`) /// \li fixed-size integer types (`int[8|16|32]_t`, `uint[8|16|32]_t`)
@ -517,7 +517,7 @@ private:
/// custom transformations to the data before it is sent, /// custom transformations to the data before it is sent,
/// and after it is received. This is typically used to /// and after it is received. This is typically used to
/// handle automatic compression or encryption of the data. /// handle automatic compression or encryption of the data.
/// This is achieved by inheriting from sf::Packet, and overriding /// This is achieved by inheriting from `sf::Packet`, and overriding
/// the onSend and onReceive functions. /// the onSend and onReceive functions.
/// ///
/// Here is an example: /// Here is an example:
@ -547,6 +547,6 @@ private:
/// ... /// ...
/// \endcode /// \endcode
/// ///
/// \see sf::TcpSocket, sf::UdpSocket /// \see `sf::TcpSocket`, `sf::UdpSocket`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -103,9 +103,9 @@ public:
/// available or not. /// available or not.
/// By default, all sockets are blocking. /// By default, all sockets are blocking.
/// ///
/// \param blocking True to set the socket as blocking, false for non-blocking /// \param blocking `true` to set the socket as blocking, `false` for non-blocking
/// ///
/// \see isBlocking /// \see `isBlocking`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setBlocking(bool blocking); void setBlocking(bool blocking);
@ -113,9 +113,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Tell whether the socket is in blocking or non-blocking mode /// \brief Tell whether the socket is in blocking or non-blocking mode
/// ///
/// \return True if the socket is blocking, false otherwise /// \return `true` if the socket is blocking, `false` otherwise
/// ///
/// \see setBlocking /// \see `setBlocking`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isBlocking() const; [[nodiscard]] bool isBlocking() const;
@ -215,7 +215,7 @@ private:
/// In non-blocking mode, all the socket functions will /// In non-blocking mode, all the socket functions will
/// return immediately. If the socket is not ready to complete /// return immediately. If the socket is not ready to complete
/// the requested operation, the function simply returns /// the requested operation, the function simply returns
/// the proper status code (Socket::Status::NotReady). /// the proper status code (`Socket::Status::NotReady`).
/// ///
/// The default mode, which is blocking, is the one that is /// The default mode, which is blocking, is the one that is
/// generally used, in combination with threads or selectors. /// generally used, in combination with threads or selectors.
@ -224,6 +224,6 @@ private:
/// the socket often enough, and cannot afford blocking /// the socket often enough, and cannot afford blocking
/// this loop. /// this loop.
/// ///
/// \see sf::TcpListener, sf::TcpSocket, sf::UdpSocket /// \see `sf::TcpListener`, `sf::TcpSocket`, `sf::UdpSocket`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -97,7 +97,7 @@ public:
/// ///
/// \param socket Reference to the socket to add /// \param socket Reference to the socket to add
/// ///
/// \see remove, clear /// \see `remove`, `clear`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void add(Socket& socket); void add(Socket& socket);
@ -110,7 +110,7 @@ public:
/// ///
/// \param socket Reference to the socket to remove /// \param socket Reference to the socket to remove
/// ///
/// \see add, clear /// \see `add`, `clear`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void remove(Socket& socket); void remove(Socket& socket);
@ -122,7 +122,7 @@ public:
/// removes all the references that the selector has to /// removes all the references that the selector has to
/// external sockets. /// external sockets.
/// ///
/// \see add, remove /// \see `add`, `remove`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void clear(); void clear();
@ -132,15 +132,15 @@ public:
/// ///
/// This function returns as soon as at least one socket has /// This function returns as soon as at least one socket has
/// some data available to be received. To know which sockets are /// some data available to be received. To know which sockets are
/// ready, use the isReady function. /// ready, use the `isReady` function.
/// If you use a timeout and no socket is ready before the timeout /// If you use a timeout and no socket is ready before the timeout
/// is over, the function returns false. /// is over, the function returns `false`.
/// ///
/// \param timeout Maximum time to wait, (use Time::Zero for infinity) /// \param timeout Maximum time to wait, (use Time::Zero for infinity)
/// ///
/// \return True if there are sockets ready, false otherwise /// \return `true` if there are sockets ready, `false` otherwise
/// ///
/// \see isReady /// \see `isReady`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool wait(Time timeout = Time::Zero); [[nodiscard]] bool wait(Time timeout = Time::Zero);
@ -152,14 +152,14 @@ public:
/// which sockets are ready to receive data. If a socket is /// which sockets are ready to receive data. If a socket is
/// ready, a call to receive will never block because we know /// ready, a call to receive will never block because we know
/// that there is data available to read. /// that there is data available to read.
/// Note that if this function returns true for a TcpListener, /// Note that if this function returns `true` for a TcpListener,
/// this means that it is ready to accept a new connection. /// this means that it is ready to accept a new connection.
/// ///
/// \param socket Socket to test /// \param socket Socket to test
/// ///
/// \return True if the socket is ready to read, false otherwise /// \return `true` if the socket is ready to read, `false` otherwise
/// ///
/// \see isReady /// \see `isReady`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isReady(Socket& socket) const; [[nodiscard]] bool isReady(Socket& socket) const;
@ -189,9 +189,9 @@ private:
/// all the sockets. /// all the sockets.
/// ///
/// All types of sockets can be used in a selector: /// All types of sockets can be used in a selector:
/// \li sf::TcpListener /// \li `sf::TcpListener`
/// \li sf::TcpSocket /// \li `sf::TcpSocket`
/// \li sf::UdpSocket /// \li `sf::UdpSocket`
/// ///
/// A selector doesn't store its own copies of the sockets /// A selector doesn't store its own copies of the sockets
/// (socket classes are not copyable anyway), it simply keeps /// (socket classes are not copyable anyway), it simply keeps
@ -268,6 +268,6 @@ private:
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::Socket /// \see `sf::Socket`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -58,7 +58,7 @@ public:
/// ///
/// \return Port to which the socket is bound /// \return Port to which the socket is bound
/// ///
/// \see listen /// \see `listen`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned short getLocalPort() const; [[nodiscard]] unsigned short getLocalPort() const;
@ -73,16 +73,16 @@ public:
/// function is called, it will stop listening on the old /// function is called, it will stop listening on the old
/// port before starting to listen on the new port. /// port before starting to listen on the new port.
/// ///
/// When providing sf::Socket::AnyPort as port, the listener /// When providing `sf::Socket::AnyPort` as port, the listener
/// will request an available port from the system. /// will request an available port from the system.
/// The chosen port can be retrieved by calling getLocalPort(). /// The chosen port can be retrieved by calling `getLocalPort()`.
/// ///
/// \param port Port to listen on for incoming connection attempts /// \param port Port to listen on for incoming connection attempts
/// \param address Address of the interface to listen on /// \param address Address of the interface to listen on
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see accept, close /// \see `accept`, `close`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status listen(unsigned short port, IpAddress address = IpAddress::Any); [[nodiscard]] Status listen(unsigned short port, IpAddress address = IpAddress::Any);
@ -93,7 +93,7 @@ public:
/// This function gracefully stops the listener. If the /// This function gracefully stops the listener. If the
/// socket is not listening, this function has no effect. /// socket is not listening, this function has no effect.
/// ///
/// \see listen /// \see `listen`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void close(); void close();
@ -108,7 +108,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see listen /// \see `listen`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status accept(TcpSocket& socket); [[nodiscard]] Status accept(TcpSocket& socket);
@ -127,18 +127,18 @@ public:
/// This is all it can do. /// This is all it can do.
/// ///
/// When a new connection is received, you must call accept and /// When a new connection is received, you must call accept and
/// the listener returns a new instance of sf::TcpSocket that /// the listener returns a new instance of `sf::TcpSocket` that
/// is properly initialized and can be used to communicate with /// is properly initialized and can be used to communicate with
/// the new client. /// the new client.
/// ///
/// Listener sockets are specific to the TCP protocol, /// Listener sockets are specific to the TCP protocol,
/// UDP sockets are connectionless and can therefore communicate /// UDP sockets are connectionless and can therefore communicate
/// directly. As a consequence, a listener socket will always /// directly. As a consequence, a listener socket will always
/// return the new connections as sf::TcpSocket instances. /// return the new connections as `sf::TcpSocket` instances.
/// ///
/// A listener is automatically closed on destruction, like all /// A listener is automatically closed on destruction, like all
/// other types of socket. However if you want to stop listening /// other types of socket. However if you want to stop listening
/// before the socket is destroyed, you can call its close() /// before the socket is destroyed, you can call its `close()`
/// function. /// function.
/// ///
/// Usage example: /// Usage example:
@ -161,6 +161,6 @@ public:
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::TcpSocket, sf::Socket /// \see `sf::TcpSocket`, `sf::Socket`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -66,7 +66,7 @@ public:
/// ///
/// \return Port to which the socket is bound /// \return Port to which the socket is bound
/// ///
/// \see connect, getRemotePort /// \see `connect`, `getRemotePort`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned short getLocalPort() const; [[nodiscard]] unsigned short getLocalPort() const;
@ -79,7 +79,7 @@ public:
/// ///
/// \return Address of the remote peer /// \return Address of the remote peer
/// ///
/// \see getRemotePort /// \see `getRemotePort`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::optional<IpAddress> getRemoteAddress() const; [[nodiscard]] std::optional<IpAddress> getRemoteAddress() const;
@ -92,7 +92,7 @@ public:
/// ///
/// \return Remote port to which the socket is connected /// \return Remote port to which the socket is connected
/// ///
/// \see getRemoteAddress /// \see `getRemoteAddress`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned short getRemotePort() const; [[nodiscard]] unsigned short getRemotePort() const;
@ -112,7 +112,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see disconnect /// \see `disconnect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status connect(IpAddress remoteAddress, unsigned short remotePort, Time timeout = Time::Zero); [[nodiscard]] Status connect(IpAddress remoteAddress, unsigned short remotePort, Time timeout = Time::Zero);
@ -123,7 +123,7 @@ public:
/// This function gracefully closes the connection. If the /// This function gracefully closes the connection. If the
/// socket is not connected, this function has no effect. /// socket is not connected, this function has no effect.
/// ///
/// \see connect /// \see `connect`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void disconnect(); void disconnect();
@ -132,7 +132,7 @@ public:
/// \brief Send raw data to the remote peer /// \brief Send raw data to the remote peer
/// ///
/// To be able to handle partial sends over non-blocking /// To be able to handle partial sends over non-blocking
/// sockets, use the send(const void*, std::size_t, std::size_t&) /// sockets, use the `send(const void*, std::size_t, std::size_t&)`
/// overload instead. /// overload instead.
/// This function will fail if the socket is not connected. /// This function will fail if the socket is not connected.
/// ///
@ -141,7 +141,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see receive /// \see `receive`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status send(const void* data, std::size_t size); [[nodiscard]] Status send(const void* data, std::size_t size);
@ -157,7 +157,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see receive /// \see `receive`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status send(const void* data, std::size_t size, std::size_t& sent); [[nodiscard]] Status send(const void* data, std::size_t size, std::size_t& sent);
@ -175,7 +175,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see send /// \see `send`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status receive(void* data, std::size_t size, std::size_t& received); [[nodiscard]] Status receive(void* data, std::size_t size, std::size_t& received);
@ -183,7 +183,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to the remote peer /// \brief Send a formatted packet of data to the remote peer
/// ///
/// In non-blocking mode, if this function returns sf::Socket::Status::Partial, /// In non-blocking mode, if this function returns `sf::Socket::Status::Partial`,
/// you \em must retry sending the same unmodified packet before sending /// you \em must retry sending the same unmodified packet before sending
/// anything else in order to guarantee the packet arrives at the remote /// anything else in order to guarantee the packet arrives at the remote
/// peer uncorrupted. /// peer uncorrupted.
@ -193,7 +193,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see receive /// \see `receive`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status send(Packet& packet); [[nodiscard]] Status send(Packet& packet);
@ -209,7 +209,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see send /// \see `send`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status receive(Packet& packet); [[nodiscard]] Status receive(Packet& packet);
@ -252,7 +252,7 @@ private:
/// ///
/// When a socket is connected to a remote host, you can /// When a socket is connected to a remote host, you can
/// retrieve information about this host with the /// retrieve information about this host with the
/// getRemoteAddress and getRemotePort functions. You can /// `getRemoteAddress` and `getRemotePort` functions. You can
/// also get the local port to which the socket is bound /// also get the local port to which the socket is bound
/// (which is automatically chosen when the socket is connected), /// (which is automatically chosen when the socket is connected),
/// with the getLocalPort function. /// with the getLocalPort function.
@ -263,9 +263,9 @@ private:
/// one call to Send will exactly match one call to Receive /// one call to Send will exactly match one call to Receive
/// at the other end of the socket. /// at the other end of the socket.
/// ///
/// The high-level interface uses packets (see sf::Packet), /// The high-level interface uses packets (see `sf::Packet`),
/// which are easier to use and provide more safety regarding /// which are easier to use and provide more safety regarding
/// the data that is exchanged. You can look at the sf::Packet /// the data that is exchanged. You can look at the `sf::Packet`
/// class to get more details about how they work. /// class to get more details about how they work.
/// ///
/// The socket is automatically disconnected when it is destroyed, /// The socket is automatically disconnected when it is destroyed,
@ -312,6 +312,6 @@ private:
/// socket.send(message.c_str(), message.size() + 1); /// socket.send(message.c_str(), message.size() + 1);
/// \endcode /// \endcode
/// ///
/// \see sf::Socket, sf::UdpSocket, sf::Packet /// \see `sf::Socket`, `sf::UdpSocket`, `sf::Packet`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -69,7 +69,7 @@ public:
/// ///
/// \return Port to which the socket is bound /// \return Port to which the socket is bound
/// ///
/// \see bind /// \see `bind`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] unsigned short getLocalPort() const; [[nodiscard]] unsigned short getLocalPort() const;
@ -80,9 +80,9 @@ public:
/// Binding the socket to a port is necessary for being /// Binding the socket to a port is necessary for being
/// able to receive data on that port. /// able to receive data on that port.
/// ///
/// When providing sf::Socket::AnyPort as port, the listener /// When providing `sf::Socket::AnyPort` as port, the listener
/// will request an available port from the system. /// will request an available port from the system.
/// The chosen port can be retrieved by calling getLocalPort(). /// The chosen port can be retrieved by calling `getLocalPort()`.
/// ///
/// Since the socket can only be bound to a single port at /// Since the socket can only be bound to a single port at
/// any given moment, if it is already bound when this /// any given moment, if it is already bound when this
@ -94,7 +94,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see unbind, getLocalPort /// \see `unbind`, `getLocalPort`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status bind(unsigned short port, IpAddress address = IpAddress::Any); [[nodiscard]] Status bind(unsigned short port, IpAddress address = IpAddress::Any);
@ -104,11 +104,11 @@ public:
/// ///
/// The port that the socket was previously bound to is immediately /// The port that the socket was previously bound to is immediately
/// made available to the operating system after this function is called. /// made available to the operating system after this function is called.
/// This means that a subsequent call to bind() will be able to re-bind /// This means that a subsequent call to `bind()` will be able to re-bind
/// the port if no other process has done so in the mean time. /// the port if no other process has done so in the mean time.
/// If the socket is not bound to a port, this function has no effect. /// If the socket is not bound to a port, this function has no effect.
/// ///
/// \see bind /// \see `bind`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void unbind(); void unbind();
@ -116,8 +116,8 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Send raw data to a remote peer /// \brief Send raw data to a remote peer
/// ///
/// Make sure that \a size is not greater than /// Make sure that \a `size` is not greater than
/// UdpSocket::MaxDatagramSize, otherwise this function will /// `UdpSocket::MaxDatagramSize`, otherwise this function will
/// fail and no data will be sent. /// fail and no data will be sent.
/// ///
/// \param data Pointer to the sequence of bytes to send /// \param data Pointer to the sequence of bytes to send
@ -127,7 +127,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see receive /// \see `receive`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status send(const void* data, std::size_t size, IpAddress remoteAddress, unsigned short remotePort); [[nodiscard]] Status send(const void* data, std::size_t size, IpAddress remoteAddress, unsigned short remotePort);
@ -150,7 +150,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see send /// \see `send`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status receive(void* data, [[nodiscard]] Status receive(void* data,
@ -163,7 +163,7 @@ public:
/// \brief Send a formatted packet of data to a remote peer /// \brief Send a formatted packet of data to a remote peer
/// ///
/// Make sure that the packet size is not greater than /// Make sure that the packet size is not greater than
/// UdpSocket::MaxDatagramSize, otherwise this function will /// `UdpSocket::MaxDatagramSize`, otherwise this function will
/// fail and no data will be sent. /// fail and no data will be sent.
/// ///
/// \param packet Packet to send /// \param packet Packet to send
@ -172,7 +172,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see receive /// \see `receive`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status send(Packet& packet, IpAddress remoteAddress, unsigned short remotePort); [[nodiscard]] Status send(Packet& packet, IpAddress remoteAddress, unsigned short remotePort);
@ -189,7 +189,7 @@ public:
/// ///
/// \return Status code /// \return Status code
/// ///
/// \see send /// \see `send`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Status receive(Packet& packet, std::optional<IpAddress>& remoteAddress, unsigned short& remotePort); [[nodiscard]] Status receive(Packet& packet, std::optional<IpAddress>& remoteAddress, unsigned short& remotePort);
@ -230,13 +230,13 @@ private:
/// Sending and receiving data can use either the low-level /// Sending and receiving data can use either the low-level
/// or the high-level functions. The low-level functions /// or the high-level functions. The low-level functions
/// process a raw sequence of bytes, whereas the high-level /// process a raw sequence of bytes, whereas the high-level
/// interface uses packets (see sf::Packet), which are easier /// interface uses packets (see `sf::Packet`), which are easier
/// to use and provide more safety regarding the data that is /// to use and provide more safety regarding the data that is
/// exchanged. You can look at the sf::Packet class to get /// exchanged. You can look at the `sf::Packet` class to get
/// more details about how they work. /// more details about how they work.
/// ///
/// It is important to note that UdpSocket is unable to send /// It is important to note that `UdpSocket` is unable to send
/// datagrams bigger than MaxDatagramSize. In this case, it /// datagrams bigger than `MaxDatagramSize`. In this case, it
/// returns an error and doesn't send anything. This applies /// returns an error and doesn't send anything. This applies
/// to both raw data and packets. Indeed, even packets are /// to both raw data and packets. Indeed, even packets are
/// unable to split and recompose data, due to the unreliability /// unable to split and recompose data, due to the unreliability
@ -288,6 +288,6 @@ private:
/// socket.send(message.c_str(), message.size() + 1, sender, port); /// socket.send(message.c_str(), message.size() + 1, sender, port);
/// \endcode /// \endcode
/// ///
/// \see sf::Socket, sf::TcpSocket, sf::Packet /// \see `sf::Socket`, `sf::TcpSocket`, `sf::Packet`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -47,7 +47,7 @@ public:
/// ///
/// \return Angle in degrees /// \return Angle in degrees
/// ///
/// \see asRadians /// \see `asRadians`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr float asDegrees() const; [[nodiscard]] constexpr float asDegrees() const;
@ -57,7 +57,7 @@ public:
/// ///
/// \return Angle in radians /// \return Angle in radians
/// ///
/// \see asDegrees /// \see `asDegrees`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr float asRadians() const; [[nodiscard]] constexpr float asRadians() const;
@ -67,7 +67,7 @@ public:
/// ///
/// Similar to a modulo operation, this returns a copy of the angle /// Similar to a modulo operation, this returns a copy of the angle
/// constrained to the range [-180°, 180°) == [-Pi, Pi). /// constrained to the range [-180°, 180°) == [-Pi, Pi).
/// The resulting angle represents a rotation which is equivalent to *this. /// The resulting angle represents a rotation which is equivalent to `*this`.
/// ///
/// The name "signed" originates from the similarity to signed integers: /// The name "signed" originates from the similarity to signed integers:
/// <table> /// <table>
@ -90,7 +90,7 @@ public:
/// ///
/// \return Signed angle, wrapped to [-180°, 180°) /// \return Signed angle, wrapped to [-180°, 180°)
/// ///
/// \see wrapUnsigned /// \see `wrapUnsigned`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle wrapSigned() const; [[nodiscard]] constexpr Angle wrapSigned() const;
@ -100,7 +100,7 @@ public:
/// ///
/// Similar to a modulo operation, this returns a copy of the angle /// Similar to a modulo operation, this returns a copy of the angle
/// constrained to the range [0°, 360°) == [0, Tau) == [0, 2*Pi). /// constrained to the range [0°, 360°) == [0, Tau) == [0, 2*Pi).
/// The resulting angle represents a rotation which is equivalent to *this. /// The resulting angle represents a rotation which is equivalent to `*this`.
/// ///
/// The name "unsigned" originates from the similarity to unsigned integers: /// The name "unsigned" originates from the similarity to unsigned integers:
/// <table> /// <table>
@ -123,7 +123,7 @@ public:
/// ///
/// \return Unsigned angle, wrapped to [0°, 360°) /// \return Unsigned angle, wrapped to [0°, 360°)
/// ///
/// \see wrapSigned /// \see `wrapSigned`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle wrapUnsigned() const; [[nodiscard]] constexpr Angle wrapUnsigned() const;
@ -142,7 +142,7 @@ private:
/// \brief Construct from a number of radians /// \brief Construct from a number of radians
/// ///
/// This function is internal. To construct angle values, /// This function is internal. To construct angle values,
/// use sf::radians or sf::degrees instead. /// use `sf::radians` or `sf::degrees` instead.
/// ///
/// \param radians Angle in radians /// \param radians Angle in radians
/// ///
@ -162,7 +162,7 @@ private:
/// ///
/// \return Angle value constructed from the number of degrees /// \return Angle value constructed from the number of degrees
/// ///
/// \see radians /// \see `radians`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle degrees(float angle); [[nodiscard]] constexpr Angle degrees(float angle);
@ -174,92 +174,92 @@ private:
/// ///
/// \return Angle value constructed from the number of radians /// \return Angle value constructed from the number of radians
/// ///
/// \see degrees /// \see `degrees`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle radians(float angle); [[nodiscard]] constexpr Angle radians(float angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of == operator to compare two angle values /// \brief Overload of `operator==` to compare two angle values
/// \note Does not automatically wrap the angle value /// \note Does not automatically wrap the angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return True if both angle values are equal /// \return `true` if both angle values are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator==(Angle left, Angle right); [[nodiscard]] constexpr bool operator==(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of != operator to compare two angle values /// \brief Overload of `operator!=` to compare two angle values
/// \note Does not automatically wrap the angle value /// \note Does not automatically wrap the angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return True if both angle values are different /// \return `true` if both angle values are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator!=(Angle left, Angle right); [[nodiscard]] constexpr bool operator!=(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of < operator to compare two angle values /// \brief Overload of `operator<` to compare two angle values
/// \note Does not automatically wrap the angle value /// \note Does not automatically wrap the angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return True if \a left is less than \a right /// \return `true` if \a left is less than \a right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator<(Angle left, Angle right); [[nodiscard]] constexpr bool operator<(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of > operator to compare two angle values /// \brief Overload of `operator>` to compare two angle values
/// \note Does not automatically wrap the angle value /// \note Does not automatically wrap the angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return True if \a left is greater than \a right /// \return `true` if \a left is greater than \a right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator>(Angle left, Angle right); [[nodiscard]] constexpr bool operator>(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of <= operator to compare two angle values /// \brief Overload of `operator<=` to compare two angle values
/// \note Does not automatically wrap the angle value /// \note Does not automatically wrap the angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return True if \a left is less than or equal to \a right /// \return `true` if \a left is less than or equal to \a right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator<=(Angle left, Angle right); [[nodiscard]] constexpr bool operator<=(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of >= operator to compare two angle values /// \brief Overload of `operator>=` to compare two angle values
/// \note Does not automatically wrap the angle value /// \note Does not automatically wrap the angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return True if \a left is greater than or equal to \a right /// \return `true` if \a left is greater than or equal to \a right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator>=(Angle left, Angle right); [[nodiscard]] constexpr bool operator>=(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of unary - operator to negate an angle value. /// \brief Overload of unary `operator-` to negate an angle value.
/// ///
/// Represents a rotation in the opposite direction. /// Represents a rotation in the opposite direction.
/// ///
@ -272,7 +272,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary + operator to add two angle values /// \brief Overload of binary `operator+` to add two angle values
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
@ -284,7 +284,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary += operator to add/assign two angle values /// \brief Overload of binary `operator+=` to add/assign two angle values
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
@ -296,7 +296,7 @@ constexpr Angle& operator+=(Angle& left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary - operator to subtract two angle values /// \brief Overload of binary `operator-` to subtract two angle values
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
@ -308,7 +308,7 @@ constexpr Angle& operator+=(Angle& left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary -= operator to subtract/assign two angle values /// \brief Overload of binary `operator-=` to subtract/assign two angle values
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
@ -320,79 +320,79 @@ constexpr Angle& operator-=(Angle& left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary * operator to scale an angle value /// \brief Overload of binary `operator*` to scale an angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator*(Angle left, float right); [[nodiscard]] constexpr Angle operator*(Angle left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary * operator to scale an angle value /// \brief Overload of binary `operator*` to scale an angle value
/// ///
/// \param left Left operand (a number) /// \param left Left operand (a number)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator*(float left, Angle right); [[nodiscard]] constexpr Angle operator*(float left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary *= operator to scale/assign an angle value /// \brief Overload of binary `operator*=` to scale/assign an angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Angle& operator*=(Angle& left, float right); constexpr Angle& operator*=(Angle& left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary / operator to scale an angle value /// \brief Overload of binary `operator/` to scale an angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator/(Angle left, float right); [[nodiscard]] constexpr Angle operator/(Angle left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary /= operator to scale/assign an angle value /// \brief Overload of binary `operator/=` to scale/assign an angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Angle& operator/=(Angle& left, float right); constexpr Angle& operator/=(Angle& left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary / operator to compute the ratio of two angle values /// \brief Overload of binary `operator/` to compute the ratio of two angle values
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr float operator/(Angle left, Angle right); [[nodiscard]] constexpr float operator/(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary % operator to compute modulo of an angle value. /// \brief Overload of binary `operator%` to compute modulo of an angle value.
/// ///
/// Right hand angle must be greater than zero. /// Right hand angle must be greater than zero.
/// ///
@ -405,19 +405,19 @@ constexpr Angle& operator/=(Angle& left, float right);
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return \a left modulo \a right /// \return \a `left` modulo \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator%(Angle left, Angle right); [[nodiscard]] constexpr Angle operator%(Angle left, Angle right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Angle /// \relates Angle
/// \brief Overload of binary %= operator to compute/assign remainder of an angle value /// \brief Overload of binary `operator%=` to compute/assign remainder of an angle value
/// ///
/// \param left Left operand (an angle) /// \param left Left operand (an angle)
/// \param right Right operand (an angle) /// \param right Right operand (an angle)
/// ///
/// \return \a left modulo \a right /// \return \a `left` modulo \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Angle& operator%=(Angle& left, Angle right); constexpr Angle& operator%=(Angle& left, Angle right);
@ -426,45 +426,45 @@ namespace Literals
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Angle /// \relates `sf::Angle`
/// \brief User defined literal for angles in degrees, e.g. 10.5_deg /// \brief User defined literal for angles in degrees, e.g. `10.5_deg`
/// ///
/// \param angle Angle in degrees /// \param angle Angle in degrees
/// ///
/// \return \a Angle /// \return Angle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator""_deg(long double angle); [[nodiscard]] constexpr Angle operator""_deg(long double angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Angle /// \relates `sf::Angle`
/// \brief User defined literal for angles in degrees, e.g. 90_deg /// \brief User defined literal for angles in degrees, e.g. `90_deg`
/// ///
/// \param angle Angle in degrees /// \param angle Angle in degrees
/// ///
/// \return \a Angle /// \return Angle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator""_deg(unsigned long long int angle); [[nodiscard]] constexpr Angle operator""_deg(unsigned long long int angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Angle /// \relates `sf::Angle`
/// \brief User defined literal for angles in radians, e.g. 0.1_rad /// \brief User defined literal for angles in radians, e.g. `0.1_rad`
/// ///
/// \param angle Angle in radians /// \param angle Angle in radians
/// ///
/// \return \a Angle /// \return Angle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator""_rad(long double angle); [[nodiscard]] constexpr Angle operator""_rad(long double angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates sf::Angle /// \relates `sf::Angle`
/// \brief User defined literal for angles in radians, e.g. 2_rad /// \brief User defined literal for angles in radians, e.g. `2_rad`
/// ///
/// \param angle Angle in radians /// \param angle Angle in radians
/// ///
/// \return \a Angle /// \return Angle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Angle operator""_rad(unsigned long long int angle); [[nodiscard]] constexpr Angle operator""_rad(unsigned long long int angle);
@ -479,7 +479,7 @@ namespace Literals
/// \class sf::Angle /// \class sf::Angle
/// \ingroup system /// \ingroup system
/// ///
/// sf::Angle encapsulates an angle value in a flexible way. /// `sf::Angle` encapsulates an angle value in a flexible way.
/// It allows for defining an angle value either as a number /// It allows for defining an angle value either as a number
/// of degrees or radians. It also works the other way /// of degrees or radians. It also works the other way
/// around. You can read an angle value as either a number /// around. You can read an angle value as either a number

View File

@ -46,12 +46,12 @@ namespace priv
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Chooses a monotonic clock of highest resolution /// \brief Chooses a monotonic clock of highest resolution
/// ///
/// The high_resolution_clock is usually an alias for other /// The `high_resolution_clock` is usually an alias for other
/// clocks: steady_clock or system_clock, whichever has a /// clocks: `steady_clock` or `system_clock`, whichever has a
/// higher precision. /// higher precision.
/// ///
/// sf::Clock, however, is aimed towards monotonic time /// `sf::Clock`, however, is aimed towards monotonic time
/// measurements and so system_clock could never be a choice /// measurements and so `system_clock` could never be a choice
/// as its subject to discontinuous jumps in the system time /// as its subject to discontinuous jumps in the system time
/// (e.g., if the system administrator manually changes /// (e.g., if the system administrator manually changes
/// the clock), and by the incremental adjustments performed /// the clock), and by the incremental adjustments performed
@ -60,8 +60,8 @@ namespace priv
/// ///
/// Note: Linux implementation of a monotonic clock that /// Note: Linux implementation of a monotonic clock that
/// takes sleep time into account is represented by /// takes sleep time into account is represented by
/// CLOCK_BOOTTIME. Android devices can define the macro: /// `CLOCK_BOOTTIME`. Android devices can define the macro:
/// SFML_ANDROID_USE_SUSPEND_AWARE_CLOCK to use a separate /// `SFML_ANDROID_USE_SUSPEND_AWARE_CLOCK` to use a separate
/// implementation of that clock, instead. /// implementation of that clock, instead.
/// ///
/// For more information on Linux clocks visit: /// For more information on Linux clocks visit:
@ -95,7 +95,7 @@ public:
/// \brief Get the elapsed time /// \brief Get the elapsed time
/// ///
/// This function returns the time elapsed since the last call /// This function returns the time elapsed since the last call
/// to restart() (or the construction of the instance if restart() /// to `restart()` (or the construction of the instance if `restart()`
/// has not been called). /// has not been called).
/// ///
/// \return Time elapsed /// \return Time elapsed
@ -106,7 +106,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check whether the clock is running /// \brief Check whether the clock is running
/// ///
/// \return True if the clock is running, false otherwise /// \return `true` if the clock is running, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isRunning() const; [[nodiscard]] bool isRunning() const;
@ -114,7 +114,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Start the clock /// \brief Start the clock
/// ///
/// \see stop /// \see `stop`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void start(); void start();
@ -122,7 +122,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Stop the clock /// \brief Stop the clock
/// ///
/// \see start /// \see `start`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void stop(); void stop();
@ -135,7 +135,7 @@ public:
/// ///
/// \return Time elapsed /// \return Time elapsed
/// ///
/// \see reset /// \see `reset`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Time restart(); Time restart();
@ -148,7 +148,7 @@ public:
/// ///
/// \return Time elapsed /// \return Time elapsed
/// ///
/// \see restart /// \see `restart`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Time reset(); Time reset();
@ -168,7 +168,7 @@ private:
/// \class sf::Clock /// \class sf::Clock
/// \ingroup system /// \ingroup system
/// ///
/// sf::Clock is a lightweight class for measuring time. /// `sf::Clock` is a lightweight class for measuring time.
/// ///
/// It provides the most precise time that the underlying /// It provides the most precise time that the underlying
/// OS can achieve (generally microseconds or nanoseconds). /// OS can achieve (generally microseconds or nanoseconds).
@ -187,10 +187,10 @@ private:
/// Time time3 = clock.reset(); /// Time time3 = clock.reset();
/// \endcode /// \endcode
/// ///
/// The sf::Time value returned by the clock can then be /// The `sf::Time` value returned by the clock can then be
/// converted to a number of seconds, milliseconds or even /// converted to a number of seconds, milliseconds or even
/// microseconds. /// microseconds.
/// ///
/// \see sf::Time /// \see `sf::Time`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -47,15 +47,15 @@ namespace sf
/// \fn sf::err /// \fn sf::err
/// \ingroup system /// \ingroup system
/// ///
/// By default, sf::err() outputs to the same location as `std::cerr`, /// By default, `sf::err()` outputs to the same location as `std::cerr`,
/// (-> the stderr descriptor) which is the console if there's /// (-> the stderr descriptor) which is the console if there's
/// one available. /// one available.
/// ///
/// It is a standard `std::ostream` instance, so it supports all the /// It is a standard `std::ostream` instance, so it supports all the
/// insertion operations defined by the STL /// insertion operations defined by the STL
/// (operator <<, manipulators, etc.). /// (`operator<<`, manipulators, etc.).
/// ///
/// sf::err() can be redirected to write to another output, independently /// `sf::err()` can be redirected to write to another output, independently
/// of `std::cerr`, by using the `rdbuf()` function provided by the /// of `std::cerr`, by using the `rdbuf()` function provided by the
/// `std::ostream` class. /// `std::ostream` class.
/// ///

View File

@ -110,7 +110,7 @@ public:
/// ///
/// \param filename Name of the file to open /// \param filename Name of the file to open
/// ///
/// \return True on success, false on error /// \return `true` on success, `false` on error
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool open(const std::filesystem::path& filename); [[nodiscard]] bool open(const std::filesystem::path& filename);
@ -182,16 +182,16 @@ private:
/// \class sf::FileInputStream /// \class sf::FileInputStream
/// \ingroup system /// \ingroup system
/// ///
/// This class is a specialization of InputStream that /// This class is a specialization of `InputStream` that
/// reads from a file on disk. /// reads from a file on disk.
/// ///
/// It wraps a file in the common InputStream interface /// It wraps a file in the common `InputStream` interface
/// and therefore allows to use generic classes or functions /// and therefore allows to use generic classes or functions
/// that accept such a stream, with a file on disk as the data /// that accept such a stream, with a file on disk as the data
/// source. /// source.
/// ///
/// In addition to the virtual functions inherited from /// In addition to the virtual functions inherited from
/// InputStream, FileInputStream adds a function to /// `InputStream`, `FileInputStream` adds a function to
/// specify the file to open. /// specify the file to open.
/// ///
/// SFML resource classes can usually be loaded directly from /// SFML resource classes can usually be loaded directly from
@ -207,6 +207,6 @@ private:
/// process(*stream); /// process(*stream);
/// \endcode /// \endcode
/// ///
/// InputStream, MemoryInputStream /// \see `InputStream`, `MemoryInputStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -102,13 +102,13 @@ public:
/// This class allows users to define their own file input sources /// This class allows users to define their own file input sources
/// from which SFML can load resources. /// from which SFML can load resources.
/// ///
/// SFML resource classes like sf::Texture and /// SFML resource classes like `sf::Texture` and
/// sf::SoundBuffer provide loadFromFile and loadFromMemory functions, /// `sf::SoundBuffer` provide `loadFromFile` and `loadFromMemory` functions,
/// which read data from conventional sources. However, if you /// which read data from conventional sources. However, if you
/// have data coming from a different source (over a network, /// have data coming from a different source (over a network,
/// embedded, encrypted, compressed, etc) you can derive your /// embedded, encrypted, compressed, etc) you can derive your
/// own class from sf::InputStream and load SFML resources with /// own class from `sf::InputStream` and load SFML resources with
/// their loadFromStream function. /// their `loadFromStream` function.
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -161,4 +161,6 @@ public:
/// // etc. /// // etc.
/// \endcode /// \endcode
/// ///
/// \see `FileInputStream`, `MemoryInputStream`
///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -111,15 +111,15 @@ private:
/// \class sf::MemoryInputStream /// \class sf::MemoryInputStream
/// \ingroup system /// \ingroup system
/// ///
/// This class is a specialization of InputStream that /// This class is a specialization of `InputStream` that
/// reads from data in memory. /// reads from data in memory.
/// ///
/// It wraps a memory chunk in the common InputStream interface /// It wraps a memory chunk in the common `InputStream` interface
/// and therefore allows to use generic classes or functions /// and therefore allows to use generic classes or functions
/// that accept such a stream, with content already loaded in memory. /// that accept such a stream, with content already loaded in memory.
/// ///
/// In addition to the virtual functions inherited from /// In addition to the virtual functions inherited from
/// InputStream, MemoryInputStream adds a function to /// `InputStream`, `MemoryInputStream` adds a function to
/// specify the pointer and size of the data in memory. /// specify the pointer and size of the data in memory.
/// ///
/// SFML resource classes can usually be loaded directly from /// SFML resource classes can usually be loaded directly from
@ -134,6 +134,6 @@ private:
/// process(stream); /// process(stream);
/// \endcode /// \endcode
/// ///
/// InputStream, FileInputStream /// \see `InputStream`, `FileInputStream`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -38,13 +38,13 @@ class Time;
/// \ingroup system /// \ingroup system
/// \brief Make the current thread sleep for a given duration /// \brief Make the current thread sleep for a given duration
/// ///
/// sf::sleep is the best way to block a program or one of its /// `sf::sleep` is the best way to block a program or one of its
/// threads, as it doesn't consume any CPU power. Compared to /// threads, as it doesn't consume any CPU power. Compared to
/// the standard `std::this_thread::sleep_for` function, this /// the standard `std::this_thread::sleep_for` function, this
/// one provides more accurate sleeping time thanks to some /// one provides more accurate sleeping time thanks to some
/// platform-specific tweaks. /// platform-specific tweaks.
/// ///
/// sf::sleep only guarantees millisecond precision. Sleeping /// `sf::sleep` only guarantees millisecond precision. Sleeping
/// for a duration less than 1 millisecond is prone to result /// for a duration less than 1 millisecond is prone to result
/// in the actual sleep duration being less than what is /// in the actual sleep duration being less than what is
/// requested. /// requested.

View File

@ -111,9 +111,9 @@ public:
String() = default; String() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Deleted nullptr constructor /// \brief Deleted `std::nullptr_t` constructor
/// ///
/// Disallow construction from nullptr literal /// Disallow construction from `nullptr` literal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
String(std::nullptr_t, const std::locale& = {}) = delete; String(std::nullptr_t, const std::locale& = {}) = delete;
@ -203,35 +203,35 @@ public:
String(std::u32string utf32String); String(std::u32string utf32String);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new sf::String from a UTF-8 encoded string /// \brief Create a new `sf::String` from a UTF-8 encoded string
/// ///
/// \param begin Forward iterator to the beginning of the UTF-8 sequence /// \param begin Forward iterator to the beginning of the UTF-8 sequence
/// \param end Forward iterator to the end of the UTF-8 sequence /// \param end Forward iterator to the end of the UTF-8 sequence
/// ///
/// \return A sf::String containing the source string /// \return A `sf::String` containing the source string
/// ///
/// \see fromUtf16, fromUtf32 /// \see `fromUtf16`, `fromUtf32`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
[[nodiscard]] static String fromUtf8(T begin, T end); [[nodiscard]] static String fromUtf8(T begin, T end);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new sf::String from a UTF-16 encoded string /// \brief Create a new `sf::String` from a UTF-16 encoded string
/// ///
/// \param begin Forward iterator to the beginning of the UTF-16 sequence /// \param begin Forward iterator to the beginning of the UTF-16 sequence
/// \param end Forward iterator to the end of the UTF-16 sequence /// \param end Forward iterator to the end of the UTF-16 sequence
/// ///
/// \return A sf::String containing the source string /// \return A `sf::String` containing the source string
/// ///
/// \see fromUtf8, fromUtf32 /// \see `fromUtf8`, `fromUtf32`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
[[nodiscard]] static String fromUtf16(T begin, T end); [[nodiscard]] static String fromUtf16(T begin, T end);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new sf::String from a UTF-32 encoded string /// \brief Create a new `sf::String` from a UTF-32 encoded string
/// ///
/// This function is provided for consistency, it is equivalent to /// This function is provided for consistency, it is equivalent to
/// using the constructors that takes a `const char32_t*` or /// using the constructors that takes a `const char32_t*` or
@ -240,9 +240,9 @@ public:
/// \param begin Forward iterator to the beginning of the UTF-32 sequence /// \param begin Forward iterator to the beginning of the UTF-32 sequence
/// \param end Forward iterator to the end of the UTF-32 sequence /// \param end Forward iterator to the end of the UTF-32 sequence
/// ///
/// \return A sf::String containing the source string /// \return A `sf::String` containing the source string
/// ///
/// \see fromUtf8, fromUtf16 /// \see `fromUtf8`, `fromUtf16`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -256,11 +256,11 @@ public:
/// Characters that do not fit in the target encoding are /// Characters that do not fit in the target encoding are
/// discarded from the returned string. /// discarded from the returned string.
/// This operator is defined for convenience, and is equivalent /// This operator is defined for convenience, and is equivalent
/// to calling toAnsiString(). /// to calling `toAnsiString()`.
/// ///
/// \return Converted ANSI string /// \return Converted ANSI string
/// ///
/// \see toAnsiString, operator std::wstring /// \see `toAnsiString`, `operator std::wstring`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
operator std::string() const; operator std::string() const;
@ -271,11 +271,11 @@ public:
/// Characters that do not fit in the target encoding are /// Characters that do not fit in the target encoding are
/// discarded from the returned string. /// discarded from the returned string.
/// This operator is defined for convenience, and is equivalent /// This operator is defined for convenience, and is equivalent
/// to calling toWideString(). /// to calling `toWideString()`.
/// ///
/// \return Converted wide string /// \return Converted wide string
/// ///
/// \see toWideString, operator std::string /// \see `toWideString`, `operator std::string`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
operator std::wstring() const; operator std::wstring() const;
@ -284,7 +284,7 @@ public:
/// \brief Convert the Unicode string to an ANSI string /// \brief Convert the Unicode string to an ANSI string
/// ///
/// The UTF-32 string is converted to an ANSI string in /// The UTF-32 string is converted to an ANSI string in
/// the encoding defined by \a locale. /// the encoding defined by \a `locale`.
/// Characters that do not fit in the target encoding are /// Characters that do not fit in the target encoding are
/// discarded from the returned string. /// discarded from the returned string.
/// ///
@ -292,7 +292,7 @@ public:
/// ///
/// \return Converted ANSI string /// \return Converted ANSI string
/// ///
/// \see toWideString, operator std::string /// \see `toWideString`, `operator std::string`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::string toAnsiString(const std::locale& locale = {}) const; [[nodiscard]] std::string toAnsiString(const std::locale& locale = {}) const;
@ -305,7 +305,7 @@ public:
/// ///
/// \return Converted wide string /// \return Converted wide string
/// ///
/// \see toAnsiString, operator std::wstring /// \see `toAnsiString`, `operator std::wstring`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::wstring toWideString() const; [[nodiscard]] std::wstring toWideString() const;
@ -315,7 +315,7 @@ public:
/// ///
/// \return Converted UTF-8 string /// \return Converted UTF-8 string
/// ///
/// \see toUtf16, toUtf32 /// \see `toUtf16`, `toUtf32`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] sf::U8String toUtf8() const; [[nodiscard]] sf::U8String toUtf8() const;
@ -325,7 +325,7 @@ public:
/// ///
/// \return Converted UTF-16 string /// \return Converted UTF-16 string
/// ///
/// \see toUtf8, toUtf32 /// \see `toUtf8`, `toUtf32`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::u16string toUtf16() const; [[nodiscard]] std::u16string toUtf16() const;
@ -338,13 +338,13 @@ public:
/// ///
/// \return Converted UTF-32 string /// \return Converted UTF-32 string
/// ///
/// \see toUtf8, toUtf16 /// \see `toUtf8`, `toUtf16`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::u32string toUtf32() const; [[nodiscard]] std::u32string toUtf32() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of += operator to append an UTF-32 string /// \brief Overload of `operator+=` to append an UTF-32 string
/// ///
/// \param right String to append /// \param right String to append
/// ///
@ -354,27 +354,27 @@ public:
String& operator+=(const String& right); String& operator+=(const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of [] operator to access a character by its position /// \brief Overload of `operator[]` to access a character by its position
/// ///
/// This function provides read-only access to characters. /// This function provides read-only access to characters.
/// Note: the behavior is undefined if \a index is out of range. /// Note: the behavior is undefined if \a `index` is out of range.
/// ///
/// \param index Index of the character to get /// \param index Index of the character to get
/// ///
/// \return Character at position \a index /// \return Character at position \a `index`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] char32_t operator[](std::size_t index) const; [[nodiscard]] char32_t operator[](std::size_t index) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Overload of [] operator to access a character by its position /// \brief Overload of `operator[]` to access a character by its position
/// ///
/// This function provides read and write access to characters. /// This function provides read and write access to characters.
/// Note: the behavior is undefined if \a index is out of range. /// Note: the behavior is undefined if \a `index` is out of range.
/// ///
/// \param index Index of the character to get /// \param index Index of the character to get
/// ///
/// \return Reference to the character at position \a index /// \return Reference to the character at position \a `index`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] char32_t& operator[](std::size_t index); [[nodiscard]] char32_t& operator[](std::size_t index);
@ -384,7 +384,7 @@ public:
/// ///
/// This function removes all the characters from the string. /// This function removes all the characters from the string.
/// ///
/// \see isEmpty, erase /// \see `isEmpty`, `erase`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void clear(); void clear();
@ -394,7 +394,7 @@ public:
/// ///
/// \return Number of characters in the string /// \return Number of characters in the string
/// ///
/// \see isEmpty /// \see `isEmpty`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::size_t getSize() const; [[nodiscard]] std::size_t getSize() const;
@ -402,9 +402,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check whether the string is empty or not /// \brief Check whether the string is empty or not
/// ///
/// \return True if the string is empty (i.e. contains no character) /// \return `true` if the string is empty (i.e. contains no character)
/// ///
/// \see clear, getSize /// \see `clear`, `getSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isEmpty() const; [[nodiscard]] bool isEmpty() const;
@ -412,8 +412,8 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Erase one or more characters from the string /// \brief Erase one or more characters from the string
/// ///
/// This function removes a sequence of \a count characters /// This function removes a sequence of \a `count` characters
/// starting from \a position. /// starting from \a `position`.
/// ///
/// \param position Position of the first character to erase /// \param position Position of the first character to erase
/// \param count Number of characters to erase /// \param count Number of characters to erase
@ -424,8 +424,8 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Insert one or more characters into the string /// \brief Insert one or more characters into the string
/// ///
/// This function inserts the characters of \a str /// This function inserts the characters of \a `str`
/// into the string, starting from \a position. /// into the string, starting from \a `position`.
/// ///
/// \param position Position of insertion /// \param position Position of insertion
/// \param str Characters to insert /// \param str Characters to insert
@ -436,13 +436,13 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Find a sequence of one or more characters in the string /// \brief Find a sequence of one or more characters in the string
/// ///
/// This function searches for the characters of \a str /// This function searches for the characters of \a `str`
/// in the string, starting from \a start. /// in the string, starting from \a `start`.
/// ///
/// \param str Characters to find /// \param str Characters to find
/// \param start Where to begin searching /// \param start Where to begin searching
/// ///
/// \return Position of \a str in the string, or String::InvalidPos if not found /// \return Position of \a `str` in the string, or `String::InvalidPos` if not found
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::size_t find(const String& str, std::size_t start = 0) const; [[nodiscard]] std::size_t find(const String& str, std::size_t start = 0) const;
@ -450,8 +450,8 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Replace a substring with another string /// \brief Replace a substring with another string
/// ///
/// This function replaces the substring that starts at index \a position /// This function replaces the substring that starts at index \a `position`
/// and spans \a length characters with the string \a replaceWith. /// and spans \a `length` characters with the string \a `replaceWith`.
/// ///
/// \param position Index of the first character to be replaced /// \param position Index of the first character to be replaced
/// \param length Number of characters to replace. You can pass InvalidPos to /// \param length Number of characters to replace. You can pass InvalidPos to
@ -464,11 +464,11 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Replace all occurrences of a substring with a replacement string /// \brief Replace all occurrences of a substring with a replacement string
/// ///
/// This function replaces all occurrences of \a searchFor in this string /// This function replaces all occurrences of \a `searchFor` in this string
/// with the string \a replaceWith. /// with the string \a `replaceWith`.
/// ///
/// \param searchFor The value being searched for /// \param searchFor The value being searched for
/// \param replaceWith The value that replaces found \a searchFor values /// \param replaceWith The value that replaces found \a `searchFor` values
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void replace(const String& searchFor, const String& replaceWith); void replace(const String& searchFor, const String& replaceWith);
@ -476,13 +476,13 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Return a part of the string /// \brief Return a part of the string
/// ///
/// This function returns the substring that starts at index \a position /// This function returns the substring that starts at index \a `position`
/// and spans \a length characters. /// and spans \a `length` characters.
/// ///
/// \param position Index of the first character /// \param position Index of the first character
/// \param length Number of characters to include in the substring (if /// \param length Number of characters to include in the substring (if
/// the string is shorter, as many characters as possible /// the string is shorter, as many characters as possible
/// are included). \ref InvalidPos can be used to include all /// are included). `InvalidPos` can be used to include all
/// characters until the end of the string. /// characters until the end of the string.
/// ///
/// \return String object containing a substring of this object /// \return String object containing a substring of this object
@ -508,7 +508,7 @@ public:
/// ///
/// \return Read-write iterator to the beginning of the string characters /// \return Read-write iterator to the beginning of the string characters
/// ///
/// \see end /// \see `end`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Iterator begin(); [[nodiscard]] Iterator begin();
@ -518,7 +518,7 @@ public:
/// ///
/// \return Read-only iterator to the beginning of the string characters /// \return Read-only iterator to the beginning of the string characters
/// ///
/// \see end /// \see `end`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] ConstIterator begin() const; [[nodiscard]] ConstIterator begin() const;
@ -532,7 +532,7 @@ public:
/// ///
/// \return Read-write iterator to the end of the string characters /// \return Read-write iterator to the end of the string characters
/// ///
/// \see begin /// \see `begin`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Iterator end(); [[nodiscard]] Iterator end();
@ -546,7 +546,7 @@ public:
/// ///
/// \return Read-only iterator to the end of the string characters /// \return Read-only iterator to the end of the string characters
/// ///
/// \see begin /// \see `begin`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] ConstIterator end() const; [[nodiscard]] ConstIterator end() const;
@ -563,79 +563,79 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of == operator to compare two UTF-32 strings /// \brief Overload of `operator==` to compare two UTF-32 strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
/// ///
/// \return True if both strings are equal /// \return `true` if both strings are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API bool operator==(const String& left, const String& right); [[nodiscard]] SFML_SYSTEM_API bool operator==(const String& left, const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of != operator to compare two UTF-32 strings /// \brief Overload of `operator!=` to compare two UTF-32 strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
/// ///
/// \return True if both strings are different /// \return `true` if both strings are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API bool operator!=(const String& left, const String& right); [[nodiscard]] SFML_SYSTEM_API bool operator!=(const String& left, const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of < operator to compare two UTF-32 strings /// \brief Overload of `operator<` to compare two UTF-32 strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
/// ///
/// \return True if \a left is lexicographically before \a right /// \return `true` if \a `left` is lexicographically before \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API bool operator<(const String& left, const String& right); [[nodiscard]] SFML_SYSTEM_API bool operator<(const String& left, const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of > operator to compare two UTF-32 strings /// \brief Overload of `operator>` to compare two UTF-32 strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
/// ///
/// \return True if \a left is lexicographically after \a right /// \return `true` if \a `left` is lexicographically after \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API bool operator>(const String& left, const String& right); [[nodiscard]] SFML_SYSTEM_API bool operator>(const String& left, const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of <= operator to compare two UTF-32 strings /// \brief Overload of `operator<=` to compare two UTF-32 strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
/// ///
/// \return True if \a left is lexicographically before or equivalent to \a right /// \return `true` if \a `left` is lexicographically before or equivalent to \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API bool operator<=(const String& left, const String& right); [[nodiscard]] SFML_SYSTEM_API bool operator<=(const String& left, const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of >= operator to compare two UTF-32 strings /// \brief Overload of `operator>=` to compare two UTF-32 strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
/// ///
/// \return True if \a left is lexicographically after or equivalent to \a right /// \return `true` if \a `left` is lexicographically after or equivalent to \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API bool operator>=(const String& left, const String& right); [[nodiscard]] SFML_SYSTEM_API bool operator>=(const String& left, const String& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates String /// \relates String
/// \brief Overload of binary + operator to concatenate two strings /// \brief Overload of binary `operator+` to concatenate two strings
/// ///
/// \param left Left operand (a string) /// \param left Left operand (a string)
/// \param right Right operand (a string) /// \param right Right operand (a string)
@ -654,7 +654,7 @@ private:
/// \class sf::String /// \class sf::String
/// \ingroup system /// \ingroup system
/// ///
/// sf::String is a utility string class defined mainly for /// `sf::String` is a utility string class defined mainly for
/// convenience. It is a Unicode string (implemented using /// convenience. It is a Unicode string (implemented using
/// UTF-32), thus it can store any character in the world /// UTF-32), thus it can store any character in the world
/// (European, Chinese, Arabic, Hebrew, etc.). /// (European, Chinese, Arabic, Hebrew, etc.).
@ -662,7 +662,7 @@ private:
/// It automatically handles conversions from/to ANSI and /// It automatically handles conversions from/to ANSI and
/// wide strings, so that you can work with standard string /// wide strings, so that you can work with standard string
/// classes and still be compatible with functions taking a /// classes and still be compatible with functions taking a
/// sf::String. /// `sf::String`.
/// ///
/// \code /// \code
/// sf::String s; /// sf::String s;
@ -685,16 +685,16 @@ private:
/// s = sf::String("hello", locale); /// s = sf::String("hello", locale);
/// \endcode /// \endcode
/// ///
/// sf::String defines the most important functions of the /// `sf::String` defines the most important functions of the
/// standard `std::string` class: removing, random access, iterating, /// standard `std::string` class: removing, random access, iterating,
/// appending, comparing, etc. However it is a simple class /// appending, comparing, etc. However it is a simple class
/// provided for convenience, and you may have to consider using /// provided for convenience, and you may have to consider using
/// a more optimized class if your program requires complex string /// a more optimized class if your program requires complex string
/// handling. The automatic conversion functions will then take /// handling. The automatic conversion functions will then take
/// care of converting your string to sf::String whenever SFML /// care of converting your string to `sf::String` whenever SFML
/// requires it. /// requires it.
/// ///
/// Please note that SFML also defines a low-level, generic /// Please note that SFML also defines a low-level, generic
/// interface for Unicode handling, see the sf::Utf classes. /// interface for Unicode handling, see the `sf::Utf` classes.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -38,16 +38,16 @@ namespace sf
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Android, chrono-compatible, suspend-aware clock /// \brief Android, chrono-compatible, suspend-aware clock
/// ///
/// Linux steady clock is represented by CLOCK_MONOTONIC. /// Linux steady clock is represented by `CLOCK_MONOTONIC`.
/// However, this implementation does not work properly for /// However, this implementation does not work properly for
/// long-running clocks that work in the background when the /// long-running clocks that work in the background when the
/// system is suspended. /// system is suspended.
/// ///
/// SuspendAwareClock uses CLOCK_BOOTTIME which is identical /// `SuspendAwareClock` uses `CLOCK_BOOTTIME` which is identical
/// to CLOCK_MONOTONIC, except that it also includes any time /// to `CLOCK_MONOTONIC`, except that it also includes any time
/// that the system is suspended. /// that the system is suspended.
/// ///
/// Note: In most cases, CLOCK_MONOTONIC is a better choice. /// Note: In most cases, `CLOCK_MONOTONIC` is a better choice.
/// Make sure this implementation is required for your use case. /// Make sure this implementation is required for your use case.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -61,7 +61,7 @@ public:
/// ///
/// \return Time in seconds /// \return Time in seconds
/// ///
/// \see asMilliseconds, asMicroseconds /// \see `asMilliseconds`, `asMicroseconds`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr float asSeconds() const; [[nodiscard]] constexpr float asSeconds() const;
@ -71,7 +71,7 @@ public:
/// ///
/// \return Time in milliseconds /// \return Time in milliseconds
/// ///
/// \see asSeconds, asMicroseconds /// \see `asSeconds`, `asMicroseconds`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr std::int32_t asMilliseconds() const; [[nodiscard]] constexpr std::int32_t asMilliseconds() const;
@ -81,13 +81,13 @@ public:
/// ///
/// \return Time in microseconds /// \return Time in microseconds
/// ///
/// \see asSeconds, asMilliseconds /// \see `asSeconds`, `asMilliseconds`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr std::int64_t asMicroseconds() const; [[nodiscard]] constexpr std::int64_t asMicroseconds() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Return the time value as a `std::chorono::duration` /// \brief Return the time value as a `std::chrono::duration`
/// ///
/// \return Time in microseconds /// \return Time in microseconds
/// ///
@ -128,7 +128,7 @@ private:
/// ///
/// \return Time value constructed from the amount of seconds /// \return Time value constructed from the amount of seconds
/// ///
/// \see milliseconds, microseconds /// \see `milliseconds`, `microseconds`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time seconds(float amount); [[nodiscard]] constexpr Time seconds(float amount);
@ -141,7 +141,7 @@ private:
/// ///
/// \return Time value constructed from the amount of milliseconds /// \return Time value constructed from the amount of milliseconds
/// ///
/// \see seconds, microseconds /// \see `seconds`, `microseconds`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time milliseconds(std::int32_t amount); [[nodiscard]] constexpr Time milliseconds(std::int32_t amount);
@ -154,86 +154,86 @@ private:
/// ///
/// \return Time value constructed from the amount of microseconds /// \return Time value constructed from the amount of microseconds
/// ///
/// \see seconds, milliseconds /// \see `seconds`, `milliseconds`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time microseconds(std::int64_t amount); [[nodiscard]] constexpr Time microseconds(std::int64_t amount);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of == operator to compare two time values /// \brief Overload of `operator==` to compare two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return True if both time values are equal /// \return `true` if both time values are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator==(Time left, Time right); [[nodiscard]] constexpr bool operator==(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of != operator to compare two time values /// \brief Overload of `operator!=` to compare two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return True if both time values are different /// \return `true` if both time values are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator!=(Time left, Time right); [[nodiscard]] constexpr bool operator!=(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of < operator to compare two time values /// \brief Overload of `operator<` to compare two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return True if \a left is lesser than \a right /// \return `true` if \a `left` is lesser than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator<(Time left, Time right); [[nodiscard]] constexpr bool operator<(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of > operator to compare two time values /// \brief Overload of `operator>` to compare two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return True if \a left is greater than \a right /// \return `true` if \a `left` is greater than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator>(Time left, Time right); [[nodiscard]] constexpr bool operator>(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of <= operator to compare two time values /// \brief Overload of `operator<=` to compare two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return True if \a left is lesser or equal than \a right /// \return `true` if \a `left` is lesser or equal than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator<=(Time left, Time right); [[nodiscard]] constexpr bool operator<=(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of >= operator to compare two time values /// \brief Overload of `operator>=` to compare two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return True if \a left is greater or equal than \a right /// \return `true` if \a `left` is greater or equal than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr bool operator>=(Time left, Time right); [[nodiscard]] constexpr bool operator>=(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of unary - operator to negate a time value /// \brief Overload of unary `operator-` to negate a time value
/// ///
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
@ -244,7 +244,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary + operator to add two time values /// \brief Overload of binary `operator+` to add two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
@ -256,7 +256,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary += operator to add/assign two time values /// \brief Overload of binary `operator+=` to add/assign two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
@ -268,7 +268,7 @@ constexpr Time& operator+=(Time& left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary - operator to subtract two time values /// \brief Overload of binary `operator-` to subtract two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
@ -280,7 +280,7 @@ constexpr Time& operator+=(Time& left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary -= operator to subtract/assign two time values /// \brief Overload of binary `operator-=` to subtract/assign two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
@ -292,156 +292,156 @@ constexpr Time& operator-=(Time& left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary * operator to scale a time value /// \brief Overload of binary `operator*` to scale a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator*(Time left, float right); [[nodiscard]] constexpr Time operator*(Time left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary * operator to scale a time value /// \brief Overload of binary `operator*` to scale a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator*(Time left, std::int64_t right); [[nodiscard]] constexpr Time operator*(Time left, std::int64_t right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary * operator to scale a time value /// \brief Overload of binary `operator*` to scale a time value
/// ///
/// \param left Left operand (a number) /// \param left Left operand (a number)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator*(float left, Time right); [[nodiscard]] constexpr Time operator*(float left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary * operator to scale a time value /// \brief Overload of binary `operator*` to scale a time value
/// ///
/// \param left Left operand (a number) /// \param left Left operand (a number)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator*(std::int64_t left, Time right); [[nodiscard]] constexpr Time operator*(std::int64_t left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary *= operator to scale/assign a time value /// \brief Overload of binary `operator*=` to scale/assign a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Time& operator*=(Time& left, float right); constexpr Time& operator*=(Time& left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary *= operator to scale/assign a time value /// \brief Overload of binary `operator*=` to scale/assign a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left multiplied by \a right /// \return \a `left` multiplied by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Time& operator*=(Time& left, std::int64_t right); constexpr Time& operator*=(Time& left, std::int64_t right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary / operator to scale a time value /// \brief Overload of binary `operator/` to scale a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator/(Time left, float right); [[nodiscard]] constexpr Time operator/(Time left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary / operator to scale a time value /// \brief Overload of binary `operator/` to scale a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator/(Time left, std::int64_t right); [[nodiscard]] constexpr Time operator/(Time left, std::int64_t right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary /= operator to scale/assign a time value /// \brief Overload of binary `operator/=` to scale/assign a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Time& operator/=(Time& left, float right); constexpr Time& operator/=(Time& left, float right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary /= operator to scale/assign a time value /// \brief Overload of binary `operator/=` to scale/assign a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a number) /// \param right Right operand (a number)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Time& operator/=(Time& left, std::int64_t right); constexpr Time& operator/=(Time& left, std::int64_t right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary / operator to compute the ratio of two time values /// \brief Overload of binary `operator/` to compute the ratio of two time values
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return \a left divided by \a right /// \return \a `left` divided by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr float operator/(Time left, Time right); [[nodiscard]] constexpr float operator/(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary % operator to compute remainder of a time value /// \brief Overload of binary `operator%` to compute remainder of a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return \a left modulo \a right /// \return \a `left` modulo \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Time operator%(Time left, Time right); [[nodiscard]] constexpr Time operator%(Time left, Time right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Time /// \relates Time
/// \brief Overload of binary %= operator to compute/assign remainder of a time value /// \brief Overload of binary `operator%=` to compute/assign remainder of a time value
/// ///
/// \param left Left operand (a time) /// \param left Left operand (a time)
/// \param right Right operand (a time) /// \param right Right operand (a time)
/// ///
/// \return \a left modulo \a right /// \return \a `left` modulo \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Time& operator%=(Time& left, Time right); constexpr Time& operator%=(Time& left, Time right);
@ -455,14 +455,14 @@ constexpr Time& operator%=(Time& left, Time right);
/// \class sf::Time /// \class sf::Time
/// \ingroup system /// \ingroup system
/// ///
/// sf::Time encapsulates a time value in a flexible way. /// `sf::Time` encapsulates a time value in a flexible way.
/// It allows to define a time value either as a number of /// It allows to define a time value either as a number of
/// seconds, milliseconds or microseconds. It also works the /// seconds, milliseconds or microseconds. It also works the
/// other way round: you can read a time value as either /// other way round: you can read a time value as either
/// a number of seconds, milliseconds or microseconds. It /// a number of seconds, milliseconds or microseconds. It
/// even interoperates with the `<chrono>` header. You can /// even interoperates with the `<chrono>` header. You can
/// construct an sf::Time from a chrono::duration and read /// construct an `sf::Time` from a `chrono::duration` and read
/// any sf::Time as a chrono::duration. /// any `sf::Time` as a chrono::duration.
/// ///
/// By using such a flexible interface, the API doesn't /// By using such a flexible interface, the API doesn't
/// impose any fixed type or resolution for time values, /// impose any fixed type or resolution for time values,
@ -499,6 +499,6 @@ constexpr Time& operator%=(Time& left, Time right);
/// update(sf::milliseconds(100)); /// update(sf::milliseconds(100));
/// \endcode /// \endcode
/// ///
/// \see sf::Clock /// \see `sf::Clock`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -123,7 +123,7 @@ public:
/// \brief Convert an ANSI characters range to UTF-8 /// \brief Convert an ANSI characters range to UTF-8
/// ///
/// The current global locale will be used by default, unless you /// The current global locale will be used by default, unless you
/// pass a custom one in the \a locale parameter. /// pass a custom one in the \a `locale` parameter.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence /// \param end Iterator pointing to the end of the input sequence
@ -166,7 +166,7 @@ public:
/// \brief Convert an UTF-8 characters range to ANSI characters /// \brief Convert an UTF-8 characters range to ANSI characters
/// ///
/// The current global locale will be used by default, unless you /// The current global locale will be used by default, unless you
/// pass a custom one in the \a locale parameter. /// pass a custom one in the \a `locale` parameter.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence /// \param end Iterator pointing to the end of the input sequence
@ -213,7 +213,7 @@ public:
/// ///
/// This functions does nothing more than a direct copy; /// This functions does nothing more than a direct copy;
/// it is defined only to provide the same interface as other /// it is defined only to provide the same interface as other
/// specializations of the sf::Utf<> template, and allow /// specializations of the `sf::Utf<>` template, and allow
/// generic code to be written on top of it. /// generic code to be written on top of it.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
@ -329,7 +329,7 @@ public:
/// \brief Convert an ANSI characters range to UTF-16 /// \brief Convert an ANSI characters range to UTF-16
/// ///
/// The current global locale will be used by default, unless you /// The current global locale will be used by default, unless you
/// pass a custom one in the \a locale parameter. /// pass a custom one in the \a `locale` parameter.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence /// \param end Iterator pointing to the end of the input sequence
@ -372,7 +372,7 @@ public:
/// \brief Convert an UTF-16 characters range to ANSI characters /// \brief Convert an UTF-16 characters range to ANSI characters
/// ///
/// The current global locale will be used by default, unless you /// The current global locale will be used by default, unless you
/// pass a custom one in the \a locale parameter. /// pass a custom one in the \a `locale` parameter.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence /// \param end Iterator pointing to the end of the input sequence
@ -432,7 +432,7 @@ public:
/// ///
/// This functions does nothing more than a direct copy; /// This functions does nothing more than a direct copy;
/// it is defined only to provide the same interface as other /// it is defined only to provide the same interface as other
/// specializations of the sf::Utf<> template, and allow /// specializations of the `sf::Utf<>` template, and allow
/// generic code to be written on top of it. /// generic code to be written on top of it.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
@ -536,7 +536,7 @@ public:
/// \brief Convert an ANSI characters range to UTF-32 /// \brief Convert an ANSI characters range to UTF-32
/// ///
/// The current global locale will be used by default, unless you /// The current global locale will be used by default, unless you
/// pass a custom one in the \a locale parameter. /// pass a custom one in the \a `locale` parameter.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence /// \param end Iterator pointing to the end of the input sequence
@ -579,7 +579,7 @@ public:
/// \brief Convert an UTF-32 characters range to ANSI characters /// \brief Convert an UTF-32 characters range to ANSI characters
/// ///
/// The current global locale will be used by default, unless you /// The current global locale will be used by default, unless you
/// pass a custom one in the \a locale parameter. /// pass a custom one in the \a `locale` parameter.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
/// \param end Iterator pointing to the end of the input sequence /// \param end Iterator pointing to the end of the input sequence
@ -652,7 +652,7 @@ public:
/// ///
/// This functions does nothing more than a direct copy; /// This functions does nothing more than a direct copy;
/// it is defined only to provide the same interface as other /// it is defined only to provide the same interface as other
/// specializations of the sf::Utf<> template, and allow /// specializations of the `sf::Utf<>` template, and allow
/// generic code to be written on top of it. /// generic code to be written on top of it.
/// ///
/// \param begin Iterator pointing to the beginning of the input sequence /// \param begin Iterator pointing to the beginning of the input sequence
@ -669,7 +669,7 @@ public:
/// \brief Decode a single ANSI character to UTF-32 /// \brief Decode a single ANSI character to UTF-32
/// ///
/// This function does not exist in other specializations /// This function does not exist in other specializations
/// of sf::Utf<>, it is defined for convenience (it is used by /// of `sf::Utf<>`, it is defined for convenience (it is used by
/// several other conversion functions). /// several other conversion functions).
/// ///
/// \param input Input ANSI character /// \param input Input ANSI character
@ -685,7 +685,7 @@ public:
/// \brief Decode a single wide character to UTF-32 /// \brief Decode a single wide character to UTF-32
/// ///
/// This function does not exist in other specializations /// This function does not exist in other specializations
/// of sf::Utf<>, it is defined for convenience (it is used by /// of `sf::Utf<>`, it is defined for convenience (it is used by
/// several other conversion functions). /// several other conversion functions).
/// ///
/// \param input Input wide character /// \param input Input wide character
@ -700,7 +700,7 @@ public:
/// \brief Encode a single UTF-32 character to ANSI /// \brief Encode a single UTF-32 character to ANSI
/// ///
/// This function does not exist in other specializations /// This function does not exist in other specializations
/// of sf::Utf<>, it is defined for convenience (it is used by /// of `sf::Utf<>`, it is defined for convenience (it is used by
/// several other conversion functions). /// several other conversion functions).
/// ///
/// \param codepoint Iterator pointing to the beginning of the input sequence /// \param codepoint Iterator pointing to the beginning of the input sequence
@ -718,7 +718,7 @@ public:
/// \brief Encode a single UTF-32 character to wide /// \brief Encode a single UTF-32 character to wide
/// ///
/// This function does not exist in other specializations /// This function does not exist in other specializations
/// of sf::Utf<>, it is defined for convenience (it is used by /// of `sf::Utf<>`, it is defined for convenience (it is used by
/// several other conversion functions). /// several other conversion functions).
/// ///
/// \param codepoint Iterator pointing to the beginning of the input sequence /// \param codepoint Iterator pointing to the beginning of the input sequence
@ -748,17 +748,17 @@ using Utf32 = Utf<32>;
/// ///
/// Utility class providing generic functions for UTF conversions. /// Utility class providing generic functions for UTF conversions.
/// ///
/// sf::Utf is a low-level, generic interface for counting, iterating, /// `sf::Utf` is a low-level, generic interface for counting, iterating,
/// encoding and decoding Unicode characters and strings. It is able /// encoding and decoding Unicode characters and strings. It is able
/// to handle ANSI, wide, latin-1, UTF-8, UTF-16 and UTF-32 encodings. /// to handle ANSI, wide, latin-1, UTF-8, UTF-16 and UTF-32 encodings.
/// ///
/// sf::Utf<X> functions are all static, these classes are not meant to /// `sf::Utf<X>` functions are all static, these classes are not meant to
/// be instantiated. All the functions are template, so that you /// be instantiated. All the functions are template, so that you
/// can use any character / string type for a given encoding. /// can use any character / string type for a given encoding.
/// ///
/// It has 3 specializations: /// It has 3 specializations:
/// \li sf::Utf<8> (with sf::Utf8 type alias) /// \li `sf::Utf<8>` (with `sf::Utf8` type alias)
/// \li sf::Utf<16> (with sf::Utf16 type alias) /// \li `sf::Utf<16>` (with `sf::Utf16` type alias)
/// \li sf::Utf<32> (with sf::Utf32 type alias) /// \li `sf::Utf<32>` (with `sf::Utf32` type alias)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -43,7 +43,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///
/// Creates a Vector2(0, 0). /// Creates a `Vector2(0, 0)`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Vector2() = default; constexpr Vector2() = default;
@ -77,12 +77,12 @@ public:
/// \param r Length of vector (can be negative) /// \param r Length of vector (can be negative)
/// \param phi Angle from X axis /// \param phi Angle from X axis
/// ///
/// Note that this constructor is lossy: calling length() and angle() /// Note that this constructor is lossy: calling `length()` and `angle()`
/// may return values different to those provided in this constructor. /// may return values different to those provided in this constructor.
/// ///
/// In particular, these transforms can be applied: /// In particular, these transforms can be applied:
/// * Vector2(r, phi) == Vector2(-r, phi + 180_deg) /// * `Vector2(r, phi) == Vector2(-r, phi + 180_deg)`
/// * Vector2(r, phi) == Vector2(r, phi + n * 360_deg) /// * `Vector2(r, phi) == Vector2(r, phi + n * 360_deg)`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_SYSTEM_API Vector2(T r, Angle phi); SFML_SYSTEM_API Vector2(T r, Angle phi);
@ -90,7 +90,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Length of the vector <i><b>(floating-point)</b></i>. /// \brief Length of the vector <i><b>(floating-point)</b></i>.
/// ///
/// If you are not interested in the actual length, but only in comparisons, consider using lengthSquared(). /// If you are not interested in the actual length, but only in comparisons, consider using `lengthSquared()`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API T length() const; [[nodiscard]] SFML_SYSTEM_API T length() const;
@ -98,7 +98,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Square of vector's length. /// \brief Square of vector's length.
/// ///
/// Suitable for comparisons, more efficient than length(). /// Suitable for comparisons, more efficient than `length()`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr T lengthSquared() const; [[nodiscard]] constexpr T lengthSquared() const;
@ -106,18 +106,18 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Vector with same direction but length 1 <i><b>(floating-point)</b></i>. /// \brief Vector with same direction but length 1 <i><b>(floating-point)</b></i>.
/// ///
/// \pre \c *this is no zero vector. /// \pre `*this` is no zero vector.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API Vector2 normalized() const; [[nodiscard]] SFML_SYSTEM_API Vector2 normalized() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Signed angle from \c *this to \c rhs <i><b>(floating-point)</b></i>. /// \brief Signed angle from `*this` to \a `rhs` <i><b>(floating-point)</b></i>.
/// ///
/// \return The smallest angle which rotates \c *this in positive /// \return The smallest angle which rotates `*this` in positive
/// or negative direction, until it has the same direction as \c rhs. /// or negative direction, until it has the same direction as \a `rhs`.
/// The result has a sign and lies in the range [-180, 180) degrees. /// The result has a sign and lies in the range [-180, 180) degrees.
/// \pre Neither \c *this nor \c rhs is a zero vector. /// \pre Neither `*this` nor \a `rhs` is a zero vector.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API Angle angleTo(Vector2 rhs) const; [[nodiscard]] SFML_SYSTEM_API Angle angleTo(Vector2 rhs) const;
@ -139,16 +139,16 @@ public:
/// Returns a vector with same length but different direction. /// Returns a vector with same length but different direction.
/// ///
/// In SFML's default coordinate system with +X right and +Y down, /// In SFML's default coordinate system with +X right and +Y down,
/// this amounts to a clockwise rotation by \c phi. /// this amounts to a clockwise rotation by \a `phi`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API Vector2 rotatedBy(Angle phi) const; [[nodiscard]] SFML_SYSTEM_API Vector2 rotatedBy(Angle phi) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Projection of this vector onto \c axis <i><b>(floating-point)</b></i>. /// \brief Projection of this vector onto \a `axis` <i><b>(floating-point)</b></i>.
/// ///
/// \param axis Vector being projected onto. Need not be normalized. /// \param axis Vector being projected onto. Need not be normalized.
/// \pre \c axis must not have length zero. /// \pre \a `axis` must not have length zero.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API Vector2 projectedOnto(Vector2 axis) const; [[nodiscard]] SFML_SYSTEM_API Vector2 projectedOnto(Vector2 axis) const;
@ -156,7 +156,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Returns a perpendicular vector. /// \brief Returns a perpendicular vector.
/// ///
/// Returns \c *this rotated by +90 degrees; (x,y) becomes (-y,x). /// Returns `*this` rotated by +90 degrees; (x,y) becomes (-y,x).
/// For example, the vector (1,0) is transformed to (0,1). /// For example, the vector (1,0) is transformed to (0,1).
/// ///
/// In SFML's default coordinate system with +X right and +Y down, /// In SFML's default coordinate system with +X right and +Y down,
@ -181,9 +181,9 @@ public:
[[nodiscard]] constexpr T cross(Vector2 rhs) const; [[nodiscard]] constexpr T cross(Vector2 rhs) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Component-wise multiplication of \c *this and \c rhs. /// \brief Component-wise multiplication of `*this` and \a `rhs`.
/// ///
/// Computes <tt>(lhs.x*rhs.x, lhs.y*rhs.y)</tt>. /// Computes `(lhs.x*rhs.x, lhs.y*rhs.y)`.
/// ///
/// Scaling is the most common use case for component-wise multiplication/division. /// Scaling is the most common use case for component-wise multiplication/division.
/// This operation is also known as the Hadamard or Schur product. /// This operation is also known as the Hadamard or Schur product.
@ -192,13 +192,13 @@ public:
[[nodiscard]] constexpr Vector2 componentWiseMul(Vector2 rhs) const; [[nodiscard]] constexpr Vector2 componentWiseMul(Vector2 rhs) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Component-wise division of \c *this and \c rhs. /// \brief Component-wise division of `*this` and \a `rhs`.
/// ///
/// Computes <tt>(lhs.x/rhs.x, lhs.y/rhs.y)</tt>. /// Computes `(lhs.x/rhs.x, lhs.y/rhs.y)`.
/// ///
/// Scaling is the most common use case for component-wise multiplication/division. /// Scaling is the most common use case for component-wise multiplication/division.
/// ///
/// \pre Neither component of \c rhs is zero. /// \pre Neither component of \a `rhs` is zero.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Vector2 componentWiseDiv(Vector2 rhs) const; [[nodiscard]] constexpr Vector2 componentWiseDiv(Vector2 rhs) const;
@ -227,11 +227,11 @@ using Vector2f = Vector2<float>;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of unary operator - /// \brief Overload of unary `operator-`
/// ///
/// \param right Vector to negate /// \param right Vector to negate
/// ///
/// \return Memberwise opposite of the vector /// \return Member-wise opposite of the vector
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -239,15 +239,15 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator += /// \brief Overload of binary `operator+=`
/// ///
/// This operator performs a memberwise addition of both vectors, /// This operator performs a member-wise addition of both vectors,
/// and assigns the result to \c left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Reference to \c left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -255,10 +255,10 @@ constexpr Vector2<T>& operator+=(Vector2<T>& left, Vector2<T> right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator -= /// \brief Overload of binary `operator-=`
/// ///
/// This operator performs a memberwise subtraction of both vectors, /// This operator performs a member-wise subtraction of both vectors,
/// and assigns the result to \c left. /// and assigns the result to \a `left.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
@ -271,12 +271,12 @@ constexpr Vector2<T>& operator-=(Vector2<T>& left, Vector2<T> right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator + /// \brief Overload of binary `operator+`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Memberwise addition of both vectors /// \return Member-wise addition of both vectors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -284,12 +284,12 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator - /// \brief Overload of binary `operator-`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Memberwise subtraction of both vectors /// \return Member-wise subtraction of both vectors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -297,12 +297,12 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator * /// \brief Overload of binary `operator*`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Memberwise multiplication by \c right /// \return Member-wise multiplication by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -310,12 +310,12 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator * /// \brief Overload of binary `operator*`
/// ///
/// \param left Left operand (a scalar value) /// \param left Left operand (a scalar value)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Memberwise multiplication by \c left /// \return Member-wise multiplication by \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -323,15 +323,15 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator *= /// \brief Overload of binary `operator*=`
/// ///
/// This operator performs a memberwise multiplication by \c right, /// This operator performs a member-wise multiplication by \a `right`,
/// and assigns the result to \c left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Reference to \c left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -339,12 +339,12 @@ constexpr Vector2<T>& operator*=(Vector2<T>& left, T right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator / /// \brief Overload of binary `operator/`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Memberwise division by \c right /// \return Member-wise division by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -352,15 +352,15 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator /= /// \brief Overload of binary `operator/=`
/// ///
/// This operator performs a memberwise division by \c right, /// This operator performs a member-wise division by \a `right`,
/// and assigns the result to \c left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Reference to \c left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -368,14 +368,14 @@ constexpr Vector2<T>& operator/=(Vector2<T>& left, T right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator == /// \brief Overload of binary `operator==`
/// ///
/// This operator compares strict equality between two vectors. /// This operator compares strict equality between two vectors.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return True if \c left is equal to \c right /// \return `true` if \a `left` is equal to \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -383,14 +383,14 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector2 /// \relates Vector2
/// \brief Overload of binary operator != /// \brief Overload of binary `operator!=`
/// ///
/// This operator compares strict difference between two vectors. /// This operator compares strict difference between two vectors.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return True if \c left is not equal to \c right /// \return `true` if \a `left` is not equal to \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -405,7 +405,7 @@ template <typename T>
/// \class sf::Vector2 /// \class sf::Vector2
/// \ingroup system /// \ingroup system
/// ///
/// sf::Vector2 is a simple class that defines a mathematical /// `sf::Vector2` is a simple class that defines a mathematical
/// vector with two coordinates (x and y). It can be used to /// vector with two coordinates (x and y). It can be used to
/// represent anything that has two dimensions: a size, a point, /// represent anything that has two dimensions: a size, a point,
/// a velocity, a scale, etc. /// a velocity, a scale, etc.
@ -422,13 +422,13 @@ template <typename T>
/// results cannot be represented accurately with integers. /// results cannot be represented accurately with integers.
/// The method documentation mentions "(floating-point)" in those cases. /// The method documentation mentions "(floating-point)" in those cases.
/// ///
/// You generally don't have to care about the templated form (sf::Vector2<T>), /// You generally don't have to care about the templated form (`sf::Vector2<T>`),
/// the most common specializations have special type aliases: /// the most common specializations have special type aliases:
/// \li sf::Vector2<float> is sf::Vector2f /// \li `sf::Vector2<float>` is `sf::Vector2f`
/// \li sf::Vector2<int> is sf::Vector2i /// \li `sf::Vector2<int>` is `sf::Vector2i`
/// \li sf::Vector2<unsigned int> is sf::Vector2u /// \li `sf::Vector2<unsigned int>` is `sf::Vector2u`
/// ///
/// The sf::Vector2 class has a simple interface, its x and y members /// The `sf::Vector2` class has a simple interface, its x and y members
/// can be accessed directly (there are no accessors like setX(), getX()). /// can be accessed directly (there are no accessors like setX(), getX()).
/// ///
/// Usage example: /// Usage example:
@ -446,6 +446,6 @@ template <typename T>
/// bool different = (v != u); /// bool different = (v != u);
/// \endcode /// \endcode
/// ///
/// Note: for 3-dimensional vectors, see sf::Vector3. /// Note: for 3-dimensional vectors, see `sf::Vector3`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -41,7 +41,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///
/// Creates a Vector3(0, 0, 0). /// Creates a `Vector3(0, 0, 0)`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr Vector3() = default; constexpr Vector3() = default;
@ -73,7 +73,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Length of the vector <i><b>(floating-point)</b></i>. /// \brief Length of the vector <i><b>(floating-point)</b></i>.
/// ///
/// If you are not interested in the actual length, but only in comparisons, consider using lengthSquared(). /// If you are not interested in the actual length, but only in comparisons, consider using `lengthSquared()`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API T length() const; [[nodiscard]] SFML_SYSTEM_API T length() const;
@ -81,7 +81,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Square of vector's length. /// \brief Square of vector's length.
/// ///
/// Suitable for comparisons, more efficient than length(). /// Suitable for comparisons, more efficient than `length()`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr T lengthSquared() const; [[nodiscard]] constexpr T lengthSquared() const;
@ -89,7 +89,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Vector with same direction but length 1 <i><b>(floating-point)</b></i>. /// \brief Vector with same direction but length 1 <i><b>(floating-point)</b></i>.
/// ///
/// \pre \c *this is no zero vector. /// \pre `*this` is no zero vector.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_SYSTEM_API Vector3 normalized() const; [[nodiscard]] SFML_SYSTEM_API Vector3 normalized() const;
@ -107,9 +107,9 @@ public:
[[nodiscard]] constexpr Vector3 cross(const Vector3& rhs) const; [[nodiscard]] constexpr Vector3 cross(const Vector3& rhs) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Component-wise multiplication of \c *this and \c rhs. /// \brief Component-wise multiplication of `*this` and \a `rhs`.
/// ///
/// Computes <tt>(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z)</tt>. /// Computes `(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z)`.
/// ///
/// Scaling is the most common use case for component-wise multiplication/division. /// Scaling is the most common use case for component-wise multiplication/division.
/// This operation is also known as the Hadamard or Schur product. /// This operation is also known as the Hadamard or Schur product.
@ -118,13 +118,13 @@ public:
[[nodiscard]] constexpr Vector3 componentWiseMul(const Vector3& rhs) const; [[nodiscard]] constexpr Vector3 componentWiseMul(const Vector3& rhs) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Component-wise division of \c *this and \c rhs. /// \brief Component-wise division of `*this` and \a `rhs`.
/// ///
/// Computes <tt>(lhs.x/rhs.x, lhs.y/rhs.y, lhs.z/rhs.z)</tt>. /// Computes `(lhs.x/rhs.x, lhs.y/rhs.y, lhs.z/rhs.z)`.
/// ///
/// Scaling is the most common use case for component-wise multiplication/division. /// Scaling is the most common use case for component-wise multiplication/division.
/// ///
/// \pre Neither component of \c rhs is zero. /// \pre Neither component of \a `rhs` is zero.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] constexpr Vector3 componentWiseDiv(const Vector3& rhs) const; [[nodiscard]] constexpr Vector3 componentWiseDiv(const Vector3& rhs) const;
@ -139,11 +139,11 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of unary operator - /// \brief Overload of unary `operator-`
/// ///
/// \param left Vector to negate /// \param left Vector to negate
/// ///
/// \return Memberwise opposite of the vector /// \return Member-wise opposite of the vector
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -151,15 +151,15 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator += /// \brief Overload of binary `operator+=`
/// ///
/// This operator performs a memberwise addition of both vectors, /// This operator performs a member-wise addition of both vectors,
/// and assigns the result to \a left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Reference to \a left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -167,15 +167,15 @@ constexpr Vector3<T>& operator+=(Vector3<T>& left, const Vector3<T>& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator -= /// \brief Overload of binary `operator-=`
/// ///
/// This operator performs a memberwise subtraction of both vectors, /// This operator performs a member-wise subtraction of both vectors,
/// and assigns the result to \a left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Reference to \a left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -183,12 +183,12 @@ constexpr Vector3<T>& operator-=(Vector3<T>& left, const Vector3<T>& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator + /// \brief Overload of binary `operator+`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Memberwise addition of both vectors /// \return Member-wise addition of both vectors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -196,12 +196,12 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator - /// \brief Overload of binary `operator-`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Memberwise subtraction of both vectors /// \return Member-wise subtraction of both vectors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -209,12 +209,12 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator * /// \brief Overload of binary `operator*`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Memberwise multiplication by \a right /// \return Member-wise multiplication by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -222,12 +222,12 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator * /// \brief Overload of binary `operator*`
/// ///
/// \param left Left operand (a scalar value) /// \param left Left operand (a scalar value)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return Memberwise multiplication by \a left /// \return Member-wise multiplication by \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -235,15 +235,15 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator *= /// \brief Overload of binary `operator*=`
/// ///
/// This operator performs a memberwise multiplication by \a right, /// This operator performs a member-wise multiplication by \a `right`,
/// and assigns the result to \a left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Reference to \a left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -251,12 +251,12 @@ constexpr Vector3<T>& operator*=(Vector3<T>& left, T right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator / /// \brief Overload of binary `operator/`
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Memberwise division by \a right /// \return Member-wise division by \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -264,15 +264,15 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator /= /// \brief Overload of binary `operator/=`
/// ///
/// This operator performs a memberwise division by \a right, /// This operator performs a member-wise division by \a `right`,
/// and assigns the result to \a left. /// and assigns the result to \a `left`.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a scalar value) /// \param right Right operand (a scalar value)
/// ///
/// \return Reference to \a left /// \return Reference to \a `left`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -280,14 +280,14 @@ constexpr Vector3<T>& operator/=(Vector3<T>& left, T right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator == /// \brief Overload of binary `operator==`
/// ///
/// This operator compares strict equality between two vectors. /// This operator compares strict equality between two vectors.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return True if \a left is equal to \a right /// \return `true` if \a `left` is equal to \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -295,14 +295,14 @@ template <typename T>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates Vector3 /// \relates Vector3
/// \brief Overload of binary operator != /// \brief Overload of binary `operator!=`
/// ///
/// This operator compares strict difference between two vectors. /// This operator compares strict difference between two vectors.
/// ///
/// \param left Left operand (a vector) /// \param left Left operand (a vector)
/// \param right Right operand (a vector) /// \param right Right operand (a vector)
/// ///
/// \return True if \a left is not equal to \a right /// \return `true` if \a `left` is not equal to \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -321,7 +321,7 @@ using Vector3f = Vector3<float>;
/// \class sf::Vector3 /// \class sf::Vector3
/// \ingroup system /// \ingroup system
/// ///
/// sf::Vector3 is a simple class that defines a mathematical /// `sf::Vector3` is a simple class that defines a mathematical
/// vector with three coordinates (x, y and z). It can be used to /// vector with three coordinates (x, y and z). It can be used to
/// represent anything that has three dimensions: a size, a point, /// represent anything that has three dimensions: a size, a point,
/// a velocity, etc. /// a velocity, etc.
@ -334,13 +334,13 @@ using Vector3f = Vector3<float>;
/// results cannot be represented accurately with integers. /// results cannot be represented accurately with integers.
/// The method documentation mentions "(floating-point)" in those cases. /// The method documentation mentions "(floating-point)" in those cases.
/// ///
/// You generally don't have to care about the templated form (sf::Vector3<T>), /// You generally don't have to care about the templated form (`sf::Vector3<T>`),
/// the most common specializations have special type aliases: /// the most common specializations have special type aliases:
/// \li sf::Vector3<float> is sf::Vector3f /// \li `sf::Vector3<float>` is `sf::Vector3f`
/// \li sf::Vector3<int> is sf::Vector3i /// \li `sf::Vector3<int>` is `sf::Vector3i`
/// ///
/// The sf::Vector3 class has a small and simple interface, its x, y and z members /// The `sf::Vector3` class has a small and simple interface, its x, y and z members
/// can be accessed directly (there are no accessors like setX(), getX()). /// can be accessed directly (there are no accessors like `setX()`, `getX()`).
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -358,6 +358,6 @@ using Vector3f = Vector3<float>;
/// bool different = (v != u); /// bool different = (v != u);
/// \endcode /// \endcode
/// ///
/// Note: for 2-dimensional vectors, see sf::Vector2. /// Note: for 2-dimensional vectors, see `sf::Vector2`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -45,9 +45,9 @@ namespace Clipboard
/// ///
/// This function returns the content of the clipboard /// This function returns the content of the clipboard
/// as a string. If the clipboard does not contain string /// as a string. If the clipboard does not contain string
/// it returns an empty sf::String object. /// it returns an empty `sf::String` object.
/// ///
/// \return Clipboard contents as sf::String object /// \return Clipboard contents as `sf::String` object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API String getString(); [[nodiscard]] SFML_WINDOW_API String getString();
@ -63,7 +63,7 @@ namespace Clipboard
/// guaranteed to work if there is currently an /// guaranteed to work if there is currently an
/// open window for which events are being handled. /// open window for which events are being handled.
/// ///
/// \param text sf::String containing the data to be sent /// \param text `sf::String` containing the data to be sent
/// to the clipboard /// to the clipboard
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -77,7 +77,7 @@ SFML_WINDOW_API void setString(const String& text);
/// \namespace sf::Clipboard /// \namespace sf::Clipboard
/// \ingroup window /// \ingroup window
/// ///
/// sf::Clipboard provides an interface for getting and /// `sf::Clipboard` provides an interface for getting and
/// setting the contents of the system clipboard. /// setting the contents of the system clipboard.
/// ///
/// It is important to note that due to limitations on some /// It is important to note that due to limitations on some
@ -109,6 +109,6 @@ SFML_WINDOW_API void setString(const String& text);
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::String, sf::Event /// \see `sf::String`, `sf::Event`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -100,9 +100,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Activate or deactivate explicitly the context /// \brief Activate or deactivate explicitly the context
/// ///
/// \param active True to activate, false to deactivate /// \param active `true` to activate, `false` to deactivate
/// ///
/// \return True on success, false on failure /// \return `true` on success, `false` on failure
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool setActive(bool active); [[nodiscard]] bool setActive(bool active);
@ -124,7 +124,7 @@ public:
/// ///
/// \param name Name of the extension to check for /// \param name Name of the extension to check for
/// ///
/// \return True if available, false if unavailable /// \return `true` if available, `false` if unavailable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool isExtensionAvailable(std::string_view name); [[nodiscard]] static bool isExtensionAvailable(std::string_view name);
@ -145,11 +145,11 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the currently active context /// \brief Get the currently active context
/// ///
/// This function will only return sf::Context objects. /// This function will only return `sf::Context` objects.
/// Contexts created e.g. by RenderTargets or for internal /// Contexts created e.g. by RenderTargets or for internal
/// use will not be returned by this function. /// use will not be returned by this function.
/// ///
/// \return The currently active context or a null pointer if none is active /// \return The currently active context or `nullptr` if none is active
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static const Context* getActiveContext(); [[nodiscard]] static const Context* getActiveContext();
@ -201,7 +201,7 @@ private:
/// if you create a new thread it will have no valid context /// if you create a new thread it will have no valid context
/// by default. /// by default.
/// ///
/// To use a sf::Context instance, just construct it and let it /// To use a `sf::Context` instance, just construct it and let it
/// live as long as you need a valid context. No explicit activation /// live as long as you need a valid context. No explicit activation
/// is needed, all it has to do is to exist. Its destructor /// is needed, all it has to do is to exist. Its destructor
/// will take care of deactivating and freeing all the attached /// will take care of deactivating and freeing all the attached

View File

@ -120,6 +120,6 @@ struct ContextSettings
/// are not supported by the system; instead, SFML will try to /// are not supported by the system; instead, SFML will try to
/// find the closest valid match. You can then retrieve the /// find the closest valid match. You can then retrieve the
/// settings that the window actually used to create its context, /// settings that the window actually used to create its context,
/// with Window::getSettings(). /// with `Window::getSettings()`.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -56,29 +56,29 @@ public:
/// Refer to the following table to determine which cursor /// Refer to the following table to determine which cursor
/// is available on which platform. /// is available on which platform.
/// ///
/// Type | Linux | macOS | Windows | /// Type | Linux | macOS | Windows |
/// ------------------------------------------|:-----:|:-----:|:--------:| /// --------------------------------------------|:-----:|:-----:|:--------:|
/// sf::Cursor::Type::Arrow | yes | yes | yes | /// `sf::Cursor::Type::Arrow` | yes | yes | yes |
/// sf::Cursor::Type::ArrowWait | no | no | yes | /// `sf::Cursor::Type::ArrowWait` | no | no | yes |
/// sf::Cursor::Type::Wait | yes | no | yes | /// `sf::Cursor::Type::Wait` | yes | no | yes |
/// sf::Cursor::Type::Text | yes | yes | yes | /// `sf::Cursor::Type::Text` | yes | yes | yes |
/// sf::Cursor::Type::Hand | yes | yes | yes | /// `sf::Cursor::Type::Hand` | yes | yes | yes |
/// sf::Cursor::Type::SizeHorizontal | yes | yes | yes | /// `sf::Cursor::Type::SizeHorizontal` | yes | yes | yes |
/// sf::Cursor::Type::SizeVertical | yes | yes | yes | /// `sf::Cursor::Type::SizeVertical` | yes | yes | yes |
/// sf::Cursor::Type::SizeTopLeftBottomRight | no | yes* | yes | /// `sf::Cursor::Type::SizeTopLeftBottomRight` | no | yes* | yes |
/// sf::Cursor::Type::SizeBottomLeftTopRight | no | yes* | yes | /// `sf::Cursor::Type::SizeBottomLeftTopRight` | no | yes* | yes |
/// sf::Cursor::Type::SizeLeft | yes | yes** | yes** | /// `sf::Cursor::Type::SizeLeft` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeRight | yes | yes** | yes** | /// `sf::Cursor::Type::SizeRight` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeTop | yes | yes** | yes** | /// `sf::Cursor::Type::SizeTop` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeBottom | yes | yes** | yes** | /// `sf::Cursor::Type::SizeBottom` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeTopLeft | yes | yes** | yes** | /// `sf::Cursor::Type::SizeTopLeft` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeTopRight | yes | yes** | yes** | /// `sf::Cursor::Type::SizeTopRight` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeBottomLeft | yes | yes** | yes** | /// `sf::Cursor::Type::SizeBottomLeft` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeBottomRight | yes | yes** | yes** | /// `sf::Cursor::Type::SizeBottomRight` | yes | yes** | yes** |
/// sf::Cursor::Type::SizeAll | yes | no | yes | /// `sf::Cursor::Type::SizeAll` | yes | no | yes |
/// sf::Cursor::Type::Cross | yes | yes | yes | /// `sf::Cursor::Type::Cross` | yes | yes | yes |
/// sf::Cursor::Type::Help | yes | yes* | yes | /// `sf::Cursor::Type::Help` | yes | yes* | yes |
/// sf::Cursor::Type::NotAllowed | yes | yes | yes | /// `sf::Cursor::Type::NotAllowed` | yes | yes | yes |
/// ///
/// * These cursor types are undocumented so may not /// * These cursor types are undocumented so may not
/// be available on all versions, but have been tested on 10.13 /// be available on all versions, but have been tested on 10.13
@ -147,12 +147,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a cursor with the provided image /// \brief Construct a cursor with the provided image
/// ///
/// \a pixels must be an array of \a width by \a height pixels /// \a `pixels` must be an array of \a `size` pixels in
/// in 32-bit RGBA format. If not, this will cause undefined behavior. /// 32-bit RGBA format. If not, this will cause undefined behavior.
/// ///
/// If \a pixels is null or either \a width or \a height are 0, /// If \a `pixels` is `nullptr` or either of \a `size`'s
/// the current cursor is left unchanged and the function will /// properties are 0, the current cursor is left unchanged
/// return false. /// and the function will return `false`.
/// ///
/// In addition to specifying the pixel data, you can also /// In addition to specifying the pixel data, you can also
/// specify the location of the hotspot of the cursor. The /// specify the location of the hotspot of the cursor. The
@ -180,7 +180,7 @@ public:
/// \brief Create a native system cursor /// \brief Create a native system cursor
/// ///
/// Refer to the list of cursor available on each system /// Refer to the list of cursor available on each system
/// (see sf::Cursor::Type) to know whether a given cursor is /// (see `sf::Cursor::Type`) to know whether a given cursor is
/// expected to load successfully or is not supported by /// expected to load successfully or is not supported by
/// the operating system. /// the operating system.
/// ///
@ -196,12 +196,12 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a cursor with the provided image /// \brief Create a cursor with the provided image
/// ///
/// \a pixels must be an array of \a width by \a height pixels /// \a `pixels` must be an array of \a `size` pixels
/// in 32-bit RGBA format. If not, this will cause undefined behavior. /// in 32-bit RGBA format. If not, this will cause undefined behavior.
/// ///
/// If \a pixels is null or either \a width or \a height are 0, /// If \a `pixels` is `nullptr` or either of \a `size`'s
/// the current cursor is left unchanged and the function will /// properties are 0, the current cursor is left unchanged
/// return false. /// and the function will return `false`.
/// ///
/// In addition to specifying the pixel data, you can also /// In addition to specifying the pixel data, you can also
/// specify the location of the hotspot of the cursor. The /// specify the location of the hotspot of the cursor. The
@ -229,7 +229,7 @@ public:
/// \brief Create a native system cursor /// \brief Create a native system cursor
/// ///
/// Refer to the list of cursor available on each system /// Refer to the list of cursor available on each system
/// (see sf::Cursor::Type) to know whether a given cursor is /// (see `sf::Cursor::Type`) to know whether a given cursor is
/// expected to load successfully or is not supported by /// expected to load successfully or is not supported by
/// the operating system. /// the operating system.
/// ///
@ -253,7 +253,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get access to the underlying implementation /// \brief Get access to the underlying implementation
/// ///
/// This is primarily designed for sf::WindowBase::setMouseCursor, /// This is primarily designed for `sf::WindowBase::setMouseCursor`,
/// hence the friendship. /// hence the friendship.
/// ///
/// \return a reference to the OS-specific implementation /// \return a reference to the OS-specific implementation
@ -282,8 +282,8 @@ private:
/// cursor. /// cursor.
/// ///
/// After loading the cursor graphical appearance /// After loading the cursor graphical appearance
/// with either createFromPixels() or createFromSystem(), the /// with either `createFromPixels()` or `createFromSystem()`, the
/// cursor can be changed with sf::WindowBase::setMouseCursor(). /// cursor can be changed with `sf::WindowBase::setMouseCursor()`.
/// ///
/// The behavior is undefined if the cursor is destroyed while /// The behavior is undefined if the cursor is destroyed while
/// in use by the window. /// in use by the window.
@ -298,6 +298,6 @@ private:
/// window.setMouseCursor(cursor); /// window.setMouseCursor(cursor);
/// \endcode /// \endcode
/// ///
/// \see sf::WindowBase::setMouseCursor /// \see `sf::WindowBase::setMouseCursor`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -167,7 +167,7 @@ public:
/// single pixel, no MouseMoved event will be generated. In /// single pixel, no MouseMoved event will be generated. In
/// contrast, any movement information generated by the /// contrast, any movement information generated by the
/// mouse independent of its sensor resolution will always /// mouse independent of its sensor resolution will always
/// generate a MouseMovedRaw event. /// generate a `MouseMovedRaw` event.
/// ///
/// In addition to screen resolution independence, raw /// In addition to screen resolution independence, raw
/// mouse data also does not have mouse acceleration or /// mouse data also does not have mouse acceleration or
@ -297,7 +297,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct from a given `sf::Event` subtype /// \brief Construct from a given `sf::Event` subtype
/// ///
/// \tparam TEventSubtype Type of event subtype used to construct the event /// \tparam `TEventSubtype` Type of event subtype used to construct the event
/// ///
/// \param eventSubtype Event subtype instance used to construct the event /// \param eventSubtype Event subtype instance used to construct the event
/// ///
@ -308,9 +308,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check current event subtype /// \brief Check current event subtype
/// ///
/// \tparam TEventSubtype Type of the event subtype to check against /// \tparam `TEventSubtype` Type of the event subtype to check against
/// ///
/// \return True if the current event subtype matches given template parameter /// \return `true` if the current event subtype matches given template parameter
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename TEventSubtype> template <typename TEventSubtype>
@ -319,7 +319,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Attempt to get specified event subtype /// \brief Attempt to get specified event subtype
/// ///
/// \tparam TEventSubtype Type of the desired event subtype /// \tparam `TEventSubtype` Type of the desired event subtype
/// ///
/// \return Address of current event subtype, otherwise `nullptr` /// \return Address of current event subtype, otherwise `nullptr`
/// ///

View File

@ -79,7 +79,7 @@ struct SFML_WINDOW_API Identification
/// ///
/// \param joystick Index of the joystick to check /// \param joystick Index of the joystick to check
/// ///
/// \return True if the joystick is connected, false otherwise /// \return `true` if the joystick is connected, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isConnected(unsigned int joystick); [[nodiscard]] SFML_WINDOW_API bool isConnected(unsigned int joystick);
@ -99,12 +99,12 @@ struct SFML_WINDOW_API Identification
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check if a joystick supports a given axis /// \brief Check if a joystick supports a given axis
/// ///
/// If the joystick is not connected, this function returns false. /// If the joystick is not connected, this function returns `false`.
/// ///
/// \param joystick Index of the joystick /// \param joystick Index of the joystick
/// \param axis Axis to check /// \param axis Axis to check
/// ///
/// \return True if the joystick supports the axis, false otherwise /// \return `true` if the joystick supports the axis, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool hasAxis(unsigned int joystick, Axis axis); [[nodiscard]] SFML_WINDOW_API bool hasAxis(unsigned int joystick, Axis axis);
@ -112,12 +112,12 @@ struct SFML_WINDOW_API Identification
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check if a joystick button is pressed /// \brief Check if a joystick button is pressed
/// ///
/// If the joystick is not connected, this function returns false. /// If the joystick is not connected, this function returns `false`.
/// ///
/// \param joystick Index of the joystick /// \param joystick Index of the joystick
/// \param button Button to check /// \param button Button to check
/// ///
/// \return True if the button is pressed, false otherwise /// \return `true` if the button is pressed, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isButtonPressed(unsigned int joystick, unsigned int button); [[nodiscard]] SFML_WINDOW_API bool isButtonPressed(unsigned int joystick, unsigned int button);
@ -162,14 +162,14 @@ SFML_WINDOW_API void update();
/// \namespace sf::Joystick /// \namespace sf::Joystick
/// \ingroup window /// \ingroup window
/// ///
/// sf::Joystick provides an interface to the state of the /// `sf::Joystick` provides an interface to the state of the
/// joysticks. Each joystick is identified by an index that /// joysticks. Each joystick is identified by an index that
/// is passed to the functions in this namespace. /// is passed to the functions in this namespace.
/// ///
/// This namespace allows users to query the state of joysticks at any /// This namespace allows users to query the state of joysticks at any
/// time and directly, without having to deal with a window and /// time and directly, without having to deal with a window and
/// its events. Compared to the JoystickMoved, JoystickButtonPressed /// its events. Compared to the `JoystickMoved`, `JoystickButtonPressed`
/// and JoystickButtonReleased events, sf::Joystick can retrieve the /// and `JoystickButtonReleased` events, `sf::Joystick` can retrieve the
/// state of axes and buttons of joysticks at any time /// state of axes and buttons of joysticks at any time
/// (you don't need to store and update a boolean on your side /// (you don't need to store and update a boolean on your side
/// in order to know if a button is pressed or released), and you /// in order to know if a button is pressed or released), and you
@ -178,17 +178,17 @@ SFML_WINDOW_API void update();
/// and no event is triggered. /// and no event is triggered.
/// ///
/// SFML supports: /// SFML supports:
/// \li 8 joysticks (sf::Joystick::Count) /// \li 8 joysticks (`sf::Joystick::Count`)
/// \li 32 buttons per joystick (sf::Joystick::ButtonCount) /// \li 32 buttons per joystick (`sf::Joystick::ButtonCount`)
/// \li 8 axes per joystick (sf::Joystick::AxisCount) /// \li 8 axes per joystick (`sf::Joystick::AxisCount`)
/// ///
/// Unlike the keyboard or mouse, the state of joysticks is sometimes /// Unlike the keyboard or mouse, the state of joysticks is sometimes
/// not directly available (depending on the OS), therefore an update() /// not directly available (depending on the OS), therefore an `update()`
/// function must be called in order to update the current state of /// function must be called in order to update the current state of
/// joysticks. When you have a window with event handling, this is done /// joysticks. When you have a window with event handling, this is done
/// automatically, you don't need to call anything. But if you have no /// automatically, you don't need to call anything. But if you have no
/// window, or if you want to check joysticks state before creating one, /// window, or if you want to check joysticks state before creating one,
/// you must call sf::Joystick::update explicitly. /// you must call `sf::Joystick::update` explicitly.
/// ///
/// Usage example: /// Usage example:
/// \code /// \code
@ -208,6 +208,6 @@ SFML_WINDOW_API void update();
/// float position = sf::Joystick::getAxisPosition(0, sf::Joystick::Axis::Y); /// float position = sf::Joystick::getAxisPosition(0, sf::Joystick::Axis::Y);
/// \endcode /// \endcode
/// ///
/// \see sf::Keyboard, sf::Mouse /// \see `sf::Keyboard`, `sf::Mouse`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -155,7 +155,7 @@ enum class Key
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief The total number of keyboard keys, ignoring Key::Unknown /// \brief The total number of keyboard keys, ignoring `Key::Unknown`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// NOLINTNEXTLINE(readability-identifier-naming) // NOLINTNEXTLINE(readability-identifier-naming)
@ -329,7 +329,7 @@ enum class Scan
using Scancode = Scan; using Scancode = Scan;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief The total number of scancodes, ignoring Scan::Unknown /// \brief The total number of scancodes, ignoring `Scan::Unknown`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// NOLINTNEXTLINE(readability-identifier-naming) // NOLINTNEXTLINE(readability-identifier-naming)
@ -340,7 +340,7 @@ static constexpr unsigned int ScancodeCount{static_cast<unsigned int>(Scan::Laun
/// ///
/// \param key Key to check /// \param key Key to check
/// ///
/// \return True if the key is pressed, false otherwise /// \return `true` if the key is pressed, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isKeyPressed(Key key); [[nodiscard]] SFML_WINDOW_API bool isKeyPressed(Key key);
@ -350,7 +350,7 @@ static constexpr unsigned int ScancodeCount{static_cast<unsigned int>(Scan::Laun
/// ///
/// \param code Scancode to check /// \param code Scancode to check
/// ///
/// \return True if the physical key is pressed, false otherwise /// \return `true` if the physical key is pressed, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isKeyPressed(Scancode code); [[nodiscard]] SFML_WINDOW_API bool isKeyPressed(Scancode code);
@ -362,10 +362,10 @@ static constexpr unsigned int ScancodeCount{static_cast<unsigned int>(Scan::Laun
/// ///
/// \return The key corresponding to the scancode under the current /// \return The key corresponding to the scancode under the current
/// keyboard layout used by the operating system, or /// keyboard layout used by the operating system, or
/// sf::Keyboard::Key::Unknown when the scancode cannot be mapped /// `sf::Keyboard::Key::Unknown` when the scancode cannot be mapped
/// to a Key. /// to a Key.
/// ///
/// \see delocalize /// \see `delocalize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API Key localize(Scancode code); [[nodiscard]] SFML_WINDOW_API Key localize(Scancode code);
@ -377,10 +377,10 @@ static constexpr unsigned int ScancodeCount{static_cast<unsigned int>(Scan::Laun
/// ///
/// \return The scancode corresponding to the key under the current /// \return The scancode corresponding to the key under the current
/// keyboard layout used by the operating system, or /// keyboard layout used by the operating system, or
/// sf::Keyboard::Scan::Unknown when the key cannot be mapped /// `sf::Keyboard::Scan::Unknown` when the key cannot be mapped
/// to a sf::Keyboard::Scancode. /// to a `sf::Keyboard::Scancode`.
/// ///
/// \see localize /// \see `localize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API Scancode delocalize(Key key); [[nodiscard]] SFML_WINDOW_API Scancode delocalize(Key key);
@ -393,12 +393,12 @@ static constexpr unsigned int ScancodeCount{static_cast<unsigned int>(Scan::Laun
/// used in user interfaces, as the description for the key takes /// used in user interfaces, as the description for the key takes
/// the users keyboard layout into consideration. /// the users keyboard layout into consideration.
/// ///
/// \warning The result is OS-dependent: for example, sf::Keyboard::Scan::LSystem /// \warning The result is OS-dependent: for example, `sf::Keyboard::Scan::LSystem`
/// is "Left Meta" on Linux, "Left Windows" on Windows and /// is "Left Meta" on Linux, "Left Windows" on Windows and
/// "Left Command" on macOS. /// "Left Command" on macOS.
/// ///
/// The current keyboard layout set by the operating system is used to /// The current keyboard layout set by the operating system is used to
/// interpret the scancode: for example, sf::Keyboard::Key::Semicolon is /// interpret the scancode: for example, `sf::Keyboard::Key::Semicolon` is
/// mapped to ";" for layout and to "é" for others. /// mapped to ";" for layout and to "é" for others.
/// ///
/// \param code Scancode to check /// \param code Scancode to check
@ -418,7 +418,7 @@ static constexpr unsigned int ScancodeCount{static_cast<unsigned int>(Scan::Laun
/// If the virtual keyboard is not available, this function does /// If the virtual keyboard is not available, this function does
/// nothing. /// nothing.
/// ///
/// \param visible True to show, false to hide /// \param visible `true` to show, `false` to hide
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_WINDOW_API void setVirtualKeyboardVisible(bool visible); SFML_WINDOW_API void setVirtualKeyboardVisible(bool visible);
@ -431,13 +431,13 @@ SFML_WINDOW_API void setVirtualKeyboardVisible(bool visible);
/// \namespace sf::Keyboard /// \namespace sf::Keyboard
/// \ingroup window /// \ingroup window
/// ///
/// sf::Keyboard provides an interface to the state of the /// `sf::Keyboard` provides an interface to the state of the
/// keyboard. /// keyboard.
/// ///
/// This namespace allows users to query the keyboard state at any /// This namespace allows users to query the keyboard state at any
/// time and directly, without having to deal with a window and /// time and directly, without having to deal with a window and
/// its events. Compared to the KeyPressed and KeyReleased events, /// its events. Compared to the `KeyPressed` and `KeyReleased` events,
/// sf::Keyboard can retrieve the state of a key at any time /// `sf::Keyboard` can retrieve the state of a key at any time
/// (you don't need to store and update a boolean on your side /// (you don't need to store and update a boolean on your side
/// in order to know if a key is pressed or released), and you /// in order to know if a key is pressed or released), and you
/// always get the real state of the keyboard, even if keys are /// always get the real state of the keyboard, even if keys are
@ -464,6 +464,6 @@ SFML_WINDOW_API void setVirtualKeyboardVisible(bool visible);
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see sf::Joystick, sf::Mouse, sf::Touch /// \see `sf::Joystick`, `sf::Mouse`, `sf::Touch`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -71,12 +71,12 @@ enum class Wheel
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed /// \brief Check if a mouse button is pressed
/// ///
/// \warning Checking the state of buttons Mouse::Button::Extra1 and /// \warning Checking the state of buttons `Mouse::Button::Extra1` and
/// Mouse::Button::Extra2 is not supported on Linux with X11. /// `Mouse::Button::Extra2` is not supported on Linux with X11.
/// ///
/// \param button Button to check /// \param button Button to check
/// ///
/// \return True if the button is pressed, false otherwise /// \return `true` if the button is pressed, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isButtonPressed(Button button); [[nodiscard]] SFML_WINDOW_API bool isButtonPressed(Button button);
@ -136,13 +136,13 @@ SFML_WINDOW_API void setPosition(Vector2i position, const WindowBase& relativeTo
/// \namespace sf::Mouse /// \namespace sf::Mouse
/// \ingroup window /// \ingroup window
/// ///
/// sf::Mouse provides an interface to the state of the /// `sf::Mouse` provides an interface to the state of the
/// mouse. A single mouse is assumed. /// mouse. A single mouse is assumed.
/// ///
/// This namespace allows users to query the mouse state at any /// This namespace allows users to query the mouse state at any
/// time and directly, without having to deal with a window and /// time and directly, without having to deal with a window and
/// its events. Compared to the MouseMoved, MouseButtonPressed /// its events. Compared to the `MouseMoved`, `MouseButtonPressed`
/// and MouseButtonReleased events, sf::Mouse can retrieve the /// and `MouseButtonReleased` events, `sf::Mouse` can retrieve the
/// state of the cursor and the buttons at any time /// state of the cursor and the buttons at any time
/// (you don't need to store and update a boolean on your side /// (you don't need to store and update a boolean on your side
/// in order to know if a button is pressed or released), and you /// in order to know if a button is pressed or released), and you
@ -150,7 +150,7 @@ SFML_WINDOW_API void setPosition(Vector2i position, const WindowBase& relativeTo
/// moved, pressed or released when your window is out of focus /// moved, pressed or released when your window is out of focus
/// and no event is triggered. /// and no event is triggered.
/// ///
/// The setPosition and getPosition functions can be used to change /// The `setPosition` and `getPosition` functions can be used to change
/// or retrieve the current position of the mouse pointer. There are /// or retrieve the current position of the mouse pointer. There are
/// two versions: one that operates in global coordinates (relative /// two versions: one that operates in global coordinates (relative
/// to the desktop) and one that operates in window coordinates /// to the desktop) and one that operates in window coordinates
@ -170,6 +170,6 @@ SFML_WINDOW_API void setPosition(Vector2i position, const WindowBase& relativeTo
/// sf::Mouse::setPosition(sf::Vector2i(100, 200), window); /// sf::Mouse::setPosition(sf::Vector2i(100, 200), window);
/// \endcode /// \endcode
/// ///
/// \see sf::Joystick, sf::Keyboard, sf::Touch /// \see `sf::Joystick`, `sf::Keyboard`, `sf::Touch`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -59,7 +59,7 @@ static constexpr unsigned int Count{6}; //!< The total number of sensor types
/// ///
/// \param sensor Sensor to check /// \param sensor Sensor to check
/// ///
/// \return True if the sensor is available, false otherwise /// \return `true` if the sensor is available, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isAvailable(Type sensor); [[nodiscard]] SFML_WINDOW_API bool isAvailable(Type sensor);
@ -74,7 +74,7 @@ static constexpr unsigned int Count{6}; //!< The total number of sensor types
/// This function does nothing if the sensor is unavailable. /// This function does nothing if the sensor is unavailable.
/// ///
/// \param sensor Sensor to enable /// \param sensor Sensor to enable
/// \param enabled True to enable, false to disable /// \param enabled `true` to enable, `false` to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_WINDOW_API void setEnabled(Type sensor, bool enabled); SFML_WINDOW_API void setEnabled(Type sensor, bool enabled);
@ -95,19 +95,19 @@ SFML_WINDOW_API void setEnabled(Type sensor, bool enabled);
/// \namespace sf::Sensor /// \namespace sf::Sensor
/// \ingroup window /// \ingroup window
/// ///
/// sf::Sensor provides an interface to the state of the /// `sf::Sensor` provides an interface to the state of the
/// various sensors that a device provides. /// various sensors that a device provides.
/// ///
/// This namespace allows users to query the sensors values at any /// This namespace allows users to query the sensors values at any
/// time and directly, without having to deal with a window and /// time and directly, without having to deal with a window and
/// its events. Compared to the SensorChanged event, sf::Sensor /// its events. Compared to the SensorChanged event, `sf::Sensor`
/// can retrieve the state of a sensor at any time (you don't need to /// can retrieve the state of a sensor at any time (you don't need to
/// store and update its current value on your side). /// store and update its current value on your side).
/// ///
/// Depending on the OS and hardware of the device (phone, tablet, ...), /// Depending on the OS and hardware of the device (phone, tablet, ...),
/// some sensor types may not be available. You should always check /// some sensor types may not be available. You should always check
/// the availability of a sensor before trying to read it, with the /// the availability of a sensor before trying to read it, with the
/// sf::Sensor::isAvailable function. /// `sf::Sensor::isAvailable` function.
/// ///
/// You may wonder why some sensor types look so similar, for example /// You may wonder why some sensor types look so similar, for example
/// Accelerometer and Gravity / UserAcceleration. The first one /// Accelerometer and Gravity / UserAcceleration. The first one
@ -119,7 +119,7 @@ SFML_WINDOW_API void setEnabled(Type sensor, bool enabled);
/// This is exactly the same for Gyroscope vs Orientation. /// This is exactly the same for Gyroscope vs Orientation.
/// ///
/// Because sensors consume a non-negligible amount of current, they are /// Because sensors consume a non-negligible amount of current, they are
/// all disabled by default. You must call sf::Sensor::setEnabled for each /// all disabled by default. You must call `sf::Sensor::setEnabled` for each
/// sensor in which you are interested. /// sensor in which you are interested.
/// ///
/// Usage example: /// Usage example:

View File

@ -47,7 +47,7 @@ namespace Touch
/// ///
/// \param finger Finger index /// \param finger Finger index
/// ///
/// \return True if \a finger is currently touching the screen, false otherwise /// \return `true` if \a finger is currently touching the screen, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isDown(unsigned int finger); [[nodiscard]] SFML_WINDOW_API bool isDown(unsigned int finger);
@ -87,13 +87,13 @@ namespace Touch
/// \namespace sf::Touch /// \namespace sf::Touch
/// \ingroup window /// \ingroup window
/// ///
/// sf::Touch provides an interface to the state of the /// `sf::Touch` provides an interface to the state of the
/// touches. /// touches.
/// ///
/// This namespace allows users to query the touches state at any /// This namespace allows users to query the touches state at any
/// time and directly, without having to deal with a window and /// time and directly, without having to deal with a window and
/// its events. Compared to the TouchBegan, TouchMoved /// its events. Compared to the `TouchBegan`, `TouchMoved`
/// and TouchEnded events, sf::Touch can retrieve the /// and `TouchEnded` events, `sf::Touch` can retrieve the
/// state of the touches at any time (you don't need to store and /// state of the touches at any time (you don't need to store and
/// update a boolean on your side in order to know if a touch is down), /// update a boolean on your side in order to know if a touch is down),
/// and you always get the real state of the touches, even if they /// and you always get the real state of the touches, even if they
@ -126,6 +126,6 @@ namespace Touch
/// sf::Vector2i relativePos = sf::Touch::getPosition(1, window); /// sf::Vector2i relativePos = sf::Touch::getPosition(1, window);
/// \endcode /// \endcode
/// ///
/// \see sf::Joystick, sf::Keyboard, sf::Mouse /// \see `sf::Joystick`, `sf::Keyboard`, `sf::Mouse`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -37,7 +37,7 @@
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief VideoMode defines a video mode (width, height, bpp) /// \brief VideoMode defines a video mode (size, bpp)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_WINDOW_API VideoMode class SFML_WINDOW_API VideoMode
@ -91,7 +91,7 @@ public:
/// fullscreen windows; otherwise any video mode can be used /// fullscreen windows; otherwise any video mode can be used
/// with no restriction. /// with no restriction.
/// ///
/// \return True if the video mode is valid for fullscreen mode /// \return `true` if the video mode is valid for fullscreen mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isValid() const; [[nodiscard]] bool isValid() const;
@ -105,72 +105,72 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates VideoMode /// \relates VideoMode
/// \brief Overload of == operator to compare two video modes /// \brief Overload of `operator==` to compare two video modes
/// ///
/// \param left Left operand (a video mode) /// \param left Left operand (a video mode)
/// \param right Right operand (a video mode) /// \param right Right operand (a video mode)
/// ///
/// \return True if modes are equal /// \return `true` if modes are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool operator==(const VideoMode& left, const VideoMode& right); [[nodiscard]] SFML_WINDOW_API bool operator==(const VideoMode& left, const VideoMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates VideoMode /// \relates VideoMode
/// \brief Overload of != operator to compare two video modes /// \brief Overload of `operator!=` to compare two video modes
/// ///
/// \param left Left operand (a video mode) /// \param left Left operand (a video mode)
/// \param right Right operand (a video mode) /// \param right Right operand (a video mode)
/// ///
/// \return True if modes are different /// \return `true` if modes are different
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool operator!=(const VideoMode& left, const VideoMode& right); [[nodiscard]] SFML_WINDOW_API bool operator!=(const VideoMode& left, const VideoMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates VideoMode /// \relates VideoMode
/// \brief Overload of < operator to compare video modes /// \brief Overload of `operator<` to compare video modes
/// ///
/// \param left Left operand (a video mode) /// \param left Left operand (a video mode)
/// \param right Right operand (a video mode) /// \param right Right operand (a video mode)
/// ///
/// \return True if \a left is lesser than \a right /// \return `true` if \a `left` is lesser than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool operator<(const VideoMode& left, const VideoMode& right); [[nodiscard]] SFML_WINDOW_API bool operator<(const VideoMode& left, const VideoMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates VideoMode /// \relates VideoMode
/// \brief Overload of > operator to compare video modes /// \brief Overload of `operator>` to compare video modes
/// ///
/// \param left Left operand (a video mode) /// \param left Left operand (a video mode)
/// \param right Right operand (a video mode) /// \param right Right operand (a video mode)
/// ///
/// \return True if \a left is greater than \a right /// \return `true` if \a `left` is greater than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool operator>(const VideoMode& left, const VideoMode& right); [[nodiscard]] SFML_WINDOW_API bool operator>(const VideoMode& left, const VideoMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates VideoMode /// \relates VideoMode
/// \brief Overload of <= operator to compare video modes /// \brief Overload of `operator<=` to compare video modes
/// ///
/// \param left Left operand (a video mode) /// \param left Left operand (a video mode)
/// \param right Right operand (a video mode) /// \param right Right operand (a video mode)
/// ///
/// \return True if \a left is lesser or equal than \a right /// \return `true` if \a `left` is lesser or equal than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool operator<=(const VideoMode& left, const VideoMode& right); [[nodiscard]] SFML_WINDOW_API bool operator<=(const VideoMode& left, const VideoMode& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \relates VideoMode /// \relates VideoMode
/// \brief Overload of >= operator to compare video modes /// \brief Overload of `operator>=` to compare video modes
/// ///
/// \param left Left operand (a video mode) /// \param left Left operand (a video mode)
/// \param right Right operand (a video mode) /// \param right Right operand (a video mode)
/// ///
/// \return True if \a left is greater or equal than \a right /// \return `true` if \a `left` is greater or equal than \a `right`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool operator>=(const VideoMode& left, const VideoMode& right); [[nodiscard]] SFML_WINDOW_API bool operator>=(const VideoMode& left, const VideoMode& right);
@ -184,7 +184,7 @@ public:
/// ///
/// A video mode is defined by a width and a height (in pixels) /// A video mode is defined by a width and a height (in pixels)
/// and a depth (in bits per pixel). Video modes are used to /// and a depth (in bits per pixel). Video modes are used to
/// setup windows (sf::Window) at creation time. /// setup windows (`sf::Window`) at creation time.
/// ///
/// The main usage of video modes is for fullscreen mode: /// The main usage of video modes is for fullscreen mode:
/// indeed you must use one of the valid video modes /// indeed you must use one of the valid video modes
@ -192,15 +192,15 @@ public:
/// and the graphics card support), otherwise your window /// and the graphics card support), otherwise your window
/// creation will just fail. /// creation will just fail.
/// ///
/// sf::VideoMode provides a static function for retrieving /// `sf::VideoMode` provides a static function for retrieving
/// the list of all the video modes supported by the system: /// the list of all the video modes supported by the system:
/// getFullscreenModes(). /// `getFullscreenModes()`.
/// ///
/// A custom video mode can also be checked directly for /// A custom video mode can also be checked directly for
/// fullscreen compatibility with its isValid() function. /// fullscreen compatibility with its `isValid()` function.
/// ///
/// Additionally, sf::VideoMode provides a static function /// Additionally, `sf::VideoMode` provides a static function
/// to get the mode currently used by the desktop: getDesktopMode(). /// to get the mode currently used by the desktop: `getDesktopMode()`.
/// This allows to build windows with the same size or pixel /// This allows to build windows with the same size or pixel
/// depth as the current resolution. /// depth as the current resolution.
/// ///

View File

@ -66,16 +66,16 @@ namespace Vulkan
/// \brief Tell whether or not the system supports Vulkan /// \brief Tell whether or not the system supports Vulkan
/// ///
/// This function should always be called before using /// This function should always be called before using
/// the Vulkan features. If it returns false, then /// the Vulkan features. If it returns `false`, then
/// any attempt to use Vulkan will fail. /// any attempt to use Vulkan will fail.
/// ///
/// If only compute is required, set \a requireGraphics /// If only compute is required, set \a `requireGraphics`
/// to false to skip checking for the extensions necessary /// to `false` to skip checking for the extensions necessary
/// for graphics rendering. /// for graphics rendering.
/// ///
/// \param requireGraphics /// \param requireGraphics
/// ///
/// \return True if Vulkan is supported, false otherwise /// \return `true` if Vulkan is supported, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] SFML_WINDOW_API bool isAvailable(bool requireGraphics = true); [[nodiscard]] SFML_WINDOW_API bool isAvailable(bool requireGraphics = true);

View File

@ -59,7 +59,7 @@ public:
/// \brief Default constructor /// \brief Default constructor
/// ///
/// This constructor doesn't actually create the window, /// This constructor doesn't actually create the window,
/// use the other constructors or call create() to do so. /// use the other constructors or call `create()` to do so.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Window(); Window();
@ -68,10 +68,10 @@ public:
/// \brief Construct a new window /// \brief Construct a new window
/// ///
/// This constructor creates the window with the size and pixel /// This constructor creates the window with the size and pixel
/// depth defined in \a mode. An optional style can be passed to /// depth defined in \a `mode`. An optional style can be passed to
/// customize the look and behavior of the window (borders, /// customize the look and behavior of the window (borders,
/// title bar, resizable, closable, ...). An optional state can /// title bar, resizable, closable, ...). An optional state can
/// be provided. If \a state is State::Fullscreen, then \a mode /// be provided. If \a `state` is `State::Fullscreen`, then \a `mode`
/// must be a valid video mode. /// must be a valid video mode.
/// ///
/// The last parameter is an optional structure specifying /// The last parameter is an optional structure specifying
@ -80,7 +80,7 @@ public:
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
/// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param style %Window style, a bitwise OR combination of `sf::Style` enumerators
/// \param state %Window state /// \param state %Window state
/// \param settings Additional settings for the underlying OpenGL context /// \param settings Additional settings for the underlying OpenGL context
/// ///
@ -95,11 +95,11 @@ public:
/// \brief Construct a new window /// \brief Construct a new window
/// ///
/// This constructor creates the window with the size and pixel /// This constructor creates the window with the size and pixel
/// depth defined in \a mode. If \a state is State::Fullscreen, /// depth defined in \a `mode`. If \a `state` is `State::Fullscreen`,
/// then \a mode must be a valid video mode. /// then \a `mode` must be a valid video mode.
/// ///
/// The last parameter is an optional structure specifying /// The last parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. /// depth-buffer bits, etc.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
@ -117,7 +117,7 @@ public:
/// rendering area into an already existing control. /// rendering area into an already existing control.
/// ///
/// The second parameter is an optional structure specifying /// The second parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. /// depth-buffer bits, etc.
/// ///
/// \param handle Platform-specific handle of the control /// \param handle Platform-specific handle of the control
@ -162,12 +162,12 @@ public:
/// \brief Create (or recreate) the window /// \brief Create (or recreate) the window
/// ///
/// If the window was already created, it closes it first. /// If the window was already created, it closes it first.
/// If \a state is State::Fullscreen, then \a mode must be /// If \a `state` is `State::Fullscreen`, then \a `mode` must be
/// a valid video mode. /// a valid video mode.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
/// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param style %Window style, a bitwise OR combination of `sf::Style` enumerators
/// \param state %Window state /// \param state %Window state
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -177,16 +177,16 @@ public:
/// \brief Create (or recreate) the window /// \brief Create (or recreate) the window
/// ///
/// If the window was already created, it closes it first. /// If the window was already created, it closes it first.
/// If \a state is State::Fullscreen, then \a mode must be /// If \a `state` is `State::Fullscreen`, then \a `mode` must be
/// a valid video mode. /// a valid video mode.
/// ///
/// The last parameter is an optional structure specifying /// The last parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. /// depth-buffer bits, etc.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
/// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param style %Window style, a bitwise OR combination of `sf::Style` enumerators
/// \param state %Window state /// \param state %Window state
/// \param settings Additional settings for the underlying OpenGL context /// \param settings Additional settings for the underlying OpenGL context
/// ///
@ -213,7 +213,7 @@ public:
/// If the window was already created, it closes it first. /// If the window was already created, it closes it first.
/// ///
/// The second parameter is an optional structure specifying /// The second parameter is an optional structure specifying
/// advanced OpenGL context settings such as antialiasing, /// advanced OpenGL context settings such as anti-aliasing,
/// depth-buffer bits, etc. /// depth-buffer bits, etc.
/// ///
/// \param handle Platform-specific handle of the control /// \param handle Platform-specific handle of the control
@ -225,10 +225,10 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Close the window and destroy all the attached resources /// \brief Close the window and destroy all the attached resources
/// ///
/// After calling this function, the sf::Window instance remains /// After calling this function, the `sf::Window` instance remains
/// valid and you can call create() to recreate the window. /// valid and you can call `create()` to recreate the window.
/// All other functions such as pollEvent() or display() will /// All other functions such as `pollEvent()` or `display()` will
/// still work (i.e. you don't have to test isOpen() every time), /// still work (i.e. you don't have to test `isOpen()` every time),
/// and will have no effect on closed windows. /// and will have no effect on closed windows.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -238,7 +238,7 @@ public:
/// \brief Get the settings of the OpenGL context of the window /// \brief Get the settings of the OpenGL context of the window
/// ///
/// Note that these settings may be different from what was /// Note that these settings may be different from what was
/// passed to the constructor or the create() function, /// passed to the constructor or the `create()` function,
/// if one or more settings were not supported. In this case, /// if one or more settings were not supported. In this case,
/// SFML chose the closest match. /// SFML chose the closest match.
/// ///
@ -257,7 +257,7 @@ public:
/// ///
/// Vertical synchronization is disabled by default. /// Vertical synchronization is disabled by default.
/// ///
/// \param enabled True to enable v-sync, false to deactivate it /// \param enabled `true` to enable v-sync, `false` to deactivate it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setVerticalSyncEnabled(bool enabled); void setVerticalSyncEnabled(bool enabled);
@ -266,10 +266,10 @@ public:
/// \brief Limit the framerate to a maximum fixed frequency /// \brief Limit the framerate to a maximum fixed frequency
/// ///
/// If a limit is set, the window will use a small delay after /// If a limit is set, the window will use a small delay after
/// each call to display() to ensure that the current frame /// each call to `display()` to ensure that the current frame
/// lasted long enough to match the framerate limit. /// lasted long enough to match the framerate limit.
/// SFML will try to match the given limit as much as it can, /// SFML will try to match the given limit as much as it can,
/// but since it internally uses sf::sleep, whose precision /// but since it internally uses `sf::sleep`, whose precision
/// depends on the underlying OS, the results may be a little /// depends on the underlying OS, the results may be a little
/// imprecise as well (for example, you can get 65 FPS when /// imprecise as well (for example, you can get 65 FPS when
/// requesting 60). /// requesting 60).
@ -288,11 +288,11 @@ public:
/// on the previous thread first if it was active. /// on the previous thread first if it was active.
/// Only one window can be active on a thread at a time, thus /// Only one window can be active on a thread at a time, thus
/// the window previously active (if any) automatically gets deactivated. /// the window previously active (if any) automatically gets deactivated.
/// This is not to be confused with requestFocus(). /// This is not to be confused with `requestFocus()`.
/// ///
/// \param active True to activate, false to deactivate /// \param active `true` to activate, `false` to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return `true` if operation was successful, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool setActive(bool active = true) const; [[nodiscard]] bool setActive(bool active = true) const;
@ -329,25 +329,25 @@ private:
/// \class sf::Window /// \class sf::Window
/// \ingroup window /// \ingroup window
/// ///
/// sf::Window is the main class of the Window module. It defines /// `sf::Window` is the main class of the Window module. It defines
/// an OS window that is able to receive an OpenGL rendering. /// an OS window that is able to receive an OpenGL rendering.
/// ///
/// A sf::Window can create its own new window, or be embedded into /// A `sf::Window` can create its own new window, or be embedded into
/// an already existing control using the create(handle) function. /// an already existing control using the `create(handle)` function.
/// This can be useful for embedding an OpenGL rendering area into /// This can be useful for embedding an OpenGL rendering area into
/// a view which is part of a bigger GUI with existing windows, /// a view which is part of a bigger GUI with existing windows,
/// controls, etc. It can also serve as embedding an OpenGL rendering /// controls, etc. It can also serve as embedding an OpenGL rendering
/// area into a window created by another (probably richer) GUI library /// area into a window created by another (probably richer) GUI library
/// like Qt or wxWidgets. /// like Qt or wxWidgets.
/// ///
/// The sf::Window class provides a simple interface for manipulating /// The `sf::Window` class provides a simple interface for manipulating
/// the window: move, resize, show/hide, control mouse cursor, etc. /// the window: move, resize, show/hide, control mouse cursor, etc.
/// It also provides event handling through its pollEvent() and waitEvent() /// It also provides event handling through its `pollEvent()` and `waitEvent()`
/// functions. /// functions.
/// ///
/// Note that OpenGL experts can pass their own parameters (antialiasing /// Note that OpenGL experts can pass their own parameters (anti-aliasing
/// level, bits for the depth and stencil buffers, etc.) to the /// level, bits for the depth and stencil buffers, etc.) to the
/// OpenGL context attached to the window, with the sf::ContextSettings /// OpenGL context attached to the window, with the `sf::ContextSettings`
/// structure which is passed as an optional argument when creating the /// structure which is passed as an optional argument when creating the
/// window. /// window.
/// ///
@ -355,7 +355,7 @@ private:
/// and a powerful discrete GPU, the driver picks which GPU will run an /// and a powerful discrete GPU, the driver picks which GPU will run an
/// SFML application. In order to inform the driver that an SFML application /// SFML application. In order to inform the driver that an SFML application
/// can benefit from being run on the more powerful discrete GPU, /// can benefit from being run on the more powerful discrete GPU,
/// #SFML_DEFINE_DISCRETE_GPU_PREFERENCE can be placed in a source file /// `#SFML_DEFINE_DISCRETE_GPU_PREFERENCE` can be placed in a source file
/// that is compiled and linked into the final application. The macro /// that is compiled and linked into the final application. The macro
/// should be placed outside of any scopes in the global namespace. /// should be placed outside of any scopes in the global namespace.
/// ///

View File

@ -66,7 +66,7 @@ public:
/// \brief Default constructor /// \brief Default constructor
/// ///
/// This constructor doesn't actually create the window, /// This constructor doesn't actually create the window,
/// use the other constructors or call create() to do so. /// use the other constructors or call `create()` to do so.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WindowBase(); WindowBase();
@ -75,15 +75,15 @@ public:
/// \brief Construct a new window /// \brief Construct a new window
/// ///
/// This constructor creates the window with the size and pixel /// This constructor creates the window with the size and pixel
/// depth defined in \a mode. An optional style can be passed to /// depth defined in \a `mode`. An optional style can be passed to
/// customize the look and behavior of the window (borders, /// customize the look and behavior of the window (borders,
/// title bar, resizable, closable, ...). An optional state can /// title bar, resizable, closable, ...). An optional state can
/// be provided. If \a state is State::Fullscreen, then \a mode /// be provided. If \a `state` is `State::Fullscreen`, then \a `mode`
/// must be a valid video mode. /// must be a valid video mode.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
/// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param style %Window style, a bitwise OR combination of `sf::Style` enumerators
/// \param state %Window state /// \param state %Window state
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -93,7 +93,7 @@ public:
/// \brief Construct a new window /// \brief Construct a new window
/// ///
/// This constructor creates the window with the size and pixel /// This constructor creates the window with the size and pixel
/// depth defined in \a mode. /// depth defined in \a `mode`.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
@ -146,12 +146,12 @@ public:
/// \brief Create (or recreate) the window /// \brief Create (or recreate) the window
/// ///
/// If the window was already created, it closes it first. /// If the window was already created, it closes it first.
/// If \a state is State::Fullscreen, then \a mode must be /// If \a `state` is `State::Fullscreen`, then \a `mode` must be
/// a valid video mode. /// a valid video mode.
/// ///
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
/// \param title Title of the window /// \param title Title of the window
/// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param style %Window style, a bitwise OR combination of `sf::Style` enumerators
/// \param state %Window state /// \param state %Window state
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -168,10 +168,10 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Close the window and destroy all the attached resources /// \brief Close the window and destroy all the attached resources
/// ///
/// After calling this function, the sf::Window instance remains /// After calling this function, the `sf::Window` instance remains
/// valid and you can call create() to recreate the window. /// valid and you can call `create()` to recreate the window.
/// All other functions such as pollEvent() or display() will /// All other functions such as `pollEvent()` or `display()` will
/// still work (i.e. you don't have to test isOpen() every time), /// still work (i.e. you don't have to test `isOpen()` every time),
/// and will have no effect on closed windows. /// and will have no effect on closed windows.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -181,10 +181,10 @@ public:
/// \brief Tell whether or not the window is open /// \brief Tell whether or not the window is open
/// ///
/// This function returns whether or not the window exists. /// This function returns whether or not the window exists.
/// Note that a hidden window (setVisible(false)) is open /// Note that a hidden window (`setVisible(false)`) is open
/// (therefore this function would return true). /// (therefore this function would return `true`).
/// ///
/// \return True if the window is open, false if it has been closed /// \return `true` if the window is open, `false` if it has been closed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool isOpen() const; [[nodiscard]] bool isOpen() const;
@ -206,7 +206,7 @@ public:
/// ///
/// \return The event, otherwise `std::nullopt` if no events are pending /// \return The event, otherwise `std::nullopt` if no events are pending
/// ///
/// \see waitEvent, handleEvents /// \see `waitEvent`, `handleEvents`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::optional<Event> pollEvent(); [[nodiscard]] std::optional<Event> pollEvent();
@ -232,7 +232,7 @@ public:
/// ///
/// \return The event, otherwise `std::nullopt` on timeout or if window was closed /// \return The event, otherwise `std::nullopt` on timeout or if window was closed
/// ///
/// \see pollEvent, handleEvents /// \see `pollEvent`, `handleEvents`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::optional<Event> waitEvent(Time timeout = Time::Zero); [[nodiscard]] std::optional<Event> waitEvent(Time timeout = Time::Zero);
@ -246,7 +246,7 @@ public:
/// This function can take a variadic list of event handlers that /// This function can take a variadic list of event handlers that
/// each take a concrete event type as a single parameter. The event /// each take a concrete event type as a single parameter. The event
/// handlers can be any kind of callable object that has an /// handlers can be any kind of callable object that has an
/// operator() defined for a specific event type. Additionally a /// `operator()` defined for a specific event type. Additionally a
/// generic callable can also be provided that will be invoked for /// generic callable can also be provided that will be invoked for
/// every event type. If both types of callables are provided, the /// every event type. If both types of callables are provided, the
/// callables taking concrete event types will be preferred over the /// callables taking concrete event types will be preferred over the
@ -309,7 +309,7 @@ public:
/// ///
/// \param handlers A variadic list of callables that take a specific event as their only parameter /// \param handlers A variadic list of callables that take a specific event as their only parameter
/// ///
/// \see waitEvent, pollEvent /// \see `waitEvent`, `pollEvent`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename... Ts> template <typename... Ts>
@ -320,7 +320,7 @@ public:
/// ///
/// \return Position of the window, in pixels /// \return Position of the window, in pixels
/// ///
/// \see setPosition /// \see `setPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2i getPosition() const; [[nodiscard]] Vector2i getPosition() const;
@ -334,7 +334,7 @@ public:
/// ///
/// \param position New position, in pixels /// \param position New position, in pixels
/// ///
/// \see getPosition /// \see `getPosition`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setPosition(Vector2i position); void setPosition(Vector2i position);
@ -347,7 +347,7 @@ public:
/// ///
/// \return Size in pixels /// \return Size in pixels
/// ///
/// \see setSize /// \see `setSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] Vector2u getSize() const; [[nodiscard]] Vector2u getSize() const;
@ -357,7 +357,7 @@ public:
/// ///
/// \param size New size, in pixels /// \param size New size, in pixels
/// ///
/// \see getSize /// \see `getSize`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setSize(Vector2u size); void setSize(Vector2u size);
@ -387,7 +387,7 @@ public:
/// ///
/// \param title New title /// \param title New title
/// ///
/// \see setIcon /// \see `setIcon`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setTitle(const String& title); void setTitle(const String& title);
@ -395,7 +395,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Change the window's icon /// \brief Change the window's icon
/// ///
/// \a pixels must be an array of \a width x \a height pixels /// \a `pixels` must be an array of \a `size` pixels
/// in 32-bits RGBA format. /// in 32-bits RGBA format.
/// ///
/// The OS default icon is used by default. /// The OS default icon is used by default.
@ -405,7 +405,7 @@ public:
/// pixels are copied, so you need not keep the /// pixels are copied, so you need not keep the
/// source alive after calling this function. /// source alive after calling this function.
/// ///
/// \see setTitle /// \see `setTitle`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setIcon(Vector2u size, const std::uint8_t* pixels); void setIcon(Vector2u size, const std::uint8_t* pixels);
@ -415,7 +415,7 @@ public:
/// ///
/// The window is shown by default. /// The window is shown by default.
/// ///
/// \param visible True to show the window, false to hide it /// \param visible `true` to show the window, `false` to hide it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setVisible(bool visible); void setVisible(bool visible);
@ -425,7 +425,7 @@ public:
/// ///
/// The mouse cursor is visible by default. /// The mouse cursor is visible by default.
/// ///
/// \param visible True to show the mouse cursor, false to hide it /// \param visible `true` to show the mouse cursor, `false` to hide it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMouseCursorVisible(bool visible); void setMouseCursorVisible(bool visible);
@ -438,7 +438,7 @@ public:
/// Note that grabbing is only active while the window has /// Note that grabbing is only active while the window has
/// focus. /// focus.
/// ///
/// \param grabbed True to enable, false to disable /// \param grabbed `true` to enable, `false` to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMouseCursorGrabbed(bool grabbed); void setMouseCursorGrabbed(bool grabbed);
@ -456,8 +456,7 @@ public:
/// ///
/// \param cursor Native system cursor type to display /// \param cursor Native system cursor type to display
/// ///
/// \see sf::Cursor::createFromSystem /// \see `sf::Cursor::createFromSystem`, `sf::Cursor::createFromPixels`
/// \see sf::Cursor::createFromPixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setMouseCursor(const Cursor& cursor); void setMouseCursor(const Cursor& cursor);
@ -471,7 +470,7 @@ public:
/// ///
/// Key repeat is enabled by default. /// Key repeat is enabled by default.
/// ///
/// \param enabled True to enable, false to disable /// \param enabled `true` to enable, `false` to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void setKeyRepeatEnabled(bool enabled); void setKeyRepeatEnabled(bool enabled);
@ -498,9 +497,9 @@ public:
/// If a window requests focus, it only hints to the operating /// If a window requests focus, it only hints to the operating
/// system, that it would like to be focused. The operating system /// system, that it would like to be focused. The operating system
/// is free to deny the request. /// is free to deny the request.
/// This is not to be confused with setActive(). /// This is not to be confused with `setActive()`.
/// ///
/// \see hasFocus /// \see `hasFocus`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void requestFocus(); void requestFocus();
@ -512,8 +511,8 @@ public:
/// to receive input events such as keystrokes or most mouse /// to receive input events such as keystrokes or most mouse
/// events. /// events.
/// ///
/// \return True if window has focus, false otherwise /// \return `true` if window has focus, `false` otherwise
/// \see requestFocus /// \see `requestFocus`
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool hasFocus() const; [[nodiscard]] bool hasFocus() const;
@ -521,7 +520,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the OS-specific handle of the window /// \brief Get the OS-specific handle of the window
/// ///
/// The type of the returned handle is sf::WindowHandle, /// The type of the returned handle is `sf::WindowHandle`,
/// which is a type alias to the handle type defined by the OS. /// which is a type alias to the handle type defined by the OS.
/// You shouldn't need to use this function, unless you have /// You shouldn't need to use this function, unless you have
/// very specific stuff to implement that SFML doesn't support, /// very specific stuff to implement that SFML doesn't support,
@ -539,7 +538,7 @@ public:
/// \param surface Created surface /// \param surface Created surface
/// \param allocator Allocator to use /// \param allocator Allocator to use
/// ///
/// \return True if surface creation was successful, false otherwise /// \return `true` if surface creation was successful, `false` otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool createVulkanSurface(const VkInstance& instance, [[nodiscard]] bool createVulkanSurface(const VkInstance& instance,
@ -573,7 +572,7 @@ private:
/// \brief Processes an event before it is sent to the user /// \brief Processes an event before it is sent to the user
/// ///
/// This function is called every time an event is received /// This function is called every time an event is received
/// from the internal window (through pollEvent or waitEvent). /// from the internal window (through `pollEvent` or `waitEvent`).
/// It filters out unwanted events, and performs whatever internal /// It filters out unwanted events, and performs whatever internal
/// stuff the window needs before the event is returned to the /// stuff the window needs before the event is returned to the
/// user. /// user.
@ -604,14 +603,14 @@ private:
/// \class sf::WindowBase /// \class sf::WindowBase
/// \ingroup window /// \ingroup window
/// ///
/// sf::WindowBase serves as the base class for all Windows. /// `sf::WindowBase` serves as the base class for all Windows.
/// ///
/// A sf::WindowBase can create its own new window, or be embedded into /// A `sf::WindowBase` can create its own new window, or be embedded into
/// an already existing control using the create(handle) function. /// an already existing control using the `create(handle)` function.
/// ///
/// The sf::WindowBase class provides a simple interface for manipulating /// The `sf::WindowBase` class provides a simple interface for manipulating
/// the window: move, resize, show/hide, control mouse cursor, etc. /// the window: move, resize, show/hide, control mouse cursor, etc.
/// It also provides event handling through its pollEvent() and waitEvent() /// It also provides event handling through its `pollEvent()` and `waitEvent()`
/// functions. /// functions.
/// ///
/// Usage example: /// Usage example:

View File

@ -89,10 +89,10 @@ using WindowHandle = "platform-specific";
/// ///
/// \par macOS Specification /// \par macOS Specification
/// ///
/// On macOS, a sf::Window can be created either from an /// On macOS, a `sf::Window` can be created either from an
/// existing \p NSWindow* or an \p NSView*. When the window /// existing \p NSWindow* or an \p NSView*. When the window
/// is created from a window, SFML will use its content view /// is created from a window, SFML will use its content view
/// as the OpenGL area. sf::Window::getNativeHandle() will /// as the OpenGL area. `sf::Window::getNativeHandle()` will
/// return the handle that was used to create the window, /// return the handle that was used to create the window,
/// which is a \p NSWindow* by default. /// which is a \p NSWindow* by default.
/// ///

View File

@ -373,7 +373,7 @@ private:
std::optional<ma_log> m_log; //!< The miniaudio log std::optional<ma_log> m_log; //!< The miniaudio log
std::optional<ma_context> m_context; //!< The miniaudio context std::optional<ma_context> m_context; //!< The miniaudio context
std::optional<ma_device> m_playbackDevice; //!< The miniaudio playback device std::optional<ma_device> m_playbackDevice; //!< The miniaudio playback device
std::optional<ma_engine> m_engine; //!< The miniaudio engine (used for effects and spatialisation) std::optional<ma_engine> m_engine; //!< The miniaudio engine (used for effects and spatialization)
ResourceEntryList m_resources; //!< Registered resources ResourceEntryList m_resources; //!< Registered resources
std::mutex m_resourcesMutex; //!< The mutex guarding the registered resources std::mutex m_resourcesMutex; //!< The mutex guarding the registered resources
}; };

View File

@ -63,7 +63,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new context, not associated to a window /// \brief Create a new context, not associated to a window
/// ///
/// \param shared Context to share the new one with (can be nullptr) /// \param shared Context to share the new one with (can be `nullptr`)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
DRMContext(DRMContext* shared); DRMContext(DRMContext* shared);
@ -128,7 +128,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the EGL context /// \brief Create the EGL context
/// ///
/// \param shared Context to share the new one with (can be nullptr) /// \param shared Context to share the new one with (can be `nullptr`)
/// \param bitsPerPixel Pixel depth, in bits per pixel /// \param bitsPerPixel Pixel depth, in bits per pixel
/// \param settings Creation parameters /// \param settings Creation parameters
/// ///

View File

@ -58,7 +58,7 @@ namespace sf::priv::VulkanImpl
/// ///
/// \param name Name of the function to get the address of /// \param name Name of the function to get the address of
/// ///
/// \return Address of the Vulkan function, nullptr on failure /// \return Address of the Vulkan function, `nullptr` on failure
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] VulkanFunctionPointer getFunction(const char* name); [[nodiscard]] VulkanFunctionPointer getFunction(const char* name);

View File

@ -98,7 +98,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Try to convert a character into a SFML key code /// \brief Try to convert a character into a SFML key code
/// ///
/// Return sf::Keyboard::Key::Unknown if it doesn't match any 'localized' keys. /// Return `sf::Keyboard::Key::Unknown` if it doesn't match any 'localized' keys.
/// ///
/// By 'localized' we mean keys that depend on the keyboard layout /// By 'localized' we mean keys that depend on the keyboard layout
/// and might not be the same as the US keycode for some countries /// and might not be the same as the US keycode for some countries
@ -122,7 +122,7 @@ public:
/// \brief Try to convert a virtual keycode (HID level) into a /// \brief Try to convert a virtual keycode (HID level) into a
/// SFML scancode. /// SFML scancode.
/// ///
/// Return sf::Keyboard::Scan::Unknown if the keycode is unknown. /// Return `sf::Keyboard::Scan::Unknown` if the keycode is unknown.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static Keyboard::Scancode nonLocalizedKey(UniChar virtualKeycode); static Keyboard::Scancode nonLocalizedKey(UniChar virtualKeycode);