Replaced NULL with nullptr.

This commit is contained in:
binary1248 2017-04-03 19:13:33 +02:00
parent e1d3eff587
commit b3b094fc91
81 changed files with 512 additions and 512 deletions

View file

@ -17,7 +17,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int main() int main()
{ {
std::srand(static_cast<unsigned int>(std::time(NULL))); std::srand(static_cast<unsigned int>(std::time(nullptr)));
// Define some constants // Define some constants
const float pi = 3.14159f; const float pi = 3.14159f;

View file

@ -66,7 +66,7 @@ protected:
static const sf::Font& getFont() static const sf::Font& getFont()
{ {
assert(s_font != NULL); assert(s_font != nullptr);
return *s_font; return *s_font;
} }

View file

@ -8,7 +8,7 @@
#include <memory> #include <memory>
const sf::Font* Effect::s_font = NULL; const sf::Font* Effect::s_font = nullptr;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// "Pixelate" fragment shader // "Pixelate" fragment shader

View file

@ -49,7 +49,7 @@ LRESULT CALLBACK onEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int main() int main()
{ {
HINSTANCE instance = GetModuleHandle(NULL); HINSTANCE instance = GetModuleHandle(nullptr);
// Define a class for our main window // Define a class for our main window
WNDCLASS windowClass; WNDCLASS windowClass;
@ -58,22 +58,22 @@ int main()
windowClass.cbClsExtra = 0; windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0; windowClass.cbWndExtra = 0;
windowClass.hInstance = instance; windowClass.hInstance = instance;
windowClass.hIcon = NULL; windowClass.hIcon = nullptr;
windowClass.hCursor = 0; windowClass.hCursor = 0;
windowClass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BACKGROUND); windowClass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BACKGROUND);
windowClass.lpszMenuName = NULL; windowClass.lpszMenuName = nullptr;
windowClass.lpszClassName = TEXT("SFML App"); windowClass.lpszClassName = TEXT("SFML App");
RegisterClass(&windowClass); RegisterClass(&windowClass);
// Let's create the main window // 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 // 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 // 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 view1 = CreateWindow(TEXT("STATIC"), nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 20, 20, 300, 400, window, nullptr, instance, nullptr);
HWND view2 = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 340, 20, 300, 400, window, NULL, instance, NULL); 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 SFMLView1(view1);
sf::RenderWindow SFMLView2(view2); sf::RenderWindow SFMLView2(view2);
@ -94,7 +94,7 @@ int main()
message.message = static_cast<UINT>(~WM_QUIT); message.message = static_cast<UINT>(~WM_QUIT);
while (message.message != 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 // If a message was waiting in the message queue, process it
TranslateMessage(&message); TranslateMessage(&message);

View file

@ -158,7 +158,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the audio buffer attached to the sound /// \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; const SoundBuffer* getBuffer() const;

View file

@ -651,7 +651,7 @@ public:
/// // draw OpenGL stuff that use s1... /// // draw OpenGL stuff that use s1...
/// sf::Shader::bind(&s2); /// sf::Shader::bind(&s2);
/// // draw OpenGL stuff that use s2... /// // draw OpenGL stuff that use s2...
/// sf::Shader::bind(NULL); /// sf::Shader::bind(nullptr);
/// // draw OpenGL stuff that use no shader... /// // draw OpenGL stuff that use no shader...
/// \endcode /// \endcode
/// ///
@ -696,7 +696,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Compile the shader(s) and create the program /// \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. /// is not created.
/// ///
/// \param vertexShaderCode Source code of the vertex shader /// \param vertexShaderCode Source code of the vertex shader
@ -867,7 +867,7 @@ private:
/// \code /// \code
/// sf::Shader::bind(&shader); /// sf::Shader::bind(&shader);
/// ... render OpenGL geometry ... /// ... render OpenGL geometry ...
/// sf::Shader::bind(NULL); /// sf::Shader::bind(nullptr);
/// \endcode /// \endcode
/// ///
/// \see sf::Glsl /// \see sf::Glsl

View file

@ -60,7 +60,7 @@ public:
/// a pointer to the one that you passed to this function. /// a pointer to the one that you passed to this function.
/// If the source texture is destroyed and the shape tries to /// If the source texture is destroyed and the shape tries to
/// use it, the behavior is undefined. /// use it, the behavior is undefined.
/// \a texture can be NULL to disable texturing. /// \a texture can be nullptr to disable texturing.
/// If \a resetRect is true, the TextureRect property of /// If \a resetRect is true, the TextureRect property of
/// the shape is automatically adjusted to the size of the new /// the shape is automatically adjusted to the size of the new
/// texture. If it is false, the texture rect is left unchanged. /// texture. If it is false, the texture rect is left unchanged.
@ -134,7 +134,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the source texture of the shape /// \brief Get the source texture of the shape
/// ///
/// If the shape has no source texture, a NULL pointer is returned. /// If the shape has no source texture, a nullptr pointer is returned.
/// The returned pointer is const, which means that you can't /// The returned pointer is const, which means that you can't
/// modify the texture when you retrieve it with this function. /// modify the texture when you retrieve it with this function.
/// ///

View file

@ -130,7 +130,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the source texture of the sprite /// \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 /// The returned pointer is const, which means that you can't
/// modify the texture when you retrieve it with this function. /// modify the texture when you retrieve it with this function.
/// ///

View file

@ -239,7 +239,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the text's font /// \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 /// The returned pointer is const, which means that you
/// cannot modify the font when you get it from this function. /// cannot modify the font when you get it from this function.
/// ///

View file

@ -551,7 +551,7 @@ public:
/// // draw OpenGL stuff that use t1... /// // draw OpenGL stuff that use t1...
/// sf::Texture::bind(&t2); /// sf::Texture::bind(&t2);
/// // draw OpenGL stuff that use t2... /// // draw OpenGL stuff that use t2...
/// sf::Texture::bind(NULL); /// sf::Texture::bind(nullptr);
/// // draw OpenGL stuff that use no texture... /// // draw OpenGL stuff that use no texture...
/// \endcode /// \endcode
/// ///
@ -723,7 +723,7 @@ private:
/// \code /// \code
/// sf::Texture::bind(&texture); /// sf::Texture::bind(&texture);
/// ... render OpenGL geometry ... /// ... render OpenGL geometry ...
/// sf::Texture::bind(NULL); /// sf::Texture::bind(nullptr);
/// \endcode /// \endcode
/// ///
/// \see sf::Sprite, sf::Image, sf::RenderTexture /// \see sf::Sprite, sf::Image, sf::RenderTexture

View file

@ -92,7 +92,7 @@ public:
/// Warning: the returned pointer may become invalid after /// Warning: the returned pointer may become invalid after
/// you append data to the packet, therefore it should never /// you append data to the packet, therefore it should never
/// be stored. /// be stored.
/// The return pointer is NULL if the packet is empty. /// The return pointer is nullptr if the packet is empty.
/// ///
/// \return Pointer to the data /// \return Pointer to the data
/// ///

View file

@ -69,7 +69,7 @@ SFML_SYSTEM_API std::ostream& err();
/// std::streambuf* previous = sf::err().rdbuf(file.rdbuf()); /// std::streambuf* previous = sf::err().rdbuf(file.rdbuf());
/// ///
/// // Redirect to nothing /// // Redirect to nothing
/// sf::err().rdbuf(NULL); /// sf::err().rdbuf(nullptr);
/// ///
/// // Restore the original output /// // Restore the original output
/// sf::err().rdbuf(previous); /// sf::err().rdbuf(previous);

View file

@ -113,7 +113,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the currently active context /// \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(); static const Context* getActiveContext();

View file

@ -33,8 +33,8 @@
namespace namespace
{ {
ALCdevice* audioDevice = NULL; ALCdevice* audioDevice = nullptr;
ALCcontext* audioContext = NULL; ALCcontext* audioContext = nullptr;
float listenerVolume = 100.f; float listenerVolume = 100.f;
sf::Vector3f listenerPosition (0.f, 0.f, 0.f); sf::Vector3f listenerPosition (0.f, 0.f, 0.f);
@ -50,12 +50,12 @@ namespace priv
AudioDevice::AudioDevice() AudioDevice::AudioDevice()
{ {
// Create the device // Create the device
audioDevice = alcOpenDevice(NULL); audioDevice = alcOpenDevice(nullptr);
if (audioDevice) if (audioDevice)
{ {
// Create the context // Create the context
audioContext = alcCreateContext(audioDevice, NULL); audioContext = alcCreateContext(audioDevice, nullptr);
if (audioContext) if (audioContext)
{ {
@ -89,7 +89,7 @@ AudioDevice::AudioDevice()
AudioDevice::~AudioDevice() AudioDevice::~AudioDevice()
{ {
// Destroy the context // Destroy the context
alcMakeContextCurrent(NULL); alcMakeContextCurrent(nullptr);
if (audioContext) if (audioContext)
alcDestroyContext(audioContext); alcDestroyContext(audioContext);

View file

@ -34,14 +34,14 @@ namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound::Sound() : Sound::Sound() :
m_buffer(NULL) m_buffer(nullptr)
{ {
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound::Sound(const SoundBuffer& buffer) : Sound::Sound(const SoundBuffer& buffer) :
m_buffer(NULL) m_buffer(nullptr)
{ {
setBuffer(buffer); setBuffer(buffer);
} }
@ -50,7 +50,7 @@ m_buffer(NULL)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound::Sound(const Sound& copy) : Sound::Sound(const Sound& copy) :
SoundSource(copy), SoundSource(copy),
m_buffer (NULL) m_buffer (nullptr)
{ {
if (copy.m_buffer) if (copy.m_buffer)
setBuffer(*copy.m_buffer); setBuffer(*copy.m_buffer);
@ -168,7 +168,7 @@ Sound& Sound::operator =(const Sound& right)
{ {
stop(); stop();
m_buffer->detachSound(this); m_buffer->detachSound(this);
m_buffer = NULL; m_buffer = nullptr;
} }
// Copy the remaining sound attributes // Copy the remaining sound attributes
@ -191,7 +191,7 @@ void Sound::resetBuffer()
{ {
alCheck(alSourcei(m_source, AL_BUFFER, 0)); alCheck(alSourcei(m_source, AL_BUFFER, 0));
m_buffer->detachSound(this); m_buffer->detachSound(this);
m_buffer = NULL; m_buffer = nullptr;
} }
} }

View file

@ -162,7 +162,7 @@ bool SoundBuffer::saveToFile(const std::string& filename) const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Int16* SoundBuffer::getSamples() const const Int16* SoundBuffer::getSamples() const
{ {
return m_samples.empty() ? NULL : m_samples.data(); return m_samples.empty() ? nullptr : m_samples.data();
} }

View file

@ -72,7 +72,7 @@ std::unique_ptr<SoundFileReader> SoundFileFactory::createReaderFromFilename(cons
FileInputStream stream; FileInputStream stream;
if (!stream.open(filename)) { if (!stream.open(filename)) {
err() << "Failed to open sound file \"" << filename << "\" (couldn't open stream)" << std::endl; 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 // Test the filename in all the registered factories
@ -85,7 +85,7 @@ std::unique_ptr<SoundFileReader> SoundFileFactory::createReaderFromFilename(cons
// No suitable reader found // No suitable reader found
err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl; err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
return NULL; return nullptr;
} }
@ -109,7 +109,7 @@ std::unique_ptr<SoundFileReader> SoundFileFactory::createReaderFromMemory(const
// No suitable reader found // No suitable reader found
err() << "Failed to open sound file from memory (format not supported)" << std::endl; err() << "Failed to open sound file from memory (format not supported)" << std::endl;
return NULL; return nullptr;
} }
@ -129,7 +129,7 @@ std::unique_ptr<SoundFileReader> SoundFileFactory::createReaderFromStream(InputS
// No suitable reader found // No suitable reader found
err() << "Failed to open sound file from stream (format not supported)" << std::endl; err() << "Failed to open sound file from stream (format not supported)" << std::endl;
return NULL; return nullptr;
} }
@ -148,7 +148,7 @@ std::unique_ptr<SoundFileWriter> SoundFileFactory::createWriterFromFilename(cons
// No suitable writer found // No suitable writer found
err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl; err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
return NULL; return nullptr;
} }
} // namespace sf } // namespace sf

View file

@ -191,7 +191,7 @@ bool SoundFileReaderFlac::check(InputStream& stream)
ClientData data; ClientData data;
data.stream = &stream; data.stream = &stream;
data.error = false; 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 // Read the header
bool valid = FLAC__stream_decoder_process_until_end_of_metadata(decoder) != 0; bool valid = FLAC__stream_decoder_process_until_end_of_metadata(decoder) != 0;
@ -206,7 +206,7 @@ bool SoundFileReaderFlac::check(InputStream& stream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundFileReaderFlac::SoundFileReaderFlac() : SoundFileReaderFlac::SoundFileReaderFlac() :
m_decoder(NULL), m_decoder(nullptr),
m_clientData() m_clientData()
{ {
} }
@ -255,7 +255,7 @@ void SoundFileReaderFlac::seek(Uint64 sampleOffset)
assert(m_decoder); assert(m_decoder);
// Reset the callback data (the "write" callback will be called) // Reset the callback data (the "write" callback will be called)
m_clientData.buffer = NULL; m_clientData.buffer = nullptr;
m_clientData.remaining = 0; m_clientData.remaining = 0;
m_clientData.leftovers.clear(); m_clientData.leftovers.clear();
@ -331,7 +331,7 @@ void SoundFileReaderFlac::close()
{ {
FLAC__stream_decoder_finish(m_decoder); FLAC__stream_decoder_finish(m_decoder);
FLAC__stream_decoder_delete(m_decoder); FLAC__stream_decoder_delete(m_decoder);
m_decoder = NULL; m_decoder = nullptr;
} }
} }

View file

@ -63,7 +63,7 @@ namespace
return static_cast<long>(stream->tell()); return static_cast<long>(stream->tell());
} }
static ov_callbacks callbacks = {&read, &seek, NULL, &tell}; static ov_callbacks callbacks = {&read, &seek, nullptr, &tell};
} }
namespace sf namespace sf
@ -74,7 +74,7 @@ namespace priv
bool SoundFileReaderOgg::check(InputStream& stream) bool SoundFileReaderOgg::check(InputStream& stream)
{ {
OggVorbis_File file; 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); ov_clear(&file);
return true; return true;
@ -91,7 +91,7 @@ SoundFileReaderOgg::SoundFileReaderOgg() :
m_vorbis (), m_vorbis (),
m_channelCount(0) m_channelCount(0)
{ {
m_vorbis.datasource = NULL; m_vorbis.datasource = nullptr;
} }
@ -106,7 +106,7 @@ SoundFileReaderOgg::~SoundFileReaderOgg()
bool SoundFileReaderOgg::open(InputStream& stream, Info& info) bool SoundFileReaderOgg::open(InputStream& stream, Info& info)
{ {
// Open the Vorbis stream // 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) if (status < 0)
{ {
err() << "Failed to open Vorbis file for reading" << std::endl; err() << "Failed to open Vorbis file for reading" << std::endl;
@ -145,7 +145,7 @@ Uint64 SoundFileReaderOgg::read(Int16* samples, Uint64 maxCount)
while (count < maxCount) while (count < maxCount)
{ {
int bytesToRead = static_cast<int>(maxCount - count) * sizeof(Int16); int bytesToRead = static_cast<int>(maxCount - count) * sizeof(Int16);
long bytesRead = ov_read(&m_vorbis, reinterpret_cast<char*>(samples), bytesToRead, 0, 2, 1, NULL); long bytesRead = ov_read(&m_vorbis, reinterpret_cast<char*>(samples), bytesToRead, 0, 2, 1, nullptr);
if (bytesRead > 0) if (bytesRead > 0)
{ {
long samplesRead = bytesRead / sizeof(Int16); long samplesRead = bytesRead / sizeof(Int16);
@ -169,7 +169,7 @@ void SoundFileReaderOgg::close()
if (m_vorbis.datasource) if (m_vorbis.datasource)
{ {
ov_clear(&m_vorbis); ov_clear(&m_vorbis);
m_vorbis.datasource = NULL; m_vorbis.datasource = nullptr;
m_channelCount = 0; m_channelCount = 0;
} }
} }

View file

@ -108,7 +108,7 @@ bool SoundFileReaderWav::check(InputStream& stream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundFileReaderWav::SoundFileReaderWav() : SoundFileReaderWav::SoundFileReaderWav() :
m_stream (NULL), m_stream (nullptr),
m_bytesPerSample(0), m_bytesPerSample(0),
m_dataStart (0), m_dataStart (0),
m_dataEnd (0) m_dataEnd (0)

View file

@ -48,7 +48,7 @@ bool SoundFileWriterFlac::check(const std::string& filename)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundFileWriterFlac::SoundFileWriterFlac() : SoundFileWriterFlac::SoundFileWriterFlac() :
m_encoder (NULL), m_encoder (nullptr),
m_channelCount(0), m_channelCount(0),
m_samples32 () 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); FLAC__stream_encoder_set_sample_rate(m_encoder, sampleRate);
// Initialize the output stream // 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; err() << "Failed to write flac file \"" << filename << "\" (failed to open the file)" << std::endl;
close(); close();
@ -124,7 +124,7 @@ void SoundFileWriterFlac::close()
// Destroy the encoder // Destroy the encoder
FLAC__stream_encoder_delete(m_encoder); FLAC__stream_encoder_delete(m_encoder);
m_encoder = NULL; m_encoder = nullptr;
} }
} }

View file

@ -167,7 +167,7 @@ void SoundFileWriterOgg::flushBlocks()
while (vorbis_analysis_blockout(&m_state, &block) == 1) while (vorbis_analysis_blockout(&m_state, &block) == 1)
{ {
// Let the automatic bitrate management do its job // Let the automatic bitrate management do its job
vorbis_analysis(&block, NULL); vorbis_analysis(&block, nullptr);
vorbis_bitrate_addblock(&block); vorbis_bitrate_addblock(&block);
// Get new packets from the bitrate management engine // Get new packets from the bitrate management engine

View file

@ -40,7 +40,7 @@
namespace namespace
{ {
ALCdevice* captureDevice = NULL; ALCdevice* captureDevice = nullptr;
} }
namespace sf namespace sf
@ -152,7 +152,7 @@ std::vector<std::string> SoundRecorder::getAvailableDevices()
{ {
std::vector<std::string> deviceNameList; std::vector<std::string> deviceNameList;
const ALchar* deviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); const ALchar* deviceList = alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER);
if (deviceList) if (deviceList)
{ {
while (*deviceList) while (*deviceList)
@ -169,7 +169,7 @@ std::vector<std::string> SoundRecorder::getAvailableDevices()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
std::string SoundRecorder::getDefaultDevice() 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 // Close the device
alcCaptureCloseDevice(captureDevice); alcCaptureCloseDevice(captureDevice);
captureDevice = NULL; captureDevice = nullptr;
} }
} // namespace sf } // namespace sf

View file

@ -406,7 +406,7 @@ bool SoundStream::fillAndPushBuffer(unsigned int bufferNum, bool immediateLoop)
bool requestStop = false; bool requestStop = false;
// Acquire audio data, also address EOF and error cases if they occur // 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) 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) // Mark the buffer as the last one (so that we know when to reset the playing position)

View file

@ -68,9 +68,9 @@ namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Font::Font() : Font::Font() :
m_library (NULL), m_library (nullptr),
m_face (NULL), m_face (nullptr),
m_stroker (NULL), m_stroker (nullptr),
m_info () m_info ()
{ {
} }
@ -241,7 +241,7 @@ bool Font::loadFromStream(InputStream& stream)
// Prepare a wrapper for our stream, that we'll pass to FreeType callbacks // Prepare a wrapper for our stream, that we'll pass to FreeType callbacks
auto rec = std::make_shared<FT_StreamRec>(); auto rec = std::make_shared<FT_StreamRec>();
std::memset(rec.get(), 0, sizeof(FT_StreamRec)); std::memset(rec.get(), 0, sizeof(FT_StreamRec));
rec->base = NULL; rec->base = nullptr;
rec->size = static_cast<unsigned long>(stream.getSize()); rec->size = static_cast<unsigned long>(stream.getSize());
rec->pos = 0; rec->pos = 0;
rec->descriptor.pointer = &stream; rec->descriptor.pointer = &stream;
@ -476,10 +476,10 @@ void Font::cleanup()
} }
// Reset members // Reset members
m_library = NULL; m_library = nullptr;
m_face = NULL; m_face = nullptr;
m_stroker = NULL; m_stroker = nullptr;
m_streamRec = NULL; m_streamRec = nullptr;
m_pages.clear(); m_pages.clear();
std::vector<Uint8>().swap(m_pixelBuffer); std::vector<Uint8>().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 IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height) const
{ {
// Find the line that fits well the glyph // Find the line that fits well the glyph
Row* row = NULL; Row* row = nullptr;
float bestRatio = 0; float bestRatio = 0;
for (std::vector<Row>::iterator it = page.rows.begin(); it != page.rows.end() && !row; ++it) for (std::vector<Row>::iterator it = page.rows.begin(); it != page.rows.end() && !row; ++it)
{ {

View file

@ -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_EXT_framebuffer_blit = sfogl_LOAD_FAILED;
int sfogl_ext_ARB_geometry_shader4 = 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() static int Load_EXT_blend_minmax()
{ {
@ -63,40 +63,40 @@ static int Load_EXT_blend_minmax()
return numFailed; return numFailed;
} }
void (GL_FUNCPTR *sf_ptrc_glActiveTextureARB)(GLenum) = NULL; void (GL_FUNCPTR *sf_ptrc_glActiveTextureARB)(GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glClientActiveTextureARB)(GLenum) = NULL; void (GL_FUNCPTR *sf_ptrc_glClientActiveTextureARB)(GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dARB)(GLenum, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dARB)(GLenum, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dvARB)(GLenum, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1dvARB)(GLenum, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fARB)(GLenum, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fARB)(GLenum, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fvARB)(GLenum, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1fvARB)(GLenum, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1iARB)(GLenum, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1iARB)(GLenum, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1ivARB)(GLenum, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1ivARB)(GLenum, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1sARB)(GLenum, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1sARB)(GLenum, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1svARB)(GLenum, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord1svARB)(GLenum, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dARB)(GLenum, GLdouble, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dARB)(GLenum, GLdouble, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dvARB)(GLenum, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2dvARB)(GLenum, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fARB)(GLenum, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fARB)(GLenum, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fvARB)(GLenum, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2fvARB)(GLenum, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2iARB)(GLenum, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2iARB)(GLenum, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2ivARB)(GLenum, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2ivARB)(GLenum, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2sARB)(GLenum, GLshort, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2sARB)(GLenum, GLshort, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2svARB)(GLenum, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord2svARB)(GLenum, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dvARB)(GLenum, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3dvARB)(GLenum, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fvARB)(GLenum, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3fvARB)(GLenum, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3iARB)(GLenum, GLint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3iARB)(GLenum, GLint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3ivARB)(GLenum, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3ivARB)(GLenum, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3svARB)(GLenum, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord3svARB)(GLenum, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dvARB)(GLenum, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4dvARB)(GLenum, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fvARB)(GLenum, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4fvARB)(GLenum, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4ivARB)(GLenum, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4ivARB)(GLenum, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4svARB)(GLenum, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glMultiTexCoord4svARB)(GLenum, const GLshort*) = nullptr;
static int Load_ARB_multitexture() static int Load_ARB_multitexture()
{ {
@ -241,7 +241,7 @@ static int Load_ARB_multitexture()
return numFailed; 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() static int Load_EXT_blend_func_separate()
{ {
@ -254,45 +254,45 @@ static int Load_EXT_blend_func_separate()
return numFailed; return numFailed;
} }
void (GL_FUNCPTR *sf_ptrc_glAttachObjectARB)(GLhandleARB, GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glAttachObjectARB)(GLhandleARB, GLhandleARB) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glCompileShaderARB)(GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glCompileShaderARB)(GLhandleARB) = nullptr;
GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateProgramObjectARB)() = NULL; GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateProgramObjectARB)() = nullptr;
GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateShaderObjectARB)(GLenum) = NULL; GLhandleARB (GL_FUNCPTR *sf_ptrc_glCreateShaderObjectARB)(GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glDeleteObjectARB)(GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glDeleteObjectARB)(GLhandleARB) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glDetachObjectARB)(GLhandleARB, GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glDetachObjectARB)(GLhandleARB, GLhandleARB) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei*, GLhandleARB*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei*, GLhandleARB*) = nullptr;
GLhandleARB (GL_FUNCPTR *sf_ptrc_glGetHandleARB)(GLenum) = NULL; GLhandleARB (GL_FUNCPTR *sf_ptrc_glGetHandleARB)(GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterivARB)(GLhandleARB, GLenum, GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetObjectParameterivARB)(GLhandleARB, GLenum, GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei*, GLcharARB*) = nullptr;
GLint (GL_FUNCPTR *sf_ptrc_glGetUniformLocationARB)(GLhandleARB, const GLcharARB*) = NULL; GLint (GL_FUNCPTR *sf_ptrc_glGetUniformLocationARB)(GLhandleARB, const GLcharARB*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetUniformfvARB)(GLhandleARB, GLint, GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetUniformfvARB)(GLhandleARB, GLint, GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetUniformivARB)(GLhandleARB, GLint, GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetUniformivARB)(GLhandleARB, GLint, GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glLinkProgramARB)(GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glLinkProgramARB)(GLhandleARB) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB**, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB**, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform1fARB)(GLint, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform1fARB)(GLint, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform1fvARB)(GLint, GLsizei, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform1fvARB)(GLint, GLsizei, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform1iARB)(GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform1iARB)(GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform1ivARB)(GLint, GLsizei, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform1ivARB)(GLint, GLsizei, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform2fARB)(GLint, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform2fARB)(GLint, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform2fvARB)(GLint, GLsizei, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform2fvARB)(GLint, GLsizei, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform2iARB)(GLint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform2iARB)(GLint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform2ivARB)(GLint, GLsizei, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform2ivARB)(GLint, GLsizei, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform3fvARB)(GLint, GLsizei, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform3fvARB)(GLint, GLsizei, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform3iARB)(GLint, GLint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform3iARB)(GLint, GLint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform3ivARB)(GLint, GLsizei, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform3ivARB)(GLint, GLsizei, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform4fvARB)(GLint, GLsizei, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform4fvARB)(GLint, GLsizei, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform4iARB)(GLint, GLint, GLint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform4iARB)(GLint, GLint, GLint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniform4ivARB)(GLint, GLsizei, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniform4ivARB)(GLint, GLsizei, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glUseProgramObjectARB)(GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glUseProgramObjectARB)(GLhandleARB) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glValidateProgramARB)(GLhandleARB) = NULL; void (GL_FUNCPTR *sf_ptrc_glValidateProgramARB)(GLhandleARB) = nullptr;
static int Load_ARB_shader_objects() static int Load_ARB_shader_objects()
{ {
@ -457,52 +457,52 @@ static int Load_ARB_shader_objects()
return numFailed; return numFailed;
} }
void (GL_FUNCPTR *sf_ptrc_glBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB*) = NULL; void (GL_FUNCPTR *sf_ptrc_glBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glDisableVertexAttribArrayARB)(GLuint) = NULL; void (GL_FUNCPTR *sf_ptrc_glDisableVertexAttribArrayARB)(GLuint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glEnableVertexAttribArrayARB)(GLuint) = NULL; void (GL_FUNCPTR *sf_ptrc_glEnableVertexAttribArrayARB)(GLuint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLcharARB*) = nullptr;
GLint (GL_FUNCPTR *sf_ptrc_glGetAttribLocationARB)(GLhandleARB, const GLcharARB*) = NULL; GLint (GL_FUNCPTR *sf_ptrc_glGetAttribLocationARB)(GLhandleARB, const GLcharARB*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribPointervARB)(GLuint, GLenum, void**) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribPointervARB)(GLuint, GLenum, void**) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribdvARB)(GLuint, GLenum, GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribdvARB)(GLuint, GLenum, GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribfvARB)(GLuint, GLenum, GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribfvARB)(GLuint, GLenum, GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribivARB)(GLuint, GLenum, GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetVertexAttribivARB)(GLuint, GLenum, GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dARB)(GLuint, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dARB)(GLuint, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dvARB)(GLuint, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1dvARB)(GLuint, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fARB)(GLuint, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fARB)(GLuint, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fvARB)(GLuint, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1fvARB)(GLuint, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1sARB)(GLuint, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1sARB)(GLuint, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1svARB)(GLuint, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib1svARB)(GLuint, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dARB)(GLuint, GLdouble, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dARB)(GLuint, GLdouble, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dvARB)(GLuint, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2dvARB)(GLuint, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fARB)(GLuint, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fARB)(GLuint, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fvARB)(GLuint, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2fvARB)(GLuint, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2sARB)(GLuint, GLshort, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2sARB)(GLuint, GLshort, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2svARB)(GLuint, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib2svARB)(GLuint, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dvARB)(GLuint, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3dvARB)(GLuint, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fvARB)(GLuint, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3fvARB)(GLuint, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3svARB)(GLuint, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib3svARB)(GLuint, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NbvARB)(GLuint, const GLbyte*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NbvARB)(GLuint, const GLbyte*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NivARB)(GLuint, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NivARB)(GLuint, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NsvARB)(GLuint, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NsvARB)(GLuint, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubvARB)(GLuint, const GLubyte*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NubvARB)(GLuint, const GLubyte*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NuivARB)(GLuint, const GLuint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NuivARB)(GLuint, const GLuint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NusvARB)(GLuint, const GLushort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4NusvARB)(GLuint, const GLushort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4bvARB)(GLuint, const GLbyte*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4bvARB)(GLuint, const GLbyte*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dvARB)(GLuint, const GLdouble*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4dvARB)(GLuint, const GLdouble*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fvARB)(GLuint, const GLfloat*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4fvARB)(GLuint, const GLfloat*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ivARB)(GLuint, const GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ivARB)(GLuint, const GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4svARB)(GLuint, const GLshort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4svARB)(GLuint, const GLshort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ubvARB)(GLuint, const GLubyte*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4ubvARB)(GLuint, const GLubyte*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4uivARB)(GLuint, const GLuint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4uivARB)(GLuint, const GLuint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4usvARB)(GLuint, const GLushort*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttrib4usvARB)(GLuint, const GLushort*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const void*) = NULL; void (GL_FUNCPTR *sf_ptrc_glVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const void*) = nullptr;
static int Load_ARB_vertex_shader() static int Load_ARB_vertex_shader()
{ {
@ -695,7 +695,7 @@ static int Load_ARB_vertex_shader()
return numFailed; 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() static int Load_EXT_blend_equation_separate()
{ {
@ -708,23 +708,23 @@ static int Load_EXT_blend_equation_separate()
return numFailed; return numFailed;
} }
void (GL_FUNCPTR *sf_ptrc_glBindFramebufferEXT)(GLenum, GLuint) = NULL; void (GL_FUNCPTR *sf_ptrc_glBindFramebufferEXT)(GLenum, GLuint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glBindRenderbufferEXT)(GLenum, GLuint) = NULL; void (GL_FUNCPTR *sf_ptrc_glBindRenderbufferEXT)(GLenum, GLuint) = nullptr;
GLenum (GL_FUNCPTR *sf_ptrc_glCheckFramebufferStatusEXT)(GLenum) = NULL; GLenum (GL_FUNCPTR *sf_ptrc_glCheckFramebufferStatusEXT)(GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glDeleteFramebuffersEXT)(GLsizei, const GLuint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glDeleteFramebuffersEXT)(GLsizei, const GLuint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glDeleteRenderbuffersEXT)(GLsizei, const GLuint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glDeleteRenderbuffersEXT)(GLsizei, const GLuint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glFramebufferRenderbufferEXT)(GLenum, GLenum, GLenum, GLuint) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferRenderbufferEXT)(GLenum, GLenum, GLenum, GLuint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture1DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture1DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture2DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture2DEXT)(GLenum, GLenum, GLenum, GLuint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture3DEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferTexture3DEXT)(GLenum, GLenum, GLenum, GLuint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGenFramebuffersEXT)(GLsizei, GLuint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGenFramebuffersEXT)(GLsizei, GLuint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGenRenderbuffersEXT)(GLsizei, GLuint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGenRenderbuffersEXT)(GLsizei, GLuint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGenerateMipmapEXT)(GLenum) = NULL; void (GL_FUNCPTR *sf_ptrc_glGenerateMipmapEXT)(GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetFramebufferAttachmentParameterivEXT)(GLenum, GLenum, GLenum, GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetFramebufferAttachmentParameterivEXT)(GLenum, GLenum, GLenum, GLint*) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glGetRenderbufferParameterivEXT)(GLenum, GLenum, GLint*) = NULL; void (GL_FUNCPTR *sf_ptrc_glGetRenderbufferParameterivEXT)(GLenum, GLenum, GLint*) = nullptr;
GLboolean (GL_FUNCPTR *sf_ptrc_glIsFramebufferEXT)(GLuint) = NULL; GLboolean (GL_FUNCPTR *sf_ptrc_glIsFramebufferEXT)(GLuint) = nullptr;
GLboolean (GL_FUNCPTR *sf_ptrc_glIsRenderbufferEXT)(GLuint) = NULL; GLboolean (GL_FUNCPTR *sf_ptrc_glIsRenderbufferEXT)(GLuint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glRenderbufferStorageEXT)(GLenum, GLenum, GLsizei, GLsizei) = NULL; void (GL_FUNCPTR *sf_ptrc_glRenderbufferStorageEXT)(GLenum, GLenum, GLsizei, GLsizei) = nullptr;
static int Load_EXT_framebuffer_object() static int Load_EXT_framebuffer_object()
{ {
@ -801,7 +801,7 @@ static int Load_EXT_framebuffer_object()
return numFailed; 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() static int Load_EXT_framebuffer_blit()
{ {
@ -814,10 +814,10 @@ static int Load_EXT_framebuffer_blit()
return numFailed; return numFailed;
} }
void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureARB)(GLenum, GLenum, GLuint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureARB)(GLenum, GLenum, GLuint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureFaceARB)(GLenum, GLenum, GLuint, GLint, GLenum) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureFaceARB)(GLenum, GLenum, GLuint, GLint, GLenum) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureLayerARB)(GLenum, GLenum, GLuint, GLint, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glFramebufferTextureLayerARB)(GLenum, GLenum, GLuint, GLint, GLint) = nullptr;
void (GL_FUNCPTR *sf_ptrc_glProgramParameteriARB)(GLuint, GLenum, GLint) = NULL; void (GL_FUNCPTR *sf_ptrc_glProgramParameteriARB)(GLuint, GLenum, GLint) = nullptr;
static int Load_ARB_geometry_shader4() static int Load_ARB_geometry_shader4()
{ {
@ -851,19 +851,19 @@ typedef struct sfogl_StrToExtMap_s
} sfogl_StrToExtMap; } sfogl_StrToExtMap;
static sfogl_StrToExtMap ExtensionMap[16] = { static sfogl_StrToExtMap ExtensionMap[16] = {
{"GL_SGIS_texture_edge_clamp", &sfogl_ext_SGIS_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, NULL}, {"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_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_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_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_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_vertex_shader", &sfogl_ext_ARB_vertex_shader, Load_ARB_vertex_shader},
{"GL_ARB_fragment_shader", &sfogl_ext_ARB_fragment_shader, 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, NULL}, {"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_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_object", &sfogl_ext_EXT_framebuffer_object, Load_EXT_framebuffer_object},
{"GL_EXT_framebuffer_blit", &sfogl_ext_EXT_framebuffer_blit, Load_EXT_framebuffer_blit}, {"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} {"GL_ARB_geometry_shader4", &sfogl_ext_ARB_geometry_shader4, Load_ARB_geometry_shader4}

View file

@ -284,7 +284,7 @@ const Uint8* Image::getPixelsPtr() const
else else
{ {
err() << "Trying to access the pixels of an empty image" << std::endl; err() << "Trying to access the pixels of an empty image" << std::endl;
return NULL; return nullptr;
} }
} }

View file

@ -43,8 +43,8 @@ const RenderStates RenderStates::Default(BlendMode(
RenderStates::RenderStates() : RenderStates::RenderStates() :
blendMode(BlendAlpha), blendMode(BlendAlpha),
transform(), transform(),
texture (NULL), texture (nullptr),
shader (NULL) shader (nullptr)
{ {
} }
@ -53,8 +53,8 @@ shader (NULL)
RenderStates::RenderStates(const Transform& theTransform) : RenderStates::RenderStates(const Transform& theTransform) :
blendMode(BlendAlpha), blendMode(BlendAlpha),
transform(theTransform), transform(theTransform),
texture (NULL), texture (nullptr),
shader (NULL) shader (nullptr)
{ {
} }
@ -63,8 +63,8 @@ shader (NULL)
RenderStates::RenderStates(const BlendMode& theBlendMode) : RenderStates::RenderStates(const BlendMode& theBlendMode) :
blendMode(theBlendMode), blendMode(theBlendMode),
transform(), transform(),
texture (NULL), texture (nullptr),
shader (NULL) shader (nullptr)
{ {
} }
@ -74,7 +74,7 @@ RenderStates::RenderStates(const Texture* theTexture) :
blendMode(BlendAlpha), blendMode(BlendAlpha),
transform(), transform(),
texture (theTexture), texture (theTexture),
shader (NULL) shader (nullptr)
{ {
} }
@ -83,7 +83,7 @@ shader (NULL)
RenderStates::RenderStates(const Shader* theShader) : RenderStates::RenderStates(const Shader* theShader) :
blendMode(BlendAlpha), blendMode(BlendAlpha),
transform(), transform(),
texture (NULL), texture (nullptr),
shader (theShader) shader (theShader)
{ {
} }

View file

@ -102,7 +102,7 @@ void RenderTarget::clear(const Color& color)
if (setActive(true)) if (setActive(true))
{ {
// Unbind texture to fix RenderTexture preventing clear // 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(glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f));
glCheck(glClear(GL_COLOR_BUFFER_BIT)); glCheck(glClear(GL_COLOR_BUFFER_BIT));
@ -267,7 +267,7 @@ void RenderTarget::draw(const Vertex* vertices, std::size_t vertexCount,
if (!m_cache.useVertexCache) if (!m_cache.useVertexCache)
vertices = m_cache.vertexCache; vertices = m_cache.vertexCache;
else else
vertices = NULL; vertices = nullptr;
} }
// Setup the pointers to the vertices' components // 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 // Unbind the shader, if any
if (states.shader) if (states.shader)
applyShader(NULL); applyShader(nullptr);
// If the texture we used to draw belonged to a RenderTexture, then forcibly unbind that texture. // 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. // This prevents a bug where some drivers do not clear RenderTextures properly.
if (states.texture && states.texture->m_fboAttachment) if (states.texture && states.texture->m_fboAttachment)
applyTexture(NULL); applyTexture(nullptr);
// Update the cache // Update the cache
m_cache.useVertexCache = useVertexCache; m_cache.useVertexCache = useVertexCache;
@ -387,9 +387,9 @@ void RenderTarget::resetGLStates()
// Apply the default SFML states // Apply the default SFML states
applyBlendMode(BlendAlpha); applyBlendMode(BlendAlpha);
applyTransform(Transform::Identity); applyTransform(Transform::Identity);
applyTexture(NULL); applyTexture(nullptr);
if (shaderAvailable) if (shaderAvailable)
applyShader(NULL); applyShader(nullptr);
m_cache.useVertexCache = false; m_cache.useVertexCache = false;

View file

@ -228,11 +228,11 @@ bool Shader::loadFromFile(const std::string& filename, Type type)
// Compile the shader program // Compile the shader program
if (type == Vertex) if (type == Vertex)
return compile(shader.data(), NULL, NULL); return compile(shader.data(), nullptr, nullptr);
else if (type == Geometry) else if (type == Geometry)
return compile(NULL, shader.data(), NULL); return compile(nullptr, shader.data(), nullptr);
else 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 // 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 // Compile the shader program
if (type == Vertex) if (type == Vertex)
return compile(shader.c_str(), NULL, NULL); return compile(shader.c_str(), nullptr, nullptr);
else if (type == Geometry) else if (type == Geometry)
return compile(NULL, shader.c_str(), NULL); return compile(nullptr, shader.c_str(), nullptr);
else 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) bool Shader::loadFromMemory(const std::string& vertexShader, const std::string& fragmentShader)
{ {
// Compile the shader program // 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 // Compile the shader program
if (type == Vertex) if (type == Vertex)
return compile(shader.data(), NULL, NULL); return compile(shader.data(), nullptr, nullptr);
else if (type == Geometry) else if (type == Geometry)
return compile(NULL, shader.data(), NULL); return compile(nullptr, shader.data(), nullptr);
else 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 // 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 // Create and compile the shader
GLEXT_GLhandle vertexShader; GLEXT_GLhandle vertexShader;
glCheck(vertexShader = GLEXT_glCreateShaderObject(GLEXT_GL_VERTEX_SHADER)); 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)); glCheck(GLEXT_glCompileShader(vertexShader));
// Check the compile log // Check the compile log
@ -862,7 +862,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod
{ {
// Create and compile the shader // Create and compile the shader
GLEXT_GLhandle geometryShader = GLEXT_glCreateShaderObject(GLEXT_GL_GEOMETRY_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)); glCheck(GLEXT_glCompileShader(geometryShader));
// Check the compile log // Check the compile log
@ -890,7 +890,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* geometryShaderCod
// Create and compile the shader // Create and compile the shader
GLEXT_GLhandle fragmentShader; GLEXT_GLhandle fragmentShader;
glCheck(fragmentShader = GLEXT_glCreateShaderObject(GLEXT_GL_FRAGMENT_SHADER)); 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)); glCheck(GLEXT_glCompileShader(fragmentShader));
// Check the compile log // Check the compile log

View file

@ -158,7 +158,7 @@ FloatRect Shape::getGlobalBounds() const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shape::Shape() : Shape::Shape() :
m_texture (NULL), m_texture (nullptr),
m_textureRect (), m_textureRect (),
m_fillColor (255, 255, 255), m_fillColor (255, 255, 255),
m_outlineColor (255, 255, 255), m_outlineColor (255, 255, 255),
@ -221,7 +221,7 @@ void Shape::draw(RenderTarget& target, RenderStates states) const
// Render the outline // Render the outline
if (m_outlineThickness != 0) if (m_outlineThickness != 0)
{ {
states.texture = NULL; states.texture = nullptr;
target.draw(m_outlineVertices, states); target.draw(m_outlineVertices, states);
} }
} }

View file

@ -35,7 +35,7 @@ namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sprite::Sprite() : Sprite::Sprite() :
m_texture (NULL), m_texture (nullptr),
m_textureRect() m_textureRect()
{ {
} }
@ -43,7 +43,7 @@ m_textureRect()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sprite::Sprite(const Texture& texture) : Sprite::Sprite(const Texture& texture) :
m_texture (NULL), m_texture (nullptr),
m_textureRect() m_textureRect()
{ {
setTexture(texture); setTexture(texture);
@ -52,7 +52,7 @@ m_textureRect()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sprite::Sprite(const Texture& texture, const IntRect& rectangle) : Sprite::Sprite(const Texture& texture, const IntRect& rectangle) :
m_texture (NULL), m_texture (nullptr),
m_textureRect() m_textureRect()
{ {
setTexture(texture); setTexture(texture);

View file

@ -75,7 +75,7 @@ namespace sf
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Text::Text() : Text::Text() :
m_string (), m_string (),
m_font (NULL), m_font (nullptr),
m_characterSize (30), m_characterSize (30),
m_style (Regular), m_style (Regular),
m_fillColor (255, 255, 255), m_fillColor (255, 255, 255),

View file

@ -197,7 +197,7 @@ bool Texture::create(unsigned int width, unsigned int height)
// Initialize the texture // Initialize the texture
glCheck(glBindTexture(GL_TEXTURE_2D, m_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_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_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)); glCheck(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, m_isSmooth ? GL_LINEAR : GL_NEAREST));

View file

@ -60,11 +60,11 @@ int getAndroidApiLevel(ANativeActivity* activity)
JNIEnv* lJNIEnv = activity->env; JNIEnv* lJNIEnv = activity->env;
jclass versionClass = lJNIEnv->FindClass("android/os/Build$VERSION"); jclass versionClass = lJNIEnv->FindClass("android/os/Build$VERSION");
if (versionClass == NULL) if (versionClass == nullptr)
return 0; return 0;
jfieldID sdkIntFieldID = lJNIEnv->GetStaticFieldID(versionClass, "SDK_INT", "I"); jfieldID sdkIntFieldID = lJNIEnv->GetStaticFieldID(versionClass, "SDK_INT", "I");
if (sdkIntFieldID == NULL) if (sdkIntFieldID == nullptr)
return 0; return 0;
jint sdkInt = 0; jint sdkInt = 0;
@ -117,7 +117,7 @@ void* main(ActivityStates* states)
initializeMain(states); initializeMain(states);
sleep(seconds(0.5)); sleep(seconds(0.5));
::main(0, NULL); ::main(0, nullptr);
// Terminate properly the main thread and wait until it's done // Terminate properly the main thread and wait until it's done
terminateMain(states); terminateMain(states);
@ -128,7 +128,7 @@ void* main(ActivityStates* states)
states->terminated = true; states->terminated = true;
} }
return NULL; return nullptr;
} }
} // namespace priv } // namespace priv
@ -315,7 +315,7 @@ static void onDestroy(ANativeActivity* activity)
delete states; delete states;
// Reset the activity pointer for all modules // Reset the activity pointer for all modules
sf::priv::getActivity(NULL, true); sf::priv::getActivity(nullptr, true);
// The application should now terminate // The application should now terminate
} }
@ -353,7 +353,7 @@ static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* wi
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
// Update the activity states // Update the activity states
states->window = NULL; states->window = nullptr;
// Notify SFML mechanism // Notify SFML mechanism
sf::Event event; sf::Event event;
@ -393,7 +393,7 @@ static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue)
{ {
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
AInputQueue_attachLooper(queue, states->looper, 1, states->processEvent, NULL); AInputQueue_attachLooper(queue, states->looper, 1, states->processEvent, nullptr);
states->inputQueue = queue; states->inputQueue = queue;
} }
} }
@ -409,7 +409,7 @@ static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
{ {
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
states->inputQueue = NULL; states->inputQueue = nullptr;
AInputQueue_detachLooper(queue); AInputQueue_detachLooper(queue);
} }
} }
@ -429,7 +429,7 @@ static void onContentRectChanged(ANativeActivity* activity, const ARect* rect)
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
// Make sure the window still exists before we access the dimensions on it // 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 // Send an event to warn people about the window move/resize
sf::Event event; sf::Event event;
event.type = sf::Event::Resized; event.type = sf::Event::Resized;
@ -452,7 +452,7 @@ static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen)
{ {
*outLen = 0; *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) void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize)
{ {
// Create an activity states (will keep us in the know, about events we care) // 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; states = new sf::priv::ActivityStates;
// Initialize the states value // Initialize the states value
states->activity = NULL; states->activity = nullptr;
states->window = NULL; states->window = nullptr;
states->looper = NULL; states->looper = nullptr;
states->inputQueue = NULL; states->inputQueue = nullptr;
states->config = NULL; states->config = nullptr;
for (unsigned int i = 0; i < sf::Mouse::ButtonCount; i++) for (unsigned int i = 0; i < sf::Mouse::ButtonCount; i++)
states->isButtonPressed[i] = false; states->isButtonPressed[i] = false;
states->display = eglGetDisplay(EGL_DEFAULT_DISPLAY); states->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (savedState != NULL) if (savedState != nullptr)
{ {
states->savedState = malloc(savedStateSize); states->savedState = malloc(savedStateSize);
states->savedStateSize = savedStateSize; states->savedStateSize = savedStateSize;
@ -527,7 +527,7 @@ void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_
AWINDOW_FLAG_KEEP_SCREEN_ON); AWINDOW_FLAG_KEEP_SCREEN_ON);
// Initialize the display // Initialize the display
eglInitialize(states->display, NULL, NULL); eglInitialize(states->display, nullptr, nullptr);
getScreenSizeInPixels(activity, &states->screenSize.x, &states->screenSize.y); getScreenSizeInPixels(activity, &states->screenSize.x, &states->screenSize.y);

View file

@ -59,7 +59,7 @@ const char *getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
jstring valueString = (jstring)lJNIEnv->CallObjectMethod(objectMetaData, methodGetString, objectName); jstring valueString = (jstring)lJNIEnv->CallObjectMethod(objectMetaData, methodGetString, objectName);
// No meta-data "sfml.app.lib_name" was found so we abort and inform the user // 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"); LOGE("No meta-data 'sfml.app.lib_name' found in AndroidManifest.xml file");
exit(1); exit(1);
@ -67,7 +67,7 @@ const char *getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
// Convert the application name to a C++ string and return it // Convert the application name to a C++ string and return it
const jsize applicationNameLength = lJNIEnv->GetStringUTFLength(valueString); const jsize applicationNameLength = lJNIEnv->GetStringUTFLength(valueString);
const char* applicationName = lJNIEnv->GetStringUTFChars(valueString, NULL); const char* applicationName = lJNIEnv->GetStringUTFChars(valueString, nullptr);
if (applicationNameLength >= 256) if (applicationNameLength >= 256)
{ {
@ -107,7 +107,7 @@ void* loadLibrary(const char* libraryName, JNIEnv* lJNIEnv, jobject& ObjectActiv
// Get the library absolute path and convert it // Get the library absolute path and convert it
jmethodID MethodGetPath = lJNIEnv->GetMethodID(ClassFile, "getPath", "()Ljava/lang/String;"); jmethodID MethodGetPath = lJNIEnv->GetMethodID(ClassFile, "getPath", "()Ljava/lang/String;");
jstring javaLibraryPath = static_cast<jstring>(lJNIEnv->CallObjectMethod(ObjectFile, MethodGetPath)); jstring javaLibraryPath = static_cast<jstring>(lJNIEnv->CallObjectMethod(ObjectFile, MethodGetPath));
const char* libraryPath = lJNIEnv->GetStringUTFChars(javaLibraryPath, NULL); const char* libraryPath = lJNIEnv->GetStringUTFChars(javaLibraryPath, nullptr);
// Manually load the library // Manually load the library
void * handle = dlopen(libraryPath, RTLD_NOW | RTLD_GLOBAL); void * handle = dlopen(libraryPath, RTLD_NOW | RTLD_GLOBAL);

View file

@ -193,8 +193,8 @@ void IpAddress::resolve(const std::string& address)
addrinfo hints; addrinfo hints;
std::memset(&hints, 0, sizeof(hints)); std::memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
addrinfo* result = NULL; addrinfo* result = nullptr;
if (getaddrinfo(address.c_str(), NULL, &hints, &result) == 0) if (getaddrinfo(address.c_str(), nullptr, &hints, &result) == 0)
{ {
if (result) if (result)
{ {

View file

@ -75,7 +75,7 @@ void Packet::clear()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const void* Packet::getData() const 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 Packet::operator BoolType() const
{ {
return m_isValid ? &Packet::checkSize : NULL; return m_isValid ? &Packet::checkSize : nullptr;
} }

View file

@ -162,7 +162,7 @@ bool SocketSelector::wait(Time timeout)
// Wait until one of the sockets is ready for reading, or timeout is reached // Wait until one of the sockets is ready for reading, or timeout is reached
// The first parameter is ignored on Windows // 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; return count > 0;
} }

View file

@ -175,7 +175,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short
time.tv_usec = static_cast<long>(timeout.asMicroseconds() % 1000000); time.tv_usec = static_cast<long>(timeout.asMicroseconds() % 1000000);
// Wait for something to write on our socket (which means that the connection request has returned) // Wait for something to write on our socket (which means that the connection request has returned)
if (select(static_cast<int>(getHandle() + 1), NULL, &selector, NULL, &time) > 0) if (select(static_cast<int>(getHandle() + 1), nullptr, &selector, nullptr, &time) > 0)
{ {
// At this point the connection may have been either accepted or refused. // 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 // To know whether it's a success or a failure, we must check the address of the connected peer

View file

@ -58,7 +58,7 @@ namespace priv
{ {
ActivityStates* getActivity(ActivityStates* initializedStates, bool reset) ActivityStates* getActivity(ActivityStates* initializedStates, bool reset)
{ {
static ActivityStates* states = NULL; static ActivityStates* states = nullptr;
if (!states || reset) if (!states || reset)
states = initializedStates; states = initializedStates;

View file

@ -92,7 +92,7 @@ struct ActivityStates
LogcatStream logcat; 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 priv
} // namespace sf } // namespace sf

View file

@ -38,9 +38,9 @@ namespace priv
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
ResourceStream::ResourceStream(const std::string& filename) : ResourceStream::ResourceStream(const std::string& filename) :
m_file (NULL) m_file (nullptr)
{ {
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
m_file = AAssetManager_open(states->activity->assetManager, filename.c_str(), AASSET_MODE_UNKNOWN); m_file = AAssetManager_open(states->activity->assetManager, filename.c_str(), AASSET_MODE_UNKNOWN);
} }

View file

@ -35,7 +35,7 @@ namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
FileInputStream::FileInputStream() 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"); m_file = std::fopen(filename.c_str(), "rb");
return m_file != NULL; return m_file != nullptr;
#endif #endif
} }

View file

@ -33,7 +33,7 @@ namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
MemoryInputStream::MemoryInputStream() : MemoryInputStream::MemoryInputStream() :
m_data (NULL), m_data (nullptr),
m_size (0), m_size (0),
m_offset(0) m_offset(0)
{ {

View file

@ -48,7 +48,7 @@ void InputImpl::setVirtualKeyboardVisible(bool visible)
{ {
// todo: Check if the window is active // todo: Check if the window is active
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
// Initializes JNI // Initializes JNI
@ -61,7 +61,7 @@ void InputImpl::setVirtualKeyboardVisible(bool visible)
JavaVMAttachArgs lJavaVMAttachArgs; JavaVMAttachArgs lJavaVMAttachArgs;
lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.version = JNI_VERSION_1_6;
lJavaVMAttachArgs.name = "NativeThread"; lJavaVMAttachArgs.name = "NativeThread";
lJavaVMAttachArgs.group = NULL; lJavaVMAttachArgs.group = nullptr;
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs); lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
@ -136,9 +136,9 @@ void InputImpl::setVirtualKeyboardVisible(bool visible)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool InputImpl::isMouseButtonPressed(Mouse::Button button) 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<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return states->isButtonPressed[button]; return states->isButtonPressed[button];
@ -148,9 +148,9 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Vector2i InputImpl::getMousePosition() 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<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return states->mousePosition; return states->mousePosition;
@ -181,9 +181,9 @@ void InputImpl::setMousePosition(const Vector2i& position, const Window& relativ
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool InputImpl::isTouchDown(unsigned int finger) 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<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return states->touchEvents.find(finger) != states->touchEvents.end(); return states->touchEvents.find(finger) != states->touchEvents.end();
@ -193,9 +193,9 @@ bool InputImpl::isTouchDown(unsigned int finger)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Vector2i InputImpl::getTouchPosition(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<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return states->touchEvents.find(finger)->second; return states->touchEvents.find(finger)->second;

View file

@ -58,7 +58,7 @@ void SensorImpl::initialize()
// Create the sensor events queue and attach it to the looper // Create the sensor events queue and attach it to the looper
sensorEventQueue = ASensorManager_createEventQueue(sensorManager, looper, sensorEventQueue = ASensorManager_createEventQueue(sensorManager, looper,
1, &processSensorEvents, NULL); 1, &processSensorEvents, nullptr);
} }
@ -113,7 +113,7 @@ void SensorImpl::close()
Vector3f SensorImpl::update() Vector3f SensorImpl::update()
{ {
// Update our sensor data list // Update our sensor data list
ALooper_pollAll(0, NULL, NULL, NULL); ALooper_pollAll(0, nullptr, nullptr, nullptr);
return sensorData[m_index]; return sensorData[m_index];
} }

View file

@ -105,7 +105,7 @@ private:
/// ///
/// \param type Type of the sensor /// \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); static ASensor const* getDefaultSensor(Sensor::Type sensor);

View file

@ -52,7 +52,7 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
VideoMode VideoModeImpl::getDesktopMode() VideoMode VideoModeImpl::getDesktopMode()
{ {
// Get the activity states // Get the activity states
priv::ActivityStates* states = priv::getActivity(NULL); priv::ActivityStates* states = priv::getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return VideoMode(states->screenSize.x, states->screenSize.y); return VideoMode(states->screenSize.x, states->screenSize.y);

View file

@ -46,7 +46,7 @@ namespace sf
{ {
namespace priv namespace priv
{ {
WindowImplAndroid* WindowImplAndroid::singleInstance = NULL; WindowImplAndroid* WindowImplAndroid::singleInstance = nullptr;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WindowImplAndroid::WindowImplAndroid(WindowHandle handle) WindowImplAndroid::WindowImplAndroid(WindowHandle handle)
@ -65,7 +65,7 @@ WindowImplAndroid::WindowImplAndroid(VideoMode mode, const String& title, unsign
, m_windowBeingDestroyed(false) , m_windowBeingDestroyed(false)
, m_hasFocus(false) , m_hasFocus(false)
{ {
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
if (style& Style::Fullscreen) if (style& Style::Fullscreen)
@ -90,7 +90,7 @@ WindowImplAndroid::~WindowImplAndroid()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WindowHandle WindowImplAndroid::getSystemHandle() const WindowHandle WindowImplAndroid::getSystemHandle() const
{ {
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return states->window; return states->window;
@ -101,9 +101,9 @@ WindowHandle WindowImplAndroid::getSystemHandle() const
void WindowImplAndroid::processEvents() void WindowImplAndroid::processEvents()
{ {
// Process incoming OS events // 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<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
if (m_windowBeingCreated) if (m_windowBeingCreated)
@ -209,7 +209,7 @@ bool WindowImplAndroid::hasFocus() const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void WindowImplAndroid::forwardEvent(const Event& event) void WindowImplAndroid::forwardEvent(const Event& event)
{ {
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
if (event.type == Event::GainedFocus) if (event.type == Event::GainedFocus)
{ {
@ -231,10 +231,10 @@ void WindowImplAndroid::forwardEvent(const Event& event)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int WindowImplAndroid::processEvent(int fd, int events, void* data) int WindowImplAndroid::processEvent(int fd, int events, void* data)
{ {
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
AInputEvent* _event = NULL; AInputEvent* _event = nullptr;
if (AInputQueue_getEvent(states->inputQueue, &_event) >= 0) if (AInputQueue_getEvent(states->inputQueue, &_event) >= 0)
{ {
@ -315,7 +315,7 @@ int WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* s
JavaVMAttachArgs lJavaVMAttachArgs; JavaVMAttachArgs lJavaVMAttachArgs;
lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.version = JNI_VERSION_1_6;
lJavaVMAttachArgs.name = "NativeThread"; lJavaVMAttachArgs.name = "NativeThread";
lJavaVMAttachArgs.group = NULL; lJavaVMAttachArgs.group = nullptr;
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs); lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
@ -665,7 +665,7 @@ Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key)
int WindowImplAndroid::getUnicode(AInputEvent* event) int WindowImplAndroid::getUnicode(AInputEvent* event)
{ {
// Retrieve activity states // Retrieve activity states
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
// Initializes JNI // Initializes JNI
@ -678,7 +678,7 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
JavaVMAttachArgs lJavaVMAttachArgs; JavaVMAttachArgs lJavaVMAttachArgs;
lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.version = JNI_VERSION_1_6;
lJavaVMAttachArgs.name = "NativeThread"; lJavaVMAttachArgs.name = "NativeThread";
lJavaVMAttachArgs.group = NULL; lJavaVMAttachArgs.group = nullptr;
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs); lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);

View file

@ -58,7 +58,7 @@ bool Context::setActive(bool active)
bool result = m_context->setActive(active); bool result = m_context->setActive(active);
if (result) if (result)
currentContext = (active ? this : NULL); currentContext = (active ? this : nullptr);
return result; return result;
} }

View file

@ -50,7 +50,7 @@ namespace
if (display == EGL_NO_DISPLAY) if (display == EGL_NO_DISPLAY)
{ {
display = eglCheck(eglGetDisplay(EGL_DEFAULT_DISPLAY)); display = eglCheck(eglGetDisplay(EGL_DEFAULT_DISPLAY));
eglCheck(eglInitialize(display, NULL, NULL)); eglCheck(eglInitialize(display, nullptr, nullptr));
} }
return display; return display;
@ -58,7 +58,7 @@ namespace
#elif defined(SFML_SYSTEM_ANDROID) #elif defined(SFML_SYSTEM_ANDROID)
// On Android, its native activity handles this for us // 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<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
return states->display; return states->display;
@ -77,7 +77,7 @@ EglContext::EglContext(EglContext* shared) :
m_display (EGL_NO_DISPLAY), m_display (EGL_NO_DISPLAY),
m_context (EGL_NO_CONTEXT), m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE), m_surface (EGL_NO_SURFACE),
m_config (NULL) m_config (nullptr)
{ {
// Get the initialized EGL display // Get the initialized EGL display
m_display = getInitializedDisplay(); m_display = getInitializedDisplay();
@ -86,7 +86,7 @@ m_config (NULL)
m_config = getBestConfig(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings()); m_config = getBestConfig(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
updateSettings(); 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? // but this is resulting in a segfault. Bug in Android?
EGLint attrib_list[] = { EGLint attrib_list[] = {
EGL_WIDTH, 1, EGL_WIDTH, 1,
@ -106,12 +106,12 @@ EglContext::EglContext(EglContext* shared, const ContextSettings& settings, cons
m_display (EGL_NO_DISPLAY), m_display (EGL_NO_DISPLAY),
m_context (EGL_NO_CONTEXT), m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE), m_surface (EGL_NO_SURFACE),
m_config (NULL) m_config (nullptr)
{ {
#ifdef SFML_SYSTEM_ANDROID #ifdef SFML_SYSTEM_ANDROID
// On Android, we must save the created context // On Android, we must save the created context
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(nullptr);
std::lock_guard<std::mutex> lock(states->mutex); std::lock_guard<std::mutex> lock(states->mutex);
states->context = this; states->context = this;
@ -141,7 +141,7 @@ EglContext::EglContext(EglContext* shared, const ContextSettings& settings, unsi
m_display (EGL_NO_DISPLAY), m_display (EGL_NO_DISPLAY),
m_context (EGL_NO_CONTEXT), m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE), 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) 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));
} }

View file

@ -46,7 +46,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new context, not associated to a window /// \brief Create a new context, not associated to a window
/// ///
/// \param shared Context to share the new one with (can be NULL) /// \param shared Context to share the new one with (can be nullptr)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
EglContext(EglContext* shared); EglContext(EglContext* shared);
@ -112,7 +112,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the context /// \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 bitsPerPixel Pixel depth, in bits per pixel
/// \param settings Creation parameters /// \param settings Creation parameters
/// ///

View file

@ -163,7 +163,7 @@ namespace priv
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void JoystickImpl::initialize() void JoystickImpl::initialize()
{ {
hid_init(NULL); hid_init(nullptr);
// Do an initial scan // Do an initial scan
updatePluggedList(); updatePluggedList();

View file

@ -246,7 +246,7 @@ void GlContext::initResource()
else else
{ {
// Try to load the >= 3.0 way // Try to load the >= 3.0 way
glGetStringiFuncType glGetStringiFunc = NULL; glGetStringiFuncType glGetStringiFunc = nullptr;
glGetStringiFunc = reinterpret_cast<glGetStringiFuncType>(getFunction("glGetStringi")); glGetStringiFunc = reinterpret_cast<glGetStringiFuncType>(getFunction("glGetStringi"));
if (glGetStringiFunc) if (glGetStringiFunc)
@ -332,7 +332,7 @@ void GlContext::releaseTransientContext()
std::unique_ptr<GlContext> GlContext::create() std::unique_ptr<GlContext> GlContext::create()
{ {
// Make sure that there's an active context (context creation may need extensions, and thus a valid context) // 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<std::recursive_mutex> lock(mutex); std::lock_guard<std::recursive_mutex> lock(mutex);
@ -360,7 +360,7 @@ std::unique_ptr<GlContext> GlContext::create()
std::unique_ptr<GlContext> GlContext::create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) std::unique_ptr<GlContext> 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) // 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<std::recursive_mutex> lock(mutex); std::lock_guard<std::recursive_mutex> lock(mutex);
@ -389,7 +389,7 @@ std::unique_ptr<GlContext> GlContext::create(const ContextSettings& settings, co
std::unique_ptr<GlContext> GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height) std::unique_ptr<GlContext> 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) // 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<std::recursive_mutex> lock(mutex); std::lock_guard<std::recursive_mutex> lock(mutex);
@ -445,7 +445,7 @@ GlContext::~GlContext()
if (sharedContext) if (sharedContext)
{ {
if (this == currentContext) if (this == currentContext)
currentContext = NULL; currentContext = nullptr;
} }
} }
@ -493,7 +493,7 @@ bool GlContext::setActive(bool active)
// Deactivate the context // Deactivate the context
if (makeCurrent(false)) if (makeCurrent(false))
{ {
currentContext = NULL; currentContext = nullptr;
return true; return true;
} }
else else

View file

@ -85,7 +85,7 @@ static void createNewPool(void)
void ensureThreadHasPool(void) void ensureThreadHasPool(void)
{ {
pthread_once(&initOnceToken, createPoolKey); pthread_once(&initOnceToken, createPoolKey);
if (pthread_getspecific(poolKey) == NULL) if (pthread_getspecific(poolKey) == nullptr)
{ {
createNewPool(); createNewPool();
} }
@ -96,7 +96,7 @@ void ensureThreadHasPool(void)
void drainThreadPool(void) void drainThreadPool(void)
{ {
void* data = pthread_getspecific(poolKey); void* data = pthread_getspecific(poolKey);
assert(data != NULL); assert(data != nullptr);
// Drain the pool but keep it alive by creating a new one // Drain the pool but keep it alive by creating a new one
destroyPool(data); destroyPool(data);

View file

@ -178,7 +178,7 @@ private:
/// ///
/// \param page HID page like kHIDPage_GenericDesktop /// \param page HID page like kHIDPage_GenericDesktop
/// \param usage HID usage page like kHIDUsage_GD_Keyboard or kHIDUsage_GD_Mouse /// \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); CFSetRef copyDevices(UInt32 page, UInt32 usage);

View file

@ -150,7 +150,7 @@ void HIDInputManager::initializeKeyboard()
// Get only keyboards // Get only keyboards
CFSetRef keyboards = copyDevices(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard); CFSetRef keyboards = copyDevices(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard);
if (keyboards == NULL) if (keyboards == nullptr)
{ {
freeUp(); freeUp();
return; return;
@ -180,9 +180,9 @@ void HIDInputManager::initializeKeyboard()
void HIDInputManager::loadKeyboard(IOHIDDeviceRef keyboard) void HIDInputManager::loadKeyboard(IOHIDDeviceRef keyboard)
{ {
CFArrayRef keys = IOHIDDeviceCopyMatchingElements(keyboard, CFArrayRef keys = IOHIDDeviceCopyMatchingElements(keyboard,
NULL, nullptr,
kIOHIDOptionsTypeNone); kIOHIDOptionsTypeNone);
if (keys == NULL) if (keys == nullptr)
{ {
sf::err() << "We got a keyboard without any keys (1)" << std::endl; sf::err() << "We got a keyboard without any keys (1)" << std::endl;
return; return;
@ -339,15 +339,15 @@ CFSetRef HIDInputManager::copyDevices(UInt32 page, UInt32 usage)
mask = 0; mask = 0;
CFSetRef devices = IOHIDManagerCopyDevices(m_manager); CFSetRef devices = IOHIDManagerCopyDevices(m_manager);
if (devices == NULL) if (devices == nullptr)
return NULL; return nullptr;
// Is there at least one device? // Is there at least one device?
CFIndex deviceCount = CFSetGetCount(devices); CFIndex deviceCount = CFSetGetCount(devices);
if (deviceCount < 1) if (deviceCount < 1)
{ {
CFRelease(devices); CFRelease(devices);
return NULL; return nullptr;
} }
return devices; return devices;

View file

@ -85,7 +85,7 @@ m_joystickCount(0)
maskArray[0] = mask0; maskArray[0] = mask0;
maskArray[1] = mask1; 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); IOHIDManagerSetDeviceMatchingMultiple(m_manager, mask);
CFRelease(mask); CFRelease(mask);
@ -111,8 +111,8 @@ HIDJoystickManager::~HIDJoystickManager()
CFRunLoopGetCurrent(), CFRunLoopGetCurrent(),
RunLoopMode); RunLoopMode);
IOHIDManagerRegisterDeviceMatchingCallback(m_manager, NULL, 0); IOHIDManagerRegisterDeviceMatchingCallback(m_manager, nullptr, 0);
IOHIDManagerRegisterDeviceRemovalCallback(m_manager, NULL, 0); IOHIDManagerRegisterDeviceRemovalCallback(m_manager, nullptr, 0);
IOHIDManagerClose(m_manager, kIOHIDOptionsTypeNone); IOHIDManagerClose(m_manager, kIOHIDOptionsTypeNone);
} }

View file

@ -69,7 +69,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Copy the devices associated with this HID manager /// \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(); CFSetRef copyJoysticks();

View file

@ -182,7 +182,7 @@ void InputImpl::setMousePosition(const Vector2i& position)
CGPoint pos = CGPointMake(position.x / scale, position.y / scale); CGPoint pos = CGPointMake(position.x / scale, position.y / scale);
// Place the cursor. // Place the cursor.
CGEventRef event = CGEventCreateMouseEvent(NULL, CGEventRef event = CGEventCreateMouseEvent(nullptr,
kCGEventMouseMoved, kCGEventMouseMoved,
pos, pos,
/* we don't care about this: */ kCGMouseButtonLeft); /* we don't care about this: */ kCGMouseButtonLeft);

View file

@ -136,7 +136,7 @@ bool JoystickImpl::isConnected(unsigned int index)
// Get all devices // Get all devices
CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks(); CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks();
if (devices != NULL) if (devices != nullptr)
{ {
CFIndex size = CFSetGetCount(devices); CFIndex size = CFSetGetCount(devices);
if (size > 0) if (size > 0)
@ -189,7 +189,7 @@ bool JoystickImpl::open(unsigned int index)
// Get all devices // Get all devices
CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks(); CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks();
if (devices == NULL) if (devices == nullptr)
return false; return false;
// Get a usable copy of the joysticks devices. // 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); m_identification.productId = getDeviceUint(self, CFSTR(kIOHIDProductIDKey), m_index);
// Get a list of all elements attached to the device. // 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); CFRelease(devices);
return false; return false;
@ -350,7 +350,7 @@ JoystickState JoystickImpl::update()
// Get all devices // Get all devices
CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks(); CFSetRef devices = HIDJoystickManager::getInstance().copyJoysticks();
if (devices == NULL) if (devices == nullptr)
return disconnectedState; return disconnectedState;
// Get a usable copy of the joysticks devices. // Get a usable copy of the joysticks devices.

View file

@ -68,7 +68,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new context, not associated to a window /// \brief Create a new context, not associated to a window
/// ///
/// \param shared Context to share the new one with (can be NULL) /// \param shared Context to share the new one with (can be nullptr)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFContext(SFContext* shared); SFContext(SFContext* shared);
@ -149,7 +149,7 @@ private:
/// \brief Create the context /// \brief Create the context
/// \note Must only be called from Ctor. /// \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 bitsPerPixel bpp
/// \param settings Creation parameters /// \param settings Creation parameters
/// ///

View file

@ -118,7 +118,7 @@ SFContext::~SFContext()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
GlFunctionPointer SFContext::getFunction(const char* name) GlFunctionPointer SFContext::getFunction(const char* name)
{ {
static void* image = NULL; static void* image = nullptr;
if (!image) if (!image)
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); 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. // 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) if (sharedContext != nil)
{ {

View file

@ -42,9 +42,9 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
std::vector<VideoMode> modes; std::vector<VideoMode> modes;
// Retrieve all modes available for main screen only. // 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; sf::err() << "Couldn't get VideoMode for main display." << std::endl;
return modes; return modes;

View file

@ -37,7 +37,7 @@
namespace namespace
{ {
// The shared display and its reference counter // The shared display and its reference counter
Display* sharedDisplay = NULL; Display* sharedDisplay = nullptr;
unsigned int referenceCount = 0; unsigned int referenceCount = 0;
std::mutex mutex; std::mutex mutex;
@ -56,7 +56,7 @@ Display* OpenDisplay()
if (referenceCount == 0) 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 // Opening display failed: The best we can do at the moment is to output a meaningful error message
// and cause an abnormal program termination // and cause an abnormal program termination

View file

@ -95,9 +95,9 @@ void ensureExtensionsInit(::Display* display, int screen)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
GlxContext::GlxContext(GlxContext* shared) : GlxContext::GlxContext(GlxContext* shared) :
m_display (NULL), m_display (nullptr),
m_window (0), m_window (0),
m_context (NULL), m_context (nullptr),
m_pbuffer (0), m_pbuffer (0),
m_ownsWindow(false) m_ownsWindow(false)
{ {
@ -120,9 +120,9 @@ m_ownsWindow(false)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) : GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
m_display (NULL), m_display (nullptr),
m_window (0), m_window (0),
m_context (NULL), m_context (nullptr),
m_pbuffer (0), m_pbuffer (0),
m_ownsWindow(false) m_ownsWindow(false)
{ {
@ -145,9 +145,9 @@ m_ownsWindow(false)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) : GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
m_display (NULL), m_display (nullptr),
m_window (0), m_window (0),
m_context (NULL), m_context (nullptr),
m_pbuffer (0), m_pbuffer (0),
m_ownsWindow(false) m_ownsWindow(false)
{ {
@ -179,7 +179,7 @@ GlxContext::~GlxContext()
#endif #endif
if (glXGetCurrentContext() == m_context) if (glXGetCurrentContext() == m_context)
glXMakeCurrent(m_display, None, NULL); glXMakeCurrent(m_display, None, nullptr);
glXDestroyContext(m_display, m_context); glXDestroyContext(m_display, m_context);
#if defined(GLX_DEBUGGING) #if defined(GLX_DEBUGGING)
@ -237,7 +237,7 @@ bool GlxContext::makeCurrent(bool current)
} }
else else
{ {
result = glXMakeCurrent(m_display, None, NULL); result = glXMakeCurrent(m_display, None, nullptr);
} }
#if defined(GLX_DEBUGGING) #if defined(GLX_DEBUGGING)
@ -314,7 +314,7 @@ XVisualInfo GlxContext::selectBestVisual(::Display* display, unsigned int bitsPe
// Retrieve all the visuals // Retrieve all the visuals
int count; int count;
XVisualInfo* visuals = XGetVisualInfo(display, 0, NULL, &count); XVisualInfo* visuals = XGetVisualInfo(display, 0, nullptr, &count);
if (visuals) if (visuals)
{ {
// Evaluate all the returned visuals, and pick the best one // 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) if (hasCreatePbuffer)
{ {
// Get a GLXFBConfig that matches the visual // Get a GLXFBConfig that matches the visual
GLXFBConfig* config = NULL; GLXFBConfig* config = nullptr;
// We don't supply attributes to match against, since // We don't supply attributes to match against, since
// the visual we are matching against was already // the visual we are matching against was already
// deemed suitable in selectBestVisual() // deemed suitable in selectBestVisual()
int nbConfigs = 0; 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) 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 // Get a working copy of the context settings
ContextSettings settings = m_settings; ContextSettings settings = m_settings;
XVisualInfo* visualInfo = NULL; XVisualInfo* visualInfo = nullptr;
if (m_pbuffer) if (m_pbuffer)
{ {
@ -606,7 +606,7 @@ void GlxContext::createContext(GlxContext* shared)
} }
// Get the context to share display lists with // 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 // There are no GLX versions prior to 1.0
int major = 0; int major = 0;
@ -622,13 +622,13 @@ void GlxContext::createContext(GlxContext* shared)
if (hasCreateContextArb) if (hasCreateContextArb)
{ {
// Get a GLXFBConfig that matches the window's visual, for glXCreateContextAttribsARB // 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 // We don't supply attributes to match against, since
// the visual we are matching against was already // the visual we are matching against was already
// deemed suitable in selectBestVisual() // deemed suitable in selectBestVisual()
int nbConfigs = 0; 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) for (int i = 0; configs && (i < nbConfigs); ++i)
{ {
@ -693,7 +693,7 @@ void GlxContext::createContext(GlxContext* shared)
if (toShare) if (toShare)
{ {
if (!glXMakeCurrent(m_display, None, NULL)) if (!glXMakeCurrent(m_display, None, nullptr))
{ {
err() << "Failed to deactivate shared context before sharing" << std::endl; err() << "Failed to deactivate shared context before sharing" << std::endl;
return; return;
@ -748,7 +748,7 @@ void GlxContext::createContext(GlxContext* shared)
if (toShare) if (toShare)
{ {
if (!glXMakeCurrent(m_display, None, NULL)) if (!glXMakeCurrent(m_display, None, nullptr))
{ {
err() << "Failed to deactivate shared context before sharing" << std::endl; err() << "Failed to deactivate shared context before sharing" << std::endl;
return; return;

View file

@ -48,7 +48,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new default context /// \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); GlxContext(GlxContext* shared);
@ -151,7 +151,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the context's drawing surface /// \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 width Back buffer width, in pixels
/// \param height Back buffer height, in pixels /// \param height Back buffer height, in pixels
/// \param bitsPerPixel Pixel depth, in bits per pixel /// \param bitsPerPixel Pixel depth, in bits per pixel
@ -170,7 +170,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the context /// \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); void createContext(GlxContext* shared);

View file

@ -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 = sfglx_LOAD_FAILED;
int sfglx_ext_ARB_create_context_profile = 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) static int Load_EXT_swap_control(void)
{ {
@ -58,7 +58,7 @@ static int Load_EXT_swap_control(void)
return numFailed; 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) static int Load_MESA_swap_control(void)
{ {
@ -69,7 +69,7 @@ static int Load_MESA_swap_control(void)
return numFailed; 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) static int Load_SGI_swap_control(void)
{ {
@ -80,11 +80,11 @@ static int Load_SGI_swap_control(void)
return numFailed; return numFailed;
} }
GLXPbufferSGIX (CODEGEN_FUNCPTR *sf_ptrc_glXCreateGLXPbufferSGIX)(Display*, GLXFBConfigSGIX, unsigned int, unsigned int, int*) = NULL; GLXPbufferSGIX (CODEGEN_FUNCPTR *sf_ptrc_glXCreateGLXPbufferSGIX)(Display*, GLXFBConfigSGIX, unsigned int, unsigned int, int*) = nullptr;
void (CODEGEN_FUNCPTR *sf_ptrc_glXDestroyGLXPbufferSGIX)(Display*, GLXPbufferSGIX) = NULL; void (CODEGEN_FUNCPTR *sf_ptrc_glXDestroyGLXPbufferSGIX)(Display*, GLXPbufferSGIX) = nullptr;
void (CODEGEN_FUNCPTR *sf_ptrc_glXGetSelectedEventSGIX)(Display*, GLXDrawable, unsigned long*) = NULL; void (CODEGEN_FUNCPTR *sf_ptrc_glXGetSelectedEventSGIX)(Display*, GLXDrawable, unsigned long*) = nullptr;
int (CODEGEN_FUNCPTR *sf_ptrc_glXQueryGLXPbufferSGIX)(Display*, GLXPbufferSGIX, int, unsigned int*) = NULL; int (CODEGEN_FUNCPTR *sf_ptrc_glXQueryGLXPbufferSGIX)(Display*, GLXPbufferSGIX, int, unsigned int*) = nullptr;
void (CODEGEN_FUNCPTR *sf_ptrc_glXSelectEventSGIX)(Display*, GLXDrawable, unsigned long) = NULL; void (CODEGEN_FUNCPTR *sf_ptrc_glXSelectEventSGIX)(Display*, GLXDrawable, unsigned long) = nullptr;
static int Load_SGIX_pbuffer(void) static int Load_SGIX_pbuffer(void)
{ {
@ -107,7 +107,7 @@ static int Load_SGIX_pbuffer(void)
return numFailed; 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) 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_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_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_SGI_swap_control", &sfglx_ext_SGI_swap_control, Load_SGI_swap_control},
{"GLX_EXT_framebuffer_sRGB", &sfglx_ext_EXT_framebuffer_sRGB, NULL}, {"GLX_EXT_framebuffer_sRGB", &sfglx_ext_EXT_framebuffer_sRGB, nullptr},
{"GLX_ARB_framebuffer_sRGB", &sfglx_ext_ARB_framebuffer_sRGB, NULL}, {"GLX_ARB_framebuffer_sRGB", &sfglx_ext_ARB_framebuffer_sRGB, nullptr},
{"GLX_ARB_multisample", &sfglx_ext_ARB_multisample, NULL}, {"GLX_ARB_multisample", &sfglx_ext_ARB_multisample, nullptr},
{"GLX_SGIX_pbuffer", &sfglx_ext_SGIX_pbuffer, Load_SGIX_pbuffer}, {"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", &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; static int g_extensionMapSize = 9;
@ -150,7 +150,7 @@ static sfglx_StrToExtMap* FindExtEntry(const char* extensionName)
return currLoc; return currLoc;
} }
return NULL; return nullptr;
} }
@ -170,7 +170,7 @@ static void ClearExtensionVars(void)
static void LoadExtByName(const char* extensionName) static void LoadExtByName(const char* extensionName)
{ {
sfglx_StrToExtMap* entry = NULL; sfglx_StrToExtMap* entry = nullptr;
entry = FindExtEntry(extensionName); entry = FindExtEntry(extensionName);
if (entry) if (entry)
{ {

View file

@ -112,7 +112,7 @@ namespace
return true; return true;
} }
void updatePluggedList(udev_device* udevDevice = NULL) void updatePluggedList(udev_device* udevDevice = nullptr)
{ {
if (udevDevice) if (udevDevice)
{ {
@ -258,7 +258,7 @@ namespace
FD_SET(monitorFd, &descriptorSet); FD_SET(monitorFd, &descriptorSet);
timeval timeout = {0, 0}; 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); FD_ISSET(monitorFd, &descriptorSet);
} }
@ -274,7 +274,7 @@ namespace
udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(udevDevice, "usb", "usb_device"); udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(udevDevice, "usb", "usb_device");
if (!udevDeviceParent) if (!udevDeviceParent)
return NULL; return nullptr;
return udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str()); return udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str());
} }
@ -289,7 +289,7 @@ namespace
unsigned int value = 0; unsigned int value = 0;
if (attribute) if (attribute)
value = static_cast<unsigned int>(std::strtoul(attribute, NULL, 16)); value = static_cast<unsigned int>(std::strtoul(attribute, nullptr, 16));
return value; return value;
} }
@ -304,7 +304,7 @@ namespace
unsigned int value = 0; unsigned int value = 0;
if (attribute) if (attribute)
value = static_cast<unsigned int>(std::strtoul(attribute, NULL, 16)); value = static_cast<unsigned int>(std::strtoul(attribute, nullptr, 16));
return value; return value;
} }
@ -466,7 +466,7 @@ void JoystickImpl::initialize()
} }
else 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) if (error < 0)
{ {
@ -528,7 +528,7 @@ bool JoystickImpl::isConnected(unsigned int index)
udev_device* udevDevice = udev_monitor_receive_device(udevMonitor); udev_device* udevDevice = udev_monitor_receive_device(udevMonitor);
// If we can get the specific device, we check that, // 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); updatePluggedList(udevDevice);
if (udevDevice) if (udevDevice)

View file

@ -61,7 +61,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
namespace namespace
{ {
sf::priv::WindowImplX11* fullscreenWindow = NULL; sf::priv::WindowImplX11* fullscreenWindow = nullptr;
std::vector<sf::priv::WindowImplX11*> allWindows; std::vector<sf::priv::WindowImplX11*> allWindows;
std::mutex allWindowsMutex; std::mutex allWindowsMutex;
sf::String windowManagerName; sf::String windowManagerName;
@ -381,8 +381,8 @@ namespace priv
WindowImplX11::WindowImplX11(WindowHandle handle) : WindowImplX11::WindowImplX11(WindowHandle handle) :
m_window (0), m_window (0),
m_screen (0), m_screen (0),
m_inputMethod (NULL), m_inputMethod (nullptr),
m_inputContext (NULL), m_inputContext (nullptr),
m_isExternal (true), m_isExternal (true),
m_oldVideoMode (0), m_oldVideoMode (0),
m_hiddenCursor (0), m_hiddenCursor (0),
@ -428,8 +428,8 @@ m_lastInputTime (0)
WindowImplX11::WindowImplX11(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings) : WindowImplX11::WindowImplX11(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings) :
m_window (0), m_window (0),
m_screen (0), m_screen (0),
m_inputMethod (NULL), m_inputMethod (nullptr),
m_inputContext (NULL), m_inputContext (nullptr),
m_isExternal (false), m_isExternal (false),
m_oldVideoMode (0), m_oldVideoMode (0),
m_hiddenCursor (0), m_hiddenCursor (0),
@ -749,21 +749,21 @@ void WindowImplX11::setTitle(const String& title)
m_window, m_window,
title.toAnsiString().c_str(), title.toAnsiString().c_str(),
title.toAnsiString().c_str(), title.toAnsiString().c_str(),
NULL, nullptr,
0, 0,
NULL, nullptr,
NULL, nullptr,
NULL); nullptr);
#else #else
XmbSetWMProperties(m_display, XmbSetWMProperties(m_display,
m_window, m_window,
title.toAnsiString().c_str(), title.toAnsiString().c_str(),
title.toAnsiString().c_str(), title.toAnsiString().c_str(),
NULL, nullptr,
0, 0,
NULL, nullptr,
NULL, nullptr,
NULL); nullptr);
#endif #endif
} }
@ -982,7 +982,7 @@ void WindowImplX11::requestFocus()
// Otherwise: display urgency hint (flashing application logo) // Otherwise: display urgency hint (flashing application logo)
// Ensure WM hints exist, allocate if necessary // Ensure WM hints exist, allocate if necessary
XWMHints* hints = XGetWMHints(m_display, m_window); XWMHints* hints = XGetWMHints(m_display, m_window);
if (hints == NULL) if (hints == nullptr)
hints = XAllocWMHints(); hints = XAllocWMHints();
// Add urgency (notification) flag to hints // Add urgency (notification) flag to hints
@ -1132,7 +1132,7 @@ void WindowImplX11::resetVideoMode()
} }
// Reset the fullscreen window // Reset the fullscreen window
fullscreenWindow = NULL; fullscreenWindow = nullptr;
} }
} }
@ -1263,7 +1263,7 @@ void WindowImplX11::setProtocols()
void WindowImplX11::initialize() void WindowImplX11::initialize()
{ {
// Create the input context // Create the input context
m_inputMethod = XOpenIM(m_display, NULL, NULL, NULL); m_inputMethod = XOpenIM(m_display, nullptr, nullptr, nullptr);
if (m_inputMethod) if (m_inputMethod)
{ {
@ -1274,11 +1274,11 @@ void WindowImplX11::initialize()
m_window, m_window,
XNInputStyle, XNInputStyle,
XIMPreeditNothing | XIMStatusNothing, XIMPreeditNothing | XIMStatusNothing,
NULL); nullptr);
} }
else else
{ {
m_inputContext = NULL; m_inputContext = nullptr;
} }
if (!m_inputContext) if (!m_inputContext)
@ -1346,7 +1346,7 @@ void WindowImplX11::createHiddenCursor()
{ {
// Create the cursor's pixmap (1x1 pixels) // Create the cursor's pixmap (1x1 pixels)
Pixmap cursorPixmap = XCreatePixmap(m_display, m_window, 1, 1, 1); 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); XDrawPoint(m_display, cursorPixmap, graphicsContext, 0, 0);
XFreeGC(m_display, graphicsContext); 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 // 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); XWMHints* hints = XGetWMHints(m_display, m_window);
if (hints != NULL) if (hints != nullptr)
{ {
// Remove urgency (notification) flag from hints // Remove urgency (notification) flag from hints
hints->flags &= ~XUrgencyHint; hints->flags &= ~XUrgencyHint;
@ -1571,7 +1571,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent)
&windowEvent.xkey, &windowEvent.xkey,
reinterpret_cast<char*>(keyBuffer), reinterpret_cast<char*>(keyBuffer),
sizeof(keyBuffer), sizeof(keyBuffer),
NULL, nullptr,
&status &status
); );
@ -1593,7 +1593,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent)
{ {
static XComposeStatus status; static XComposeStatus status;
char keyBuffer[16]; char keyBuffer[16];
if (XLookupString(&windowEvent.xkey, keyBuffer, sizeof(keyBuffer), NULL, &status)) if (XLookupString(&windowEvent.xkey, keyBuffer, sizeof(keyBuffer), nullptr, &status))
{ {
Event textEvent; Event textEvent;
textEvent.type = Event::TextEntered; textEvent.type = Event::TextEntered;

View file

@ -56,7 +56,7 @@ namespace
{ {
PTCHAR buffer; PTCHAR buffer;
if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, reinterpret_cast<PTCHAR>(&buffer), 0, NULL) == 0) if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr, error, 0, reinterpret_cast<PTCHAR>(&buffer), 0, nullptr) == 0)
return "Unknown error."; return "Unknown error.";
sf::String message = buffer; sf::String message = buffer;
@ -106,7 +106,7 @@ namespace
TCHAR keyData[256]; TCHAR keyData[256];
DWORD keyDataSize = sizeof(keyData); DWORD keyDataSize = sizeof(keyData);
result = RegQueryValueEx(currentKey, subkey.c_str(), NULL, NULL, reinterpret_cast<LPBYTE>(keyData), &keyDataSize); result = RegQueryValueEx(currentKey, subkey.c_str(), nullptr, nullptr, reinterpret_cast<LPBYTE>(keyData), &keyDataSize);
RegCloseKey(currentKey); RegCloseKey(currentKey);
if (result != ERROR_SUCCESS) if (result != ERROR_SUCCESS)
@ -129,7 +129,7 @@ namespace
keyDataSize = sizeof(keyData); keyDataSize = sizeof(keyData);
result = RegQueryValueEx(currentKey, REGSTR_VAL_JOYOEMNAME, NULL, NULL, reinterpret_cast<LPBYTE>(keyData), &keyDataSize); result = RegQueryValueEx(currentKey, REGSTR_VAL_JOYOEMNAME, nullptr, nullptr, reinterpret_cast<LPBYTE>(keyData), &keyDataSize);
RegCloseKey(currentKey); RegCloseKey(currentKey);
if (result != ERROR_SUCCESS) if (result != ERROR_SUCCESS)

View file

@ -42,7 +42,7 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
// Enumerate all available video modes for the primary display adapter // Enumerate all available video modes for the primary display adapter
DEVMODE win32Mode; DEVMODE win32Mode;
win32Mode.dmSize = sizeof(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 // Convert to sf::VideoMode
VideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel); VideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
@ -61,7 +61,7 @@ VideoMode VideoModeImpl::getDesktopMode()
{ {
DEVMODE win32Mode; DEVMODE win32Mode;
win32Mode.dmSize = sizeof(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); return VideoMode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
} }

View file

@ -64,7 +64,7 @@ String getErrorString(DWORD errorCode)
{ {
std::basic_ostringstream<TCHAR, std::char_traits<TCHAR> > ss; std::basic_ostringstream<TCHAR, std::char_traits<TCHAR> > ss;
TCHAR errBuff[256]; 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; ss << errBuff;
String errMsg(ss.str()); String errMsg(ss.str());
@ -74,10 +74,10 @@ String getErrorString(DWORD errorCode)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WglContext::WglContext(WglContext* shared) : WglContext::WglContext(WglContext* shared) :
m_window (NULL), m_window (nullptr),
m_pbuffer (NULL), m_pbuffer (nullptr),
m_deviceContext(NULL), m_deviceContext(nullptr),
m_context (NULL), m_context (nullptr),
m_ownsWindow (false) m_ownsWindow (false)
{ {
// Save the creation settings // Save the creation settings
@ -99,10 +99,10 @@ m_ownsWindow (false)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WglContext::WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) : WglContext::WglContext(WglContext* shared, const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel) :
m_window (NULL), m_window (nullptr),
m_pbuffer (NULL), m_pbuffer (nullptr),
m_deviceContext(NULL), m_deviceContext(nullptr),
m_context (NULL), m_context (nullptr),
m_ownsWindow (false) m_ownsWindow (false)
{ {
// Save the creation settings // Save the creation settings
@ -124,10 +124,10 @@ m_ownsWindow (false)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WglContext::WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) : WglContext::WglContext(WglContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
m_window (NULL), m_window (nullptr),
m_pbuffer (NULL), m_pbuffer (nullptr),
m_deviceContext(NULL), m_deviceContext(nullptr),
m_context (NULL), m_context (nullptr),
m_ownsWindow (false) m_ownsWindow (false)
{ {
// Save the creation settings // Save the creation settings
@ -155,8 +155,8 @@ WglContext::~WglContext()
{ {
if (currentContext == this) if (currentContext == this)
{ {
if (wglMakeCurrent(m_deviceContext, NULL) == TRUE) if (wglMakeCurrent(m_deviceContext, nullptr) == TRUE)
currentContext = NULL; currentContext = nullptr;
} }
wglDeleteContext(m_context); wglDeleteContext(m_context);
@ -215,13 +215,13 @@ bool WglContext::makeCurrent(bool current)
if (!m_deviceContext || !m_context) if (!m_deviceContext || !m_context)
return false; 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; err() << "Failed to " << (current ? "activate" : "deactivate") << " OpenGL context: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
return false; return false;
} }
currentContext = (current ? this : NULL); currentContext = (current ? this : nullptr);
return true; return true;
} }
@ -278,7 +278,7 @@ int WglContext::selectBestPixelFormat(HDC deviceContext, unsigned int bitsPerPix
// Let's check how many formats are supporting our requirements // Let's check how many formats are supporting our requirements
int formats[512]; int formats[512];
UINT nbFormats; UINT nbFormats;
bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, NULL, 512, formats, &nbFormats) != FALSE; bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, nullptr, 512, formats, &nbFormats) != FALSE;
if (!isValid) if (!isValid)
err() << "Failed to enumerate pixel formats: " << getErrorString(GetLastError()).toAnsiString() << std::endl; 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; err() << "Failed to retrieve pixel buffer device context: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
wglDestroyPbufferARB(m_pbuffer); wglDestroyPbufferARB(m_pbuffer);
m_pbuffer = NULL; m_pbuffer = nullptr;
} }
} }
else else
@ -553,7 +553,7 @@ void WglContext::createSurface(WglContext* shared, unsigned int width, unsigned
// with other contexts and thus wglShareLists would always fail // with other contexts and thus wglShareLists would always fail
// Create the hidden window // 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); ShowWindow(m_window, SW_HIDE);
m_deviceContext = GetDC(m_window); m_deviceContext = GetDC(m_window);
@ -589,7 +589,7 @@ void WglContext::createContext(WglContext* shared)
ContextSettings settings = m_settings; ContextSettings settings = m_settings;
// Get the context to share display lists with // 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 // Create the OpenGL context -- first try using wglCreateContextAttribsARB
while (!m_context && m_settings.majorVersion) while (!m_context && m_settings.majorVersion)
@ -638,13 +638,13 @@ void WglContext::createContext(WglContext* shared)
if (currentContext == 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; err() << "Failed to deactivate shared context before sharing: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
return; return;
} }
currentContext = NULL; currentContext = nullptr;
} }
} }
@ -708,13 +708,13 @@ void WglContext::createContext(WglContext* shared)
if (currentContext == 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; err() << "Failed to deactivate shared context before sharing: " << getErrorString(GetLastError()).toAnsiString() << std::endl;
return; return;
} }
currentContext = NULL; currentContext = nullptr;
} }
if (wglShareLists(sharedContext, m_context) == FALSE) if (wglShareLists(sharedContext, m_context) == FALSE)

View file

@ -47,7 +47,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new default context /// \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); WglContext(WglContext* shared);
@ -151,7 +151,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the context's drawing surface /// \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 width Back buffer width, in pixels
/// \param height Back buffer height, in pixels /// \param height Back buffer height, in pixels
/// \param bitsPerPixel Pixel depth, in bits per pixel /// \param bitsPerPixel Pixel depth, in bits per pixel
@ -171,7 +171,7 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the context /// \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); void createContext(WglContext* shared);

View file

@ -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 = sfwgl_LOAD_FAILED;
int sfwgl_ext_ARB_create_context_profile = sfwgl_LOAD_FAILED; int sfwgl_ext_ARB_create_context_profile = sfwgl_LOAD_FAILED;
int (CODEGEN_FUNCPTR *sf_ptrc_wglGetSwapIntervalEXT)(void) = NULL; int (CODEGEN_FUNCPTR *sf_ptrc_wglGetSwapIntervalEXT)(void) = nullptr;
BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglSwapIntervalEXT)(int) = NULL; BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglSwapIntervalEXT)(int) = nullptr;
static int Load_EXT_swap_control(void) static int Load_EXT_swap_control(void)
{ {
@ -61,9 +61,9 @@ static int Load_EXT_swap_control(void)
return numFailed; return numFailed;
} }
BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglChoosePixelFormatARB)(HDC, const int*, const FLOAT*, UINT, int*, UINT*) = 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*) = NULL; 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*) = NULL; BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglGetPixelFormatAttribivARB)(HDC, int, int, UINT, const int*, int*) = nullptr;
static int Load_ARB_pixel_format(void) static int Load_ARB_pixel_format(void)
{ {
@ -80,11 +80,11 @@ static int Load_ARB_pixel_format(void)
return numFailed; return numFailed;
} }
HPBUFFERARB (CODEGEN_FUNCPTR *sf_ptrc_wglCreatePbufferARB)(HDC, int, int, int, const int*) = NULL; HPBUFFERARB (CODEGEN_FUNCPTR *sf_ptrc_wglCreatePbufferARB)(HDC, int, int, int, const int*) = nullptr;
BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglDestroyPbufferARB)(HPBUFFERARB) = NULL; BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglDestroyPbufferARB)(HPBUFFERARB) = nullptr;
HDC (CODEGEN_FUNCPTR *sf_ptrc_wglGetPbufferDCARB)(HPBUFFERARB) = NULL; HDC (CODEGEN_FUNCPTR *sf_ptrc_wglGetPbufferDCARB)(HPBUFFERARB) = nullptr;
BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglQueryPbufferARB)(HPBUFFERARB, int, int*) = NULL; BOOL (CODEGEN_FUNCPTR *sf_ptrc_wglQueryPbufferARB)(HPBUFFERARB, int, int*) = nullptr;
int (CODEGEN_FUNCPTR *sf_ptrc_wglReleasePbufferDCARB)(HPBUFFERARB, HDC) = NULL; int (CODEGEN_FUNCPTR *sf_ptrc_wglReleasePbufferDCARB)(HPBUFFERARB, HDC) = nullptr;
static int Load_ARB_pbuffer() static int Load_ARB_pbuffer()
{ {
@ -107,7 +107,7 @@ static int Load_ARB_pbuffer()
return numFailed; 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) 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 int (*PFN_LOADFUNCPOINTERS)(void);
typedef struct sfwgl_StrToExtMap_s typedef struct sfwgl_StrToExtMap_s
@ -131,13 +131,13 @@ typedef struct sfwgl_StrToExtMap_s
static sfwgl_StrToExtMap ExtensionMap[8] = { static sfwgl_StrToExtMap ExtensionMap[8] = {
{"WGL_EXT_swap_control", &sfwgl_ext_EXT_swap_control, Load_EXT_swap_control}, {"WGL_EXT_swap_control", &sfwgl_ext_EXT_swap_control, Load_EXT_swap_control},
{"WGL_EXT_framebuffer_sRGB", &sfwgl_ext_EXT_framebuffer_sRGB, NULL}, {"WGL_EXT_framebuffer_sRGB", &sfwgl_ext_EXT_framebuffer_sRGB, nullptr},
{"WGL_ARB_framebuffer_sRGB", &sfwgl_ext_ARB_framebuffer_sRGB, NULL}, {"WGL_ARB_framebuffer_sRGB", &sfwgl_ext_ARB_framebuffer_sRGB, nullptr},
{"WGL_ARB_multisample", &sfwgl_ext_ARB_multisample, NULL}, {"WGL_ARB_multisample", &sfwgl_ext_ARB_multisample, nullptr},
{"WGL_ARB_pixel_format", &sfwgl_ext_ARB_pixel_format, Load_ARB_pixel_format}, {"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_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", &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; static int g_extensionMapSize = 8;
@ -152,7 +152,7 @@ static sfwgl_StrToExtMap* FindExtEntry(const char* extensionName)
return currLoc; return currLoc;
} }
return NULL; return nullptr;
} }
@ -171,7 +171,7 @@ static void ClearExtensionVars(void)
static void LoadExtByName(const char* extensionName) static void LoadExtByName(const char* extensionName)
{ {
sfwgl_StrToExtMap* entry = NULL; sfwgl_StrToExtMap* entry = nullptr;
entry = FindExtEntry(extensionName); entry = FindExtEntry(extensionName);
if (entry) if (entry)
{ {

View file

@ -65,7 +65,7 @@ namespace
unsigned int windowCount = 0; // Windows owned by SFML unsigned int windowCount = 0; // Windows owned by SFML
unsigned int handleCount = 0; // All window handles unsigned int handleCount = 0; // All window handles
const wchar_t* className = L"SFML_Window"; const wchar_t* className = L"SFML_Window";
sf::priv::WindowImplWin32* fullscreenWindow = NULL; sf::priv::WindowImplWin32* fullscreenWindow = nullptr;
void setProcessDpiAware() void setProcessDpiAware()
{ {
@ -131,8 +131,8 @@ namespace priv
WindowImplWin32::WindowImplWin32(WindowHandle handle) : WindowImplWin32::WindowImplWin32(WindowHandle handle) :
m_handle (handle), m_handle (handle),
m_callback (0), m_callback (0),
m_cursor (NULL), m_cursor (nullptr),
m_icon (NULL), m_icon (nullptr),
m_keyRepeatEnabled(true), m_keyRepeatEnabled(true),
m_lastSize (0, 0), m_lastSize (0, 0),
m_resizing (false), m_resizing (false),
@ -161,10 +161,10 @@ m_cursorGrabbed (false)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WindowImplWin32::WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& /*settings*/) : WindowImplWin32::WindowImplWin32(VideoMode mode, const String& title, Uint32 style, const ContextSettings& /*settings*/) :
m_handle (NULL), m_handle (nullptr),
m_callback (0), m_callback (0),
m_cursor (NULL), m_cursor (nullptr),
m_icon (NULL), m_icon (nullptr),
m_keyRepeatEnabled(true), m_keyRepeatEnabled(true),
m_lastSize (mode.width, mode.height), m_lastSize (mode.width, mode.height),
m_resizing (false), m_resizing (false),
@ -181,12 +181,12 @@ m_cursorGrabbed (m_fullscreen)
registerWindowClass(); registerWindowClass();
// Compute position and size // Compute position and size
HDC screenDC = GetDC(NULL); HDC screenDC = GetDC(nullptr);
int left = (GetDeviceCaps(screenDC, HORZRES) - static_cast<int>(mode.width)) / 2; int left = (GetDeviceCaps(screenDC, HORZRES) - static_cast<int>(mode.width)) / 2;
int top = (GetDeviceCaps(screenDC, VERTRES) - static_cast<int>(mode.height)) / 2; int top = (GetDeviceCaps(screenDC, VERTRES) - static_cast<int>(mode.height)) / 2;
int width = mode.width; int width = mode.width;
int height = mode.height; int height = mode.height;
ReleaseDC(NULL, screenDC); ReleaseDC(nullptr, screenDC);
// Choose the window style according to the Style parameter // Choose the window style according to the Style parameter
DWORD win32Style = WS_VISIBLE; DWORD win32Style = WS_VISIBLE;
@ -211,7 +211,7 @@ m_cursorGrabbed (m_fullscreen)
} }
// Create the window // 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 we're the first window handle, we only need to poll for joysticks when WM_DEVICECHANGE message is received
if (m_handle) if (m_handle)
@ -262,7 +262,7 @@ WindowImplWin32::~WindowImplWin32()
// Unregister window class if we were the last window // Unregister window class if we were the last window
if (windowCount == 0) if (windowCount == 0)
UnregisterClassW(className, GetModuleHandleW(NULL)); UnregisterClassW(className, GetModuleHandleW(nullptr));
} }
else else
{ {
@ -286,7 +286,7 @@ void WindowImplWin32::processEvents()
if (!m_callback) if (!m_callback)
{ {
MSG message; MSG message;
while (PeekMessageW(&message, NULL, 0, 0, PM_REMOVE)) while (PeekMessageW(&message, nullptr, 0, 0, PM_REMOVE))
{ {
TranslateMessage(&message); TranslateMessage(&message);
DispatchMessageW(&message); DispatchMessageW(&message);
@ -308,7 +308,7 @@ Vector2i WindowImplWin32::getPosition() const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void WindowImplWin32::setPosition(const Vector2i& position) 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) if(m_cursorGrabbed)
grabCursor(true); grabCursor(true);
@ -335,7 +335,7 @@ void WindowImplWin32::setSize(const Vector2u& size)
int width = rectangle.right - rectangle.left; int width = rectangle.right - rectangle.left;
int height = rectangle.bottom - rectangle.top; 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 // 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 // Set it as both big and small icon of the window
if (m_icon) if (m_icon)
@ -390,9 +390,9 @@ void WindowImplWin32::setVisible(bool visible)
void WindowImplWin32::setMouseCursorVisible(bool visible) void WindowImplWin32::setMouseCursorVisible(bool visible)
{ {
if (visible) if (visible)
m_cursor = LoadCursorW(NULL, IDC_ARROW); m_cursor = LoadCursorW(nullptr, IDC_ARROW);
else else
m_cursor = NULL; m_cursor = nullptr;
SetCursor(m_cursor); SetCursor(m_cursor);
} }
@ -417,8 +417,8 @@ void WindowImplWin32::setKeyRepeatEnabled(bool enabled)
void WindowImplWin32::requestFocus() void WindowImplWin32::requestFocus()
{ {
// Allow focus stealing only within the same process; compare PIDs of current and foreground window // Allow focus stealing only within the same process; compare PIDs of current and foreground window
DWORD thisPid = GetWindowThreadProcessId(m_handle, NULL); DWORD thisPid = GetWindowThreadProcessId(m_handle, nullptr);
DWORD foregroundPid = GetWindowThreadProcessId(GetForegroundWindow(), NULL); DWORD foregroundPid = GetWindowThreadProcessId(GetForegroundWindow(), nullptr);
if (thisPid == foregroundPid) if (thisPid == foregroundPid)
{ {
@ -455,11 +455,11 @@ void WindowImplWin32::registerWindowClass()
windowClass.lpfnWndProc = &WindowImplWin32::globalOnEvent; windowClass.lpfnWndProc = &WindowImplWin32::globalOnEvent;
windowClass.cbClsExtra = 0; windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0; windowClass.cbWndExtra = 0;
windowClass.hInstance = GetModuleHandleW(NULL); windowClass.hInstance = GetModuleHandleW(nullptr);
windowClass.hIcon = NULL; windowClass.hIcon = nullptr;
windowClass.hCursor = 0; windowClass.hCursor = 0;
windowClass.hbrBackground = 0; windowClass.hbrBackground = 0;
windowClass.lpszMenuName = NULL; windowClass.lpszMenuName = nullptr;
windowClass.lpszClassName = className; windowClass.lpszClassName = className;
RegisterClassW(&windowClass); RegisterClassW(&windowClass);
} }
@ -501,8 +501,8 @@ void WindowImplWin32::cleanup()
// Restore the previous video mode (in case we were running in fullscreen) // Restore the previous video mode (in case we were running in fullscreen)
if (fullscreenWindow == this) if (fullscreenWindow == this)
{ {
ChangeDisplaySettingsW(NULL, 0); ChangeDisplaySettingsW(nullptr, 0);
fullscreenWindow = NULL; fullscreenWindow = nullptr;
} }
// Unhide the mouse cursor (in case it was hidden) // Unhide the mouse cursor (in case it was hidden)
@ -535,12 +535,12 @@ void WindowImplWin32::grabCursor(bool grabbed)
{ {
RECT rect; RECT rect;
GetClientRect(m_handle, &rect); GetClientRect(m_handle, &rect);
MapWindowPoints(m_handle, NULL, reinterpret_cast<LPPOINT>(&rect), 2); MapWindowPoints(m_handle, nullptr, reinterpret_cast<LPPOINT>(&rect), 2);
ClipCursor(&rect); ClipCursor(&rect);
} }
else else
{ {
ClipCursor(NULL); ClipCursor(nullptr);
} }
} }
@ -549,7 +549,7 @@ void WindowImplWin32::grabCursor(bool grabbed)
void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam) void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
{ {
// Don't process any message until window is created // Don't process any message until window is created
if (m_handle == NULL) if (m_handle == nullptr)
return; return;
switch (message) switch (message)
@ -1111,7 +1111,7 @@ LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARA
} }
// Get the WindowImpl instance corresponding to the window handle // Get the WindowImpl instance corresponding to the window handle
WindowImplWin32* window = handle ? reinterpret_cast<WindowImplWin32*>(GetWindowLongPtr(handle, GWLP_USERDATA)) : NULL; WindowImplWin32* window = handle ? reinterpret_cast<WindowImplWin32*>(GetWindowLongPtr(handle, GWLP_USERDATA)) : nullptr;
// Forward the event to the appropriate function // Forward the event to the appropriate function
if (window) if (window)

View file

@ -34,7 +34,7 @@
namespace namespace
{ {
const sf::Window* fullscreenWindow = NULL; const sf::Window* fullscreenWindow = nullptr;
} }
@ -153,14 +153,14 @@ void Window::close()
// Update the fullscreen window // Update the fullscreen window
if (this == fullscreenWindow) if (this == fullscreenWindow)
fullscreenWindow = NULL; fullscreenWindow = nullptr;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Window::isOpen() const bool Window::isOpen() const
{ {
return m_impl != NULL; return m_impl != nullptr;
} }

View file

@ -55,7 +55,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new context, not associated to a window /// \brief Create a new context, not associated to a window
/// ///
/// \param shared Context to share the new one with (can be NULL) /// \param shared Context to share the new one with (can be nullptr)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
EaglContext(EaglContext* shared); EaglContext(EaglContext* shared);
@ -138,8 +138,8 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the context /// \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 window Window to attach the context to (can be NULL) /// \param window Window to attach the context to (can be nullptr)
/// \param bitsPerPixel Pixel depth, in bits per pixel /// \param bitsPerPixel Pixel depth, in bits per pixel
/// \param settings Creation parameters /// \param settings Creation parameters
/// ///

View file

@ -33,7 +33,7 @@
namespace namespace
{ {
// Save the global instance of the delegate // Save the global instance of the delegate
SFAppDelegate* delegateInstance = NULL; SFAppDelegate* delegateInstance = nullptr;
// Current touches positions // Current touches positions
std::vector<sf::Vector2i> touchPositions; std::vector<sf::Vector2i> touchPositions;
@ -64,7 +64,7 @@ namespace
- (void)runUserMain - (void)runUserMain
{ {
// Arguments intentionally dropped, see comments in main in sfml-main // Arguments intentionally dropped, see comments in main in sfml-main
sfmlMain(0, NULL); sfmlMain(0, nullptr);
} }

View file

@ -183,7 +183,7 @@
if (self) if (self)
{ {
self.context = NULL; self.context = nullptr;
self.touches = [NSMutableArray array]; self.touches = [NSMutableArray array];
// Configure the EAGL layer // Configure the EAGL layer