From b3b094fc91423c1e4d690e926020fbb2dd6e9285 Mon Sep 17 00:00:00 2001 From: binary1248 Date: Mon, 3 Apr 2017 19:13:33 +0200 Subject: [PATCH] Replaced NULL with nullptr. --- examples/pong/Pong.cpp | 2 +- examples/shader/Effect.hpp | 2 +- examples/shader/Shader.cpp | 2 +- examples/win32/Win32.cpp | 16 +- include/SFML/Audio/Sound.hpp | 2 +- include/SFML/Graphics/Shader.hpp | 6 +- include/SFML/Graphics/Shape.hpp | 4 +- include/SFML/Graphics/Sprite.hpp | 2 +- include/SFML/Graphics/Text.hpp | 2 +- include/SFML/Graphics/Texture.hpp | 4 +- include/SFML/Network/Packet.hpp | 2 +- include/SFML/System/Err.hpp | 2 +- include/SFML/Window/Context.hpp | 2 +- src/SFML/Audio/AudioDevice.cpp | 10 +- src/SFML/Audio/Sound.cpp | 10 +- src/SFML/Audio/SoundBuffer.cpp | 2 +- src/SFML/Audio/SoundFileFactory.cpp | 10 +- src/SFML/Audio/SoundFileReaderFlac.cpp | 8 +- src/SFML/Audio/SoundFileReaderOgg.cpp | 12 +- src/SFML/Audio/SoundFileReaderWav.cpp | 2 +- src/SFML/Audio/SoundFileWriterFlac.cpp | 6 +- src/SFML/Audio/SoundFileWriterOgg.cpp | 2 +- src/SFML/Audio/SoundRecorder.cpp | 8 +- src/SFML/Audio/SoundStream.cpp | 2 +- src/SFML/Graphics/Font.cpp | 18 +- src/SFML/Graphics/GLLoader.cpp | 302 +++++++++--------- src/SFML/Graphics/Image.cpp | 2 +- src/SFML/Graphics/RenderStates.cpp | 16 +- src/SFML/Graphics/RenderTarget.cpp | 12 +- src/SFML/Graphics/Shader.cpp | 30 +- src/SFML/Graphics/Shape.cpp | 4 +- src/SFML/Graphics/Sprite.cpp | 6 +- src/SFML/Graphics/Text.cpp | 2 +- src/SFML/Graphics/Texture.cpp | 2 +- src/SFML/Main/MainAndroid.cpp | 36 +-- src/SFML/Main/SFMLActivity.cpp | 6 +- src/SFML/Network/IpAddress.cpp | 4 +- src/SFML/Network/Packet.cpp | 4 +- src/SFML/Network/SocketSelector.cpp | 2 +- src/SFML/Network/TcpSocket.cpp | 2 +- src/SFML/System/Android/Activity.cpp | 2 +- src/SFML/System/Android/Activity.hpp | 2 +- src/SFML/System/Android/ResourceStream.cpp | 4 +- src/SFML/System/FileInputStream.cpp | 4 +- src/SFML/System/MemoryInputStream.cpp | 2 +- src/SFML/Window/Android/InputImpl.cpp | 20 +- src/SFML/Window/Android/SensorImpl.cpp | 4 +- src/SFML/Window/Android/SensorImpl.hpp | 2 +- src/SFML/Window/Android/VideoModeImpl.cpp | 2 +- src/SFML/Window/Android/WindowImplAndroid.cpp | 22 +- src/SFML/Window/Context.cpp | 2 +- src/SFML/Window/EglContext.cpp | 16 +- src/SFML/Window/EglContext.hpp | 4 +- src/SFML/Window/FreeBSD/JoystickImpl.cpp | 2 +- src/SFML/Window/GlContext.cpp | 12 +- src/SFML/Window/OSX/AutoreleasePoolWrapper.mm | 4 +- src/SFML/Window/OSX/HIDInputManager.hpp | 2 +- src/SFML/Window/OSX/HIDInputManager.mm | 12 +- src/SFML/Window/OSX/HIDJoystickManager.cpp | 6 +- src/SFML/Window/OSX/HIDJoystickManager.hpp | 2 +- src/SFML/Window/OSX/InputImpl.mm | 2 +- src/SFML/Window/OSX/JoystickImpl.cpp | 10 +- src/SFML/Window/OSX/SFContext.hpp | 4 +- src/SFML/Window/OSX/SFContext.mm | 4 +- src/SFML/Window/OSX/VideoModeImpl.cpp | 4 +- src/SFML/Window/Unix/Display.cpp | 4 +- src/SFML/Window/Unix/GlxContext.cpp | 34 +- src/SFML/Window/Unix/GlxContext.hpp | 6 +- src/SFML/Window/Unix/GlxExtensions.cpp | 30 +- src/SFML/Window/Unix/JoystickImpl.cpp | 14 +- src/SFML/Window/Unix/WindowImplX11.cpp | 44 +-- src/SFML/Window/Win32/JoystickImpl.cpp | 6 +- src/SFML/Window/Win32/VideoModeImpl.cpp | 4 +- src/SFML/Window/Win32/WglContext.cpp | 50 +-- src/SFML/Window/Win32/WglContext.hpp | 6 +- src/SFML/Window/Win32/WglExtensions.cpp | 36 +-- src/SFML/Window/Win32/WindowImplWin32.cpp | 54 ++-- src/SFML/Window/Window.cpp | 6 +- src/SFML/Window/iOS/EaglContext.hpp | 6 +- src/SFML/Window/iOS/SFAppDelegate.mm | 4 +- src/SFML/Window/iOS/SFView.mm | 2 +- 81 files changed, 512 insertions(+), 512 deletions(-) diff --git a/examples/pong/Pong.cpp b/examples/pong/Pong.cpp index 58c9fd71..9fdcede0 100644 --- a/examples/pong/Pong.cpp +++ b/examples/pong/Pong.cpp @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////// int main() { - std::srand(static_cast(std::time(NULL))); + std::srand(static_cast(std::time(nullptr))); // Define some constants const float pi = 3.14159f; diff --git a/examples/shader/Effect.hpp b/examples/shader/Effect.hpp index 0ff65b43..f6065dfe 100644 --- a/examples/shader/Effect.hpp +++ b/examples/shader/Effect.hpp @@ -66,7 +66,7 @@ protected: static const sf::Font& getFont() { - assert(s_font != NULL); + assert(s_font != nullptr); return *s_font; } diff --git a/examples/shader/Shader.cpp b/examples/shader/Shader.cpp index 0b8fd4f1..1d87cf17 100644 --- a/examples/shader/Shader.cpp +++ b/examples/shader/Shader.cpp @@ -8,7 +8,7 @@ #include -const sf::Font* Effect::s_font = NULL; +const sf::Font* Effect::s_font = nullptr; //////////////////////////////////////////////////////////// // "Pixelate" fragment shader diff --git a/examples/win32/Win32.cpp b/examples/win32/Win32.cpp index aedfc76e..e39b42f9 100644 --- a/examples/win32/Win32.cpp +++ b/examples/win32/Win32.cpp @@ -49,7 +49,7 @@ LRESULT CALLBACK onEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam //////////////////////////////////////////////////////////// int main() { - HINSTANCE instance = GetModuleHandle(NULL); + HINSTANCE instance = GetModuleHandle(nullptr); // Define a class for our main window WNDCLASS windowClass; @@ -58,22 +58,22 @@ int main() windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = instance; - windowClass.hIcon = NULL; + windowClass.hIcon = nullptr; windowClass.hCursor = 0; windowClass.hbrBackground = reinterpret_cast(COLOR_BACKGROUND); - windowClass.lpszMenuName = NULL; + windowClass.lpszMenuName = nullptr; windowClass.lpszClassName = TEXT("SFML App"); RegisterClass(&windowClass); // Let's create the main window - HWND window = CreateWindow(TEXT("SFML App"), TEXT("SFML Win32"), WS_SYSMENU | WS_VISIBLE, 200, 200, 660, 520, NULL, NULL, instance, NULL); + HWND window = CreateWindow(TEXT("SFML App"), TEXT("SFML Win32"), WS_SYSMENU | WS_VISIBLE, 200, 200, 660, 520, nullptr, nullptr, instance, nullptr); // Add a button for exiting - button = CreateWindow(TEXT("BUTTON"), TEXT("Quit"), WS_CHILD | WS_VISIBLE, 560, 440, 80, 40, window, NULL, instance, NULL); + button = CreateWindow(TEXT("BUTTON"), TEXT("Quit"), WS_CHILD | WS_VISIBLE, 560, 440, 80, 40, window, nullptr, instance, nullptr); // Let's create two SFML views - HWND view1 = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 20, 20, 300, 400, window, NULL, instance, NULL); - HWND view2 = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 340, 20, 300, 400, window, NULL, instance, NULL); + HWND view1 = CreateWindow(TEXT("STATIC"), nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 20, 20, 300, 400, window, nullptr, instance, nullptr); + HWND view2 = CreateWindow(TEXT("STATIC"), nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 340, 20, 300, 400, window, nullptr, instance, nullptr); sf::RenderWindow SFMLView1(view1); sf::RenderWindow SFMLView2(view2); @@ -94,7 +94,7 @@ int main() message.message = static_cast(~WM_QUIT); while (message.message != WM_QUIT) { - if (PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) + if (PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { // If a message was waiting in the message queue, process it TranslateMessage(&message); diff --git a/include/SFML/Audio/Sound.hpp b/include/SFML/Audio/Sound.hpp index 5f21cf1e..3ef57606 100644 --- a/include/SFML/Audio/Sound.hpp +++ b/include/SFML/Audio/Sound.hpp @@ -158,7 +158,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Get the audio buffer attached to the sound /// - /// \return Sound buffer attached to the sound (can be NULL) + /// \return Sound buffer attached to the sound (can be nullptr) /// //////////////////////////////////////////////////////////// const SoundBuffer* getBuffer() const; diff --git a/include/SFML/Graphics/Shader.hpp b/include/SFML/Graphics/Shader.hpp index 9fe9c607..114dbdc8 100644 --- a/include/SFML/Graphics/Shader.hpp +++ b/include/SFML/Graphics/Shader.hpp @@ -651,7 +651,7 @@ public: /// // draw OpenGL stuff that use s1... /// sf::Shader::bind(&s2); /// // draw OpenGL stuff that use s2... - /// sf::Shader::bind(NULL); + /// sf::Shader::bind(nullptr); /// // draw OpenGL stuff that use no shader... /// \endcode /// @@ -696,7 +696,7 @@ private: //////////////////////////////////////////////////////////// /// \brief Compile the shader(s) and create the program /// - /// If one of the arguments is NULL, the corresponding shader + /// If one of the arguments is nullptr, the corresponding shader /// is not created. /// /// \param vertexShaderCode Source code of the vertex shader @@ -867,7 +867,7 @@ private: /// \code /// sf::Shader::bind(&shader); /// ... render OpenGL geometry ... -/// sf::Shader::bind(NULL); +/// sf::Shader::bind(nullptr); /// \endcode /// /// \see sf::Glsl diff --git a/include/SFML/Graphics/Shape.hpp b/include/SFML/Graphics/Shape.hpp index 18f8626f..73722d5c 100644 --- a/include/SFML/Graphics/Shape.hpp +++ b/include/SFML/Graphics/Shape.hpp @@ -60,7 +60,7 @@ public: /// a pointer to the one that you passed to this function. /// If the source texture is destroyed and the shape tries to /// use it, the behavior is undefined. - /// \a texture can be NULL to disable texturing. + /// \a texture can be nullptr to disable texturing. /// If \a resetRect is true, the TextureRect property of /// the shape is automatically adjusted to the size of the new /// texture. If it is false, the texture rect is left unchanged. @@ -134,7 +134,7 @@ public: //////////////////////////////////////////////////////////// /// \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 pointer is returned. /// The returned pointer is const, which means that you can't /// modify the texture when you retrieve it with this function. /// diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp index 1791690e..d2c42060 100644 --- a/include/SFML/Graphics/Sprite.hpp +++ b/include/SFML/Graphics/Sprite.hpp @@ -130,7 +130,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Get the source texture of the sprite /// - /// If the sprite has no source texture, a NULL pointer is returned. + /// If the sprite has no source texture, a nullptr pointer is returned. /// The returned pointer is const, which means that you can't /// modify the texture when you retrieve it with this function. /// diff --git a/include/SFML/Graphics/Text.hpp b/include/SFML/Graphics/Text.hpp index 4d3238d9..ac8463d6 100644 --- a/include/SFML/Graphics/Text.hpp +++ b/include/SFML/Graphics/Text.hpp @@ -239,7 +239,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Get the text's font /// - /// If the text has no font attached, a NULL pointer is returned. + /// If the text has no font attached, a nullptr pointer is returned. /// The returned pointer is const, which means that you /// cannot modify the font when you get it from this function. /// diff --git a/include/SFML/Graphics/Texture.hpp b/include/SFML/Graphics/Texture.hpp index 20a8ede8..99ae3725 100644 --- a/include/SFML/Graphics/Texture.hpp +++ b/include/SFML/Graphics/Texture.hpp @@ -551,7 +551,7 @@ public: /// // draw OpenGL stuff that use t1... /// sf::Texture::bind(&t2); /// // draw OpenGL stuff that use t2... - /// sf::Texture::bind(NULL); + /// sf::Texture::bind(nullptr); /// // draw OpenGL stuff that use no texture... /// \endcode /// @@ -723,7 +723,7 @@ private: /// \code /// sf::Texture::bind(&texture); /// ... render OpenGL geometry ... -/// sf::Texture::bind(NULL); +/// sf::Texture::bind(nullptr); /// \endcode /// /// \see sf::Sprite, sf::Image, sf::RenderTexture diff --git a/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp index ac97692a..e9970c39 100644 --- a/include/SFML/Network/Packet.hpp +++ b/include/SFML/Network/Packet.hpp @@ -92,7 +92,7 @@ public: /// Warning: the returned pointer may become invalid after /// you append data to the packet, therefore it should never /// be stored. - /// The return pointer is NULL if the packet is empty. + /// The return pointer is nullptr if the packet is empty. /// /// \return Pointer to the data /// diff --git a/include/SFML/System/Err.hpp b/include/SFML/System/Err.hpp index 56505a9d..a41f4626 100644 --- a/include/SFML/System/Err.hpp +++ b/include/SFML/System/Err.hpp @@ -69,7 +69,7 @@ SFML_SYSTEM_API std::ostream& err(); /// std::streambuf* previous = sf::err().rdbuf(file.rdbuf()); /// /// // Redirect to nothing -/// sf::err().rdbuf(NULL); +/// sf::err().rdbuf(nullptr); /// /// // Restore the original output /// sf::err().rdbuf(previous); diff --git a/include/SFML/Window/Context.hpp b/include/SFML/Window/Context.hpp index 53e6177b..1a0057d3 100644 --- a/include/SFML/Window/Context.hpp +++ b/include/SFML/Window/Context.hpp @@ -113,7 +113,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Get the currently active context /// - /// \return The currently active context or NULL if none is active + /// \return The currently active context or nullptr if none is active /// //////////////////////////////////////////////////////////// static const Context* getActiveContext(); diff --git a/src/SFML/Audio/AudioDevice.cpp b/src/SFML/Audio/AudioDevice.cpp index 02fd0e37..d5472cee 100644 --- a/src/SFML/Audio/AudioDevice.cpp +++ b/src/SFML/Audio/AudioDevice.cpp @@ -33,8 +33,8 @@ namespace { - ALCdevice* audioDevice = NULL; - ALCcontext* audioContext = NULL; + ALCdevice* audioDevice = nullptr; + ALCcontext* audioContext = nullptr; float listenerVolume = 100.f; sf::Vector3f listenerPosition (0.f, 0.f, 0.f); @@ -50,12 +50,12 @@ namespace priv AudioDevice::AudioDevice() { // Create the device - audioDevice = alcOpenDevice(NULL); + audioDevice = alcOpenDevice(nullptr); if (audioDevice) { // Create the context - audioContext = alcCreateContext(audioDevice, NULL); + audioContext = alcCreateContext(audioDevice, nullptr); if (audioContext) { @@ -89,7 +89,7 @@ AudioDevice::AudioDevice() AudioDevice::~AudioDevice() { // Destroy the context - alcMakeContextCurrent(NULL); + alcMakeContextCurrent(nullptr); if (audioContext) alcDestroyContext(audioContext); diff --git a/src/SFML/Audio/Sound.cpp b/src/SFML/Audio/Sound.cpp index 8ebaa038..1b4aeefa 100644 --- a/src/SFML/Audio/Sound.cpp +++ b/src/SFML/Audio/Sound.cpp @@ -34,14 +34,14 @@ namespace sf { //////////////////////////////////////////////////////////// Sound::Sound() : -m_buffer(NULL) +m_buffer(nullptr) { } //////////////////////////////////////////////////////////// Sound::Sound(const SoundBuffer& buffer) : -m_buffer(NULL) +m_buffer(nullptr) { setBuffer(buffer); } @@ -50,7 +50,7 @@ m_buffer(NULL) //////////////////////////////////////////////////////////// Sound::Sound(const Sound& copy) : SoundSource(copy), -m_buffer (NULL) +m_buffer (nullptr) { if (copy.m_buffer) setBuffer(*copy.m_buffer); @@ -168,7 +168,7 @@ Sound& Sound::operator =(const Sound& right) { stop(); m_buffer->detachSound(this); - m_buffer = NULL; + m_buffer = nullptr; } // Copy the remaining sound attributes @@ -191,7 +191,7 @@ void Sound::resetBuffer() { alCheck(alSourcei(m_source, AL_BUFFER, 0)); m_buffer->detachSound(this); - m_buffer = NULL; + m_buffer = nullptr; } } diff --git a/src/SFML/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp index 9ccc13bd..bae25181 100644 --- a/src/SFML/Audio/SoundBuffer.cpp +++ b/src/SFML/Audio/SoundBuffer.cpp @@ -162,7 +162,7 @@ bool SoundBuffer::saveToFile(const std::string& filename) const //////////////////////////////////////////////////////////// const Int16* SoundBuffer::getSamples() const { - return m_samples.empty() ? NULL : m_samples.data(); + return m_samples.empty() ? nullptr : m_samples.data(); } diff --git a/src/SFML/Audio/SoundFileFactory.cpp b/src/SFML/Audio/SoundFileFactory.cpp index 172fa415..f12b847f 100644 --- a/src/SFML/Audio/SoundFileFactory.cpp +++ b/src/SFML/Audio/SoundFileFactory.cpp @@ -72,7 +72,7 @@ std::unique_ptr SoundFileFactory::createReaderFromFilename(cons FileInputStream stream; if (!stream.open(filename)) { err() << "Failed to open sound file \"" << filename << "\" (couldn't open stream)" << std::endl; - return NULL; + return nullptr; } // Test the filename in all the registered factories @@ -85,7 +85,7 @@ std::unique_ptr SoundFileFactory::createReaderFromFilename(cons // No suitable reader found err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl; - return NULL; + return nullptr; } @@ -109,7 +109,7 @@ std::unique_ptr SoundFileFactory::createReaderFromMemory(const // No suitable reader found err() << "Failed to open sound file from memory (format not supported)" << std::endl; - return NULL; + return nullptr; } @@ -129,7 +129,7 @@ std::unique_ptr SoundFileFactory::createReaderFromStream(InputS // No suitable reader found err() << "Failed to open sound file from stream (format not supported)" << std::endl; - return NULL; + return nullptr; } @@ -148,7 +148,7 @@ std::unique_ptr SoundFileFactory::createWriterFromFilename(cons // No suitable writer found err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl; - return NULL; + return nullptr; } } // namespace sf diff --git a/src/SFML/Audio/SoundFileReaderFlac.cpp b/src/SFML/Audio/SoundFileReaderFlac.cpp index 00794b66..64112ab7 100644 --- a/src/SFML/Audio/SoundFileReaderFlac.cpp +++ b/src/SFML/Audio/SoundFileReaderFlac.cpp @@ -191,7 +191,7 @@ bool SoundFileReaderFlac::check(InputStream& stream) ClientData data; data.stream = &stream; data.error = false; - FLAC__stream_decoder_init_stream(decoder, &streamRead, &streamSeek, &streamTell, &streamLength, &streamEof, &streamWrite, NULL, &streamError, &data); + FLAC__stream_decoder_init_stream(decoder, &streamRead, &streamSeek, &streamTell, &streamLength, &streamEof, &streamWrite, nullptr, &streamError, &data); // Read the header bool valid = FLAC__stream_decoder_process_until_end_of_metadata(decoder) != 0; @@ -206,7 +206,7 @@ bool SoundFileReaderFlac::check(InputStream& stream) //////////////////////////////////////////////////////////// SoundFileReaderFlac::SoundFileReaderFlac() : -m_decoder(NULL), +m_decoder(nullptr), m_clientData() { } @@ -255,7 +255,7 @@ void SoundFileReaderFlac::seek(Uint64 sampleOffset) assert(m_decoder); // Reset the callback data (the "write" callback will be called) - m_clientData.buffer = NULL; + m_clientData.buffer = nullptr; m_clientData.remaining = 0; m_clientData.leftovers.clear(); @@ -331,7 +331,7 @@ void SoundFileReaderFlac::close() { FLAC__stream_decoder_finish(m_decoder); FLAC__stream_decoder_delete(m_decoder); - m_decoder = NULL; + m_decoder = nullptr; } } diff --git a/src/SFML/Audio/SoundFileReaderOgg.cpp b/src/SFML/Audio/SoundFileReaderOgg.cpp index df46193e..b99cbd75 100644 --- a/src/SFML/Audio/SoundFileReaderOgg.cpp +++ b/src/SFML/Audio/SoundFileReaderOgg.cpp @@ -63,7 +63,7 @@ namespace return static_cast(stream->tell()); } - static ov_callbacks callbacks = {&read, &seek, NULL, &tell}; + static ov_callbacks callbacks = {&read, &seek, nullptr, &tell}; } namespace sf @@ -74,7 +74,7 @@ namespace priv bool SoundFileReaderOgg::check(InputStream& stream) { OggVorbis_File file; - if (ov_test_callbacks(&stream, &file, NULL, 0, callbacks) == 0) + if (ov_test_callbacks(&stream, &file, nullptr, 0, callbacks) == 0) { ov_clear(&file); return true; @@ -91,7 +91,7 @@ SoundFileReaderOgg::SoundFileReaderOgg() : m_vorbis (), m_channelCount(0) { - m_vorbis.datasource = NULL; + m_vorbis.datasource = nullptr; } @@ -106,7 +106,7 @@ SoundFileReaderOgg::~SoundFileReaderOgg() bool SoundFileReaderOgg::open(InputStream& stream, Info& info) { // Open the Vorbis stream - int status = ov_open_callbacks(&stream, &m_vorbis, NULL, 0, callbacks); + int status = ov_open_callbacks(&stream, &m_vorbis, nullptr, 0, callbacks); if (status < 0) { err() << "Failed to open Vorbis file for reading" << std::endl; @@ -145,7 +145,7 @@ Uint64 SoundFileReaderOgg::read(Int16* samples, Uint64 maxCount) while (count < maxCount) { int bytesToRead = static_cast(maxCount - count) * sizeof(Int16); - long bytesRead = ov_read(&m_vorbis, reinterpret_cast(samples), bytesToRead, 0, 2, 1, NULL); + long bytesRead = ov_read(&m_vorbis, reinterpret_cast(samples), bytesToRead, 0, 2, 1, nullptr); if (bytesRead > 0) { long samplesRead = bytesRead / sizeof(Int16); @@ -169,7 +169,7 @@ void SoundFileReaderOgg::close() if (m_vorbis.datasource) { ov_clear(&m_vorbis); - m_vorbis.datasource = NULL; + m_vorbis.datasource = nullptr; m_channelCount = 0; } } diff --git a/src/SFML/Audio/SoundFileReaderWav.cpp b/src/SFML/Audio/SoundFileReaderWav.cpp index 6f4a7779..35ca04a6 100644 --- a/src/SFML/Audio/SoundFileReaderWav.cpp +++ b/src/SFML/Audio/SoundFileReaderWav.cpp @@ -108,7 +108,7 @@ bool SoundFileReaderWav::check(InputStream& stream) //////////////////////////////////////////////////////////// SoundFileReaderWav::SoundFileReaderWav() : -m_stream (NULL), +m_stream (nullptr), m_bytesPerSample(0), m_dataStart (0), m_dataEnd (0) diff --git a/src/SFML/Audio/SoundFileWriterFlac.cpp b/src/SFML/Audio/SoundFileWriterFlac.cpp index b72ee0d5..acc66f3c 100644 --- a/src/SFML/Audio/SoundFileWriterFlac.cpp +++ b/src/SFML/Audio/SoundFileWriterFlac.cpp @@ -48,7 +48,7 @@ bool SoundFileWriterFlac::check(const std::string& filename) //////////////////////////////////////////////////////////// SoundFileWriterFlac::SoundFileWriterFlac() : -m_encoder (NULL), +m_encoder (nullptr), m_channelCount(0), m_samples32 () { @@ -79,7 +79,7 @@ bool SoundFileWriterFlac::open(const std::string& filename, unsigned int sampleR FLAC__stream_encoder_set_sample_rate(m_encoder, sampleRate); // Initialize the output stream - if (FLAC__stream_encoder_init_file(m_encoder, filename.c_str(), NULL, NULL) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) + if (FLAC__stream_encoder_init_file(m_encoder, filename.c_str(), nullptr, nullptr) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { err() << "Failed to write flac file \"" << filename << "\" (failed to open the file)" << std::endl; close(); @@ -124,7 +124,7 @@ void SoundFileWriterFlac::close() // Destroy the encoder FLAC__stream_encoder_delete(m_encoder); - m_encoder = NULL; + m_encoder = nullptr; } } diff --git a/src/SFML/Audio/SoundFileWriterOgg.cpp b/src/SFML/Audio/SoundFileWriterOgg.cpp index a5cbf15b..52f3a348 100644 --- a/src/SFML/Audio/SoundFileWriterOgg.cpp +++ b/src/SFML/Audio/SoundFileWriterOgg.cpp @@ -167,7 +167,7 @@ void SoundFileWriterOgg::flushBlocks() while (vorbis_analysis_blockout(&m_state, &block) == 1) { // Let the automatic bitrate management do its job - vorbis_analysis(&block, NULL); + vorbis_analysis(&block, nullptr); vorbis_bitrate_addblock(&block); // Get new packets from the bitrate management engine diff --git a/src/SFML/Audio/SoundRecorder.cpp b/src/SFML/Audio/SoundRecorder.cpp index f139d67e..bc678bc6 100644 --- a/src/SFML/Audio/SoundRecorder.cpp +++ b/src/SFML/Audio/SoundRecorder.cpp @@ -40,7 +40,7 @@ namespace { - ALCdevice* captureDevice = NULL; + ALCdevice* captureDevice = nullptr; } namespace sf @@ -152,7 +152,7 @@ std::vector SoundRecorder::getAvailableDevices() { std::vector deviceNameList; - const ALchar* deviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); + const ALchar* deviceList = alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER); if (deviceList) { while (*deviceList) @@ -169,7 +169,7 @@ std::vector SoundRecorder::getAvailableDevices() //////////////////////////////////////////////////////////// std::string SoundRecorder::getDefaultDevice() { - return alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER); + return alcGetString(nullptr, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER); } @@ -333,7 +333,7 @@ void SoundRecorder::cleanup() // Close the device alcCaptureCloseDevice(captureDevice); - captureDevice = NULL; + captureDevice = nullptr; } } // namespace sf diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 78320da7..e6d6afc4 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -406,7 +406,7 @@ bool SoundStream::fillAndPushBuffer(unsigned int bufferNum, bool immediateLoop) bool requestStop = false; // Acquire audio data, also address EOF and error cases if they occur - Chunk data = {NULL, 0}; + Chunk data = {nullptr, 0}; for (Uint32 retryCount = 0; !onGetData(data) && (retryCount < BufferRetries); ++retryCount) { // Mark the buffer as the last one (so that we know when to reset the playing position) diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index ec82080f..868e3df1 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -68,9 +68,9 @@ namespace sf { //////////////////////////////////////////////////////////// Font::Font() : -m_library (NULL), -m_face (NULL), -m_stroker (NULL), +m_library (nullptr), +m_face (nullptr), +m_stroker (nullptr), m_info () { } @@ -241,7 +241,7 @@ bool Font::loadFromStream(InputStream& stream) // Prepare a wrapper for our stream, that we'll pass to FreeType callbacks auto rec = std::make_shared(); std::memset(rec.get(), 0, sizeof(FT_StreamRec)); - rec->base = NULL; + rec->base = nullptr; rec->size = static_cast(stream.getSize()); rec->pos = 0; rec->descriptor.pointer = &stream; @@ -476,10 +476,10 @@ void Font::cleanup() } // Reset members - m_library = NULL; - m_face = NULL; - m_stroker = NULL; - m_streamRec = NULL; + m_library = nullptr; + m_face = nullptr; + m_stroker = nullptr; + m_streamRec = nullptr; m_pages.clear(); std::vector().swap(m_pixelBuffer); } @@ -647,7 +647,7 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, f IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height) const { // Find the line that fits well the glyph - Row* row = NULL; + Row* row = nullptr; float bestRatio = 0; for (std::vector::iterator it = page.rows.begin(); it != page.rows.end() && !row; ++it) { diff --git a/src/SFML/Graphics/GLLoader.cpp b/src/SFML/Graphics/GLLoader.cpp index ec1531fb..d5d5838f 100644 --- a/src/SFML/Graphics/GLLoader.cpp +++ b/src/SFML/Graphics/GLLoader.cpp @@ -50,7 +50,7 @@ int sfogl_ext_EXT_framebuffer_object = sfogl_LOAD_FAILED; int sfogl_ext_EXT_framebuffer_blit = sfogl_LOAD_FAILED; int sfogl_ext_ARB_geometry_shader4 = sfogl_LOAD_FAILED; -void (GL_FUNCPTR *sf_ptrc_glBlendEquationEXT)(GLenum) = NULL; +void (GL_FUNCPTR *sf_ptrc_glBlendEquationEXT)(GLenum) = nullptr; static int Load_EXT_blend_minmax() { @@ -63,40 +63,40 @@ static int Load_EXT_blend_minmax() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glActiveTextureARB)(GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glClientActiveTextureARB)(GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dARB)(GLenum, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dvARB)(GLenum, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fARB)(GLenum, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fvARB)(GLenum, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1iARB)(GLenum, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1ivARB)(GLenum, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1sARB)(GLenum, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1svARB)(GLenum, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dARB)(GLenum, GLdouble, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dvARB)(GLenum, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fARB)(GLenum, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fvARB)(GLenum, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2iARB)(GLenum, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2ivARB)(GLenum, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2sARB)(GLenum, GLshort, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2svARB)(GLenum, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dvARB)(GLenum, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fvARB)(GLenum, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3iARB)(GLenum, GLint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3ivARB)(GLenum, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3svARB)(GLenum, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dvARB)(GLenum, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fvARB)(GLenum, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4ivARB)(GLenum, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4svARB)(GLenum, const GLshort*) = NULL; +void (GL_FUNCPTR *sf_ptrc_glActiveTextureARB)(GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glClientActiveTextureARB)(GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dARB)(GLenum, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dvARB)(GLenum, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fARB)(GLenum, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fvARB)(GLenum, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1iARB)(GLenum, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1ivARB)(GLenum, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1sARB)(GLenum, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1svARB)(GLenum, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dARB)(GLenum, GLdouble, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dvARB)(GLenum, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fARB)(GLenum, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fvARB)(GLenum, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2iARB)(GLenum, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2ivARB)(GLenum, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2sARB)(GLenum, GLshort, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2svARB)(GLenum, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dvARB)(GLenum, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fvARB)(GLenum, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3iARB)(GLenum, GLint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3ivARB)(GLenum, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3svARB)(GLenum, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dvARB)(GLenum, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fvARB)(GLenum, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4ivARB)(GLenum, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4svARB)(GLenum, const GLshort*) = nullptr; static int Load_ARB_multitexture() { @@ -241,7 +241,7 @@ static int Load_ARB_multitexture() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glBlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum) = NULL; +void (GL_FUNCPTR *sf_ptrc_glBlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum) = nullptr; static int Load_EXT_blend_func_separate() { @@ -254,45 +254,45 @@ static int Load_EXT_blend_func_separate() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glAttachObjectARB)(GLhandleARB, GLhandleARB) = NULL; -void (GL_FUNCPTR *sf_ptrc_glCompileShaderARB)(GLhandleARB) = NULL; -GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateProgramObjectARB)() = NULL; -GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateShaderObjectARB)(GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glDeleteObjectARB)(GLhandleARB) = NULL; -void (GL_FUNCPTR *sf_ptrc_glDetachObjectARB)(GLhandleARB, GLhandleARB) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei*, GLhandleARB*) = NULL; -GLhandleARB (GL_FUNCPTR *sf_ptrc_glGetHandleARB)(GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterivARB)(GLhandleARB, GLenum, GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = NULL; -GLint (GL_FUNCPTR *sf_ptrc_glGetUniformLocationARB)(GLhandleARB, const GLcharARB*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetUniformfvARB)(GLhandleARB, GLint, GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetUniformivARB)(GLhandleARB, GLint, GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glLinkProgramARB)(GLhandleARB) = NULL; -void (GL_FUNCPTR *sf_ptrc_glShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB**, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform1fARB)(GLint, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform1fvARB)(GLint, GLsizei, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform1iARB)(GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform1ivARB)(GLint, GLsizei, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform2fARB)(GLint, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform2fvARB)(GLint, GLsizei, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform2iARB)(GLint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform2ivARB)(GLint, GLsizei, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform3fvARB)(GLint, GLsizei, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform3iARB)(GLint, GLint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform3ivARB)(GLint, GLsizei, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform4fvARB)(GLint, GLsizei, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform4iARB)(GLint, GLint, GLint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniform4ivARB)(GLint, GLsizei, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glUseProgramObjectARB)(GLhandleARB) = NULL; -void (GL_FUNCPTR *sf_ptrc_glValidateProgramARB)(GLhandleARB) = NULL; +void (GL_FUNCPTR *sf_ptrc_glAttachObjectARB)(GLhandleARB, GLhandleARB) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glCompileShaderARB)(GLhandleARB) = nullptr; +GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateProgramObjectARB)() = nullptr; +GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateShaderObjectARB)(GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glDeleteObjectARB)(GLhandleARB) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glDetachObjectARB)(GLhandleARB, GLhandleARB) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei*, GLhandleARB*) = nullptr; +GLhandleARB (GL_FUNCPTR *sf_ptrc_glGetHandleARB)(GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterivARB)(GLhandleARB, GLenum, GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = nullptr; +GLint (GL_FUNCPTR *sf_ptrc_glGetUniformLocationARB)(GLhandleARB, const GLcharARB*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetUniformfvARB)(GLhandleARB, GLint, GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetUniformivARB)(GLhandleARB, GLint, GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glLinkProgramARB)(GLhandleARB) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB**, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform1fARB)(GLint, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform1fvARB)(GLint, GLsizei, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform1iARB)(GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform1ivARB)(GLint, GLsizei, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform2fARB)(GLint, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform2fvARB)(GLint, GLsizei, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform2iARB)(GLint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform2ivARB)(GLint, GLsizei, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform3fvARB)(GLint, GLsizei, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform3iARB)(GLint, GLint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform3ivARB)(GLint, GLsizei, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform4fvARB)(GLint, GLsizei, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform4iARB)(GLint, GLint, GLint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniform4ivARB)(GLint, GLsizei, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glUseProgramObjectARB)(GLhandleARB) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glValidateProgramARB)(GLhandleARB) = nullptr; static int Load_ARB_shader_objects() { @@ -457,52 +457,52 @@ static int Load_ARB_shader_objects() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glDisableVertexAttribArrayARB)(GLuint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glEnableVertexAttribArrayARB)(GLuint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = NULL; -GLint (GL_FUNCPTR *sf_ptrc_glGetAttribLocationARB)(GLhandleARB, const GLcharARB*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribPointervARB)(GLuint, GLenum, void**) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribdvARB)(GLuint, GLenum, GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribfvARB)(GLuint, GLenum, GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribivARB)(GLuint, GLenum, GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dARB)(GLuint, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dvARB)(GLuint, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fARB)(GLuint, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fvARB)(GLuint, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1sARB)(GLuint, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1svARB)(GLuint, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dARB)(GLuint, GLdouble, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dvARB)(GLuint, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fARB)(GLuint, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fvARB)(GLuint, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2sARB)(GLuint, GLshort, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2svARB)(GLuint, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dvARB)(GLuint, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fvARB)(GLuint, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3svARB)(GLuint, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NbvARB)(GLuint, const GLbyte*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NivARB)(GLuint, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NsvARB)(GLuint, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubvARB)(GLuint, const GLubyte*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NuivARB)(GLuint, const GLuint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NusvARB)(GLuint, const GLushort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4bvARB)(GLuint, const GLbyte*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dvARB)(GLuint, const GLdouble*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fvARB)(GLuint, const GLfloat*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ivARB)(GLuint, const GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4svARB)(GLuint, const GLshort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ubvARB)(GLuint, const GLubyte*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4uivARB)(GLuint, const GLuint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4usvARB)(GLuint, const GLushort*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const void*) = NULL; +void (GL_FUNCPTR *sf_ptrc_glBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glDisableVertexAttribArrayARB)(GLuint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glEnableVertexAttribArrayARB)(GLuint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = nullptr; +GLint (GL_FUNCPTR *sf_ptrc_glGetAttribLocationARB)(GLhandleARB, const GLcharARB*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribPointervARB)(GLuint, GLenum, void**) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribdvARB)(GLuint, GLenum, GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribfvARB)(GLuint, GLenum, GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribivARB)(GLuint, GLenum, GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dARB)(GLuint, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dvARB)(GLuint, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fARB)(GLuint, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fvARB)(GLuint, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1sARB)(GLuint, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1svARB)(GLuint, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dARB)(GLuint, GLdouble, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dvARB)(GLuint, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fARB)(GLuint, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fvARB)(GLuint, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2sARB)(GLuint, GLshort, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2svARB)(GLuint, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dvARB)(GLuint, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fvARB)(GLuint, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3svARB)(GLuint, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NbvARB)(GLuint, const GLbyte*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NivARB)(GLuint, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NsvARB)(GLuint, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubvARB)(GLuint, const GLubyte*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NuivARB)(GLuint, const GLuint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NusvARB)(GLuint, const GLushort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4bvARB)(GLuint, const GLbyte*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dvARB)(GLuint, const GLdouble*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fvARB)(GLuint, const GLfloat*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ivARB)(GLuint, const GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4svARB)(GLuint, const GLshort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ubvARB)(GLuint, const GLubyte*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4uivARB)(GLuint, const GLuint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4usvARB)(GLuint, const GLushort*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const void*) = nullptr; static int Load_ARB_vertex_shader() { @@ -695,7 +695,7 @@ static int Load_ARB_vertex_shader() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glBlendEquationSeparateEXT)(GLenum, GLenum) = NULL; +void (GL_FUNCPTR *sf_ptrc_glBlendEquationSeparateEXT)(GLenum, GLenum) = nullptr; static int Load_EXT_blend_equation_separate() { @@ -708,23 +708,23 @@ static int Load_EXT_blend_equation_separate() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glBindFramebufferEXT)(GLenum, GLuint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glBindRenderbufferEXT)(GLenum, GLuint) = NULL; -GLenum (GL_FUNCPTR *sf_ptrc_glCheckFramebufferStatusEXT)(GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glDeleteFramebuffersEXT)(GLsizei, const GLuint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glDeleteRenderbuffersEXT)(GLsizei, const GLuint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glFramebufferRenderbufferEXT)(GLenum, GLenum, GLenum, GLuint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture1DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture2DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture3DEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGenFramebuffersEXT)(GLsizei, GLuint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGenRenderbuffersEXT)(GLsizei, GLuint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGenerateMipmapEXT)(GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetFramebufferAttachmentParameterivEXT)(GLenum, GLenum, GLenum, GLint*) = NULL; -void (GL_FUNCPTR *sf_ptrc_glGetRenderbufferParameterivEXT)(GLenum, GLenum, GLint*) = NULL; -GLboolean (GL_FUNCPTR *sf_ptrc_glIsFramebufferEXT)(GLuint) = NULL; -GLboolean (GL_FUNCPTR *sf_ptrc_glIsRenderbufferEXT)(GLuint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glRenderbufferStorageEXT)(GLenum, GLenum, GLsizei, GLsizei) = NULL; +void (GL_FUNCPTR *sf_ptrc_glBindFramebufferEXT)(GLenum, GLuint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glBindRenderbufferEXT)(GLenum, GLuint) = nullptr; +GLenum (GL_FUNCPTR *sf_ptrc_glCheckFramebufferStatusEXT)(GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glDeleteFramebuffersEXT)(GLsizei, const GLuint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glDeleteRenderbuffersEXT)(GLsizei, const GLuint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glFramebufferRenderbufferEXT)(GLenum, GLenum, GLenum, GLuint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture1DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture2DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture3DEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGenFramebuffersEXT)(GLsizei, GLuint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGenRenderbuffersEXT)(GLsizei, GLuint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGenerateMipmapEXT)(GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetFramebufferAttachmentParameterivEXT)(GLenum, GLenum, GLenum, GLint*) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glGetRenderbufferParameterivEXT)(GLenum, GLenum, GLint*) = nullptr; +GLboolean (GL_FUNCPTR *sf_ptrc_glIsFramebufferEXT)(GLuint) = nullptr; +GLboolean (GL_FUNCPTR *sf_ptrc_glIsRenderbufferEXT)(GLuint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glRenderbufferStorageEXT)(GLenum, GLenum, GLsizei, GLsizei) = nullptr; static int Load_EXT_framebuffer_object() { @@ -801,7 +801,7 @@ static int Load_EXT_framebuffer_object() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glBlitFramebufferEXT)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) = NULL; +void (GL_FUNCPTR *sf_ptrc_glBlitFramebufferEXT)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) = nullptr; static int Load_EXT_framebuffer_blit() { @@ -814,10 +814,10 @@ static int Load_EXT_framebuffer_blit() return numFailed; } -void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureARB)(GLenum, GLenum, GLuint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureFaceARB)(GLenum, GLenum, GLuint, GLint, GLenum) = NULL; -void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureLayerARB)(GLenum, GLenum, GLuint, GLint, GLint) = NULL; -void (GL_FUNCPTR *sf_ptrc_glProgramParameteriARB)(GLuint, GLenum, GLint) = NULL; +void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureARB)(GLenum, GLenum, GLuint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureFaceARB)(GLenum, GLenum, GLuint, GLint, GLenum) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureLayerARB)(GLenum, GLenum, GLuint, GLint, GLint) = nullptr; +void (GL_FUNCPTR *sf_ptrc_glProgramParameteriARB)(GLuint, GLenum, GLint) = nullptr; static int Load_ARB_geometry_shader4() { @@ -851,19 +851,19 @@ typedef struct sfogl_StrToExtMap_s } sfogl_StrToExtMap; static sfogl_StrToExtMap ExtensionMap[16] = { - {"GL_SGIS_texture_edge_clamp", &sfogl_ext_SGIS_texture_edge_clamp, NULL}, - {"GL_EXT_texture_edge_clamp", &sfogl_ext_EXT_texture_edge_clamp, NULL}, + {"GL_SGIS_texture_edge_clamp", &sfogl_ext_SGIS_texture_edge_clamp, nullptr}, + {"GL_EXT_texture_edge_clamp", &sfogl_ext_EXT_texture_edge_clamp, nullptr}, {"GL_EXT_blend_minmax", &sfogl_ext_EXT_blend_minmax, Load_EXT_blend_minmax}, - {"GL_EXT_blend_subtract", &sfogl_ext_EXT_blend_subtract, NULL}, + {"GL_EXT_blend_subtract", &sfogl_ext_EXT_blend_subtract, nullptr}, {"GL_ARB_multitexture", &sfogl_ext_ARB_multitexture, Load_ARB_multitexture}, {"GL_EXT_blend_func_separate", &sfogl_ext_EXT_blend_func_separate, Load_EXT_blend_func_separate}, - {"GL_ARB_shading_language_100", &sfogl_ext_ARB_shading_language_100, NULL}, + {"GL_ARB_shading_language_100", &sfogl_ext_ARB_shading_language_100, nullptr}, {"GL_ARB_shader_objects", &sfogl_ext_ARB_shader_objects, Load_ARB_shader_objects}, {"GL_ARB_vertex_shader", &sfogl_ext_ARB_vertex_shader, Load_ARB_vertex_shader}, - {"GL_ARB_fragment_shader", &sfogl_ext_ARB_fragment_shader, NULL}, - {"GL_ARB_texture_non_power_of_two", &sfogl_ext_ARB_texture_non_power_of_two, NULL}, + {"GL_ARB_fragment_shader", &sfogl_ext_ARB_fragment_shader, nullptr}, + {"GL_ARB_texture_non_power_of_two", &sfogl_ext_ARB_texture_non_power_of_two, nullptr}, {"GL_EXT_blend_equation_separate", &sfogl_ext_EXT_blend_equation_separate, Load_EXT_blend_equation_separate}, - {"GL_EXT_texture_sRGB", &sfogl_ext_EXT_texture_sRGB, NULL}, + {"GL_EXT_texture_sRGB", &sfogl_ext_EXT_texture_sRGB, nullptr}, {"GL_EXT_framebuffer_object", &sfogl_ext_EXT_framebuffer_object, Load_EXT_framebuffer_object}, {"GL_EXT_framebuffer_blit", &sfogl_ext_EXT_framebuffer_blit, Load_EXT_framebuffer_blit}, {"GL_ARB_geometry_shader4", &sfogl_ext_ARB_geometry_shader4, Load_ARB_geometry_shader4} diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp index 00bb1a7e..efc77f5d 100644 --- a/src/SFML/Graphics/Image.cpp +++ b/src/SFML/Graphics/Image.cpp @@ -284,7 +284,7 @@ const Uint8* Image::getPixelsPtr() const else { err() << "Trying to access the pixels of an empty image" << std::endl; - return NULL; + return nullptr; } } diff --git a/src/SFML/Graphics/RenderStates.cpp b/src/SFML/Graphics/RenderStates.cpp index bc451031..01a0f09b 100644 --- a/src/SFML/Graphics/RenderStates.cpp +++ b/src/SFML/Graphics/RenderStates.cpp @@ -43,8 +43,8 @@ const RenderStates RenderStates::Default(BlendMode( RenderStates::RenderStates() : blendMode(BlendAlpha), transform(), -texture (NULL), -shader (NULL) +texture (nullptr), +shader (nullptr) { } @@ -53,8 +53,8 @@ shader (NULL) RenderStates::RenderStates(const Transform& theTransform) : blendMode(BlendAlpha), transform(theTransform), -texture (NULL), -shader (NULL) +texture (nullptr), +shader (nullptr) { } @@ -63,8 +63,8 @@ shader (NULL) RenderStates::RenderStates(const BlendMode& theBlendMode) : blendMode(theBlendMode), transform(), -texture (NULL), -shader (NULL) +texture (nullptr), +shader (nullptr) { } @@ -74,7 +74,7 @@ RenderStates::RenderStates(const Texture* theTexture) : blendMode(BlendAlpha), transform(), texture (theTexture), -shader (NULL) +shader (nullptr) { } @@ -83,7 +83,7 @@ shader (NULL) RenderStates::RenderStates(const Shader* theShader) : blendMode(BlendAlpha), transform(), -texture (NULL), +texture (nullptr), shader (theShader) { } diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index 146f48a2..0b5a6af1 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -102,7 +102,7 @@ void RenderTarget::clear(const Color& color) if (setActive(true)) { // Unbind texture to fix RenderTexture preventing clear - applyTexture(NULL); + applyTexture(nullptr); glCheck(glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f)); glCheck(glClear(GL_COLOR_BUFFER_BIT)); @@ -267,7 +267,7 @@ void RenderTarget::draw(const Vertex* vertices, std::size_t vertexCount, if (!m_cache.useVertexCache) vertices = m_cache.vertexCache; else - vertices = NULL; + vertices = nullptr; } // Setup the pointers to the vertices' components @@ -289,12 +289,12 @@ void RenderTarget::draw(const Vertex* vertices, std::size_t vertexCount, // Unbind the shader, if any if (states.shader) - applyShader(NULL); + applyShader(nullptr); // If the texture we used to draw belonged to a RenderTexture, then forcibly unbind that texture. // This prevents a bug where some drivers do not clear RenderTextures properly. if (states.texture && states.texture->m_fboAttachment) - applyTexture(NULL); + applyTexture(nullptr); // Update the cache m_cache.useVertexCache = useVertexCache; @@ -387,9 +387,9 @@ void RenderTarget::resetGLStates() // Apply the default SFML states applyBlendMode(BlendAlpha); applyTransform(Transform::Identity); - applyTexture(NULL); + applyTexture(nullptr); if (shaderAvailable) - applyShader(NULL); + applyShader(nullptr); m_cache.useVertexCache = false; diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index 066a8b10..86511d4e 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -228,11 +228,11 @@ bool Shader::loadFromFile(const std::string& filename, Type type) // Compile the shader program if (type == Vertex) - return compile(shader.data(), NULL, NULL); + return compile(shader.data(), nullptr, nullptr); else if (type == Geometry) - return compile(NULL, shader.data(), NULL); + return compile(nullptr, shader.data(), nullptr); else - return compile(NULL, NULL, shader.data()); + return compile(nullptr, nullptr, shader.data()); } @@ -256,7 +256,7 @@ bool Shader::loadFromFile(const std::string& vertexShaderFilename, const std::st } // Compile the shader program - return compile(vertexShader.data(), NULL, fragmentShader.data()); + return compile(vertexShader.data(), nullptr, fragmentShader.data()); } @@ -297,11 +297,11 @@ bool Shader::loadFromMemory(const std::string& shader, Type type) { // Compile the shader program if (type == Vertex) - return compile(shader.c_str(), NULL, NULL); + return compile(shader.c_str(), nullptr, nullptr); else if (type == Geometry) - return compile(NULL, shader.c_str(), NULL); + return compile(nullptr, shader.c_str(), nullptr); else - return compile(NULL, NULL, shader.c_str()); + return compile(nullptr, nullptr, shader.c_str()); } @@ -309,7 +309,7 @@ bool Shader::loadFromMemory(const std::string& shader, Type type) bool Shader::loadFromMemory(const std::string& vertexShader, const std::string& fragmentShader) { // Compile the shader program - return compile(vertexShader.c_str(), NULL, fragmentShader.c_str()); + return compile(vertexShader.c_str(), nullptr, fragmentShader.c_str()); } @@ -334,11 +334,11 @@ bool Shader::loadFromStream(InputStream& stream, Type type) // Compile the shader program if (type == Vertex) - return compile(shader.data(), NULL, NULL); + return compile(shader.data(), nullptr, nullptr); else if (type == Geometry) - return compile(NULL, shader.data(), NULL); + return compile(nullptr, shader.data(), nullptr); else - return compile(NULL, NULL, shader.data()); + return compile(nullptr, nullptr, shader.data()); } @@ -362,7 +362,7 @@ bool Shader::loadFromStream(InputStream& vertexShaderStream, InputStream& fragme } // Compile the shader program - return compile(vertexShader.data(), NULL, fragmentShader.data()); + return compile(vertexShader.data(), nullptr, fragmentShader.data()); } @@ -835,7 +835,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod // Create and compile the shader GLEXT_GLhandle vertexShader; glCheck(vertexShader = GLEXT_glCreateShaderObject(GLEXT_GL_VERTEX_SHADER)); - glCheck(GLEXT_glShaderSource(vertexShader, 1, &vertexShaderCode, NULL)); + glCheck(GLEXT_glShaderSource(vertexShader, 1, &vertexShaderCode, nullptr)); glCheck(GLEXT_glCompileShader(vertexShader)); // Check the compile log @@ -862,7 +862,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod { // Create and compile the shader GLEXT_GLhandle geometryShader = GLEXT_glCreateShaderObject(GLEXT_GL_GEOMETRY_SHADER); - glCheck(GLEXT_glShaderSource(geometryShader, 1, &geometryShaderCode, NULL)); + glCheck(GLEXT_glShaderSource(geometryShader, 1, &geometryShaderCode, nullptr)); glCheck(GLEXT_glCompileShader(geometryShader)); // Check the compile log @@ -890,7 +890,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod // Create and compile the shader GLEXT_GLhandle fragmentShader; glCheck(fragmentShader = GLEXT_glCreateShaderObject(GLEXT_GL_FRAGMENT_SHADER)); - glCheck(GLEXT_glShaderSource(fragmentShader, 1, &fragmentShaderCode, NULL)); + glCheck(GLEXT_glShaderSource(fragmentShader, 1, &fragmentShaderCode, nullptr)); glCheck(GLEXT_glCompileShader(fragmentShader)); // Check the compile log diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp index c0d4f821..634286c9 100644 --- a/src/SFML/Graphics/Shape.cpp +++ b/src/SFML/Graphics/Shape.cpp @@ -158,7 +158,7 @@ FloatRect Shape::getGlobalBounds() const //////////////////////////////////////////////////////////// Shape::Shape() : -m_texture (NULL), +m_texture (nullptr), m_textureRect (), m_fillColor (255, 255, 255), m_outlineColor (255, 255, 255), @@ -221,7 +221,7 @@ void Shape::draw(RenderTarget& target, RenderStates states) const // Render the outline if (m_outlineThickness != 0) { - states.texture = NULL; + states.texture = nullptr; target.draw(m_outlineVertices, states); } } diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp index 71d5c70a..bad0059a 100644 --- a/src/SFML/Graphics/Sprite.cpp +++ b/src/SFML/Graphics/Sprite.cpp @@ -35,7 +35,7 @@ namespace sf { //////////////////////////////////////////////////////////// Sprite::Sprite() : -m_texture (NULL), +m_texture (nullptr), m_textureRect() { } @@ -43,7 +43,7 @@ m_textureRect() //////////////////////////////////////////////////////////// Sprite::Sprite(const Texture& texture) : -m_texture (NULL), +m_texture (nullptr), m_textureRect() { setTexture(texture); @@ -52,7 +52,7 @@ m_textureRect() //////////////////////////////////////////////////////////// Sprite::Sprite(const Texture& texture, const IntRect& rectangle) : -m_texture (NULL), +m_texture (nullptr), m_textureRect() { setTexture(texture); diff --git a/src/SFML/Graphics/Text.cpp b/src/SFML/Graphics/Text.cpp index 5ad50c1f..c830e0bd 100644 --- a/src/SFML/Graphics/Text.cpp +++ b/src/SFML/Graphics/Text.cpp @@ -75,7 +75,7 @@ namespace sf //////////////////////////////////////////////////////////// Text::Text() : m_string (), -m_font (NULL), +m_font (nullptr), m_characterSize (30), m_style (Regular), m_fillColor (255, 255, 255), diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index 98d4fbb7..bd066972 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -197,7 +197,7 @@ bool Texture::create(unsigned int width, unsigned int height) // Initialize the texture glCheck(glBindTexture(GL_TEXTURE_2D, m_texture)); - glCheck(glTexImage2D(GL_TEXTURE_2D, 0, (m_sRgb ? GLEXT_GL_SRGB8_ALPHA8 : GL_RGBA), m_actualSize.x, m_actualSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL)); + glCheck(glTexImage2D(GL_TEXTURE_2D, 0, (m_sRgb ? GLEXT_GL_SRGB8_ALPHA8 : GL_RGBA), m_actualSize.x, m_actualSize.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr)); glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, m_isRepeated ? GL_REPEAT : (textureEdgeClamp ? GLEXT_GL_CLAMP_TO_EDGE : GLEXT_GL_CLAMP))); glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_isRepeated ? GL_REPEAT : (textureEdgeClamp ? GLEXT_GL_CLAMP_TO_EDGE : GLEXT_GL_CLAMP))); glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, m_isSmooth ? GL_LINEAR : GL_NEAREST)); diff --git a/src/SFML/Main/MainAndroid.cpp b/src/SFML/Main/MainAndroid.cpp index c5a352e0..7db2082a 100644 --- a/src/SFML/Main/MainAndroid.cpp +++ b/src/SFML/Main/MainAndroid.cpp @@ -60,11 +60,11 @@ int getAndroidApiLevel(ANativeActivity* activity) JNIEnv* lJNIEnv = activity->env; jclass versionClass = lJNIEnv->FindClass("android/os/Build$VERSION"); - if (versionClass == NULL) + if (versionClass == nullptr) return 0; jfieldID sdkIntFieldID = lJNIEnv->GetStaticFieldID(versionClass, "SDK_INT", "I"); - if (sdkIntFieldID == NULL) + if (sdkIntFieldID == nullptr) return 0; jint sdkInt = 0; @@ -117,7 +117,7 @@ void* main(ActivityStates* states) initializeMain(states); sleep(seconds(0.5)); - ::main(0, NULL); + ::main(0, nullptr); // Terminate properly the main thread and wait until it's done terminateMain(states); @@ -128,7 +128,7 @@ void* main(ActivityStates* states) states->terminated = true; } - return NULL; + return nullptr; } } // namespace priv @@ -315,7 +315,7 @@ static void onDestroy(ANativeActivity* activity) delete states; // Reset the activity pointer for all modules - sf::priv::getActivity(NULL, true); + sf::priv::getActivity(nullptr, true); // The application should now terminate } @@ -353,7 +353,7 @@ static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* wi std::lock_guard lock(states->mutex); // Update the activity states - states->window = NULL; + states->window = nullptr; // Notify SFML mechanism sf::Event event; @@ -393,7 +393,7 @@ static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) { std::lock_guard lock(states->mutex); - AInputQueue_attachLooper(queue, states->looper, 1, states->processEvent, NULL); + AInputQueue_attachLooper(queue, states->looper, 1, states->processEvent, nullptr); states->inputQueue = queue; } } @@ -409,7 +409,7 @@ static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) { std::lock_guard lock(states->mutex); - states->inputQueue = NULL; + states->inputQueue = nullptr; AInputQueue_detachLooper(queue); } } @@ -429,7 +429,7 @@ static void onContentRectChanged(ANativeActivity* activity, const ARect* rect) std::lock_guard lock(states->mutex); // Make sure the window still exists before we access the dimensions on it - if (states->window != NULL) { + if (states->window != nullptr) { // Send an event to warn people about the window move/resize sf::Event event; event.type = sf::Event::Resized; @@ -452,7 +452,7 @@ static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) { *outLen = 0; - return NULL; + return nullptr; } @@ -466,22 +466,22 @@ static void onLowMemory(ANativeActivity* activity) void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize) { // Create an activity states (will keep us in the know, about events we care) - sf::priv::ActivityStates* states = NULL; + sf::priv::ActivityStates* states = nullptr; states = new sf::priv::ActivityStates; // Initialize the states value - states->activity = NULL; - states->window = NULL; - states->looper = NULL; - states->inputQueue = NULL; - states->config = NULL; + states->activity = nullptr; + states->window = nullptr; + states->looper = nullptr; + states->inputQueue = nullptr; + states->config = nullptr; for (unsigned int i = 0; i < sf::Mouse::ButtonCount; i++) states->isButtonPressed[i] = false; states->display = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (savedState != NULL) + if (savedState != nullptr) { states->savedState = malloc(savedStateSize); states->savedStateSize = savedStateSize; @@ -527,7 +527,7 @@ void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_ AWINDOW_FLAG_KEEP_SCREEN_ON); // Initialize the display - eglInitialize(states->display, NULL, NULL); + eglInitialize(states->display, nullptr, nullptr); getScreenSizeInPixels(activity, &states->screenSize.x, &states->screenSize.y); diff --git a/src/SFML/Main/SFMLActivity.cpp b/src/SFML/Main/SFMLActivity.cpp index 07602fb2..070f72b4 100644 --- a/src/SFML/Main/SFMLActivity.cpp +++ b/src/SFML/Main/SFMLActivity.cpp @@ -59,7 +59,7 @@ const char *getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo) jstring valueString = (jstring)lJNIEnv->CallObjectMethod(objectMetaData, methodGetString, objectName); // No meta-data "sfml.app.lib_name" was found so we abort and inform the user - if (valueString == NULL) + if (valueString == nullptr) { LOGE("No meta-data 'sfml.app.lib_name' found in AndroidManifest.xml file"); exit(1); @@ -67,7 +67,7 @@ const char *getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo) // Convert the application name to a C++ string and return it const jsize applicationNameLength = lJNIEnv->GetStringUTFLength(valueString); - const char* applicationName = lJNIEnv->GetStringUTFChars(valueString, NULL); + const char* applicationName = lJNIEnv->GetStringUTFChars(valueString, nullptr); if (applicationNameLength >= 256) { @@ -107,7 +107,7 @@ void* loadLibrary(const char* libraryName, JNIEnv* lJNIEnv, jobject& ObjectActiv // Get the library absolute path and convert it jmethodID MethodGetPath = lJNIEnv->GetMethodID(ClassFile, "getPath", "()Ljava/lang/String;"); jstring javaLibraryPath = static_cast(lJNIEnv->CallObjectMethod(ObjectFile, MethodGetPath)); - const char* libraryPath = lJNIEnv->GetStringUTFChars(javaLibraryPath, NULL); + const char* libraryPath = lJNIEnv->GetStringUTFChars(javaLibraryPath, nullptr); // Manually load the library void * handle = dlopen(libraryPath, RTLD_NOW | RTLD_GLOBAL); diff --git a/src/SFML/Network/IpAddress.cpp b/src/SFML/Network/IpAddress.cpp index 91eec78e..923e5c53 100644 --- a/src/SFML/Network/IpAddress.cpp +++ b/src/SFML/Network/IpAddress.cpp @@ -193,8 +193,8 @@ void IpAddress::resolve(const std::string& address) addrinfo hints; std::memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; - addrinfo* result = NULL; - if (getaddrinfo(address.c_str(), NULL, &hints, &result) == 0) + addrinfo* result = nullptr; + if (getaddrinfo(address.c_str(), nullptr, &hints, &result) == 0) { if (result) { diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index 7dff0a8b..3349ed57 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -75,7 +75,7 @@ void Packet::clear() //////////////////////////////////////////////////////////// const void* Packet::getData() const { - return !m_data.empty() ? m_data.data() : NULL; + return !m_data.empty() ? m_data.data() : nullptr; } @@ -96,7 +96,7 @@ bool Packet::endOfPacket() const //////////////////////////////////////////////////////////// Packet::operator BoolType() const { - return m_isValid ? &Packet::checkSize : NULL; + return m_isValid ? &Packet::checkSize : nullptr; } diff --git a/src/SFML/Network/SocketSelector.cpp b/src/SFML/Network/SocketSelector.cpp index 9159391a..ad2ae373 100644 --- a/src/SFML/Network/SocketSelector.cpp +++ b/src/SFML/Network/SocketSelector.cpp @@ -162,7 +162,7 @@ bool SocketSelector::wait(Time timeout) // Wait until one of the sockets is ready for reading, or timeout is reached // The first parameter is ignored on Windows - int count = select(m_impl->maxSocket + 1, &m_impl->socketsReady, NULL, NULL, timeout != Time::Zero ? &time : NULL); + int count = select(m_impl->maxSocket + 1, &m_impl->socketsReady, nullptr, nullptr, timeout != Time::Zero ? &time : nullptr); return count > 0; } diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 73394011..944ca79b 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -175,7 +175,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short time.tv_usec = static_cast(timeout.asMicroseconds() % 1000000); // Wait for something to write on our socket (which means that the connection request has returned) - if (select(static_cast(getHandle() + 1), NULL, &selector, NULL, &time) > 0) + if (select(static_cast(getHandle() + 1), nullptr, &selector, nullptr, &time) > 0) { // At this point the connection may have been either accepted or refused. // To know whether it's a success or a failure, we must check the address of the connected peer diff --git a/src/SFML/System/Android/Activity.cpp b/src/SFML/System/Android/Activity.cpp index 4f657ee0..7067ccae 100644 --- a/src/SFML/System/Android/Activity.cpp +++ b/src/SFML/System/Android/Activity.cpp @@ -58,7 +58,7 @@ namespace priv { ActivityStates* getActivity(ActivityStates* initializedStates, bool reset) { - static ActivityStates* states = NULL; + static ActivityStates* states = nullptr; if (!states || reset) states = initializedStates; diff --git a/src/SFML/System/Android/Activity.hpp b/src/SFML/System/Android/Activity.hpp index 772ab70e..94df7afd 100644 --- a/src/SFML/System/Android/Activity.hpp +++ b/src/SFML/System/Android/Activity.hpp @@ -92,7 +92,7 @@ struct ActivityStates LogcatStream logcat; }; -SFML_SYSTEM_API ActivityStates* getActivity(ActivityStates* initializedStates=NULL, bool reset=false); +SFML_SYSTEM_API ActivityStates* getActivity(ActivityStates* initializedStates=nullptr, bool reset=false); } // namespace priv } // namespace sf diff --git a/src/SFML/System/Android/ResourceStream.cpp b/src/SFML/System/Android/ResourceStream.cpp index b6f2b390..d4c40ea7 100644 --- a/src/SFML/System/Android/ResourceStream.cpp +++ b/src/SFML/System/Android/ResourceStream.cpp @@ -38,9 +38,9 @@ namespace priv //////////////////////////////////////////////////////////// ResourceStream::ResourceStream(const std::string& filename) : -m_file (NULL) +m_file (nullptr) { - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); m_file = AAssetManager_open(states->activity->assetManager, filename.c_str(), AASSET_MODE_UNKNOWN); } diff --git a/src/SFML/System/FileInputStream.cpp b/src/SFML/System/FileInputStream.cpp index 924b6c43..63199353 100644 --- a/src/SFML/System/FileInputStream.cpp +++ b/src/SFML/System/FileInputStream.cpp @@ -35,7 +35,7 @@ namespace sf { //////////////////////////////////////////////////////////// FileInputStream::FileInputStream() -: m_file(NULL) +: m_file(nullptr) { } @@ -63,7 +63,7 @@ bool FileInputStream::open(const std::string& filename) m_file = std::fopen(filename.c_str(), "rb"); - return m_file != NULL; + return m_file != nullptr; #endif } diff --git a/src/SFML/System/MemoryInputStream.cpp b/src/SFML/System/MemoryInputStream.cpp index e3129279..a0ac46cf 100644 --- a/src/SFML/System/MemoryInputStream.cpp +++ b/src/SFML/System/MemoryInputStream.cpp @@ -33,7 +33,7 @@ namespace sf { //////////////////////////////////////////////////////////// MemoryInputStream::MemoryInputStream() : -m_data (NULL), +m_data (nullptr), m_size (0), m_offset(0) { diff --git a/src/SFML/Window/Android/InputImpl.cpp b/src/SFML/Window/Android/InputImpl.cpp index 3108f78c..1ab1e1f0 100644 --- a/src/SFML/Window/Android/InputImpl.cpp +++ b/src/SFML/Window/Android/InputImpl.cpp @@ -48,7 +48,7 @@ void InputImpl::setVirtualKeyboardVisible(bool visible) { // todo: Check if the window is active - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); // Initializes JNI @@ -61,7 +61,7 @@ void InputImpl::setVirtualKeyboardVisible(bool visible) JavaVMAttachArgs lJavaVMAttachArgs; lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.name = "NativeThread"; - lJavaVMAttachArgs.group = NULL; + lJavaVMAttachArgs.group = nullptr; lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs); @@ -136,9 +136,9 @@ void InputImpl::setVirtualKeyboardVisible(bool visible) //////////////////////////////////////////////////////////// bool InputImpl::isMouseButtonPressed(Mouse::Button button) { - ALooper_pollAll(0, NULL, NULL, NULL); + ALooper_pollAll(0, nullptr, nullptr, nullptr); - priv::ActivityStates* states = priv::getActivity(NULL); + priv::ActivityStates* states = priv::getActivity(nullptr); std::lock_guard lock(states->mutex); return states->isButtonPressed[button]; @@ -148,9 +148,9 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button) //////////////////////////////////////////////////////////// Vector2i InputImpl::getMousePosition() { - ALooper_pollAll(0, NULL, NULL, NULL); + ALooper_pollAll(0, nullptr, nullptr, nullptr); - priv::ActivityStates* states = priv::getActivity(NULL); + priv::ActivityStates* states = priv::getActivity(nullptr); std::lock_guard lock(states->mutex); return states->mousePosition; @@ -181,9 +181,9 @@ void InputImpl::setMousePosition(const Vector2i& position, const Window& relativ //////////////////////////////////////////////////////////// bool InputImpl::isTouchDown(unsigned int finger) { - ALooper_pollAll(0, NULL, NULL, NULL); + ALooper_pollAll(0, nullptr, nullptr, nullptr); - priv::ActivityStates* states = priv::getActivity(NULL); + priv::ActivityStates* states = priv::getActivity(nullptr); std::lock_guard lock(states->mutex); return states->touchEvents.find(finger) != states->touchEvents.end(); @@ -193,9 +193,9 @@ bool InputImpl::isTouchDown(unsigned int finger) //////////////////////////////////////////////////////////// Vector2i InputImpl::getTouchPosition(unsigned int finger) { - ALooper_pollAll(0, NULL, NULL, NULL); + ALooper_pollAll(0, nullptr, nullptr, nullptr); - priv::ActivityStates* states = priv::getActivity(NULL); + priv::ActivityStates* states = priv::getActivity(nullptr); std::lock_guard lock(states->mutex); return states->touchEvents.find(finger)->second; diff --git a/src/SFML/Window/Android/SensorImpl.cpp b/src/SFML/Window/Android/SensorImpl.cpp index 201c3ebf..902a410f 100644 --- a/src/SFML/Window/Android/SensorImpl.cpp +++ b/src/SFML/Window/Android/SensorImpl.cpp @@ -58,7 +58,7 @@ void SensorImpl::initialize() // Create the sensor events queue and attach it to the looper sensorEventQueue = ASensorManager_createEventQueue(sensorManager, looper, - 1, &processSensorEvents, NULL); + 1, &processSensorEvents, nullptr); } @@ -113,7 +113,7 @@ void SensorImpl::close() Vector3f SensorImpl::update() { // Update our sensor data list - ALooper_pollAll(0, NULL, NULL, NULL); + ALooper_pollAll(0, nullptr, nullptr, nullptr); return sensorData[m_index]; } diff --git a/src/SFML/Window/Android/SensorImpl.hpp b/src/SFML/Window/Android/SensorImpl.hpp index 5cae66b4..a35c56b6 100644 --- a/src/SFML/Window/Android/SensorImpl.hpp +++ b/src/SFML/Window/Android/SensorImpl.hpp @@ -105,7 +105,7 @@ private: /// /// \param type Type of the sensor /// - /// \return The default Android sensor, NULL otherwise + /// \return The default Android sensor, nullptr otherwise /// //////////////////////////////////////////////////////////// static ASensor const* getDefaultSensor(Sensor::Type sensor); diff --git a/src/SFML/Window/Android/VideoModeImpl.cpp b/src/SFML/Window/Android/VideoModeImpl.cpp index 4d11ad61..ce39de5f 100644 --- a/src/SFML/Window/Android/VideoModeImpl.cpp +++ b/src/SFML/Window/Android/VideoModeImpl.cpp @@ -52,7 +52,7 @@ std::vector VideoModeImpl::getFullscreenModes() VideoMode VideoModeImpl::getDesktopMode() { // Get the activity states - priv::ActivityStates* states = priv::getActivity(NULL); + priv::ActivityStates* states = priv::getActivity(nullptr); std::lock_guard lock(states->mutex); return VideoMode(states->screenSize.x, states->screenSize.y); diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 6f226890..5c0f4305 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -46,7 +46,7 @@ namespace sf { namespace priv { -WindowImplAndroid* WindowImplAndroid::singleInstance = NULL; +WindowImplAndroid* WindowImplAndroid::singleInstance = nullptr; //////////////////////////////////////////////////////////// WindowImplAndroid::WindowImplAndroid(WindowHandle handle) @@ -65,7 +65,7 @@ WindowImplAndroid::WindowImplAndroid(VideoMode mode, const String& title, unsign , m_windowBeingDestroyed(false) , m_hasFocus(false) { - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); if (style& Style::Fullscreen) @@ -90,7 +90,7 @@ WindowImplAndroid::~WindowImplAndroid() //////////////////////////////////////////////////////////// WindowHandle WindowImplAndroid::getSystemHandle() const { - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); return states->window; @@ -101,9 +101,9 @@ WindowHandle WindowImplAndroid::getSystemHandle() const void WindowImplAndroid::processEvents() { // Process incoming OS events - ALooper_pollAll(0, NULL, NULL, NULL); + ALooper_pollAll(0, nullptr, nullptr, nullptr); - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); if (m_windowBeingCreated) @@ -209,7 +209,7 @@ bool WindowImplAndroid::hasFocus() const //////////////////////////////////////////////////////////// void WindowImplAndroid::forwardEvent(const Event& event) { - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); if (event.type == Event::GainedFocus) { @@ -231,10 +231,10 @@ void WindowImplAndroid::forwardEvent(const Event& event) //////////////////////////////////////////////////////////// int WindowImplAndroid::processEvent(int fd, int events, void* data) { - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); - AInputEvent* _event = NULL; + AInputEvent* _event = nullptr; if (AInputQueue_getEvent(states->inputQueue, &_event) >= 0) { @@ -315,7 +315,7 @@ int WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* s JavaVMAttachArgs lJavaVMAttachArgs; lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.name = "NativeThread"; - lJavaVMAttachArgs.group = NULL; + lJavaVMAttachArgs.group = nullptr; lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs); @@ -665,7 +665,7 @@ Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key) int WindowImplAndroid::getUnicode(AInputEvent* event) { // Retrieve activity states - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); // Initializes JNI @@ -678,7 +678,7 @@ int WindowImplAndroid::getUnicode(AInputEvent* event) JavaVMAttachArgs lJavaVMAttachArgs; lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.name = "NativeThread"; - lJavaVMAttachArgs.group = NULL; + lJavaVMAttachArgs.group = nullptr; lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs); diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp index b59e4deb..2d40438d 100644 --- a/src/SFML/Window/Context.cpp +++ b/src/SFML/Window/Context.cpp @@ -58,7 +58,7 @@ bool Context::setActive(bool active) bool result = m_context->setActive(active); if (result) - currentContext = (active ? this : NULL); + currentContext = (active ? this : nullptr); return result; } diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index d1893886..65f408b4 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -50,7 +50,7 @@ namespace if (display == EGL_NO_DISPLAY) { display = eglCheck(eglGetDisplay(EGL_DEFAULT_DISPLAY)); - eglCheck(eglInitialize(display, NULL, NULL)); + eglCheck(eglInitialize(display, nullptr, nullptr)); } return display; @@ -58,7 +58,7 @@ namespace #elif defined(SFML_SYSTEM_ANDROID) // On Android, its native activity handles this for us - sf::priv::ActivityStates* states = sf::priv::getActivity(NULL); + sf::priv::ActivityStates* states = sf::priv::getActivity(nullptr); std::lock_guard lock(states->mutex); return states->display; @@ -77,7 +77,7 @@ EglContext::EglContext(EglContext* shared) : m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), -m_config (NULL) +m_config (nullptr) { // Get the initialized EGL display m_display = getInitializedDisplay(); @@ -86,7 +86,7 @@ m_config (NULL) m_config = getBestConfig(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings()); updateSettings(); - // Note: The EGL specs say that attrib_list can be NULL when passed to eglCreatePbufferSurface, + // Note: The EGL specs say that attrib_list can be nullptr when passed to eglCreatePbufferSurface, // but this is resulting in a segfault. Bug in Android? EGLint attrib_list[] = { EGL_WIDTH, 1, @@ -106,12 +106,12 @@ EglContext::EglContext(EglContext* shared, const ContextSettings& settings, cons m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), -m_config (NULL) +m_config (nullptr) { #ifdef SFML_SYSTEM_ANDROID // On Android, we must save the created context - ActivityStates* states = getActivity(NULL); + ActivityStates* states = getActivity(nullptr); std::lock_guard lock(states->mutex); states->context = this; @@ -141,7 +141,7 @@ EglContext::EglContext(EglContext* shared, const ContextSettings& settings, unsi m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), -m_config (NULL) +m_config (nullptr) { } @@ -222,7 +222,7 @@ void EglContext::createContext(EglContext* shared) //////////////////////////////////////////////////////////// void EglContext::createSurface(EGLNativeWindowType window) { - m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, window, NULL)); + m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, window, nullptr)); } diff --git a/src/SFML/Window/EglContext.hpp b/src/SFML/Window/EglContext.hpp index f38e018a..b6796d91 100644 --- a/src/SFML/Window/EglContext.hpp +++ b/src/SFML/Window/EglContext.hpp @@ -46,7 +46,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create a new context, not associated to a window /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// EglContext(EglContext* shared); @@ -112,7 +112,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create the context /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// \param bitsPerPixel Pixel depth, in bits per pixel /// \param settings Creation parameters /// diff --git a/src/SFML/Window/FreeBSD/JoystickImpl.cpp b/src/SFML/Window/FreeBSD/JoystickImpl.cpp index 8758b904..dd8c659d 100644 --- a/src/SFML/Window/FreeBSD/JoystickImpl.cpp +++ b/src/SFML/Window/FreeBSD/JoystickImpl.cpp @@ -163,7 +163,7 @@ namespace priv //////////////////////////////////////////////////////////// void JoystickImpl::initialize() { - hid_init(NULL); + hid_init(nullptr); // Do an initial scan updatePluggedList(); diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp index e4695be1..514ad865 100644 --- a/src/SFML/Window/GlContext.cpp +++ b/src/SFML/Window/GlContext.cpp @@ -246,7 +246,7 @@ void GlContext::initResource() else { // Try to load the >= 3.0 way - glGetStringiFuncType glGetStringiFunc = NULL; + glGetStringiFuncType glGetStringiFunc = nullptr; glGetStringiFunc = reinterpret_cast(getFunction("glGetStringi")); if (glGetStringiFunc) @@ -332,7 +332,7 @@ void GlContext::releaseTransientContext() std::unique_ptr GlContext::create() { // Make sure that there's an active context (context creation may need extensions, and thus a valid context) - assert(sharedContext != NULL); + assert(sharedContext != nullptr); std::lock_guard lock(mutex); @@ -360,7 +360,7 @@ std::unique_ptr GlContext::create() std::unique_ptr GlContext::create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) { // Make sure that there's an active context (context creation may need extensions, and thus a valid context) - assert(sharedContext != NULL); + assert(sharedContext != nullptr); std::lock_guard lock(mutex); @@ -389,7 +389,7 @@ std::unique_ptr GlContext::create(const ContextSettings& settings, co std::unique_ptr GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height) { // Make sure that there's an active context (context creation may need extensions, and thus a valid context) - assert(sharedContext != NULL); + assert(sharedContext != nullptr); std::lock_guard lock(mutex); @@ -445,7 +445,7 @@ GlContext::~GlContext() if (sharedContext) { if (this == currentContext) - currentContext = NULL; + currentContext = nullptr; } } @@ -493,7 +493,7 @@ bool GlContext::setActive(bool active) // Deactivate the context if (makeCurrent(false)) { - currentContext = NULL; + currentContext = nullptr; return true; } else diff --git a/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm index 9f832c7d..51fd49c6 100644 --- a/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm +++ b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm @@ -85,7 +85,7 @@ static void createNewPool(void) void ensureThreadHasPool(void) { pthread_once(&initOnceToken, createPoolKey); - if (pthread_getspecific(poolKey) == NULL) + if (pthread_getspecific(poolKey) == nullptr) { createNewPool(); } @@ -96,7 +96,7 @@ void ensureThreadHasPool(void) void drainThreadPool(void) { void* data = pthread_getspecific(poolKey); - assert(data != NULL); + assert(data != nullptr); // Drain the pool but keep it alive by creating a new one destroyPool(data); diff --git a/src/SFML/Window/OSX/HIDInputManager.hpp b/src/SFML/Window/OSX/HIDInputManager.hpp index 819039a7..1b80ad2b 100644 --- a/src/SFML/Window/OSX/HIDInputManager.hpp +++ b/src/SFML/Window/OSX/HIDInputManager.hpp @@ -178,7 +178,7 @@ private: /// /// \param page HID page like kHIDPage_GenericDesktop /// \param usage HID usage page like kHIDUsage_GD_Keyboard or kHIDUsage_GD_Mouse - /// \return a retained CFSetRef of IOHIDDeviceRef or NULL + /// \return a retained CFSetRef of IOHIDDeviceRef or nullptr /// //////////////////////////////////////////////////////////// CFSetRef copyDevices(UInt32 page, UInt32 usage); diff --git a/src/SFML/Window/OSX/HIDInputManager.mm b/src/SFML/Window/OSX/HIDInputManager.mm index c74200ce..d4bf5101 100644 --- a/src/SFML/Window/OSX/HIDInputManager.mm +++ b/src/SFML/Window/OSX/HIDInputManager.mm @@ -150,7 +150,7 @@ void HIDInputManager::initializeKeyboard() // Get only keyboards CFSetRef keyboards = copyDevices(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard); - if (keyboards == NULL) + if (keyboards == nullptr) { freeUp(); return; @@ -180,9 +180,9 @@ void HIDInputManager::initializeKeyboard() void HIDInputManager::loadKeyboard(IOHIDDeviceRef keyboard) { CFArrayRef keys = IOHIDDeviceCopyMatchingElements(keyboard, - NULL, + nullptr, kIOHIDOptionsTypeNone); - if (keys == NULL) + if (keys == nullptr) { sf::err() << "We got a keyboard without any keys (1)" << std::endl; return; @@ -339,15 +339,15 @@ CFSetRef HIDInputManager::copyDevices(UInt32 page, UInt32 usage) mask = 0; CFSetRef devices = IOHIDManagerCopyDevices(m_manager); - if (devices == NULL) - return NULL; + if (devices == nullptr) + return nullptr; // Is there at least one device? CFIndex deviceCount = CFSetGetCount(devices); if (deviceCount < 1) { CFRelease(devices); - return NULL; + return nullptr; } return devices; diff --git a/src/SFML/Window/OSX/HIDJoystickManager.cpp b/src/SFML/Window/OSX/HIDJoystickManager.cpp index 64416809..4660d3ec 100644 --- a/src/SFML/Window/OSX/HIDJoystickManager.cpp +++ b/src/SFML/Window/OSX/HIDJoystickManager.cpp @@ -85,7 +85,7 @@ m_joystickCount(0) maskArray[0] = mask0; maskArray[1] = mask1; - CFArrayRef mask = CFArrayCreate(NULL, (const void**)maskArray, 2, NULL); + CFArrayRef mask = CFArrayCreate(nullptr, (const void**)maskArray, 2, nullptr); IOHIDManagerSetDeviceMatchingMultiple(m_manager, mask); CFRelease(mask); @@ -111,8 +111,8 @@ HIDJoystickManager::~HIDJoystickManager() CFRunLoopGetCurrent(), RunLoopMode); - IOHIDManagerRegisterDeviceMatchingCallback(m_manager, NULL, 0); - IOHIDManagerRegisterDeviceRemovalCallback(m_manager, NULL, 0); + IOHIDManagerRegisterDeviceMatchingCallback(m_manager, nullptr, 0); + IOHIDManagerRegisterDeviceRemovalCallback(m_manager, nullptr, 0); IOHIDManagerClose(m_manager, kIOHIDOptionsTypeNone); } diff --git a/src/SFML/Window/OSX/HIDJoystickManager.hpp b/src/SFML/Window/OSX/HIDJoystickManager.hpp index 6052d38d..5df27701 100644 --- a/src/SFML/Window/OSX/HIDJoystickManager.hpp +++ b/src/SFML/Window/OSX/HIDJoystickManager.hpp @@ -69,7 +69,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Copy the devices associated with this HID manager /// - /// \return a retained CFSetRef of IOHIDDeviceRef or NULL + /// \return a retained CFSetRef of IOHIDDeviceRef or nullptr /// //////////////////////////////////////////////////////////// CFSetRef copyJoysticks(); diff --git a/src/SFML/Window/OSX/InputImpl.mm b/src/SFML/Window/OSX/InputImpl.mm index cf41b032..24f2aaf2 100644 --- a/src/SFML/Window/OSX/InputImpl.mm +++ b/src/SFML/Window/OSX/InputImpl.mm @@ -182,7 +182,7 @@ void InputImpl::setMousePosition(const Vector2i& position) CGPoint pos = CGPointMake(position.x / scale, position.y / scale); // Place the cursor. - CGEventRef event = CGEventCreateMouseEvent(NULL, + CGEventRef event = CGEventCreateMouseEvent(nullptr, kCGEventMouseMoved, pos, /* we don't care about this: */ kCGMouseButtonLeft); diff --git a/src/SFML/Window/OSX/JoystickImpl.cpp b/src/SFML/Window/OSX/JoystickImpl.cpp index 117caa6f..5740cd7a 100644 --- a/src/SFML/Window/OSX/JoystickImpl.cpp +++ b/src/SFML/Window/OSX/JoystickImpl.cpp @@ -136,7 +136,7 @@ bool JoystickImpl::isConnected(unsigned int index) // Get all devices CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks(); - if (devices != NULL) + if (devices != nullptr) { CFIndex size = CFSetGetCount(devices); if (size > 0) @@ -189,7 +189,7 @@ bool JoystickImpl::open(unsigned int index) // Get all devices CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks(); - if (devices == NULL) + if (devices == nullptr) return false; // Get a usable copy of the joysticks devices. @@ -221,9 +221,9 @@ bool JoystickImpl::open(unsigned int index) m_identification.productId = getDeviceUint(self, CFSTR(kIOHIDProductIDKey), m_index); // Get a list of all elements attached to the device. - CFArrayRef elements = IOHIDDeviceCopyMatchingElements(self, NULL, kIOHIDOptionsTypeNone); + CFArrayRef elements = IOHIDDeviceCopyMatchingElements(self, nullptr, kIOHIDOptionsTypeNone); - if (elements == NULL) + if (elements == nullptr) { CFRelease(devices); return false; @@ -350,7 +350,7 @@ JoystickState JoystickImpl::update() // Get all devices CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks(); - if (devices == NULL) + if (devices == nullptr) return disconnectedState; // Get a usable copy of the joysticks devices. diff --git a/src/SFML/Window/OSX/SFContext.hpp b/src/SFML/Window/OSX/SFContext.hpp index 2a1e70d4..10787b2e 100644 --- a/src/SFML/Window/OSX/SFContext.hpp +++ b/src/SFML/Window/OSX/SFContext.hpp @@ -68,7 +68,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create a new context, not associated to a window /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// SFContext(SFContext* shared); @@ -149,7 +149,7 @@ private: /// \brief Create the context /// \note Must only be called from Ctor. /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// \param bitsPerPixel bpp /// \param settings Creation parameters /// diff --git a/src/SFML/Window/OSX/SFContext.mm b/src/SFML/Window/OSX/SFContext.mm index 88d17551..c5f541ce 100644 --- a/src/SFML/Window/OSX/SFContext.mm +++ b/src/SFML/Window/OSX/SFContext.mm @@ -118,7 +118,7 @@ SFContext::~SFContext() //////////////////////////////////////////////////////////// GlFunctionPointer SFContext::getFunction(const char* name) { - static void* image = NULL; + static void* image = nullptr; if (!image) image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); @@ -267,7 +267,7 @@ void SFContext::createContext(SFContext* shared, } // Use the shared context if one is given. - NSOpenGLContext* sharedContext = shared != NULL ? shared->m_context : nil; + NSOpenGLContext* sharedContext = shared != nullptr ? shared->m_context : nil; if (sharedContext != nil) { diff --git a/src/SFML/Window/OSX/VideoModeImpl.cpp b/src/SFML/Window/OSX/VideoModeImpl.cpp index ae5fdfb9..5de6f372 100644 --- a/src/SFML/Window/OSX/VideoModeImpl.cpp +++ b/src/SFML/Window/OSX/VideoModeImpl.cpp @@ -42,9 +42,9 @@ std::vector VideoModeImpl::getFullscreenModes() std::vector modes; // Retrieve all modes available for main screen only. - CFArrayRef cgmodes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL); + CFArrayRef cgmodes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), nullptr); - if (cgmodes == NULL) + if (cgmodes == nullptr) { sf::err() << "Couldn't get VideoMode for main display." << std::endl; return modes; diff --git a/src/SFML/Window/Unix/Display.cpp b/src/SFML/Window/Unix/Display.cpp index 5d6a3142..97b59292 100644 --- a/src/SFML/Window/Unix/Display.cpp +++ b/src/SFML/Window/Unix/Display.cpp @@ -37,7 +37,7 @@ namespace { // The shared display and its reference counter - Display* sharedDisplay = NULL; + Display* sharedDisplay = nullptr; unsigned int referenceCount = 0; std::mutex mutex; @@ -56,7 +56,7 @@ Display* OpenDisplay() if (referenceCount == 0) { - sharedDisplay = XOpenDisplay(NULL); + sharedDisplay = XOpenDisplay(nullptr); // Opening display failed: The best we can do at the moment is to output a meaningful error message // and cause an abnormal program termination diff --git a/src/SFML/Window/Unix/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp index a557ba1f..2655142f 100644 --- a/src/SFML/Window/Unix/GlxContext.cpp +++ b/src/SFML/Window/Unix/GlxContext.cpp @@ -95,9 +95,9 @@ void ensureExtensionsInit(::Display* display, int screen) //////////////////////////////////////////////////////////// GlxContext::GlxContext(GlxContext* shared) : -m_display (NULL), +m_display (nullptr), m_window (0), -m_context (NULL), +m_context (nullptr), m_pbuffer (0), m_ownsWindow(false) { @@ -120,9 +120,9 @@ m_ownsWindow(false) //////////////////////////////////////////////////////////// GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) : -m_display (NULL), +m_display (nullptr), m_window (0), -m_context (NULL), +m_context (nullptr), m_pbuffer (0), m_ownsWindow(false) { @@ -145,9 +145,9 @@ m_ownsWindow(false) //////////////////////////////////////////////////////////// GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) : -m_display (NULL), +m_display (nullptr), m_window (0), -m_context (NULL), +m_context (nullptr), m_pbuffer (0), m_ownsWindow(false) { @@ -179,7 +179,7 @@ GlxContext::~GlxContext() #endif if (glXGetCurrentContext() == m_context) - glXMakeCurrent(m_display, None, NULL); + glXMakeCurrent(m_display, None, nullptr); glXDestroyContext(m_display, m_context); #if defined(GLX_DEBUGGING) @@ -237,7 +237,7 @@ bool GlxContext::makeCurrent(bool current) } else { - result = glXMakeCurrent(m_display, None, NULL); + result = glXMakeCurrent(m_display, None, nullptr); } #if defined(GLX_DEBUGGING) @@ -314,7 +314,7 @@ XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPe // Retrieve all the visuals int count; - XVisualInfo* visuals = XGetVisualInfo(display, 0, NULL, &count); + XVisualInfo* visuals = XGetVisualInfo(display, 0, nullptr, &count); if (visuals) { // Evaluate all the returned visuals, and pick the best one @@ -470,13 +470,13 @@ void GlxContext::createSurface(GlxContext* shared, unsigned int width, unsigned if (hasCreatePbuffer) { // Get a GLXFBConfig that matches the visual - GLXFBConfig* config = NULL; + GLXFBConfig* config = nullptr; // We don't supply attributes to match against, since // the visual we are matching against was already // deemed suitable in selectBestVisual() int nbConfigs = 0; - GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), NULL, &nbConfigs); + GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), nullptr, &nbConfigs); for (int i = 0; configs && (i < nbConfigs); ++i) { @@ -558,7 +558,7 @@ void GlxContext::createContext(GlxContext* shared) // Get a working copy of the context settings ContextSettings settings = m_settings; - XVisualInfo* visualInfo = NULL; + XVisualInfo* visualInfo = nullptr; if (m_pbuffer) { @@ -606,7 +606,7 @@ void GlxContext::createContext(GlxContext* shared) } // Get the context to share display lists with - GLXContext toShare = shared ? shared->m_context : NULL; + GLXContext toShare = shared ? shared->m_context : nullptr; // There are no GLX versions prior to 1.0 int major = 0; @@ -622,13 +622,13 @@ void GlxContext::createContext(GlxContext* shared) if (hasCreateContextArb) { // Get a GLXFBConfig that matches the window's visual, for glXCreateContextAttribsARB - GLXFBConfig* config = NULL; + GLXFBConfig* config = nullptr; // We don't supply attributes to match against, since // the visual we are matching against was already // deemed suitable in selectBestVisual() int nbConfigs = 0; - GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), NULL, &nbConfigs); + GLXFBConfig* configs = glXChooseFBConfig(m_display, DefaultScreen(m_display), nullptr, &nbConfigs); for (int i = 0; configs && (i < nbConfigs); ++i) { @@ -693,7 +693,7 @@ void GlxContext::createContext(GlxContext* shared) if (toShare) { - if (!glXMakeCurrent(m_display, None, NULL)) + if (!glXMakeCurrent(m_display, None, nullptr)) { err() << "Failed to deactivate shared context before sharing" << std::endl; return; @@ -748,7 +748,7 @@ void GlxContext::createContext(GlxContext* shared) if (toShare) { - if (!glXMakeCurrent(m_display, None, NULL)) + if (!glXMakeCurrent(m_display, None, nullptr)) { err() << "Failed to deactivate shared context before sharing" << std::endl; return; diff --git a/src/SFML/Window/Unix/GlxContext.hpp b/src/SFML/Window/Unix/GlxContext.hpp index 304b0049..c0c41adb 100644 --- a/src/SFML/Window/Unix/GlxContext.hpp +++ b/src/SFML/Window/Unix/GlxContext.hpp @@ -48,7 +48,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create a new default context /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// GlxContext(GlxContext* shared); @@ -151,7 +151,7 @@ private: //////////////////////////////////////////////////////////// /// \brief Create the context's drawing surface /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// \param width Back buffer width, in pixels /// \param height Back buffer height, in pixels /// \param bitsPerPixel Pixel depth, in bits per pixel @@ -170,7 +170,7 @@ private: //////////////////////////////////////////////////////////// /// \brief Create the context /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// void createContext(GlxContext* shared); diff --git a/src/SFML/Window/Unix/GlxExtensions.cpp b/src/SFML/Window/Unix/GlxExtensions.cpp index 4d9d9781..e667b696 100644 --- a/src/SFML/Window/Unix/GlxExtensions.cpp +++ b/src/SFML/Window/Unix/GlxExtensions.cpp @@ -47,7 +47,7 @@ int sfglx_ext_SGIX_pbuffer = sfglx_LOAD_FAILED; int sfglx_ext_ARB_create_context = sfglx_LOAD_FAILED; int sfglx_ext_ARB_create_context_profile = sfglx_LOAD_FAILED; -void (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalEXT)(Display*, GLXDrawable, int) = NULL; +void (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalEXT)(Display*, GLXDrawable, int) = nullptr; static int Load_EXT_swap_control(void) { @@ -58,7 +58,7 @@ static int Load_EXT_swap_control(void) return numFailed; } -int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalMESA)(int) = NULL; +int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalMESA)(int) = nullptr; static int Load_MESA_swap_control(void) { @@ -69,7 +69,7 @@ static int Load_MESA_swap_control(void) return numFailed; } -int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalSGI)(int) = NULL; +int (CODEGEN_FUNCPTR *sf_ptrc_glXSwapIntervalSGI)(int) = nullptr; static int Load_SGI_swap_control(void) { @@ -80,11 +80,11 @@ static int Load_SGI_swap_control(void) return numFailed; } -GLXPbufferSGIX (CODEGEN_FUNCPTR *sf_ptrc_glXCreateGLXPbufferSGIX)(Display*, GLXFBConfigSGIX, unsigned int, unsigned int, int*) = NULL; -void (CODEGEN_FUNCPTR *sf_ptrc_glXDestroyGLXPbufferSGIX)(Display*, GLXPbufferSGIX) = NULL; -void (CODEGEN_FUNCPTR *sf_ptrc_glXGetSelectedEventSGIX)(Display*, GLXDrawable, unsigned long*) = NULL; -int (CODEGEN_FUNCPTR *sf_ptrc_glXQueryGLXPbufferSGIX)(Display*, GLXPbufferSGIX, int, unsigned int*) = NULL; -void (CODEGEN_FUNCPTR *sf_ptrc_glXSelectEventSGIX)(Display*, GLXDrawable, unsigned long) = NULL; +GLXPbufferSGIX (CODEGEN_FUNCPTR *sf_ptrc_glXCreateGLXPbufferSGIX)(Display*, GLXFBConfigSGIX, unsigned int, unsigned int, int*) = nullptr; +void (CODEGEN_FUNCPTR *sf_ptrc_glXDestroyGLXPbufferSGIX)(Display*, GLXPbufferSGIX) = nullptr; +void (CODEGEN_FUNCPTR *sf_ptrc_glXGetSelectedEventSGIX)(Display*, GLXDrawable, unsigned long*) = nullptr; +int (CODEGEN_FUNCPTR *sf_ptrc_glXQueryGLXPbufferSGIX)(Display*, GLXPbufferSGIX, int, unsigned int*) = nullptr; +void (CODEGEN_FUNCPTR *sf_ptrc_glXSelectEventSGIX)(Display*, GLXDrawable, unsigned long) = nullptr; static int Load_SGIX_pbuffer(void) { @@ -107,7 +107,7 @@ static int Load_SGIX_pbuffer(void) return numFailed; } -GLXContext (CODEGEN_FUNCPTR *sf_ptrc_glXCreateContextAttribsARB)(Display*, GLXFBConfig, GLXContext, Bool, const int*) = NULL; +GLXContext (CODEGEN_FUNCPTR *sf_ptrc_glXCreateContextAttribsARB)(Display*, GLXFBConfig, GLXContext, Bool, const int*) = nullptr; static int Load_ARB_create_context(void) { @@ -130,12 +130,12 @@ static sfglx_StrToExtMap ExtensionMap[9] = { {"GLX_EXT_swap_control", &sfglx_ext_EXT_swap_control, Load_EXT_swap_control}, {"GLX_MESA_swap_control", &sfglx_ext_MESA_swap_control, Load_MESA_swap_control}, {"GLX_SGI_swap_control", &sfglx_ext_SGI_swap_control, Load_SGI_swap_control}, - {"GLX_EXT_framebuffer_sRGB", &sfglx_ext_EXT_framebuffer_sRGB, NULL}, - {"GLX_ARB_framebuffer_sRGB", &sfglx_ext_ARB_framebuffer_sRGB, NULL}, - {"GLX_ARB_multisample", &sfglx_ext_ARB_multisample, NULL}, + {"GLX_EXT_framebuffer_sRGB", &sfglx_ext_EXT_framebuffer_sRGB, nullptr}, + {"GLX_ARB_framebuffer_sRGB", &sfglx_ext_ARB_framebuffer_sRGB, nullptr}, + {"GLX_ARB_multisample", &sfglx_ext_ARB_multisample, nullptr}, {"GLX_SGIX_pbuffer", &sfglx_ext_SGIX_pbuffer, Load_SGIX_pbuffer}, {"GLX_ARB_create_context", &sfglx_ext_ARB_create_context, Load_ARB_create_context}, - {"GLX_ARB_create_context_profile", &sfglx_ext_ARB_create_context_profile, NULL} + {"GLX_ARB_create_context_profile", &sfglx_ext_ARB_create_context_profile, nullptr} }; static int g_extensionMapSize = 9; @@ -150,7 +150,7 @@ static sfglx_StrToExtMap* FindExtEntry(const char* extensionName) return currLoc; } - return NULL; + return nullptr; } @@ -170,7 +170,7 @@ static void ClearExtensionVars(void) static void LoadExtByName(const char* extensionName) { - sfglx_StrToExtMap* entry = NULL; + sfglx_StrToExtMap* entry = nullptr; entry = FindExtEntry(extensionName); if (entry) { diff --git a/src/SFML/Window/Unix/JoystickImpl.cpp b/src/SFML/Window/Unix/JoystickImpl.cpp index 2898c6ca..7ca0de03 100644 --- a/src/SFML/Window/Unix/JoystickImpl.cpp +++ b/src/SFML/Window/Unix/JoystickImpl.cpp @@ -112,7 +112,7 @@ namespace return true; } - void updatePluggedList(udev_device* udevDevice = NULL) + void updatePluggedList(udev_device* udevDevice = nullptr) { if (udevDevice) { @@ -258,7 +258,7 @@ namespace FD_SET(monitorFd, &descriptorSet); timeval timeout = {0, 0}; - return (select(monitorFd + 1, &descriptorSet, NULL, NULL, &timeout) > 0) && + return (select(monitorFd + 1, &descriptorSet, nullptr, nullptr, &timeout) > 0) && FD_ISSET(monitorFd, &descriptorSet); } @@ -274,7 +274,7 @@ namespace udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(udevDevice, "usb", "usb_device"); if (!udevDeviceParent) - return NULL; + return nullptr; return udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str()); } @@ -289,7 +289,7 @@ namespace unsigned int value = 0; if (attribute) - value = static_cast(std::strtoul(attribute, NULL, 16)); + value = static_cast(std::strtoul(attribute, nullptr, 16)); return value; } @@ -304,7 +304,7 @@ namespace unsigned int value = 0; if (attribute) - value = static_cast(std::strtoul(attribute, NULL, 16)); + value = static_cast(std::strtoul(attribute, nullptr, 16)); return value; } @@ -466,7 +466,7 @@ void JoystickImpl::initialize() } else { - int error = udev_monitor_filter_add_match_subsystem_devtype(udevMonitor, "input", NULL); + int error = udev_monitor_filter_add_match_subsystem_devtype(udevMonitor, "input", nullptr); if (error < 0) { @@ -528,7 +528,7 @@ bool JoystickImpl::isConnected(unsigned int index) udev_device* udevDevice = udev_monitor_receive_device(udevMonitor); // If we can get the specific device, we check that, - // otherwise just do a full scan if udevDevice == NULL + // otherwise just do a full scan if udevDevice == nullptr updatePluggedList(udevDevice); if (udevDevice) diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index af8ccbb5..7553aa41 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -61,7 +61,7 @@ //////////////////////////////////////////////////////////// namespace { - sf::priv::WindowImplX11* fullscreenWindow = NULL; + sf::priv::WindowImplX11* fullscreenWindow = nullptr; std::vector allWindows; std::mutex allWindowsMutex; sf::String windowManagerName; @@ -381,8 +381,8 @@ namespace priv WindowImplX11::WindowImplX11(WindowHandle handle) : m_window (0), m_screen (0), -m_inputMethod (NULL), -m_inputContext (NULL), +m_inputMethod (nullptr), +m_inputContext (nullptr), m_isExternal (true), m_oldVideoMode (0), m_hiddenCursor (0), @@ -428,8 +428,8 @@ m_lastInputTime (0) WindowImplX11::WindowImplX11(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings) : m_window (0), m_screen (0), -m_inputMethod (NULL), -m_inputContext (NULL), +m_inputMethod (nullptr), +m_inputContext (nullptr), m_isExternal (false), m_oldVideoMode (0), m_hiddenCursor (0), @@ -749,21 +749,21 @@ void WindowImplX11::setTitle(const String& title) m_window, title.toAnsiString().c_str(), title.toAnsiString().c_str(), - NULL, + nullptr, 0, - NULL, - NULL, - NULL); + nullptr, + nullptr, + nullptr); #else XmbSetWMProperties(m_display, m_window, title.toAnsiString().c_str(), title.toAnsiString().c_str(), - NULL, + nullptr, 0, - NULL, - NULL, - NULL); + nullptr, + nullptr, + nullptr); #endif } @@ -982,7 +982,7 @@ void WindowImplX11::requestFocus() // Otherwise: display urgency hint (flashing application logo) // Ensure WM hints exist, allocate if necessary XWMHints* hints = XGetWMHints(m_display, m_window); - if (hints == NULL) + if (hints == nullptr) hints = XAllocWMHints(); // Add urgency (notification) flag to hints @@ -1132,7 +1132,7 @@ void WindowImplX11::resetVideoMode() } // Reset the fullscreen window - fullscreenWindow = NULL; + fullscreenWindow = nullptr; } } @@ -1263,7 +1263,7 @@ void WindowImplX11::setProtocols() void WindowImplX11::initialize() { // Create the input context - m_inputMethod = XOpenIM(m_display, NULL, NULL, NULL); + m_inputMethod = XOpenIM(m_display, nullptr, nullptr, nullptr); if (m_inputMethod) { @@ -1274,11 +1274,11 @@ void WindowImplX11::initialize() m_window, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - NULL); + nullptr); } else { - m_inputContext = NULL; + m_inputContext = nullptr; } if (!m_inputContext) @@ -1346,7 +1346,7 @@ void WindowImplX11::createHiddenCursor() { // Create the cursor's pixmap (1x1 pixels) Pixmap cursorPixmap = XCreatePixmap(m_display, m_window, 1, 1, 1); - GC graphicsContext = XCreateGC(m_display, cursorPixmap, 0, NULL); + GC graphicsContext = XCreateGC(m_display, cursorPixmap, 0, nullptr); XDrawPoint(m_display, cursorPixmap, graphicsContext, 0, 0); XFreeGC(m_display, graphicsContext); @@ -1456,7 +1456,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent) // If the window has been previously marked urgent (notification) as a result of a focus request, undo that XWMHints* hints = XGetWMHints(m_display, m_window); - if (hints != NULL) + if (hints != nullptr) { // Remove urgency (notification) flag from hints hints->flags &= ~XUrgencyHint; @@ -1571,7 +1571,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent) &windowEvent.xkey, reinterpret_cast(keyBuffer), sizeof(keyBuffer), - NULL, + nullptr, &status ); @@ -1593,7 +1593,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent) { static XComposeStatus status; char keyBuffer[16]; - if (XLookupString(&windowEvent.xkey, keyBuffer, sizeof(keyBuffer), NULL, &status)) + if (XLookupString(&windowEvent.xkey, keyBuffer, sizeof(keyBuffer), nullptr, &status)) { Event textEvent; textEvent.type = Event::TextEntered; diff --git a/src/SFML/Window/Win32/JoystickImpl.cpp b/src/SFML/Window/Win32/JoystickImpl.cpp index c6defc6f..820e1cee 100644 --- a/src/SFML/Window/Win32/JoystickImpl.cpp +++ b/src/SFML/Window/Win32/JoystickImpl.cpp @@ -56,7 +56,7 @@ namespace { PTCHAR buffer; - if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, reinterpret_cast(&buffer), 0, NULL) == 0) + if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr, error, 0, reinterpret_cast(&buffer), 0, nullptr) == 0) return "Unknown error."; sf::String message = buffer; @@ -106,7 +106,7 @@ namespace TCHAR keyData[256]; DWORD keyDataSize = sizeof(keyData); - result = RegQueryValueEx(currentKey, subkey.c_str(), NULL, NULL, reinterpret_cast(keyData), &keyDataSize); + result = RegQueryValueEx(currentKey, subkey.c_str(), nullptr, nullptr, reinterpret_cast(keyData), &keyDataSize); RegCloseKey(currentKey); if (result != ERROR_SUCCESS) @@ -129,7 +129,7 @@ namespace keyDataSize = sizeof(keyData); - result = RegQueryValueEx(currentKey, REGSTR_VAL_JOYOEMNAME, NULL, NULL, reinterpret_cast(keyData), &keyDataSize); + result = RegQueryValueEx(currentKey, REGSTR_VAL_JOYOEMNAME, nullptr, nullptr, reinterpret_cast(keyData), &keyDataSize); RegCloseKey(currentKey); if (result != ERROR_SUCCESS) diff --git a/src/SFML/Window/Win32/VideoModeImpl.cpp b/src/SFML/Window/Win32/VideoModeImpl.cpp index 87839316..d04f4c27 100644 --- a/src/SFML/Window/Win32/VideoModeImpl.cpp +++ b/src/SFML/Window/Win32/VideoModeImpl.cpp @@ -42,7 +42,7 @@ std::vector VideoModeImpl::getFullscreenModes() // Enumerate all available video modes for the primary display adapter DEVMODE win32Mode; win32Mode.dmSize = sizeof(win32Mode); - for (int count = 0; EnumDisplaySettings(NULL, count, &win32Mode); ++count) + for (int count = 0; EnumDisplaySettings(nullptr, count, &win32Mode); ++count) { // Convert to sf::VideoMode VideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel); @@ -61,7 +61,7 @@ VideoMode VideoModeImpl::getDesktopMode() { DEVMODE win32Mode; win32Mode.dmSize = sizeof(win32Mode); - EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &win32Mode); + EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &win32Mode); return VideoMode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel); } diff --git a/src/SFML/Window/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp index 198f7ef2..862bc753 100644 --- a/src/SFML/Window/Win32/WglContext.cpp +++ b/src/SFML/Window/Win32/WglContext.cpp @@ -64,7 +64,7 @@ String getErrorString(DWORD errorCode) { std::basic_ostringstream > ss; TCHAR errBuff[256]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, 0, errBuff, sizeof(errBuff), NULL); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, errorCode, 0, errBuff, sizeof(errBuff), nullptr); ss << errBuff; String errMsg(ss.str()); @@ -74,10 +74,10 @@ String getErrorString(DWORD errorCode) //////////////////////////////////////////////////////////// WglContext::WglContext(WglContext* shared) : -m_window (NULL), -m_pbuffer (NULL), -m_deviceContext(NULL), -m_context (NULL), +m_window (nullptr), +m_pbuffer (nullptr), +m_deviceContext(nullptr), +m_context (nullptr), m_ownsWindow (false) { // Save the creation settings @@ -99,10 +99,10 @@ m_ownsWindow (false) //////////////////////////////////////////////////////////// WglContext::WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) : -m_window (NULL), -m_pbuffer (NULL), -m_deviceContext(NULL), -m_context (NULL), +m_window (nullptr), +m_pbuffer (nullptr), +m_deviceContext(nullptr), +m_context (nullptr), m_ownsWindow (false) { // Save the creation settings @@ -124,10 +124,10 @@ m_ownsWindow (false) //////////////////////////////////////////////////////////// WglContext::WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) : -m_window (NULL), -m_pbuffer (NULL), -m_deviceContext(NULL), -m_context (NULL), +m_window (nullptr), +m_pbuffer (nullptr), +m_deviceContext(nullptr), +m_context (nullptr), m_ownsWindow (false) { // Save the creation settings @@ -155,8 +155,8 @@ WglContext::~WglContext() { if (currentContext == this) { - if (wglMakeCurrent(m_deviceContext, NULL) == TRUE) - currentContext = NULL; + if (wglMakeCurrent(m_deviceContext, nullptr) == TRUE) + currentContext = nullptr; } wglDeleteContext(m_context); @@ -215,13 +215,13 @@ bool WglContext::makeCurrent(bool current) if (!m_deviceContext || !m_context) return false; - if (wglMakeCurrent(m_deviceContext, current ? m_context : NULL) == FALSE) + if (wglMakeCurrent(m_deviceContext, current ? m_context : nullptr) == FALSE) { err() << "Failed to " << (current ? "activate" : "deactivate") << " OpenGL context: " << getErrorString(GetLastError()).toAnsiString() << std::endl; return false; } - currentContext = (current ? this : NULL); + currentContext = (current ? this : nullptr); return true; } @@ -278,7 +278,7 @@ int WglContext::selectBestPixelFormat(HDC deviceContext, unsigned int bitsPerPix // Let's check how many formats are supporting our requirements int formats[512]; UINT nbFormats; - bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, NULL, 512, formats, &nbFormats) != FALSE; + bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, nullptr, 512, formats, &nbFormats) != FALSE; if (!isValid) err() << "Failed to enumerate pixel formats: " << getErrorString(GetLastError()).toAnsiString() << std::endl; @@ -536,7 +536,7 @@ void WglContext::createSurface(WglContext* shared, unsigned int width, unsigned err() << "Failed to retrieve pixel buffer device context: " << getErrorString(GetLastError()).toAnsiString() << std::endl; wglDestroyPbufferARB(m_pbuffer); - m_pbuffer = NULL; + m_pbuffer = nullptr; } } else @@ -553,7 +553,7 @@ void WglContext::createSurface(WglContext* shared, unsigned int width, unsigned // with other contexts and thus wglShareLists would always fail // Create the hidden window - m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, width, height, NULL, NULL, GetModuleHandle(NULL), NULL); + m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, width, height, nullptr, nullptr, GetModuleHandle(nullptr), nullptr); ShowWindow(m_window, SW_HIDE); m_deviceContext = GetDC(m_window); @@ -589,7 +589,7 @@ void WglContext::createContext(WglContext* shared) ContextSettings settings = m_settings; // Get the context to share display lists with - HGLRC sharedContext = shared ? shared->m_context : NULL; + HGLRC sharedContext = shared ? shared->m_context : nullptr; // Create the OpenGL context -- first try using wglCreateContextAttribsARB while (!m_context && m_settings.majorVersion) @@ -638,13 +638,13 @@ void WglContext::createContext(WglContext* shared) if (currentContext == shared) { - if (wglMakeCurrent(shared->m_deviceContext, NULL) == FALSE) + if (wglMakeCurrent(shared->m_deviceContext, nullptr) == FALSE) { err() << "Failed to deactivate shared context before sharing: " << getErrorString(GetLastError()).toAnsiString() << std::endl; return; } - currentContext = NULL; + currentContext = nullptr; } } @@ -708,13 +708,13 @@ void WglContext::createContext(WglContext* shared) if (currentContext == shared) { - if (wglMakeCurrent(shared->m_deviceContext, NULL) == FALSE) + if (wglMakeCurrent(shared->m_deviceContext, nullptr) == FALSE) { err() << "Failed to deactivate shared context before sharing: " << getErrorString(GetLastError()).toAnsiString() << std::endl; return; } - currentContext = NULL; + currentContext = nullptr; } if (wglShareLists(sharedContext, m_context) == FALSE) diff --git a/src/SFML/Window/Win32/WglContext.hpp b/src/SFML/Window/Win32/WglContext.hpp index d3a284df..36450a24 100644 --- a/src/SFML/Window/Win32/WglContext.hpp +++ b/src/SFML/Window/Win32/WglContext.hpp @@ -47,7 +47,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create a new default context /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// WglContext(WglContext* shared); @@ -151,7 +151,7 @@ private: //////////////////////////////////////////////////////////// /// \brief Create the context's drawing surface /// - /// \param shared Shared context (can be NULL) + /// \param shared Shared context (can be nullptr) /// \param width Back buffer width, in pixels /// \param height Back buffer height, in pixels /// \param bitsPerPixel Pixel depth, in bits per pixel @@ -171,7 +171,7 @@ private: //////////////////////////////////////////////////////////// /// \brief Create the context /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// void createContext(WglContext* shared); diff --git a/src/SFML/Window/Win32/WglExtensions.cpp b/src/SFML/Window/Win32/WglExtensions.cpp index 3c037ab7..08bfa54c 100644 --- a/src/SFML/Window/Win32/WglExtensions.cpp +++ b/src/SFML/Window/Win32/WglExtensions.cpp @@ -46,8 +46,8 @@ int sfwgl_ext_ARB_pbuffer = sfwgl_LOAD_FAILED; int sfwgl_ext_ARB_create_context = sfwgl_LOAD_FAILED; int sfwgl_ext_ARB_create_context_profile = sfwgl_LOAD_FAILED; -int (CODEGEN_FUNCPTR *sf_ptrc_wglGetSwapIntervalEXT)(void) = NULL; -BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglSwapIntervalEXT)(int) = NULL; +int (CODEGEN_FUNCPTR *sf_ptrc_wglGetSwapIntervalEXT)(void) = nullptr; +BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglSwapIntervalEXT)(int) = nullptr; static int Load_EXT_swap_control(void) { @@ -61,9 +61,9 @@ static int Load_EXT_swap_control(void) return numFailed; } -BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglChoosePixelFormatARB)(HDC, const int*, const FLOAT*, UINT, int*, UINT*) = NULL; -BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribfvARB)(HDC, int, int, UINT, const int*, FLOAT*) = NULL; -BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribivARB)(HDC, int, int, UINT, const int*, int*) = NULL; +BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglChoosePixelFormatARB)(HDC, const int*, const FLOAT*, UINT, int*, UINT*) = nullptr; +BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribfvARB)(HDC, int, int, UINT, const int*, FLOAT*) = nullptr; +BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribivARB)(HDC, int, int, UINT, const int*, int*) = nullptr; static int Load_ARB_pixel_format(void) { @@ -80,11 +80,11 @@ static int Load_ARB_pixel_format(void) return numFailed; } -HPBUFFERARB (CODEGEN_FUNCPTR *sf_ptrc_wglCreatePbufferARB)(HDC, int, int, int, const int*) = NULL; -BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglDestroyPbufferARB)(HPBUFFERARB) = NULL; -HDC (CODEGEN_FUNCPTR *sf_ptrc_wglGetPbufferDCARB)(HPBUFFERARB) = NULL; -BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglQueryPbufferARB)(HPBUFFERARB, int, int*) = NULL; -int (CODEGEN_FUNCPTR *sf_ptrc_wglReleasePbufferDCARB)(HPBUFFERARB, HDC) = NULL; +HPBUFFERARB (CODEGEN_FUNCPTR *sf_ptrc_wglCreatePbufferARB)(HDC, int, int, int, const int*) = nullptr; +BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglDestroyPbufferARB)(HPBUFFERARB) = nullptr; +HDC (CODEGEN_FUNCPTR *sf_ptrc_wglGetPbufferDCARB)(HPBUFFERARB) = nullptr; +BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglQueryPbufferARB)(HPBUFFERARB, int, int*) = nullptr; +int (CODEGEN_FUNCPTR *sf_ptrc_wglReleasePbufferDCARB)(HPBUFFERARB, HDC) = nullptr; static int Load_ARB_pbuffer() { @@ -107,7 +107,7 @@ static int Load_ARB_pbuffer() return numFailed; } -HGLRC (CODEGEN_FUNCPTR *sf_ptrc_wglCreateContextAttribsARB)(HDC, HGLRC, const int*) = NULL; +HGLRC (CODEGEN_FUNCPTR *sf_ptrc_wglCreateContextAttribsARB)(HDC, HGLRC, const int*) = nullptr; static int Load_ARB_create_context(void) { @@ -119,7 +119,7 @@ static int Load_ARB_create_context(void) } -static const char* (CODEGEN_FUNCPTR *sf_ptrc_wglGetExtensionsStringARB)(HDC) = NULL; +static const char* (CODEGEN_FUNCPTR *sf_ptrc_wglGetExtensionsStringARB)(HDC) = nullptr; typedef int (*PFN_LOADFUNCPOINTERS)(void); typedef struct sfwgl_StrToExtMap_s @@ -131,13 +131,13 @@ typedef struct sfwgl_StrToExtMap_s static sfwgl_StrToExtMap ExtensionMap[8] = { {"WGL_EXT_swap_control", &sfwgl_ext_EXT_swap_control, Load_EXT_swap_control}, - {"WGL_EXT_framebuffer_sRGB", &sfwgl_ext_EXT_framebuffer_sRGB, NULL}, - {"WGL_ARB_framebuffer_sRGB", &sfwgl_ext_ARB_framebuffer_sRGB, NULL}, - {"WGL_ARB_multisample", &sfwgl_ext_ARB_multisample, NULL}, + {"WGL_EXT_framebuffer_sRGB", &sfwgl_ext_EXT_framebuffer_sRGB, nullptr}, + {"WGL_ARB_framebuffer_sRGB", &sfwgl_ext_ARB_framebuffer_sRGB, nullptr}, + {"WGL_ARB_multisample", &sfwgl_ext_ARB_multisample, nullptr}, {"WGL_ARB_pixel_format", &sfwgl_ext_ARB_pixel_format, Load_ARB_pixel_format}, {"WGL_ARB_pbuffer", &sfwgl_ext_ARB_pbuffer, Load_ARB_pbuffer}, {"WGL_ARB_create_context", &sfwgl_ext_ARB_create_context, Load_ARB_create_context}, - {"WGL_ARB_create_context_profile", &sfwgl_ext_ARB_create_context_profile, NULL} + {"WGL_ARB_create_context_profile", &sfwgl_ext_ARB_create_context_profile, nullptr} }; static int g_extensionMapSize = 8; @@ -152,7 +152,7 @@ static sfwgl_StrToExtMap* FindExtEntry(const char* extensionName) return currLoc; } - return NULL; + return nullptr; } @@ -171,7 +171,7 @@ static void ClearExtensionVars(void) static void LoadExtByName(const char* extensionName) { - sfwgl_StrToExtMap* entry = NULL; + sfwgl_StrToExtMap* entry = nullptr; entry = FindExtEntry(extensionName); if (entry) { diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp index 9c55180d..e9fc32db 100644 --- a/src/SFML/Window/Win32/WindowImplWin32.cpp +++ b/src/SFML/Window/Win32/WindowImplWin32.cpp @@ -65,7 +65,7 @@ namespace unsigned int windowCount = 0; // Windows owned by SFML unsigned int handleCount = 0; // All window handles const wchar_t* className = L"SFML_Window"; - sf::priv::WindowImplWin32* fullscreenWindow = NULL; + sf::priv::WindowImplWin32* fullscreenWindow = nullptr; void setProcessDpiAware() { @@ -131,8 +131,8 @@ namespace priv WindowImplWin32::WindowImplWin32(WindowHandle handle) : m_handle (handle), m_callback (0), -m_cursor (NULL), -m_icon (NULL), +m_cursor (nullptr), +m_icon (nullptr), m_keyRepeatEnabled(true), m_lastSize (0, 0), m_resizing (false), @@ -161,10 +161,10 @@ m_cursorGrabbed (false) //////////////////////////////////////////////////////////// WindowImplWin32::WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& /*settings*/) : -m_handle (NULL), +m_handle (nullptr), m_callback (0), -m_cursor (NULL), -m_icon (NULL), +m_cursor (nullptr), +m_icon (nullptr), m_keyRepeatEnabled(true), m_lastSize (mode.width, mode.height), m_resizing (false), @@ -181,12 +181,12 @@ m_cursorGrabbed (m_fullscreen) registerWindowClass(); // Compute position and size - HDC screenDC = GetDC(NULL); + HDC screenDC = GetDC(nullptr); int left = (GetDeviceCaps(screenDC, HORZRES) - static_cast(mode.width)) / 2; int top = (GetDeviceCaps(screenDC, VERTRES) - static_cast(mode.height)) / 2; int width = mode.width; int height = mode.height; - ReleaseDC(NULL, screenDC); + ReleaseDC(nullptr, screenDC); // Choose the window style according to the Style parameter DWORD win32Style = WS_VISIBLE; @@ -211,7 +211,7 @@ m_cursorGrabbed (m_fullscreen) } // Create the window - m_handle = CreateWindowW(className, title.toWideString().c_str(), win32Style, left, top, width, height, NULL, NULL, GetModuleHandle(NULL), this); + m_handle = CreateWindowW(className, title.toWideString().c_str(), win32Style, left, top, width, height, nullptr, nullptr, GetModuleHandle(nullptr), this); // If we're the first window handle, we only need to poll for joysticks when WM_DEVICECHANGE message is received if (m_handle) @@ -262,7 +262,7 @@ WindowImplWin32::~WindowImplWin32() // Unregister window class if we were the last window if (windowCount == 0) - UnregisterClassW(className, GetModuleHandleW(NULL)); + UnregisterClassW(className, GetModuleHandleW(nullptr)); } else { @@ -286,7 +286,7 @@ void WindowImplWin32::processEvents() if (!m_callback) { MSG message; - while (PeekMessageW(&message, NULL, 0, 0, PM_REMOVE)) + while (PeekMessageW(&message, nullptr, 0, 0, PM_REMOVE)) { TranslateMessage(&message); DispatchMessageW(&message); @@ -308,7 +308,7 @@ Vector2i WindowImplWin32::getPosition() const //////////////////////////////////////////////////////////// void WindowImplWin32::setPosition(const Vector2i& position) { - SetWindowPos(m_handle, NULL, position.x, position.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + SetWindowPos(m_handle, nullptr, position.x, position.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); if(m_cursorGrabbed) grabCursor(true); @@ -335,7 +335,7 @@ void WindowImplWin32::setSize(const Vector2u& size) int width = rectangle.right - rectangle.left; int height = rectangle.bottom - rectangle.top; - SetWindowPos(m_handle, NULL, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER); + SetWindowPos(m_handle, nullptr, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER); } @@ -364,7 +364,7 @@ void WindowImplWin32::setIcon(unsigned int width, unsigned int height, const Uin } // Create the icon from the pixel array - m_icon = CreateIcon(GetModuleHandleW(NULL), width, height, 1, 32, NULL, iconPixels.data()); + m_icon = CreateIcon(GetModuleHandleW(nullptr), width, height, 1, 32, nullptr, iconPixels.data()); // Set it as both big and small icon of the window if (m_icon) @@ -390,9 +390,9 @@ void WindowImplWin32::setVisible(bool visible) void WindowImplWin32::setMouseCursorVisible(bool visible) { if (visible) - m_cursor = LoadCursorW(NULL, IDC_ARROW); + m_cursor = LoadCursorW(nullptr, IDC_ARROW); else - m_cursor = NULL; + m_cursor = nullptr; SetCursor(m_cursor); } @@ -417,8 +417,8 @@ void WindowImplWin32::setKeyRepeatEnabled(bool enabled) void WindowImplWin32::requestFocus() { // Allow focus stealing only within the same process; compare PIDs of current and foreground window - DWORD thisPid = GetWindowThreadProcessId(m_handle, NULL); - DWORD foregroundPid = GetWindowThreadProcessId(GetForegroundWindow(), NULL); + DWORD thisPid = GetWindowThreadProcessId(m_handle, nullptr); + DWORD foregroundPid = GetWindowThreadProcessId(GetForegroundWindow(), nullptr); if (thisPid == foregroundPid) { @@ -455,11 +455,11 @@ void WindowImplWin32::registerWindowClass() windowClass.lpfnWndProc = &WindowImplWin32::globalOnEvent; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; - windowClass.hInstance = GetModuleHandleW(NULL); - windowClass.hIcon = NULL; + windowClass.hInstance = GetModuleHandleW(nullptr); + windowClass.hIcon = nullptr; windowClass.hCursor = 0; windowClass.hbrBackground = 0; - windowClass.lpszMenuName = NULL; + windowClass.lpszMenuName = nullptr; windowClass.lpszClassName = className; RegisterClassW(&windowClass); } @@ -501,8 +501,8 @@ void WindowImplWin32::cleanup() // Restore the previous video mode (in case we were running in fullscreen) if (fullscreenWindow == this) { - ChangeDisplaySettingsW(NULL, 0); - fullscreenWindow = NULL; + ChangeDisplaySettingsW(nullptr, 0); + fullscreenWindow = nullptr; } // Unhide the mouse cursor (in case it was hidden) @@ -535,12 +535,12 @@ void WindowImplWin32::grabCursor(bool grabbed) { RECT rect; GetClientRect(m_handle, &rect); - MapWindowPoints(m_handle, NULL, reinterpret_cast(&rect), 2); + MapWindowPoints(m_handle, nullptr, reinterpret_cast(&rect), 2); ClipCursor(&rect); } else { - ClipCursor(NULL); + ClipCursor(nullptr); } } @@ -549,7 +549,7 @@ void WindowImplWin32::grabCursor(bool grabbed) void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam) { // Don't process any message until window is created - if (m_handle == NULL) + if (m_handle == nullptr) return; switch (message) @@ -1111,7 +1111,7 @@ LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARA } // Get the WindowImpl instance corresponding to the window handle - WindowImplWin32* window = handle ? reinterpret_cast(GetWindowLongPtr(handle, GWLP_USERDATA)) : NULL; + WindowImplWin32* window = handle ? reinterpret_cast(GetWindowLongPtr(handle, GWLP_USERDATA)) : nullptr; // Forward the event to the appropriate function if (window) diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 1657dc99..2e1481b0 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -34,7 +34,7 @@ namespace { - const sf::Window* fullscreenWindow = NULL; + const sf::Window* fullscreenWindow = nullptr; } @@ -153,14 +153,14 @@ void Window::close() // Update the fullscreen window if (this == fullscreenWindow) - fullscreenWindow = NULL; + fullscreenWindow = nullptr; } //////////////////////////////////////////////////////////// bool Window::isOpen() const { - return m_impl != NULL; + return m_impl != nullptr; } diff --git a/src/SFML/Window/iOS/EaglContext.hpp b/src/SFML/Window/iOS/EaglContext.hpp index 8eed8f81..5150a721 100644 --- a/src/SFML/Window/iOS/EaglContext.hpp +++ b/src/SFML/Window/iOS/EaglContext.hpp @@ -55,7 +55,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create a new context, not associated to a window /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// EaglContext(EaglContext* shared); @@ -138,8 +138,8 @@ private: //////////////////////////////////////////////////////////// /// \brief Create the context /// - /// \param shared Context to share the new one with (can be NULL) - /// \param window Window to attach the context to (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) + /// \param window Window to attach the context to (can be nullptr) /// \param bitsPerPixel Pixel depth, in bits per pixel /// \param settings Creation parameters /// diff --git a/src/SFML/Window/iOS/SFAppDelegate.mm b/src/SFML/Window/iOS/SFAppDelegate.mm index 5e202d38..98c671f2 100644 --- a/src/SFML/Window/iOS/SFAppDelegate.mm +++ b/src/SFML/Window/iOS/SFAppDelegate.mm @@ -33,7 +33,7 @@ namespace { // Save the global instance of the delegate - SFAppDelegate* delegateInstance = NULL; + SFAppDelegate* delegateInstance = nullptr; // Current touches positions std::vector touchPositions; @@ -64,7 +64,7 @@ namespace - (void)runUserMain { // Arguments intentionally dropped, see comments in main in sfml-main - sfmlMain(0, NULL); + sfmlMain(0, nullptr); } diff --git a/src/SFML/Window/iOS/SFView.mm b/src/SFML/Window/iOS/SFView.mm index b4ae496d..c62e812c 100644 --- a/src/SFML/Window/iOS/SFView.mm +++ b/src/SFML/Window/iOS/SFView.mm @@ -183,7 +183,7 @@ if (self) { - self.context = NULL; + self.context = nullptr; self.touches = [NSMutableArray array]; // Configure the EAGL layer