diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index 2cd1d2403..266fee1c1 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -66,6 +66,7 @@ function(set_file_warnings) -Wdouble-promotion # warn if float is implicit promoted to double -Wformat=2 # warn on security issues around functions that format output (ie printf) -Wimplicit-fallthrough # warn when a missing break causes control flow to continue at the next case in a switch statement + -Wsuggest-override # warn when 'override' could be used on a member function overriding a virtual function ${NON_ANDROID_CLANG_AND_GCC_WARNINGS} ) diff --git a/examples/shader/Effect.hpp b/examples/shader/Effect.hpp index f6065dfe0..f60d340b5 100644 --- a/examples/shader/Effect.hpp +++ b/examples/shader/Effect.hpp @@ -16,7 +16,7 @@ class Effect : public sf::Drawable { public: - virtual ~Effect() + ~Effect() override { } @@ -41,7 +41,7 @@ public: onUpdate(time, x, y); } - void draw(sf::RenderTarget& target, sf::RenderStates states) const + void draw(sf::RenderTarget& target, sf::RenderStates states) const override { if (m_isLoaded) { diff --git a/examples/shader/Shader.cpp b/examples/shader/Shader.cpp index 410db0fa8..163760f7e 100644 --- a/examples/shader/Shader.cpp +++ b/examples/shader/Shader.cpp @@ -21,7 +21,7 @@ public: { } - bool onLoad() + bool onLoad() override { // Load the texture and initialize the sprite if (!m_texture.loadFromFile("resources/background.jpg")) @@ -36,12 +36,12 @@ public: return true; } - void onUpdate(float, float x, float y) + void onUpdate(float, float x, float y) override { m_shader.setUniform("pixel_threshold", (x + y) / 30); } - void onDraw(sf::RenderTarget& target, sf::RenderStates states) const + void onDraw(sf::RenderTarget& target, sf::RenderStates states) const override { states.shader = &m_shader; target.draw(m_sprite, states); @@ -67,7 +67,7 @@ public: { } - bool onLoad() + bool onLoad() override { // Create the text m_text.setString("Praesent suscipit augue in velit pulvinar hendrerit varius purus aliquam.\n" @@ -99,14 +99,14 @@ public: return true; } - void onUpdate(float time, float x, float y) + void onUpdate(float time, float x, float y) override { m_shader.setUniform("wave_phase", time); m_shader.setUniform("wave_amplitude", sf::Vector2f(x * 40, y * 40)); m_shader.setUniform("blur_radius", (x + y) * 0.008f); } - void onDraw(sf::RenderTarget& target, sf::RenderStates states) const + void onDraw(sf::RenderTarget& target, sf::RenderStates states) const override { states.shader = &m_shader; target.draw(m_text, states); @@ -131,7 +131,7 @@ public: { } - bool onLoad() + bool onLoad() override { // Create the points m_points.setPrimitiveType(sf::Points); @@ -152,7 +152,7 @@ public: return true; } - void onUpdate(float time, float x, float y) + void onUpdate(float time, float x, float y) override { float radius = 200 + std::cos(time) * 150; m_shader.setUniform("storm_position", sf::Vector2f(x * 800, y * 600)); @@ -161,7 +161,7 @@ public: m_shader.setUniform("blink_alpha", 0.5f + std::cos(time * 3) * 0.25f); } - void onDraw(sf::RenderTarget& target, sf::RenderStates states) const + void onDraw(sf::RenderTarget& target, sf::RenderStates states) const override { states.shader = &m_shader; target.draw(m_points, states); @@ -186,7 +186,7 @@ public: { } - bool onLoad() + bool onLoad() override { // Create the off-screen surface if (!m_surface.create(800, 600)) @@ -220,7 +220,7 @@ public: return true; } - void onUpdate(float time, float x, float y) + void onUpdate(float time, float x, float y) override { m_shader.setUniform("edge_threshold", 1 - (x + y) / 2); @@ -241,7 +241,7 @@ public: m_surface.display(); } - void onDraw(sf::RenderTarget& target, sf::RenderStates states) const + void onDraw(sf::RenderTarget& target, sf::RenderStates states) const override { states.shader = &m_shader; target.draw(sf::Sprite(m_surface.getTexture()), states); @@ -271,7 +271,7 @@ public: { } - bool onLoad() + bool onLoad() override { // Check if geometry shaders are supported if (!sf::Shader::isGeometryAvailable()) @@ -301,7 +301,7 @@ public: return true; } - void onUpdate(float /*time*/, float x, float y) + void onUpdate(float /*time*/, float x, float y) override { // Reset our transformation matrix m_transform = sf::Transform::Identity; @@ -317,7 +317,7 @@ public: m_shader.setUniform("size", sf::Vector2f(size, size)); } - void onDraw(sf::RenderTarget& target, sf::RenderStates states) const + void onDraw(sf::RenderTarget& target, sf::RenderStates states) const override { // Prepare the render state states.shader = &m_shader; diff --git a/examples/voip/Client.cpp b/examples/voip/Client.cpp index 300370989..3b032f1ff 100644 --- a/examples/voip/Client.cpp +++ b/examples/voip/Client.cpp @@ -38,7 +38,7 @@ public: /// \see SoundRecorder::~SoundRecorder() /// //////////////////////////////////////////////////////////// - ~NetworkRecorder() + ~NetworkRecorder() override { // Make sure to stop the recording thread stop(); @@ -50,7 +50,7 @@ private: /// \see SoundRecorder::onStart /// //////////////////////////////////////////////////////////// - virtual bool onStart() + bool onStart() override { if (m_socket.connect(m_host, m_port) == sf::Socket::Done) { @@ -67,7 +67,7 @@ private: /// \see SoundRecorder::onProcessSamples /// //////////////////////////////////////////////////////////// - virtual bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount) + bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount) override { // Pack the audio samples into a network packet sf::Packet packet; @@ -82,7 +82,7 @@ private: /// \see SoundRecorder::onStop /// //////////////////////////////////////////////////////////// - virtual void onStop() + void onStop() override { // Send a "end-of-stream" packet sf::Packet packet; diff --git a/examples/voip/Server.cpp b/examples/voip/Server.cpp index a93cd7df0..e4c9c95f4 100644 --- a/examples/voip/Server.cpp +++ b/examples/voip/Server.cpp @@ -71,7 +71,7 @@ private: /// /see SoundStream::OnGetData /// //////////////////////////////////////////////////////////// - virtual bool onGetData(sf::SoundStream::Chunk& data) + bool onGetData(sf::SoundStream::Chunk& data) override { // We have reached the end of the buffer and all audio data have been played: we can stop playback if ((m_offset >= m_samples.size()) && m_hasFinished) @@ -102,7 +102,7 @@ private: /// /see SoundStream::OnSeek /// //////////////////////////////////////////////////////////// - virtual void onSeek(sf::Time timeOffset) + void onSeek(sf::Time timeOffset) override { m_offset = static_cast(timeOffset.asMilliseconds()) * getSampleRate() * getChannelCount() / 1000; } diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp index 141db6a16..b1bcbb29e 100644 --- a/include/SFML/Audio/Music.hpp +++ b/include/SFML/Audio/Music.hpp @@ -96,7 +96,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~Music(); + ~Music() override; //////////////////////////////////////////////////////////// /// \brief Open a music from an audio file @@ -223,7 +223,7 @@ protected: /// \return True to continue playback, false to stop /// //////////////////////////////////////////////////////////// - virtual bool onGetData(Chunk& data); + bool onGetData(Chunk& data) override; //////////////////////////////////////////////////////////// /// \brief Change the current playing position in the stream source @@ -231,7 +231,7 @@ protected: /// \param timeOffset New playing position, from the beginning of the music /// //////////////////////////////////////////////////////////// - virtual void onSeek(Time timeOffset); + void onSeek(Time timeOffset) override; //////////////////////////////////////////////////////////// /// \brief Change the current playing position in the stream source to the loop offset @@ -243,7 +243,7 @@ protected: /// \return The seek position after looping (or -1 if there's no loop) /// //////////////////////////////////////////////////////////// - virtual Int64 onLoop(); + Int64 onLoop() override; private: diff --git a/include/SFML/Audio/Sound.hpp b/include/SFML/Audio/Sound.hpp index 4891a568b..43f7c4ebf 100644 --- a/include/SFML/Audio/Sound.hpp +++ b/include/SFML/Audio/Sound.hpp @@ -72,7 +72,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~Sound(); + ~Sound() override; //////////////////////////////////////////////////////////// /// \brief Start or resume playing the sound @@ -86,7 +86,7 @@ public: /// \see pause, stop /// //////////////////////////////////////////////////////////// - void play(); + void play() override; //////////////////////////////////////////////////////////// /// \brief Pause the sound @@ -97,7 +97,7 @@ public: /// \see play, stop /// //////////////////////////////////////////////////////////// - void pause(); + void pause() override; //////////////////////////////////////////////////////////// /// \brief stop playing the sound @@ -109,7 +109,7 @@ public: /// \see play, pause /// //////////////////////////////////////////////////////////// - void stop(); + void stop() override; //////////////////////////////////////////////////////////// /// \brief Set the source buffer containing the audio data to play @@ -189,7 +189,7 @@ public: /// \return Current status of the sound /// //////////////////////////////////////////////////////////// - Status getStatus() const; + Status getStatus() const override; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator diff --git a/include/SFML/Audio/SoundBufferRecorder.hpp b/include/SFML/Audio/SoundBufferRecorder.hpp index 0646beffe..f223c9720 100644 --- a/include/SFML/Audio/SoundBufferRecorder.hpp +++ b/include/SFML/Audio/SoundBufferRecorder.hpp @@ -49,7 +49,7 @@ public: /// \brief destructor /// //////////////////////////////////////////////////////////// - ~SoundBufferRecorder(); + ~SoundBufferRecorder() override; //////////////////////////////////////////////////////////// /// \brief Get the sound buffer containing the captured audio data @@ -72,7 +72,7 @@ protected: /// \return True to start the capture, or false to abort it /// //////////////////////////////////////////////////////////// - virtual bool onStart(); + bool onStart() override; //////////////////////////////////////////////////////////// /// \brief Process a new chunk of recorded samples @@ -83,13 +83,13 @@ protected: /// \return True to continue the capture, or false to stop it /// //////////////////////////////////////////////////////////// - virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount); + bool onProcessSamples(const Int16* samples, std::size_t sampleCount) override; //////////////////////////////////////////////////////////// /// \brief Stop capturing audio data /// //////////////////////////////////////////////////////////// - virtual void onStop(); + void onStop() override; private: diff --git a/include/SFML/Audio/SoundFileReader.hpp b/include/SFML/Audio/SoundFileReader.hpp index 8671b60ac..c3b629b09 100644 --- a/include/SFML/Audio/SoundFileReader.hpp +++ b/include/SFML/Audio/SoundFileReader.hpp @@ -43,7 +43,6 @@ class InputStream; class SFML_AUDIO_API SoundFileReader { public: - //////////////////////////////////////////////////////////// /// \brief Structure holding the audio properties of a sound file /// @@ -136,19 +135,20 @@ public: /// // return true if the reader can handle the format /// } /// -/// virtual bool open(sf::InputStream& stream, Info& info) +/// bool open(sf::InputStream& stream, Info& info) override /// { /// // read the sound file header and fill the sound attributes /// // (channel count, sample count and sample rate) /// // return true on success /// } /// -/// virtual void seek(sf::Uint64 sampleOffset) +/// void seek(sf::Uint64 sampleOffset) override /// { -/// // advance to the sampleOffset-th sample from the beginning of the sound +/// // advance to the sampleOffset-th sample from the beginning of the +/// sound /// } /// -/// virtual sf::Uint64 read(sf::Int16* samples, sf::Uint64 maxCount) +/// sf::Uint64 read(sf::Int16* samples, sf::Uint64 maxCount) override /// { /// // read up to 'maxCount' samples into the 'samples' array, /// // convert them (for example from normalized float) if they are not stored diff --git a/include/SFML/Audio/SoundFileWriter.hpp b/include/SFML/Audio/SoundFileWriter.hpp index 5b4239327..d0c71ad9a 100644 --- a/include/SFML/Audio/SoundFileWriter.hpp +++ b/include/SFML/Audio/SoundFileWriter.hpp @@ -103,14 +103,14 @@ public: /// // return true if the writer can handle the format /// } /// -/// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) +/// bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) override /// { /// // open the file 'filename' for writing, /// // write the given sample rate and channel count to the file header /// // return true on success /// } /// -/// virtual void write(const sf::Int16* samples, sf::Uint64 count) +/// void write(const sf::Int16* samples, sf::Uint64 count) override /// { /// // write 'count' samples stored at address 'samples', /// // convert them (for example to normalized float) if the format requires it diff --git a/include/SFML/Audio/SoundRecorder.hpp b/include/SFML/Audio/SoundRecorder.hpp index 725f1dee6..5a15e60e6 100644 --- a/include/SFML/Audio/SoundRecorder.hpp +++ b/include/SFML/Audio/SoundRecorder.hpp @@ -365,7 +365,7 @@ private: /// stop(); /// } /// -/// virtual bool onStart() // optional +/// bool onStart() override // optional /// { /// // Initialize whatever has to be done before the capture starts /// ... @@ -374,7 +374,7 @@ private: /// return true; /// } /// -/// virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount) +/// bool onProcessSamples(const Int16* samples, std::size_t sampleCount) override /// { /// // Do something with the new chunk of samples (store them, send them, ...) /// ... @@ -383,7 +383,7 @@ private: /// return true; /// } /// -/// virtual void onStop() // optional +/// void onStop() override // optional /// { /// // Clean up whatever has to be done after the capture ends /// ... diff --git a/include/SFML/Audio/SoundStream.hpp b/include/SFML/Audio/SoundStream.hpp index 841466e21..f39cf3fd3 100644 --- a/include/SFML/Audio/SoundStream.hpp +++ b/include/SFML/Audio/SoundStream.hpp @@ -60,7 +60,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - virtual ~SoundStream(); + ~SoundStream() override; //////////////////////////////////////////////////////////// /// \brief Start or resume playing the audio stream @@ -74,7 +74,7 @@ public: /// \see pause, stop /// //////////////////////////////////////////////////////////// - void play(); + void play() override; //////////////////////////////////////////////////////////// /// \brief Pause the audio stream @@ -85,7 +85,7 @@ public: /// \see play, stop /// //////////////////////////////////////////////////////////// - void pause(); + void pause() override; //////////////////////////////////////////////////////////// /// \brief Stop playing the audio stream @@ -97,7 +97,7 @@ public: /// \see play, pause /// //////////////////////////////////////////////////////////// - void stop(); + void stop() override; //////////////////////////////////////////////////////////// /// \brief Return the number of channels of the stream @@ -126,7 +126,7 @@ public: /// \return Current status /// //////////////////////////////////////////////////////////// - Status getStatus() const; + Status getStatus() const override; //////////////////////////////////////////////////////////// /// \brief Change the current playing position of the stream @@ -391,7 +391,7 @@ private: /// /// private: /// -/// virtual bool onGetData(Chunk& data) +/// bool onGetData(Chunk& data) override /// { /// // Fill the chunk with audio data from the stream source /// // (note: must not be empty if you want to continue playing) @@ -402,7 +402,7 @@ private: /// return true; /// } /// -/// virtual void onSeek(sf::Time timeOffset) +/// void onSeek(sf::Time timeOffset) override /// { /// // Change the current position in the stream source /// ... diff --git a/include/SFML/Graphics/CircleShape.hpp b/include/SFML/Graphics/CircleShape.hpp index 467530be4..fa93e7417 100644 --- a/include/SFML/Graphics/CircleShape.hpp +++ b/include/SFML/Graphics/CircleShape.hpp @@ -89,7 +89,7 @@ public: /// \see setPointCount /// //////////////////////////////////////////////////////////// - virtual std::size_t getPointCount() const; + std::size_t getPointCount() const override; //////////////////////////////////////////////////////////// /// \brief Get a point of the circle @@ -104,7 +104,7 @@ public: /// \return index-th point of the shape /// //////////////////////////////////////////////////////////// - virtual Vector2f getPoint(std::size_t index) const; + Vector2f getPoint(std::size_t index) const override; private: diff --git a/include/SFML/Graphics/ConvexShape.hpp b/include/SFML/Graphics/ConvexShape.hpp index 6ad877e38..112b94ede 100644 --- a/include/SFML/Graphics/ConvexShape.hpp +++ b/include/SFML/Graphics/ConvexShape.hpp @@ -71,7 +71,7 @@ public: /// \see setPointCount /// //////////////////////////////////////////////////////////// - virtual std::size_t getPointCount() const; + std::size_t getPointCount() const override; //////////////////////////////////////////////////////////// /// \brief Set the position of a point @@ -105,7 +105,7 @@ public: /// \see setPoint /// //////////////////////////////////////////////////////////// - virtual Vector2f getPoint(std::size_t index) const; + Vector2f getPoint(std::size_t index) const override; private: diff --git a/include/SFML/Graphics/Drawable.hpp b/include/SFML/Graphics/Drawable.hpp index aa035e142..97d448e1f 100644 --- a/include/SFML/Graphics/Drawable.hpp +++ b/include/SFML/Graphics/Drawable.hpp @@ -100,7 +100,7 @@ protected: /// /// private: /// -/// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const +/// void draw(sf::RenderTarget& target, sf::RenderStates states) const override /// { /// // You can draw other high-level objects /// target.draw(m_sprite, states); diff --git a/include/SFML/Graphics/RectangleShape.hpp b/include/SFML/Graphics/RectangleShape.hpp index 5ff8364dc..783ccdb93 100644 --- a/include/SFML/Graphics/RectangleShape.hpp +++ b/include/SFML/Graphics/RectangleShape.hpp @@ -77,7 +77,7 @@ public: /// shapes, this number is always 4. /// //////////////////////////////////////////////////////////// - virtual std::size_t getPointCount() const; + std::size_t getPointCount() const override; //////////////////////////////////////////////////////////// /// \brief Get a point of the rectangle @@ -92,7 +92,7 @@ public: /// \return index-th point of the shape /// //////////////////////////////////////////////////////////// - virtual Vector2f getPoint(std::size_t index) const; + Vector2f getPoint(std::size_t index) const override; private: diff --git a/include/SFML/Graphics/RenderTexture.hpp b/include/SFML/Graphics/RenderTexture.hpp index c4de0cb47..1fdd4e896 100644 --- a/include/SFML/Graphics/RenderTexture.hpp +++ b/include/SFML/Graphics/RenderTexture.hpp @@ -64,7 +64,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - virtual ~RenderTexture(); + ~RenderTexture() override; //////////////////////////////////////////////////////////// /// \brief Create the render-texture @@ -193,7 +193,7 @@ public: /// \return True if operation was successful, false otherwise /// //////////////////////////////////////////////////////////// - bool setActive(bool active = true); + bool setActive(bool active = true) override; //////////////////////////////////////////////////////////// /// \brief Update the contents of the target texture @@ -215,7 +215,7 @@ public: /// \return Size in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// @@ -227,7 +227,7 @@ public: /// \return True if the render-texture use sRGB encoding, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool isSrgb() const; + bool isSrgb() const override; //////////////////////////////////////////////////////////// /// \brief Get a read-only reference to the target texture diff --git a/include/SFML/Graphics/RenderWindow.hpp b/include/SFML/Graphics/RenderWindow.hpp index 2f710e903..781dace80 100644 --- a/include/SFML/Graphics/RenderWindow.hpp +++ b/include/SFML/Graphics/RenderWindow.hpp @@ -99,7 +99,7 @@ public: /// Closes the window and frees all the resources attached to it. /// //////////////////////////////////////////////////////////// - virtual ~RenderWindow(); + ~RenderWindow() override; //////////////////////////////////////////////////////////// /// \brief Get the size of the rendering region of the window @@ -110,7 +110,7 @@ public: /// \return Size in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// @@ -121,7 +121,7 @@ public: /// \return True if the window use sRGB encoding, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool isSrgb() const; + bool isSrgb() const override; //////////////////////////////////////////////////////////// /// \brief Activate or deactivate the window as the current target @@ -139,7 +139,7 @@ public: /// \return True if operation was successful, false otherwise /// //////////////////////////////////////////////////////////// - bool setActive(bool active = true); + bool setActive(bool active = true) override; //////////////////////////////////////////////////////////// /// \brief Copy the current contents of the window to an image @@ -178,7 +178,7 @@ protected: /// the window is created. /// //////////////////////////////////////////////////////////// - virtual void onCreate(); + void onCreate() override; //////////////////////////////////////////////////////////// /// \brief Function called after the window has been resized @@ -187,7 +187,7 @@ protected: /// perform custom actions when the size of the window changes. /// //////////////////////////////////////////////////////////// - virtual void onResize(); + void onResize() override; private: diff --git a/include/SFML/Graphics/Shape.hpp b/include/SFML/Graphics/Shape.hpp index 1fc91f48e..6ae93e1c8 100644 --- a/include/SFML/Graphics/Shape.hpp +++ b/include/SFML/Graphics/Shape.hpp @@ -49,7 +49,7 @@ public: /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// - virtual ~Shape(); + ~Shape() override; //////////////////////////////////////////////////////////// /// \brief Change the source texture of the shape @@ -274,7 +274,7 @@ private: /// \param states Current render states /// //////////////////////////////////////////////////////////// - virtual void draw(RenderTarget& target, RenderStates states) const; + void draw(RenderTarget& target, RenderStates states) const override; //////////////////////////////////////////////////////////// /// \brief Update the fill vertices' color diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp index 571f1d4ba..deb60b19a 100644 --- a/include/SFML/Graphics/Sprite.hpp +++ b/include/SFML/Graphics/Sprite.hpp @@ -198,7 +198,7 @@ private: /// \param states Current render states /// //////////////////////////////////////////////////////////// - virtual void draw(RenderTarget& target, RenderStates states) const; + void draw(RenderTarget& target, RenderStates states) const override; //////////////////////////////////////////////////////////// /// \brief Update the vertices' positions diff --git a/include/SFML/Graphics/Text.hpp b/include/SFML/Graphics/Text.hpp index 9a5073565..aa62e2179 100644 --- a/include/SFML/Graphics/Text.hpp +++ b/include/SFML/Graphics/Text.hpp @@ -421,7 +421,7 @@ private: /// \param states Current render states /// //////////////////////////////////////////////////////////// - virtual void draw(RenderTarget& target, RenderStates states) const; + void draw(RenderTarget& target, RenderStates states) const override; //////////////////////////////////////////////////////////// /// \brief Make sure the text's geometry is updated diff --git a/include/SFML/Graphics/Transformable.hpp b/include/SFML/Graphics/Transformable.hpp index 698809afb..b47c08ada 100644 --- a/include/SFML/Graphics/Transformable.hpp +++ b/include/SFML/Graphics/Transformable.hpp @@ -377,7 +377,7 @@ private: /// \code /// class MyEntity : public sf::Transformable, public sf::Drawable /// { -/// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const +/// void draw(sf::RenderTarget& target, sf::RenderStates states) const override /// { /// states.transform *= getTransform(); /// target.draw(..., states); diff --git a/include/SFML/Graphics/VertexArray.hpp b/include/SFML/Graphics/VertexArray.hpp index 2fd030be1..e7b77b3b2 100644 --- a/include/SFML/Graphics/VertexArray.hpp +++ b/include/SFML/Graphics/VertexArray.hpp @@ -180,7 +180,7 @@ private: /// \param states Current render states /// //////////////////////////////////////////////////////////// - virtual void draw(RenderTarget& target, RenderStates states) const; + void draw(RenderTarget& target, RenderStates states) const override; private: diff --git a/include/SFML/Graphics/VertexBuffer.hpp b/include/SFML/Graphics/VertexBuffer.hpp index 38979841f..642f82bb3 100644 --- a/include/SFML/Graphics/VertexBuffer.hpp +++ b/include/SFML/Graphics/VertexBuffer.hpp @@ -116,7 +116,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~VertexBuffer(); + ~VertexBuffer() override; //////////////////////////////////////////////////////////// /// \brief Create the vertex buffer @@ -327,7 +327,7 @@ private: /// \param states Current render states /// //////////////////////////////////////////////////////////// - virtual void draw(RenderTarget& target, RenderStates states) const; + void draw(RenderTarget& target, RenderStates states) const override; private: diff --git a/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp index e97607c33..b18165adf 100644 --- a/include/SFML/Network/Packet.hpp +++ b/include/SFML/Network/Packet.hpp @@ -514,7 +514,7 @@ private: /// \code /// class ZipPacket : public sf::Packet /// { -/// virtual const void* onSend(std::size_t& size) +/// const void* onSend(std::size_t& size) override /// { /// const void* srcData = getData(); /// std::size_t srcSize = getDataSize(); @@ -522,7 +522,7 @@ private: /// return MySuperZipFunction(srcData, srcSize, &size); /// } /// -/// virtual void onReceive(const void* data, std::size_t size) +/// void onReceive(const void* data, std::size_t size) override /// { /// std::size_t dstSize; /// const void* dstData = MySuperUnzipFunction(data, size, &dstSize); diff --git a/include/SFML/System/FileInputStream.hpp b/include/SFML/System/FileInputStream.hpp index 0e5c1dd63..05ae2b9db 100644 --- a/include/SFML/System/FileInputStream.hpp +++ b/include/SFML/System/FileInputStream.hpp @@ -65,7 +65,7 @@ public: /// \brief Default destructor /// //////////////////////////////////////////////////////////// - virtual ~FileInputStream(); + ~FileInputStream() override; //////////////////////////////////////////////////////////// /// \brief Open the stream from a file path @@ -89,7 +89,7 @@ public: /// \return The number of bytes actually read, or -1 on error /// //////////////////////////////////////////////////////////// - virtual Int64 read(void* data, Int64 size); + Int64 read(void* data, Int64 size) override; //////////////////////////////////////////////////////////// /// \brief Change the current reading position @@ -99,7 +99,7 @@ public: /// \return The position actually sought to, or -1 on error /// //////////////////////////////////////////////////////////// - virtual Int64 seek(Int64 position); + Int64 seek(Int64 position) override; //////////////////////////////////////////////////////////// /// \brief Get the current reading position in the stream @@ -107,7 +107,7 @@ public: /// \return The current position, or -1 on error. /// //////////////////////////////////////////////////////////// - virtual Int64 tell(); + Int64 tell() override; //////////////////////////////////////////////////////////// /// \brief Return the size of the stream @@ -115,7 +115,7 @@ public: /// \return The total number of bytes available in the stream, or -1 on error /// //////////////////////////////////////////////////////////// - virtual Int64 getSize(); + Int64 getSize() override; private: diff --git a/include/SFML/System/MemoryInputStream.hpp b/include/SFML/System/MemoryInputStream.hpp index 397984080..91bce635f 100644 --- a/include/SFML/System/MemoryInputStream.hpp +++ b/include/SFML/System/MemoryInputStream.hpp @@ -71,7 +71,7 @@ public: /// \return The number of bytes actually read, or -1 on error /// //////////////////////////////////////////////////////////// - virtual Int64 read(void* data, Int64 size); + Int64 read(void* data, Int64 size) override; //////////////////////////////////////////////////////////// /// \brief Change the current reading position @@ -81,7 +81,7 @@ public: /// \return The position actually sought to, or -1 on error /// //////////////////////////////////////////////////////////// - virtual Int64 seek(Int64 position); + Int64 seek(Int64 position) override; //////////////////////////////////////////////////////////// /// \brief Get the current reading position in the stream @@ -89,7 +89,7 @@ public: /// \return The current position, or -1 on error. /// //////////////////////////////////////////////////////////// - virtual Int64 tell(); + Int64 tell() override; //////////////////////////////////////////////////////////// /// \brief Return the size of the stream @@ -97,7 +97,7 @@ public: /// \return The total number of bytes available in the stream, or -1 on error /// //////////////////////////////////////////////////////////// - virtual Int64 getSize(); + Int64 getSize() override; private: diff --git a/include/SFML/System/Thread.inl b/include/SFML/System/Thread.inl index 4d8eb00fe..b5a54ad10 100644 --- a/include/SFML/System/Thread.inl +++ b/include/SFML/System/Thread.inl @@ -36,7 +36,7 @@ template struct ThreadFunctor : ThreadFunc { ThreadFunctor(T functor) : m_functor(functor) {} - virtual void run() {m_functor();} + void run() override {m_functor();} T m_functor; }; @@ -45,7 +45,7 @@ template struct ThreadFunctorWithArg : ThreadFunc { ThreadFunctorWithArg(F function, A arg) : m_function(function), m_arg(arg) {} - virtual void run() {m_function(m_arg);} + void run() override {m_function(m_arg);} F m_function; A m_arg; }; @@ -55,7 +55,7 @@ template struct ThreadMemberFunc : ThreadFunc { ThreadMemberFunc(void(C::*function)(), C* object) : m_function(function), m_object(object) {} - virtual void run() {(m_object->*m_function)();} + void run() override {(m_object->*m_function)();} void(C::*m_function)(); C* m_object; }; diff --git a/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp index a50e2840e..fa876e1dd 100644 --- a/include/SFML/Window/Window.hpp +++ b/include/SFML/Window/Window.hpp @@ -102,7 +102,7 @@ public: /// Closes the window and frees all the resources attached to it. /// //////////////////////////////////////////////////////////// - virtual ~Window(); + ~Window() override; //////////////////////////////////////////////////////////// /// \brief Create (or recreate) the window @@ -116,7 +116,7 @@ public: /// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// //////////////////////////////////////////////////////////// - virtual void create(VideoMode mode, const String& title, Uint32 style = Style::Default); + void create(VideoMode mode, const String& title, Uint32 style = Style::Default) override; //////////////////////////////////////////////////////////// /// \brief Create (or recreate) the window @@ -147,7 +147,7 @@ public: /// \param handle Platform-specific handle of the control /// //////////////////////////////////////////////////////////// - virtual void create(WindowHandle handle); + void create(WindowHandle handle) override; //////////////////////////////////////////////////////////// /// \brief Create (or recreate) the window from an existing control @@ -176,7 +176,7 @@ public: /// and will have no effect on closed windows. /// //////////////////////////////////////////////////////////// - virtual void close(); + void close() override; //////////////////////////////////////////////////////////// /// \brief Get the settings of the OpenGL context of the window diff --git a/src/SFML/Audio/SoundFileReaderFlac.hpp b/src/SFML/Audio/SoundFileReaderFlac.hpp index 657f79305..ee0af6436 100644 --- a/src/SFML/Audio/SoundFileReaderFlac.hpp +++ b/src/SFML/Audio/SoundFileReaderFlac.hpp @@ -68,7 +68,7 @@ public: /// \brief Default constructor /// //////////////////////////////////////////////////////////// - ~SoundFileReaderFlac(); + ~SoundFileReaderFlac() override; //////////////////////////////////////////////////////////// /// \brief Open a sound file for reading @@ -77,7 +77,7 @@ public: /// \param info Structure to fill with the attributes of the loaded sound /// //////////////////////////////////////////////////////////// - virtual bool open(sf::InputStream& stream, Info& info); + bool open(sf::InputStream& stream, Info& info) override; //////////////////////////////////////////////////////////// /// \brief Change the current read position to the given sample offset @@ -92,7 +92,7 @@ public: /// \param sampleOffset Index of the sample to jump to, relative to the beginning /// //////////////////////////////////////////////////////////// - virtual void seek(Uint64 sampleOffset); + void seek(Uint64 sampleOffset) override; //////////////////////////////////////////////////////////// /// \brief Read audio samples from the open file @@ -103,7 +103,7 @@ public: /// \return Number of samples actually read (may be less than \a maxCount) /// //////////////////////////////////////////////////////////// - virtual Uint64 read(Int16* samples, Uint64 maxCount); + Uint64 read(Int16* samples, Uint64 maxCount) override; public: diff --git a/src/SFML/Audio/SoundFileReaderOgg.hpp b/src/SFML/Audio/SoundFileReaderOgg.hpp index df2bff258..51085832a 100644 --- a/src/SFML/Audio/SoundFileReaderOgg.hpp +++ b/src/SFML/Audio/SoundFileReaderOgg.hpp @@ -66,7 +66,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~SoundFileReaderOgg(); + ~SoundFileReaderOgg() override; //////////////////////////////////////////////////////////// /// \brief Open a sound file for reading @@ -77,7 +77,7 @@ public: /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// - virtual bool open(InputStream& stream, Info& info); + bool open(InputStream& stream, Info& info) override; //////////////////////////////////////////////////////////// /// \brief Change the current read position to the given sample offset @@ -92,7 +92,7 @@ public: /// \param sampleOffset Index of the sample to jump to, relative to the beginning /// //////////////////////////////////////////////////////////// - virtual void seek(Uint64 sampleOffset); + void seek(Uint64 sampleOffset) override; //////////////////////////////////////////////////////////// /// \brief Read audio samples from the open file @@ -103,7 +103,7 @@ public: /// \return Number of samples actually read (may be less than \a maxCount) /// //////////////////////////////////////////////////////////// - virtual Uint64 read(Int16* samples, Uint64 maxCount); + Uint64 read(Int16* samples, Uint64 maxCount) override; private: diff --git a/src/SFML/Audio/SoundFileReaderWav.hpp b/src/SFML/Audio/SoundFileReaderWav.hpp index d8b1c1a34..b25342591 100644 --- a/src/SFML/Audio/SoundFileReaderWav.hpp +++ b/src/SFML/Audio/SoundFileReaderWav.hpp @@ -69,7 +69,7 @@ public: /// \param info Structure to fill with the attributes of the loaded sound /// //////////////////////////////////////////////////////////// - virtual bool open(sf::InputStream& stream, Info& info); + bool open(sf::InputStream& stream, Info& info) override; //////////////////////////////////////////////////////////// /// \brief Change the current read position to the given sample offset @@ -84,7 +84,7 @@ public: /// \param sampleOffset Index of the sample to jump to, relative to the beginning /// //////////////////////////////////////////////////////////// - virtual void seek(Uint64 sampleOffset); + void seek(Uint64 sampleOffset) override; //////////////////////////////////////////////////////////// /// \brief Read audio samples from the open file @@ -95,7 +95,7 @@ public: /// \return Number of samples actually read (may be less than \a maxCount) /// //////////////////////////////////////////////////////////// - virtual Uint64 read(Int16* samples, Uint64 maxCount); + Uint64 read(Int16* samples, Uint64 maxCount) override; private: diff --git a/src/SFML/Audio/SoundFileWriterFlac.hpp b/src/SFML/Audio/SoundFileWriterFlac.hpp index 2bd175d02..09f0b8c90 100644 --- a/src/SFML/Audio/SoundFileWriterFlac.hpp +++ b/src/SFML/Audio/SoundFileWriterFlac.hpp @@ -67,7 +67,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~SoundFileWriterFlac(); + ~SoundFileWriterFlac() override; //////////////////////////////////////////////////////////// /// \brief Open a sound file for writing @@ -79,7 +79,7 @@ public: /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// - virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount); + bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) override; //////////////////////////////////////////////////////////// /// \brief Write audio samples to the open file @@ -88,7 +88,7 @@ public: /// \param count Number of samples to write /// //////////////////////////////////////////////////////////// - virtual void write(const Int16* samples, Uint64 count); + void write(const Int16* samples, Uint64 count) override; private: diff --git a/src/SFML/Audio/SoundFileWriterOgg.hpp b/src/SFML/Audio/SoundFileWriterOgg.hpp index 602e8d32e..c0792bcb5 100644 --- a/src/SFML/Audio/SoundFileWriterOgg.hpp +++ b/src/SFML/Audio/SoundFileWriterOgg.hpp @@ -67,7 +67,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~SoundFileWriterOgg(); + ~SoundFileWriterOgg() override; //////////////////////////////////////////////////////////// /// \brief Open a sound file for writing @@ -79,7 +79,7 @@ public: /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// - virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount); + bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) override; //////////////////////////////////////////////////////////// /// \brief Write audio samples to the open file @@ -88,7 +88,7 @@ public: /// \param count Number of samples to write /// //////////////////////////////////////////////////////////// - virtual void write(const Int16* samples, Uint64 count); + void write(const Int16* samples, Uint64 count) override; private: diff --git a/src/SFML/Audio/SoundFileWriterWav.hpp b/src/SFML/Audio/SoundFileWriterWav.hpp index a70efa89b..0019daf99 100644 --- a/src/SFML/Audio/SoundFileWriterWav.hpp +++ b/src/SFML/Audio/SoundFileWriterWav.hpp @@ -67,7 +67,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~SoundFileWriterWav(); + ~SoundFileWriterWav() override; //////////////////////////////////////////////////////////// /// \brief Open a sound file for writing @@ -79,7 +79,7 @@ public: /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// - virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount); + bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) override; //////////////////////////////////////////////////////////// /// \brief Write audio samples to the open file @@ -88,7 +88,7 @@ public: /// \param count Number of samples to write /// //////////////////////////////////////////////////////////// - virtual void write(const Int16* samples, Uint64 count); + void write(const Int16* samples, Uint64 count) override; private: diff --git a/src/SFML/Graphics/RenderTextureImplDefault.hpp b/src/SFML/Graphics/RenderTextureImplDefault.hpp index 2507c8583..b79ce0b66 100644 --- a/src/SFML/Graphics/RenderTextureImplDefault.hpp +++ b/src/SFML/Graphics/RenderTextureImplDefault.hpp @@ -56,7 +56,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~RenderTextureImplDefault(); + ~RenderTextureImplDefault() override; //////////////////////////////////////////////////////////// /// \brief Get the maximum anti-aliasing level supported by the system @@ -79,7 +79,7 @@ private: /// \return True if creation has been successful /// //////////////////////////////////////////////////////////// - virtual bool create(unsigned int width, unsigned int height, unsigned int textureId, const ContextSettings& settings); + bool create(unsigned int width, unsigned int height, unsigned int textureId, const ContextSettings& settings) override; //////////////////////////////////////////////////////////// /// \brief Activate or deactivate the render texture for rendering @@ -89,7 +89,7 @@ private: /// \return True on success, false on failure /// //////////////////////////////////////////////////////////// - virtual bool activate(bool active); + bool activate(bool active) override; //////////////////////////////////////////////////////////// /// \brief Tell if the render-texture will use sRGB encoding when drawing on it @@ -100,7 +100,7 @@ private: /// \return True if the render-texture use sRGB encoding, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool isSrgb() const; + bool isSrgb() const override; //////////////////////////////////////////////////////////// /// \brief Update the pixels of the target texture @@ -108,7 +108,7 @@ private: /// \param textureId OpenGL identifier of the target texture /// //////////////////////////////////////////////////////////// - virtual void updateTexture(unsigned textureId); + void updateTexture(unsigned textureId) override; //////////////////////////////////////////////////////////// // Member data diff --git a/src/SFML/Graphics/RenderTextureImplFBO.hpp b/src/SFML/Graphics/RenderTextureImplFBO.hpp index 90465803a..0b2fc70f3 100644 --- a/src/SFML/Graphics/RenderTextureImplFBO.hpp +++ b/src/SFML/Graphics/RenderTextureImplFBO.hpp @@ -57,7 +57,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~RenderTextureImplFBO(); + ~RenderTextureImplFBO() override; //////////////////////////////////////////////////////////// /// \brief Check whether the system supports FBOs or not @@ -94,7 +94,7 @@ private: /// \return True if creation has been successful /// //////////////////////////////////////////////////////////// - virtual bool create(unsigned int width, unsigned int height, unsigned int textureId, const ContextSettings& settings); + bool create(unsigned int width, unsigned int height, unsigned int textureId, const ContextSettings& settings) override; //////////////////////////////////////////////////////////// /// \brief Create an FBO in the current context @@ -112,7 +112,7 @@ private: /// \return True on success, false on failure /// //////////////////////////////////////////////////////////// - virtual bool activate(bool active); + bool activate(bool active) override; //////////////////////////////////////////////////////////// /// \brief Tell if the render-texture will use sRGB encoding when drawing on it @@ -123,7 +123,7 @@ private: /// \return True if the render-texture use sRGB encoding, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool isSrgb() const; + bool isSrgb() const override; //////////////////////////////////////////////////////////// /// \brief Update the pixels of the target texture @@ -131,7 +131,7 @@ private: /// \param textureId OpenGL identifier of the target texture /// //////////////////////////////////////////////////////////// - virtual void updateTexture(unsigned textureId); + void updateTexture(unsigned textureId) override; //////////////////////////////////////////////////////////// // Member data diff --git a/src/SFML/System/Err.cpp b/src/SFML/System/Err.cpp index 9296a6b11..df371fe5e 100644 --- a/src/SFML/System/Err.cpp +++ b/src/SFML/System/Err.cpp @@ -46,7 +46,7 @@ public: setp(buffer, buffer + size); } - ~DefaultErrStreamBuf() + ~DefaultErrStreamBuf() override { // Synchronize sync(); @@ -57,7 +57,7 @@ public: private: - virtual int overflow(int character) + int overflow(int character) override { if ((character != EOF) && (pptr() != epptr())) { @@ -77,7 +77,7 @@ private: } } - virtual int sync() + int sync() override { // Check if there is something into the write buffer if (pbase() != pptr()) diff --git a/src/SFML/Window/Android/WindowImplAndroid.hpp b/src/SFML/Window/Android/WindowImplAndroid.hpp index 821550527..95a3bc484 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.hpp +++ b/src/SFML/Window/Android/WindowImplAndroid.hpp @@ -78,7 +78,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const; + WindowHandle getSystemHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window @@ -86,7 +86,7 @@ public: /// \return Position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2i getPosition() const; + Vector2i getPosition() const override; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen @@ -94,7 +94,7 @@ public: /// \param position New position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual void setPosition(const Vector2i& position); + void setPosition(const Vector2i& position) override; //////////////////////////////////////////////////////////// /// \brief Get the client size of the window @@ -102,7 +102,7 @@ public: /// \return Size of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window @@ -110,7 +110,7 @@ public: /// \param size New size, in pixels /// //////////////////////////////////////////////////////////// - virtual void setSize(const Vector2u& size); + void setSize(const Vector2u& size) override; //////////////////////////////////////////////////////////// /// \brief Change the title of the window @@ -118,7 +118,7 @@ public: /// \param title New title /// //////////////////////////////////////////////////////////// - virtual void setTitle(const String& title); + void setTitle(const String& title) override; //////////////////////////////////////////////////////////// /// \brief Change the window's icon @@ -128,7 +128,7 @@ public: /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits /// //////////////////////////////////////////////////////////// - virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels); + void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the window @@ -136,7 +136,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setVisible(bool visible); + void setVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor @@ -144,7 +144,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorVisible(bool visible); + void setMouseCursorVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Clips or releases the mouse cursor @@ -152,7 +152,7 @@ public: /// \param grabbed True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorGrabbed(bool grabbed); + void setMouseCursorGrabbed(bool grabbed) override; //////////////////////////////////////////////////////////// /// \brief Set the displayed cursor to a native system cursor @@ -160,7 +160,7 @@ public: /// \param cursor Native system cursor type to display /// //////////////////////////////////////////////////////////// - virtual void setMouseCursor(const CursorImpl& cursor); + void setMouseCursor(const CursorImpl& cursor) override; //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat @@ -168,14 +168,14 @@ public: /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setKeyRepeatEnabled(bool enabled); + void setKeyRepeatEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// //////////////////////////////////////////////////////////// - virtual void requestFocus(); + void requestFocus() override; //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus @@ -183,7 +183,7 @@ public: /// \return True if window has focus, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool hasFocus() const; + bool hasFocus() const override; static void forwardEvent(const Event& event); static WindowImplAndroid* singleInstance; @@ -194,7 +194,7 @@ protected: /// \brief Process incoming events from the operating system /// //////////////////////////////////////////////////////////// - virtual void processEvents(); + void processEvents() override; private: diff --git a/src/SFML/Window/EglContext.hpp b/src/SFML/Window/EglContext.hpp index e1fdf46a5..f88ce7986 100644 --- a/src/SFML/Window/EglContext.hpp +++ b/src/SFML/Window/EglContext.hpp @@ -81,7 +81,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~EglContext(); + ~EglContext() override; //////////////////////////////////////////////////////////// /// \brief Get the address of an OpenGL function @@ -102,13 +102,13 @@ public: /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - virtual bool makeCurrent(bool current); + bool makeCurrent(bool current) override; //////////////////////////////////////////////////////////// /// \brief Display what has been rendered to the context so far /// //////////////////////////////////////////////////////////// - virtual void display(); + void display() override; //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization @@ -121,7 +121,7 @@ public: /// \param enabled: True to enable v-sync, false to deactivate /// //////////////////////////////////////////////////////////// - virtual void setVerticalSyncEnabled(bool enabled); + void setVerticalSyncEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Create the context diff --git a/src/SFML/Window/OSX/SFContext.hpp b/src/SFML/Window/OSX/SFContext.hpp index 417bea26e..3aa19b372 100644 --- a/src/SFML/Window/OSX/SFContext.hpp +++ b/src/SFML/Window/OSX/SFContext.hpp @@ -117,7 +117,7 @@ public: /// \brief Display what has been rendered to the context so far /// //////////////////////////////////////////////////////////// - virtual void display(); + void display() override; //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization @@ -130,7 +130,7 @@ public: /// \param enabled True to enable v-sync, false to deactivate /// //////////////////////////////////////////////////////////// - virtual void setVerticalSyncEnabled(bool enabled); + void setVerticalSyncEnabled(bool enabled) override; protected: //////////////////////////////////////////////////////////// @@ -142,7 +142,7 @@ protected: /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - virtual bool makeCurrent(bool current); + bool makeCurrent(bool current) override; private: //////////////////////////////////////////////////////////// diff --git a/src/SFML/Window/OSX/WindowImplCocoa.hpp b/src/SFML/Window/OSX/WindowImplCocoa.hpp index 6756ec026..1662f512e 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.hpp +++ b/src/SFML/Window/OSX/WindowImplCocoa.hpp @@ -245,7 +245,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const; + WindowHandle getSystemHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window @@ -253,7 +253,7 @@ public: /// \return Position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2i getPosition() const; + Vector2i getPosition() const override; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen @@ -261,7 +261,7 @@ public: /// \param position New position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual void setPosition(const Vector2i& position); + void setPosition(const Vector2i& position) override; //////////////////////////////////////////////////////////// /// \brief Get the client size of the window @@ -269,7 +269,7 @@ public: /// \return Size of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window @@ -277,7 +277,7 @@ public: /// \param size New size, in pixels /// //////////////////////////////////////////////////////////// - virtual void setSize(const Vector2u& size); + void setSize(const Vector2u& size) override; //////////////////////////////////////////////////////////// /// \brief Change the title of the window @@ -285,7 +285,7 @@ public: /// \param title New title /// //////////////////////////////////////////////////////////// - virtual void setTitle(const String& title); + void setTitle(const String& title) override; //////////////////////////////////////////////////////////// /// \brief Change the window's icon @@ -295,7 +295,7 @@ public: /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits /// //////////////////////////////////////////////////////////// - virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels); + void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the window @@ -303,7 +303,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setVisible(bool visible); + void setVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor @@ -311,7 +311,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorVisible(bool visible); + void setMouseCursorVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Grab or release the mouse cursor @@ -319,7 +319,7 @@ public: /// \param grabbed True to grab, false to release /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorGrabbed(bool grabbed); + void setMouseCursorGrabbed(bool grabbed) override; //////////////////////////////////////////////////////////// /// \brief Set the displayed cursor to a native system cursor @@ -327,7 +327,7 @@ public: /// \param cursor Native system cursor type to display /// //////////////////////////////////////////////////////////// - virtual void setMouseCursor(const CursorImpl& cursor); + void setMouseCursor(const CursorImpl& cursor) override; //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat @@ -335,14 +335,14 @@ public: /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setKeyRepeatEnabled(bool enabled); + void setKeyRepeatEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// //////////////////////////////////////////////////////////// - virtual void requestFocus(); + void requestFocus() override; //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus @@ -350,7 +350,7 @@ public: /// \return True if window has focus, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool hasFocus() const; + bool hasFocus() const override; protected: @@ -358,7 +358,7 @@ protected: /// \brief Process incoming events from the operating system /// //////////////////////////////////////////////////////////// - virtual void processEvents(); + void processEvents() override; private: diff --git a/src/SFML/Window/Unix/GlxContext.hpp b/src/SFML/Window/Unix/GlxContext.hpp index 6d1971ce0..e5a990364 100644 --- a/src/SFML/Window/Unix/GlxContext.hpp +++ b/src/SFML/Window/Unix/GlxContext.hpp @@ -99,13 +99,13 @@ public: /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - virtual bool makeCurrent(bool current); + bool makeCurrent(bool current) override; //////////////////////////////////////////////////////////// /// \brief Display what has been rendered to the context so far /// //////////////////////////////////////////////////////////// - virtual void display(); + void display() override; //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization @@ -118,7 +118,7 @@ public: /// \param enabled True to enable v-sync, false to deactivate /// //////////////////////////////////////////////////////////// - virtual void setVerticalSyncEnabled(bool enabled); + void setVerticalSyncEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Select the best GLX visual for a given set of settings diff --git a/src/SFML/Window/Unix/WindowImplX11.hpp b/src/SFML/Window/Unix/WindowImplX11.hpp index ea8aec86c..1af56ab6c 100644 --- a/src/SFML/Window/Unix/WindowImplX11.hpp +++ b/src/SFML/Window/Unix/WindowImplX11.hpp @@ -80,7 +80,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const; + WindowHandle getSystemHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window @@ -88,7 +88,7 @@ public: /// \return Position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2i getPosition() const; + Vector2i getPosition() const override; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen @@ -96,7 +96,7 @@ public: /// \param position New position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual void setPosition(const Vector2i& position); + void setPosition(const Vector2i& position) override; //////////////////////////////////////////////////////////// /// \brief Get the client size of the window @@ -104,7 +104,7 @@ public: /// \return Size of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window @@ -112,7 +112,7 @@ public: /// \param size New size, in pixels /// //////////////////////////////////////////////////////////// - virtual void setSize(const Vector2u& size); + void setSize(const Vector2u& size) override; //////////////////////////////////////////////////////////// /// \brief Change the title of the window @@ -120,7 +120,7 @@ public: /// \param title New title /// //////////////////////////////////////////////////////////// - virtual void setTitle(const String& title); + void setTitle(const String& title) override; //////////////////////////////////////////////////////////// /// \brief Change the window's icon @@ -130,7 +130,7 @@ public: /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits /// //////////////////////////////////////////////////////////// - virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels); + void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the window @@ -138,7 +138,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setVisible(bool visible); + void setVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor @@ -146,7 +146,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorVisible(bool visible); + void setMouseCursorVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Grab or release the mouse cursor @@ -154,7 +154,7 @@ public: /// \param grabbed True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorGrabbed(bool grabbed); + void setMouseCursorGrabbed(bool grabbed) override; //////////////////////////////////////////////////////////// /// \brief Set the displayed cursor to a native system cursor @@ -162,7 +162,7 @@ public: /// \param cursor Native system cursor type to display /// //////////////////////////////////////////////////////////// - virtual void setMouseCursor(const CursorImpl& cursor); + void setMouseCursor(const CursorImpl& cursor) override; //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat @@ -170,14 +170,14 @@ public: /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setKeyRepeatEnabled(bool enabled); + void setKeyRepeatEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// //////////////////////////////////////////////////////////// - virtual void requestFocus(); + void requestFocus() override; //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus @@ -185,7 +185,7 @@ public: /// \return True if window has focus, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool hasFocus() const; + bool hasFocus() const override; protected: @@ -193,7 +193,7 @@ protected: /// \brief Process incoming events from the operating system /// //////////////////////////////////////////////////////////// - virtual void processEvents(); + void processEvents() override; private: @@ -266,7 +266,7 @@ private: bool processEvent(XEvent& windowEvent); //////////////////////////////////////////////////////////// - /// \brief Check if a valid version of XRandR extension is present + /// \brief Check if a valid version of XRandR extension is present /// /// \param xRandRMajor XRandR major version /// \param xRandRMinor XRandR minor version diff --git a/src/SFML/Window/Win32/WglContext.hpp b/src/SFML/Window/Win32/WglContext.hpp index 63106e7d3..db600a4e1 100644 --- a/src/SFML/Window/Win32/WglContext.hpp +++ b/src/SFML/Window/Win32/WglContext.hpp @@ -78,7 +78,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~WglContext(); + ~WglContext() override; //////////////////////////////////////////////////////////// /// \brief Get the address of an OpenGL function @@ -98,13 +98,13 @@ public: /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - virtual bool makeCurrent(bool current); + bool makeCurrent(bool current) override; //////////////////////////////////////////////////////////// /// \brief Display what has been rendered to the context so far /// //////////////////////////////////////////////////////////// - virtual void display(); + void display() override; //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization @@ -117,7 +117,7 @@ public: /// \param enabled: True to enable v-sync, false to deactivate /// //////////////////////////////////////////////////////////// - virtual void setVerticalSyncEnabled(bool enabled); + void setVerticalSyncEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Select the best pixel format for a given set of settings diff --git a/src/SFML/Window/Win32/WindowImplWin32.hpp b/src/SFML/Window/Win32/WindowImplWin32.hpp index 7f2057a2f..04fd3bd0b 100755 --- a/src/SFML/Window/Win32/WindowImplWin32.hpp +++ b/src/SFML/Window/Win32/WindowImplWin32.hpp @@ -69,7 +69,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~WindowImplWin32(); + ~WindowImplWin32() override; //////////////////////////////////////////////////////////// /// \brief Get the OS-specific handle of the window @@ -77,7 +77,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const; + WindowHandle getSystemHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window @@ -85,7 +85,7 @@ public: /// \return Position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2i getPosition() const; + Vector2i getPosition() const override; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen @@ -93,7 +93,7 @@ public: /// \param position New position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual void setPosition(const Vector2i& position); + void setPosition(const Vector2i& position) override; //////////////////////////////////////////////////////////// /// \brief Get the client size of the window @@ -101,7 +101,7 @@ public: /// \return Size of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window @@ -109,7 +109,7 @@ public: /// \param size New size, in pixels /// //////////////////////////////////////////////////////////// - virtual void setSize(const Vector2u& size); + void setSize(const Vector2u& size) override; //////////////////////////////////////////////////////////// /// \brief Change the title of the window @@ -117,7 +117,7 @@ public: /// \param title New title /// //////////////////////////////////////////////////////////// - virtual void setTitle(const String& title); + void setTitle(const String& title) override; //////////////////////////////////////////////////////////// /// \brief Change the window's icon @@ -127,7 +127,7 @@ public: /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits /// //////////////////////////////////////////////////////////// - virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels); + void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the window @@ -135,7 +135,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setVisible(bool visible); + void setVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor @@ -143,7 +143,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorVisible(bool visible); + void setMouseCursorVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Grab or release the mouse cursor @@ -151,7 +151,7 @@ public: /// \param grabbed True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorGrabbed(bool grabbed); + void setMouseCursorGrabbed(bool grabbed) override; //////////////////////////////////////////////////////////// /// \brief Set the displayed cursor to a native system cursor @@ -159,7 +159,7 @@ public: /// \param cursor Native system cursor type to display /// //////////////////////////////////////////////////////////// - virtual void setMouseCursor(const CursorImpl& cursor); + void setMouseCursor(const CursorImpl& cursor) override; //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat @@ -167,14 +167,14 @@ public: /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setKeyRepeatEnabled(bool enabled); + void setKeyRepeatEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// //////////////////////////////////////////////////////////// - virtual void requestFocus(); + void requestFocus() override; //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus @@ -182,7 +182,7 @@ public: /// \return True if window has focus, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool hasFocus() const; + bool hasFocus() const override; protected: @@ -190,7 +190,7 @@ protected: /// \brief Process incoming events from the operating system /// //////////////////////////////////////////////////////////// - virtual void processEvents(); + void processEvents() override; private: diff --git a/src/SFML/Window/iOS/EaglContext.hpp b/src/SFML/Window/iOS/EaglContext.hpp index 0c392907e..346f682b0 100644 --- a/src/SFML/Window/iOS/EaglContext.hpp +++ b/src/SFML/Window/iOS/EaglContext.hpp @@ -115,7 +115,7 @@ public: /// \brief Display what has been rendered to the context so far /// //////////////////////////////////////////////////////////// - virtual void display(); + void display() override; //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization @@ -128,7 +128,7 @@ public: /// \param enabled: True to enable v-sync, false to deactivate /// //////////////////////////////////////////////////////////// - virtual void setVerticalSyncEnabled(bool enabled); + void setVerticalSyncEnabled(bool enabled) override; protected: @@ -141,7 +141,7 @@ protected: /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - virtual bool makeCurrent(bool current); + bool makeCurrent(bool current) override; private: diff --git a/src/SFML/Window/iOS/WindowImplUIKit.hpp b/src/SFML/Window/iOS/WindowImplUIKit.hpp index 52aeda645..7368d2b9c 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.hpp +++ b/src/SFML/Window/iOS/WindowImplUIKit.hpp @@ -81,7 +81,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const; + WindowHandle getSystemHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window @@ -89,7 +89,7 @@ public: /// \return Position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2i getPosition() const; + Vector2i getPosition() const override; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen @@ -97,7 +97,7 @@ public: /// \param position New position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual void setPosition(const Vector2i& position); + void setPosition(const Vector2i& position) override; //////////////////////////////////////////////////////////// /// \brief Get the client size of the window @@ -105,7 +105,7 @@ public: /// \return Size of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window @@ -113,7 +113,7 @@ public: /// \param size New size, in pixels /// //////////////////////////////////////////////////////////// - virtual void setSize(const Vector2u& size); + void setSize(const Vector2u& size) override; //////////////////////////////////////////////////////////// /// \brief Change the title of the window @@ -121,7 +121,7 @@ public: /// \param title New title /// //////////////////////////////////////////////////////////// - virtual void setTitle(const String& title); + void setTitle(const String& title) override; //////////////////////////////////////////////////////////// /// \brief Change the window's icon @@ -131,7 +131,7 @@ public: /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits /// //////////////////////////////////////////////////////////// - virtual void setIcon(unsigned int width, unsigned int height, const Uint8* pixels); + void setIcon(unsigned int width, unsigned int height, const Uint8* pixels) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the window @@ -139,7 +139,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setVisible(bool visible); + void setVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor @@ -147,7 +147,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorVisible(bool visible); + void setMouseCursorVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Clips or releases the mouse cursor @@ -155,7 +155,7 @@ public: /// \param grabbed True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorGrabbed(bool grabbed); + void setMouseCursorGrabbed(bool grabbed) override; //////////////////////////////////////////////////////////// /// \brief Set the displayed cursor to a native system cursor @@ -163,7 +163,7 @@ public: /// \param cursor Native system cursor type to display /// //////////////////////////////////////////////////////////// - virtual void setMouseCursor(const CursorImpl& cursor); + void setMouseCursor(const CursorImpl& cursor) override; //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat @@ -171,14 +171,14 @@ public: /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setKeyRepeatEnabled(bool enabled); + void setKeyRepeatEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// //////////////////////////////////////////////////////////// - virtual void requestFocus(); + void requestFocus() override; //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus @@ -186,7 +186,7 @@ public: /// \return True if window has focus, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool hasFocus() const; + bool hasFocus() const override; public: @@ -220,7 +220,7 @@ protected: /// \brief Process incoming events from the operating system /// //////////////////////////////////////////////////////////// - virtual void processEvents(); + void processEvents() override; private: