Fixed linker errors in sfml-network and csfml-network

Made every read-only pointer "const" in CSFML

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1290 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-11-26 20:09:57 +00:00
parent 29ecc552c2
commit d979ca254e
62 changed files with 438 additions and 429 deletions

View File

@ -64,7 +64,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="sfml-network-s-d.lib" AdditionalDependencies="sfml-network-s-d.lib sfml-system-s-d.lib"
OutputFile="$(SolutionDir)..\..\lib\vc2005\$(ProjectName)-d.dll" OutputFile="$(SolutionDir)..\..\lib\vc2005\$(ProjectName)-d.dll"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2005\" AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2005\"
@ -149,7 +149,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="sfml-network-s.lib" AdditionalDependencies="sfml-network-s.lib sfml-system-s.lib"
OutputFile="$(SolutionDir)..\..\lib\vc2005\$(ProjectName).dll" OutputFile="$(SolutionDir)..\..\lib\vc2005\$(ProjectName).dll"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2005\" AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2005\"

View File

@ -65,7 +65,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="sfml-network-s-d.lib" AdditionalDependencies="sfml-network-s-d.lib sfml-system-s-d.lib"
OutputFile="$(SolutionDir)..\..\lib\vc2008\$(ProjectName)-d.dll" OutputFile="$(SolutionDir)..\..\lib\vc2008\$(ProjectName)-d.dll"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2008\" AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2008\"
@ -149,7 +149,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="sfml-network-s.lib" AdditionalDependencies="sfml-network-s.lib sfml-system-s.lib"
OutputFile="$(SolutionDir)..\..\lib\vc2008\$(ProjectName).dll" OutputFile="$(SolutionDir)..\..\lib\vc2008\$(ProjectName).dll"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2008\" AdditionalLibraryDirectories="$(SolutionDir)..\..\..\lib\vc2008\"

View File

@ -79,7 +79,7 @@ CSFML_API void sfMusic_SetLoop(sfMusic* music, sfBool loop);
/// \return sfTrue if the music is looping, sfFalse otherwise /// \return sfTrue if the music is looping, sfFalse otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfMusic_GetLoop(sfMusic* music); CSFML_API sfBool sfMusic_GetLoop(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a music duration /// Get a music duration
@ -89,7 +89,7 @@ CSFML_API sfBool sfMusic_GetLoop(sfMusic* music);
/// \return Music duration, in seconds /// \return Music duration, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetDuration(sfMusic* music); CSFML_API float sfMusic_GetDuration(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a music /// Start playing a music
@ -123,7 +123,7 @@ CSFML_API void sfMusic_Stop(sfMusic* music);
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfMusic_GetChannelsCount(sfMusic* music); CSFML_API unsigned int sfMusic_GetChannelsCount(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the stream sample rate of a music /// Get the stream sample rate of a music
@ -133,7 +133,7 @@ CSFML_API unsigned int sfMusic_GetChannelsCount(sfMusic* music);
/// \return Stream frequency (number of samples per second) /// \return Stream frequency (number of samples per second)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfMusic_GetSampleRate(sfMusic* music); CSFML_API unsigned int sfMusic_GetSampleRate(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a music (stopped, paused, playing) /// Get the status of a music (stopped, paused, playing)
@ -143,7 +143,7 @@ CSFML_API unsigned int sfMusic_GetSampleRate(sfMusic* music);
/// \return Current status of the sound /// \return Current status of the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfMusic_GetStatus(sfMusic* music); CSFML_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a music /// Get the current playing position of a music
@ -153,7 +153,7 @@ CSFML_API sfSoundStatus sfMusic_GetStatus(sfMusic* music);
/// \return Current playing position, expressed in seconds /// \return Current playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetPlayingOffset(sfMusic* music); CSFML_API float sfMusic_GetPlayingOffset(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a music /// Set the pitch of a music
@ -234,7 +234,7 @@ CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset);
/// \return Pitch value /// \return Pitch value
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetPitch(sfMusic* music); CSFML_API float sfMusic_GetPitch(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a music /// Get the volume of a music
@ -244,7 +244,7 @@ CSFML_API float sfMusic_GetPitch(sfMusic* music);
/// \return Volume value (in range [1, 100]) /// \return Volume value (in range [1, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetVolume(sfMusic* music); CSFML_API float sfMusic_GetVolume(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a music /// Get the position of a music
@ -255,7 +255,7 @@ CSFML_API float sfMusic_GetVolume(sfMusic* music);
/// \param z : Z position of the sound in the world /// \param z : Z position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_GetPosition(sfMusic* music, float* x, float* y, float* z); CSFML_API void sfMusic_GetPosition(const sfMusic* music, float* x, float* y, float* z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the music's position is relative to the listener's /// Tell if the music's position is relative to the listener's
@ -266,7 +266,7 @@ CSFML_API void sfMusic_GetPosition(sfMusic* music, float* x, float* y, float* z)
/// \return sfTrue if the position is relative, sfFalse if it's absolute /// \return sfTrue if the position is relative, sfFalse if it's absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfMusic_IsRelativeToListener(sfMusic* music); CSFML_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a music /// Get the minimum distance of a music
@ -276,7 +276,7 @@ CSFML_API sfBool sfMusic_IsRelativeToListener(sfMusic* music);
/// \return Minimum distance for the music /// \return Minimum distance for the music
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetMinDistance(sfMusic* music); CSFML_API float sfMusic_GetMinDistance(const sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a music /// Get the attenuation factor of a music
@ -286,7 +286,7 @@ CSFML_API float sfMusic_GetMinDistance(sfMusic* music);
/// \return Attenuation factor for the a music /// \return Attenuation factor for the a music
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetAttenuation(sfMusic* music); CSFML_API float sfMusic_GetAttenuation(const sfMusic* music);
#endif // SFML_MUSIC_H #endif // SFML_MUSIC_H

View File

@ -80,7 +80,7 @@ CSFML_API void sfSound_Stop(sfSound* sound);
/// \param buffer : Buffer to bind /// \param buffer : Buffer to bind
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetBuffer(sfSound* sound, sfSoundBuffer* buffer); CSFML_API void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sound buffer bound to a sound /// Get the sound buffer bound to a sound
@ -90,7 +90,7 @@ CSFML_API void sfSound_SetBuffer(sfSound* sound, sfSoundBuffer* buffer);
/// \return Pointer to the sound's buffer /// \return Pointer to the sound's buffer
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSound_GetBuffer(sfSound* sound); CSFML_API const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a sound loop state /// Set a sound loop state
@ -109,7 +109,7 @@ CSFML_API void sfSound_SetLoop(sfSound* sound, sfBool loop);
/// \return sfTrue if the sound is looping, sfFalse otherwise /// \return sfTrue if the sound is looping, sfFalse otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSound_GetLoop(sfSound* sound); CSFML_API sfBool sfSound_GetLoop(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a sound (stopped, paused, playing) /// Get the status of a sound (stopped, paused, playing)
@ -119,7 +119,7 @@ CSFML_API sfBool sfSound_GetLoop(sfSound* sound);
/// \return Current status of the sound /// \return Current status of the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfSound_GetStatus(sfSound* sound); CSFML_API sfSoundStatus sfSound_GetStatus(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a sound /// Set the pitch of a sound
@ -200,7 +200,7 @@ CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset);
/// \return Pitch value /// \return Pitch value
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetPitch(sfSound* sound); CSFML_API float sfSound_GetPitch(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound /// Get the volume of a sound
@ -210,7 +210,7 @@ CSFML_API float sfSound_GetPitch(sfSound* sound);
/// \return Volume value (in range [1, 100]) /// \return Volume value (in range [1, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetVolume(sfSound* sound); CSFML_API float sfSound_GetVolume(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a sound /// Get the position of a sound
@ -221,7 +221,7 @@ CSFML_API float sfSound_GetVolume(sfSound* sound);
/// \param z : Z position of the sound in the world /// \param z : Z position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_GetPosition(sfSound* sound, float* x, float* y, float* z); CSFML_API void sfSound_GetPosition(const sfSound* sound, float* x, float* y, float* z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the sound's position is relative to the listener's /// Tell if the sound's position is relative to the listener's
@ -232,7 +232,7 @@ CSFML_API void sfSound_GetPosition(sfSound* sound, float* x, float* y, float* z)
/// \return sfTrue if the position is relative, sfFalse if it's absolute /// \return sfTrue if the position is relative, sfFalse if it's absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSound_IsRelativeToListener(sfSound* sound); CSFML_API sfBool sfSound_IsRelativeToListener(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound /// Get the minimum distance of a sound
@ -242,7 +242,7 @@ CSFML_API sfBool sfSound_IsRelativeToListener(sfSound* sound);
/// \return Minimum distance for the sound /// \return Minimum distance for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetMinDistance(sfSound* sound); CSFML_API float sfSound_GetMinDistance(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound /// Get the attenuation factor of a sound
@ -252,7 +252,7 @@ CSFML_API float sfSound_GetMinDistance(sfSound* sound);
/// \return Attenuation factor for the sound /// \return Attenuation factor for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetAttenuation(sfSound* sound); CSFML_API float sfSound_GetAttenuation(const sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound /// Get the current playing position of a sound
@ -262,7 +262,7 @@ CSFML_API float sfSound_GetAttenuation(sfSound* sound);
/// \return Current playing position, expressed in seconds /// \return Current playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetPlayingOffset(sfSound* sound); CSFML_API float sfSound_GetPlayingOffset(const sfSound* sound);
#endif // SFML_SOUND_H #endif // SFML_SOUND_H

View File

@ -85,7 +85,7 @@ CSFML_API void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer);
/// \return sfTrue if saving has been successful /// \return sfTrue if saving has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundBuffer_SaveToFile(sfSoundBuffer* soundBuffer, const char* filename); CSFML_API sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the samples contained in a sound buffer /// Return the samples contained in a sound buffer
@ -95,7 +95,7 @@ CSFML_API sfBool sfSoundBuffer_SaveToFile(sfSoundBuffer* soundBuffer, const char
/// \return Pointer to the array of sound samples, in 16 bits signed integer format /// \return Pointer to the array of sound samples, in 16 bits signed integer format
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfInt16* sfSoundBuffer_GetSamples(sfSoundBuffer* soundBuffer); CSFML_API const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of samples contained in a sound buffer /// Return the number of samples contained in a sound buffer
@ -105,7 +105,7 @@ CSFML_API const sfInt16* sfSoundBuffer_GetSamples(sfSoundBuffer* soundBuffer);
/// \return Number of samples /// \return Number of samples
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API size_t sfSoundBuffer_GetSamplesCount(sfSoundBuffer* soundBuffer); CSFML_API size_t sfSoundBuffer_GetSamplesCount(const sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer /// Get the sample rate of a sound buffer
@ -115,7 +115,7 @@ CSFML_API size_t sfSoundBuffer_GetSamplesCount(sfSoundBuffer* soundBuffer);
/// \return Sound frequency (number of samples per second) /// \return Sound frequency (number of samples per second)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundBuffer_GetSampleRate(sfSoundBuffer* soundBuffer); CSFML_API unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of channels of a sound buffer (1 = mono, 2 = stereo, ...) /// Return the number of channels of a sound buffer (1 = mono, 2 = stereo, ...)
@ -125,7 +125,7 @@ CSFML_API unsigned int sfSoundBuffer_GetSampleRate(sfSoundBuffer* soundBuffer);
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(sfSoundBuffer* soundBuffer); CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer /// Get the duration of a sound buffer
@ -135,7 +135,7 @@ CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(sfSoundBuffer* soundBuffer
/// \return Sound duration, in seconds /// \return Sound duration, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundBuffer_GetDuration(sfSoundBuffer* soundBuffer); CSFML_API float sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer);
#endif // SFML_SOUNDBUFFER_H #endif // SFML_SOUNDBUFFER_H

View File

@ -74,7 +74,7 @@ CSFML_API void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferReco
/// \return Frequency, in samples per second /// \return Frequency, in samples per second
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundBufferRecorder_GetSampleRate(sfSoundBufferRecorder* soundBufferRecorder); CSFML_API unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBufferRecorder* soundBufferRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sound buffer containing the captured audio data /// Get the sound buffer containing the captured audio data
@ -85,7 +85,7 @@ CSFML_API unsigned int sfSoundBufferRecorder_GetSampleRate(sfSoundBufferRecorder
/// \return Pointer to the sound buffer (you don't need to destroy it after use) /// \return Pointer to the sound buffer (you don't need to destroy it after use)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(sfSoundBufferRecorder* soundBufferRecorder); CSFML_API const sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
#endif // SFML_SOUNDBUFFERRECORDER_H #endif // SFML_SOUNDBUFFERRECORDER_H

View File

@ -88,7 +88,7 @@ CSFML_API void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder);
/// \return Frequency, in samples per second /// \return Frequency, in samples per second
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundRecorder_GetSampleRate(sfSoundRecorder* soundRecorder); CSFML_API unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder* soundRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the system supports sound capture. /// Tell if the system supports sound capture.

View File

@ -105,7 +105,7 @@ CSFML_API void sfSoundStream_Stop(sfSoundStream* soundStream);
/// \return Current status of the sound stream /// \return Current status of the sound stream
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfSoundStream_GetStatus(sfSoundStream* soundStream); CSFML_API sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of channels of a sound stream /// Return the number of channels of a sound stream
@ -116,7 +116,7 @@ CSFML_API sfSoundStatus sfSoundStream_GetStatus(sfSoundStream* soundStream);
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* soundStream); CSFML_API unsigned int sfSoundStream_GetChannelsCount(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound stream /// Get the sample rate of a sound stream
@ -126,7 +126,7 @@ CSFML_API unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* soundStream
/// \return Stream frequency (number of samples per second) /// \return Stream frequency (number of samples per second)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundStream_GetSampleRate(sfSoundStream* soundStream); CSFML_API unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a sound stream /// Set the pitch of a sound stream
@ -216,7 +216,7 @@ CSFML_API void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop);
/// \return Pitch value /// \return Pitch value
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetPitch(sfSoundStream* soundStream); CSFML_API float sfSoundStream_GetPitch(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound stream /// Get the volume of a sound stream
@ -226,7 +226,7 @@ CSFML_API float sfSoundStream_GetPitch(sfSoundStream* soundStream);
/// \return Volume value (in range [1, 100]) /// \return Volume value (in range [1, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetVolume(sfSoundStream* soundStream); CSFML_API float sfSoundStream_GetVolume(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a sound stream /// Get the position of a sound stream
@ -237,7 +237,7 @@ CSFML_API float sfSoundStream_GetVolume(sfSoundStream* soundStream);
/// \param z : Z position of the sound stream in the world /// \param z : Z position of the sound stream in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_GetPosition(sfSoundStream* soundStream, float* x, float* y, float* z); CSFML_API void sfSoundStream_GetPosition(const sfSoundStream* soundStream, float* x, float* y, float* z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the sound stream's position is relative to the listener's /// Tell if the sound stream's position is relative to the listener's
@ -248,7 +248,7 @@ CSFML_API void sfSoundStream_GetPosition(sfSoundStream* soundStream, float* x, f
/// \return sfTrue if the position is relative, sfFalse if it's absolute /// \return sfTrue if the position is relative, sfFalse if it's absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundStream_IsRelativeToListener(sfSoundStream* soundStream); CSFML_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound stream /// Get the minimum distance of a sound stream
@ -258,7 +258,7 @@ CSFML_API sfBool sfSoundStream_IsRelativeToListener(sfSoundStream* soundStream);
/// \return Minimum distance for the sound stream /// \return Minimum distance for the sound stream
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetMinDistance(sfSoundStream* soundStream); CSFML_API float sfSoundStream_GetMinDistance(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound stream /// Get the attenuation factor of a sound stream
@ -268,7 +268,7 @@ CSFML_API float sfSoundStream_GetMinDistance(sfSoundStream* soundStream);
/// \return Attenuation factor for the sound stream /// \return Attenuation factor for the sound stream
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetAttenuation(sfSoundStream* soundStream); CSFML_API float sfSoundStream_GetAttenuation(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a stream is looping /// Tell whether or not a stream is looping
@ -278,7 +278,7 @@ CSFML_API float sfSoundStream_GetAttenuation(sfSoundStream* soundStream);
/// \return sfTrue if the stream is looping, sfFalse otherwise /// \return sfTrue if the stream is looping, sfFalse otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundStream_GetLoop(sfSoundStream* soundStream); CSFML_API sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound stream /// Get the current playing position of a sound stream
@ -288,7 +288,7 @@ CSFML_API sfBool sfSoundStream_GetLoop(sfSoundStream* soundStream);
/// \return Current playing position, expressed in seconds /// \return Current playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetPlayingOffset(sfSoundStream* soundStream); CSFML_API float sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream);
#endif // SFML_SOUNDSTREAM_H #endif // SFML_SOUNDSTREAM_H

View File

@ -82,7 +82,7 @@ CSFML_API void sfFont_Destroy(sfFont* font);
/// \return Base size of characters /// \return Base size of characters
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfFont_GetCharacterSize(sfFont* font); CSFML_API unsigned int sfFont_GetCharacterSize(const sfFont* font);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the built-in default font (Arial) /// Get the built-in default font (Arial)
@ -90,7 +90,7 @@ CSFML_API unsigned int sfFont_GetCharacterSize(sfFont* font);
/// \return Pointer to the default font /// \return Pointer to the default font
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFont* sfFont_GetDefaultFont(); CSFML_API const sfFont* sfFont_GetDefaultFont();
#endif // SFML_IMAGE_H #endif // SFML_IMAGE_H

View File

@ -104,7 +104,7 @@ CSFML_API void sfImage_Destroy(sfImage* image);
/// \return sfTrue if saving was successful /// \return sfTrue if saving was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfImage_SaveToFile(sfImage* image, const char* filename); CSFML_API sfBool sfImage_SaveToFile(const sfImage* image, const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a transparency mask for an image from a specified colorkey /// Create a transparency mask for an image from a specified colorkey
@ -128,7 +128,7 @@ CSFML_API void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfU
/// \param sourceRect : Sub-rectangle of the source image to copy /// \param sourceRect : Sub-rectangle of the source image to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_Copy(sfImage* image, sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect); CSFML_API void sfImage_Copy(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the image from the current contents of the /// Create the image from the current contents of the
@ -165,7 +165,7 @@ CSFML_API void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y,
/// \return Color of pixel (x, y) /// \return Color of pixel (x, y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfImage_GetPixel(sfImage* image, unsigned int x, unsigned int y); CSFML_API sfColor sfImage_GetPixel(const sfImage* image, unsigned int x, unsigned int y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a read-only pointer to the array of pixels of an image (8 bits integers RGBA) /// Get a read-only pointer to the array of pixels of an image (8 bits integers RGBA)
@ -177,7 +177,7 @@ CSFML_API sfColor sfImage_GetPixel(sfImage* image, unsigned int x, unsigned int
/// \return Pointer to the array of pixels /// \return Pointer to the array of pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfUint8* sfImage_GetPixelsPtr(sfImage* image); CSFML_API const sfUint8* sfImage_GetPixelsPtr(const sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind the image for rendering /// Bind the image for rendering
@ -185,7 +185,7 @@ CSFML_API const sfUint8* sfImage_GetPixelsPtr(sfImage* image);
/// \param image : Image to bind /// \param image : Image to bind
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_Bind(sfImage* image); CSFML_API void sfImage_Bind(const sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable image smooth filter /// Enable or disable image smooth filter
@ -204,7 +204,7 @@ CSFML_API void sfImage_SetSmooth(sfImage* image, sfBool smooth);
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfImage_GetWidth(sfImage* image); CSFML_API unsigned int sfImage_GetWidth(const sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the height of the image /// Return the height of the image
@ -214,7 +214,7 @@ CSFML_API unsigned int sfImage_GetWidth(sfImage* image);
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfImage_GetHeight(sfImage* image); CSFML_API unsigned int sfImage_GetHeight(const sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tells whether the smoothing filter is enabled or not on an image /// Tells whether the smoothing filter is enabled or not on an image
@ -224,7 +224,7 @@ CSFML_API unsigned int sfImage_GetHeight(sfImage* image);
/// \return sfTrue if the smoothing filter is enabled /// \return sfTrue if the smoothing filter is enabled
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfImage_IsSmooth(sfImage* image); CSFML_API sfBool sfImage_IsSmooth(const sfImage* image);
#endif // SFML_IMAGE_H #endif // SFML_IMAGE_H

View File

@ -73,8 +73,8 @@ CSFML_API void sfIntRect_Offset(sfIntRect* rect, int offsetX, int offsetY);
/// \return sfTrue if the point is inside /// \return sfTrue if the point is inside
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfFloatRect_Contains(sfFloatRect* rect, float x, float y); CSFML_API sfBool sfFloatRect_Contains(const sfFloatRect* rect, float x, float y);
CSFML_API sfBool sfIntRect_Contains(sfIntRect* rect, int x, int y); CSFML_API sfBool sfIntRect_Contains(const sfIntRect* rect, int x, int y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles /// Check intersection between two rectangles
@ -86,8 +86,8 @@ CSFML_API sfBool sfIntRect_Contains(sfIntRect* rect, int x, int y);
/// \return sfTrue if rectangles overlap /// \return sfTrue if rectangles overlap
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfFloatRect_Intersects(sfFloatRect* rect1, sfFloatRect* rect2, sfFloatRect* intersection); CSFML_API sfBool sfFloatRect_Intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
CSFML_API sfBool sfIntRect_Intersects(sfIntRect* rect1, sfIntRect* rect2, sfIntRect* intersection); CSFML_API sfBool sfIntRect_Intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
#endif // SFML_RECT_H #endif // SFML_RECT_H

View File

@ -60,7 +60,7 @@ CSFML_API void sfRenderImage_Destroy(sfRenderImage* renderImage);
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderImage_GetWidth(sfRenderImage* renderImage); CSFML_API unsigned int sfRenderImage_GetWidth(const sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rendering region of a renderimage /// Get the height of the rendering region of a renderimage
@ -70,7 +70,7 @@ CSFML_API unsigned int sfRenderImage_GetWidth(sfRenderImage* renderImage);
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderImage_GetHeight(sfRenderImage* renderImage); CSFML_API unsigned int sfRenderImage_GetHeight(const sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a renderimage as the current target for rendering /// Activate or deactivate a renderimage as the current target for rendering
@ -116,9 +116,9 @@ CSFML_API void sfRenderImage_Display(sfRenderImage* renderImage);
/// \param sprite / text / shape : Object to draw /// \param sprite / text / shape : Object to draw
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_DrawSprite(sfRenderImage* renderImage, sfSprite* sprite); CSFML_API void sfRenderImage_DrawSprite(sfRenderImage* renderImage, const sfSprite* sprite);
CSFML_API void sfRenderImage_DrawShape (sfRenderImage* renderImage, sfShape* shape); CSFML_API void sfRenderImage_DrawShape (sfRenderImage* renderImage, const sfShape* shape);
CSFML_API void sfRenderImage_DrawText (sfRenderImage* renderImage, sfText* text); CSFML_API void sfRenderImage_DrawText (sfRenderImage* renderImage, const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderimage with a shader /// Draw something on a renderimage with a shader
@ -128,9 +128,9 @@ CSFML_API void sfRenderImage_DrawText (sfRenderImage* renderImage, sfText* te
/// \param shader : Shader to use /// \param shader : Shader to use
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_DrawSpriteWithShader(sfRenderImage* renderImage, sfSprite* sprite, sfShader* shader); CSFML_API void sfRenderImage_DrawSpriteWithShader(sfRenderImage* renderImage, const sfSprite* sprite, const sfShader* shader);
CSFML_API void sfRenderImage_DrawShapeWithShader (sfRenderImage* renderImage, sfShape* shape, sfShader* shader); CSFML_API void sfRenderImage_DrawShapeWithShader (sfRenderImage* renderImage, const sfShape* shape, const sfShader* shader);
CSFML_API void sfRenderImage_DrawTextWithShader (sfRenderImage* renderImage, sfText* text, sfShader* shader); CSFML_API void sfRenderImage_DrawTextWithShader (sfRenderImage* renderImage, const sfText* text, const sfShader* shader);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear the renderimage with the given color /// Clear the renderimage with the given color
@ -148,7 +148,7 @@ CSFML_API void sfRenderImage_Clear(sfRenderImage* renderImage, sfColor color);
/// \param view : Pointer to the new view /// \param view : Pointer to the new view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_SetView(sfRenderImage* renderImage, sfView* view); CSFML_API void sfRenderImage_SetView(sfRenderImage* renderImage, const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current active view of a renderimage /// Get the current active view of a renderimage
@ -158,7 +158,7 @@ CSFML_API void sfRenderImage_SetView(sfRenderImage* renderImage, sfView* view);
/// \return Current active view /// \return Current active view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfView* sfRenderImage_GetView(sfRenderImage* renderImage); CSFML_API const sfView* sfRenderImage_GetView(const sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the default view of a renderimage /// Get the default view of a renderimage
@ -179,7 +179,7 @@ CSFML_API sfView* sfRenderImage_GetDefaultView(sfRenderImage* renderImage);
/// \return Viewport rectangle, expressed in pixels in the current target /// \return Viewport rectangle, expressed in pixels in the current target
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIntRect sfRenderImage_GetViewport(sfRenderImage* renderImage, sfView* view); CSFML_API sfIntRect sfRenderImage_GetViewport(const sfRenderImage* renderImage, const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Convert a point in image coordinates into view coordinates /// Convert a point in image coordinates into view coordinates
@ -192,7 +192,7 @@ CSFML_API sfIntRect sfRenderImage_GetViewport(sfRenderImage* renderImage, sfView
/// \param targetView : Target view to convert the point to (pass NULL to use the current view) /// \param targetView : Target view to convert the point to (pass NULL to use the current view)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_ConvertCoords(sfRenderImage* renderImage, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, sfView* targetView); CSFML_API void sfRenderImage_ConvertCoords(const sfRenderImage* renderImage, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target image /// Get the target image
@ -202,7 +202,7 @@ CSFML_API void sfRenderImage_ConvertCoords(sfRenderImage* renderImage, unsigned
/// \return Pointer to the target image /// \return Pointer to the target image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfRenderImage_GetImage(sfRenderImage* renderImage); CSFML_API const sfImage* sfRenderImage_GetImage(const sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check whether the system supports render images or not /// Check whether the system supports render images or not

View File

@ -47,7 +47,7 @@
/// \param settings : Creation settings (pass NULL to use default values) /// \param settings : Creation settings (pass NULL to use default values)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, unsigned long style, sfContextSettings* settings); CSFML_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, unsigned long style, const sfContextSettings* settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a renderwindow from an existing control /// Construct a renderwindow from an existing control
@ -56,7 +56,7 @@ CSFML_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* ti
/// \param settings : Creation settings (pass NULL to use default values) /// \param settings : Creation settings (pass NULL to use default values)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings* settings); CSFML_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing renderwindow /// Destroy an existing renderwindow
@ -80,7 +80,7 @@ CSFML_API void sfRenderWindow_Close(sfRenderWindow* renderWindow);
/// \param renderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfRenderWindow_IsOpened(sfRenderWindow* renderWindow); CSFML_API sfBool sfRenderWindow_IsOpened(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of a window /// Get the width of the rendering region of a window
@ -90,7 +90,7 @@ CSFML_API sfBool sfRenderWindow_IsOpened(sfRenderWindow* renderWindow);
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderWindow_GetWidth(sfRenderWindow* renderWindow); CSFML_API unsigned int sfRenderWindow_GetWidth(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rendering region of a window /// Get the height of the rendering region of a window
@ -100,7 +100,7 @@ CSFML_API unsigned int sfRenderWindow_GetWidth(sfRenderWindow* renderWindow);
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderWindow_GetHeight(sfRenderWindow* renderWindow); CSFML_API unsigned int sfRenderWindow_GetHeight(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
@ -110,7 +110,7 @@ CSFML_API unsigned int sfRenderWindow_GetHeight(sfRenderWindow* renderWindow);
/// \return Settings used to create the window /// \return Settings used to create the window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfContextSettings sfRenderWindow_GetSettings(sfRenderWindow* renderWindow); CSFML_API sfContextSettings sfRenderWindow_GetSettings(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the event on top of events stack of a window, if any, and pop it /// Get the event on top of events stack of a window, if any, and pop it
@ -211,7 +211,7 @@ CSFML_API void sfRenderWindow_EnableKeyRepeat(sfRenderWindow* renderWindow, sfBo
/// \param pixels : Pointer to the pixels in memory, format must be RGBA 32 bits /// \param pixels : Pointer to the pixels in memory, format must be RGBA 32 bits
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, sfUint8* pixels); CSFML_API void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a window as the current target for rendering /// Activate or deactivate a window as the current target for rendering
@ -258,7 +258,7 @@ CSFML_API void sfRenderWindow_Display(sfRenderWindow* renderWindow);
/// \return Reference to the input /// \return Reference to the input
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfInput* sfRenderWindow_GetInput(sfRenderWindow* renderWindow); CSFML_API const sfInput* sfRenderWindow_GetInput(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Limit the framerate to a maximum fixed frequency for a window /// Limit the framerate to a maximum fixed frequency for a window
@ -277,7 +277,7 @@ CSFML_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, un
/// \return Time elapsed, in seconds /// \return Time elapsed, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfRenderWindow_GetFrameTime(sfRenderWindow* renderWindow); CSFML_API float sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which /// Change the joystick threshold, ie. the value below which
@ -296,9 +296,9 @@ CSFML_API void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* renderWindow,
/// \param sprite / text / shape : Object to draw /// \param sprite / text / shape : Object to draw
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, sfSprite* sprite); CSFML_API void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, const sfSprite* sprite);
CSFML_API void sfRenderWindow_DrawShape (sfRenderWindow* renderWindow, sfShape* shape); CSFML_API void sfRenderWindow_DrawShape (sfRenderWindow* renderWindow, const sfShape* shape);
CSFML_API void sfRenderWindow_DrawText (sfRenderWindow* renderWindow, sfText* text); CSFML_API void sfRenderWindow_DrawText (sfRenderWindow* renderWindow, const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderwindow with a shader /// Draw something on a renderwindow with a shader
@ -308,9 +308,9 @@ CSFML_API void sfRenderWindow_DrawText (sfRenderWindow* renderWindow, sfText*
/// \param shader : Shader to use /// \param shader : Shader to use
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_DrawSpriteWithShader(sfRenderWindow* renderWindow, sfSprite* sprite, sfShader* shader); CSFML_API void sfRenderWindow_DrawSpriteWithShader(sfRenderWindow* renderWindow, const sfSprite* sprite, const sfShader* shader);
CSFML_API void sfRenderWindow_DrawShapeWithShader (sfRenderWindow* renderWindow, sfShape* shape, sfShader* shader); CSFML_API void sfRenderWindow_DrawShapeWithShader (sfRenderWindow* renderWindow, const sfShape* shape, const sfShader* shader);
CSFML_API void sfRenderWindow_DrawTextWithShader (sfRenderWindow* renderWindow, sfText* text, sfShader* shader); CSFML_API void sfRenderWindow_DrawTextWithShader (sfRenderWindow* renderWindow, const sfText* text, const sfShader* shader);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear the screen with the given color /// Clear the screen with the given color
@ -328,7 +328,7 @@ CSFML_API void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfColor color)
/// \param view : Pointer to the new view /// \param view : Pointer to the new view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetView(sfRenderWindow* renderWindow, sfView* view); CSFML_API void sfRenderWindow_SetView(sfRenderWindow* renderWindow, const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current active view of a renderwindow /// Get the current active view of a renderwindow
@ -338,7 +338,7 @@ CSFML_API void sfRenderWindow_SetView(sfRenderWindow* renderWindow, sfView* view
/// \return Current active view /// \return Current active view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfView* sfRenderWindow_GetView(sfRenderWindow* renderWindow); CSFML_API const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the default view of a renderwindow /// Get the default view of a renderwindow
@ -359,7 +359,7 @@ CSFML_API sfView* sfRenderWindow_GetDefaultView(sfRenderWindow* renderWindow);
/// \return Viewport rectangle, expressed in pixels in the current target /// \return Viewport rectangle, expressed in pixels in the current target
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIntRect sfRenderWindow_GetViewport(sfRenderWindow* renderWindow, sfView* view); CSFML_API sfIntRect sfRenderWindow_GetViewport(const sfRenderWindow* renderWindow, const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Convert a point in window coordinates into view coordinates /// Convert a point in window coordinates into view coordinates
@ -372,7 +372,7 @@ CSFML_API sfIntRect sfRenderWindow_GetViewport(sfRenderWindow* renderWindow, sfV
/// \param targetView : Target view to convert the point to (pass NULL to use the current view) /// \param targetView : Target view to convert the point to (pass NULL to use the current view)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_ConvertCoords(sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, sfView* targetView); CSFML_API void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView);
#endif // SFML_RENDERWINDOW_H #endif // SFML_RENDERWINDOW_H

View File

@ -40,7 +40,7 @@
/// \return A new sfShader object, or NULL if it failed /// \return A new sfShader object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfShader* sfShader_CreateFromFile(const char* Filename); CSFML_API sfShader* sfShader_CreateFromFile(const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shader from an effect source code /// Create a new shader from an effect source code
@ -108,7 +108,7 @@ CSFML_API void sfShader_SetParameter4(sfShader* shader, const char* name, float
/// \param texture : Image to set (pass NULL to use the texture of the object being drawn) /// \param texture : Image to set (pass NULL to use the texture of the object being drawn)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShader_SetTexture(sfShader* shader, const char* name, sfImage* texture); CSFML_API void sfShader_SetTexture(sfShader* shader, const char* name, const sfImage* texture);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a shader for rendering /// Bind a shader for rendering
@ -116,7 +116,7 @@ CSFML_API void sfShader_SetTexture(sfShader* shader, const char* name, sfImage*
/// \param shader : Shader to bind /// \param shader : Shader to bind
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShader_Bind(sfShader* shader); CSFML_API void sfShader_Bind(const sfShader* shader);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Unbind a shader /// Unbind a shader
@ -124,7 +124,7 @@ CSFML_API void sfShader_Bind(sfShader* shader);
/// \param shader : Shader to unbind /// \param shader : Shader to unbind
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShader_Unbind(sfShader* shader); CSFML_API void sfShader_Unbind(const sfShader* shader);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not the system supports shaders /// Tell whether or not the system supports shaders

View File

@ -189,7 +189,7 @@ CSFML_API void sfShape_SetBlendMode(sfShape* shape, sfBlendMode mode);
/// \return Current X position /// \return Current X position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetX(sfShape* shape); CSFML_API float sfShape_GetX(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a shape /// Get the Y position of a shape
@ -199,7 +199,7 @@ CSFML_API float sfShape_GetX(sfShape* shape);
/// \return Current Y position /// \return Current Y position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetY(sfShape* shape); CSFML_API float sfShape_GetY(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a shape /// Get the horizontal scale of a shape
@ -209,7 +209,7 @@ CSFML_API float sfShape_GetY(sfShape* shape);
/// \return Current X scale factor (always positive) /// \return Current X scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetScaleX(sfShape* shape); CSFML_API float sfShape_GetScaleX(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a shape /// Get the vertical scale of a shape
@ -219,7 +219,7 @@ CSFML_API float sfShape_GetScaleX(sfShape* shape);
/// \return Current Y scale factor (always positive) /// \return Current Y scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetScaleY(sfShape* shape); CSFML_API float sfShape_GetScaleY(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a shape /// Get the orientation of a shape
@ -229,7 +229,7 @@ CSFML_API float sfShape_GetScaleY(sfShape* shape);
/// \return Current rotation, in degrees /// \return Current rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetRotation(sfShape* shape); CSFML_API float sfShape_GetRotation(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a shape /// Get the X position of the origin a shape
@ -239,7 +239,7 @@ CSFML_API float sfShape_GetRotation(sfShape* shape);
/// \return Current X origin /// \return Current X origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetOriginX(sfShape* shape); CSFML_API float sfShape_GetOriginX(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of the origin a shape /// Get the Y position of the origin a shape
@ -249,7 +249,7 @@ CSFML_API float sfShape_GetOriginX(sfShape* shape);
/// \return Current Y origin /// \return Current Y origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetOriginY(sfShape* shape); CSFML_API float sfShape_GetOriginY(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a shape /// Get the color of a shape
@ -259,7 +259,7 @@ CSFML_API float sfShape_GetOriginY(sfShape* shape);
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfShape_GetColor(sfShape* shape); CSFML_API sfColor sfShape_GetColor(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a shape /// Get the current blending mode of a shape
@ -269,7 +269,7 @@ CSFML_API sfColor sfShape_GetColor(sfShape* shape);
/// \return Current blending mode /// \return Current blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBlendMode sfShape_GetBlendMode(sfShape* shape); CSFML_API sfBlendMode sfShape_GetBlendMode(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a shape /// Move a shape
@ -311,7 +311,7 @@ CSFML_API void sfShape_Rotate(sfShape* shape, float angle);
/// \param y : Value to fill with the y coordinate of the converted point /// \param y : Value to fill with the y coordinate of the converted point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_TransformToLocal(sfShape* shape, float pointX, float pointY, float* x, float* y); CSFML_API void sfShape_TransformToLocal(const sfShape* shape, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point from the shape's local coordinates into global coordinates /// Transform a point from the shape's local coordinates into global coordinates
@ -324,7 +324,7 @@ CSFML_API void sfShape_TransformToLocal(sfShape* shape, float pointX, float poin
/// \param y : Value to fill with the y coordinate of the converted point /// \param y : Value to fill with the y coordinate of the converted point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_TransformToGlobal(sfShape* shape, float pointX, float pointY, float* x, float* y); CSFML_API void sfShape_TransformToGlobal(const sfShape* shape, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add a point to a shape /// Add a point to a shape
@ -374,7 +374,7 @@ CSFML_API void sfShape_SetOutlineWidth(sfShape* shape, float width);
/// \param return Current outline width /// \param return Current outline width
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetOutlineWidth(sfShape* shape); CSFML_API float sfShape_GetOutlineWidth(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the number of points composing a shape /// Get the number of points composing a shape
@ -384,7 +384,7 @@ CSFML_API float sfShape_GetOutlineWidth(sfShape* shape);
/// \return Total number of points /// \return Total number of points
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfShape_GetNbPoints(sfShape* shape); CSFML_API unsigned int sfShape_GetNbPoints(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a the position of a shape's point /// Get a the position of a shape's point
@ -395,7 +395,7 @@ CSFML_API unsigned int sfShape_GetNbPoints(sfShape* shape);
/// \param y : Variable to fill with the Y coordinate of the point /// \param y : Variable to fill with the Y coordinate of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_GetPointPosition(sfShape* shape, unsigned int index, float* x, float* y); CSFML_API void sfShape_GetPointPosition(const sfShape* shape, unsigned int index, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a the color of a shape's point /// Get a the color of a shape's point
@ -406,7 +406,7 @@ CSFML_API void sfShape_GetPointPosition(sfShape* shape, unsigned int index, floa
/// \return Color of the point /// \return Color of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfShape_GetPointColor(sfShape* shape, unsigned int index); CSFML_API sfColor sfShape_GetPointColor(const sfShape* shape, unsigned int index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a the outline color of a shape's point /// Get a the outline color of a shape's point
@ -417,7 +417,7 @@ CSFML_API sfColor sfShape_GetPointColor(sfShape* shape, unsigned int index);
/// \return Outline color of the point /// \return Outline color of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfShape_GetPointOutlineColor(sfShape* shape, unsigned int index); CSFML_API sfColor sfShape_GetPointOutlineColor(const sfShape* shape, unsigned int index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the position of a shape's point /// Set a the position of a shape's point

View File

@ -153,7 +153,7 @@ CSFML_API void sfSprite_SetBlendMode(sfSprite* sprite, sfBlendMode mode);
/// \return Current X position /// \return Current X position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetX(sfSprite* sprite); CSFML_API float sfSprite_GetX(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a sprite /// Get the Y position of a sprite
@ -163,7 +163,7 @@ CSFML_API float sfSprite_GetX(sfSprite* sprite);
/// \return Current Y position /// \return Current Y position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetY(sfSprite* sprite); CSFML_API float sfSprite_GetY(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a sprite /// Get the horizontal scale of a sprite
@ -173,7 +173,7 @@ CSFML_API float sfSprite_GetY(sfSprite* sprite);
/// \return Current X scale factor (always positive) /// \return Current X scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetScaleX(sfSprite* sprite); CSFML_API float sfSprite_GetScaleX(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a sprite /// Get the vertical scale of a sprite
@ -183,7 +183,7 @@ CSFML_API float sfSprite_GetScaleX(sfSprite* sprite);
/// \return Current Y scale factor (always positive) /// \return Current Y scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetScaleY(sfSprite* sprite); CSFML_API float sfSprite_GetScaleY(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a sprite /// Get the orientation of a sprite
@ -193,7 +193,7 @@ CSFML_API float sfSprite_GetScaleY(sfSprite* sprite);
/// \return Current rotation, in degrees /// \return Current rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetRotation(sfSprite* sprite); CSFML_API float sfSprite_GetRotation(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a sprite /// Get the X position of the origin a sprite
@ -203,7 +203,7 @@ CSFML_API float sfSprite_GetRotation(sfSprite* sprite);
/// \return Current X origin /// \return Current X origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetOriginX(sfSprite* sprite); CSFML_API float sfSprite_GetOriginX(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of the origin a sprite /// Get the Y position of the origin a sprite
@ -213,7 +213,7 @@ CSFML_API float sfSprite_GetOriginX(sfSprite* sprite);
/// \return Current Y origin /// \return Current Y origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetOriginY(sfSprite* sprite); CSFML_API float sfSprite_GetOriginY(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a sprite /// Get the color of a sprite
@ -223,7 +223,7 @@ CSFML_API float sfSprite_GetOriginY(sfSprite* sprite);
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfSprite_GetColor(sfSprite* sprite); CSFML_API sfColor sfSprite_GetColor(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a sprite /// Get the current blending mode of a sprite
@ -233,7 +233,7 @@ CSFML_API sfColor sfSprite_GetColor(sfSprite* sprite);
/// \return Current blending mode /// \return Current blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBlendMode sfSprite_GetBlendMode(sfSprite* sprite); CSFML_API sfBlendMode sfSprite_GetBlendMode(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a sprite /// Move a sprite
@ -275,7 +275,7 @@ CSFML_API void sfSprite_Rotate(sfSprite* sprite, float angle);
/// \param y : Value to fill with the y coordinate of the converted point /// \param y : Value to fill with the y coordinate of the converted point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_TransformToLocal(sfSprite* sprite, float pointX, float pointY, float* x, float* y); CSFML_API void sfSprite_TransformToLocal(const sfSprite* sprite, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point from the sprite's local coordinates into global coordinates /// Transform a point from the sprite's local coordinates into global coordinates
@ -288,7 +288,7 @@ CSFML_API void sfSprite_TransformToLocal(sfSprite* sprite, float pointX, float p
/// \param y : Value to fill with the y coordinate of the converted point /// \param y : Value to fill with the y coordinate of the converted point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_TransformToGlobal(sfSprite* sprite, float pointX, float pointY, float* x, float* y); CSFML_API void sfSprite_TransformToGlobal(const sfSprite* sprite, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the image of a sprite /// Change the image of a sprite
@ -297,7 +297,7 @@ CSFML_API void sfSprite_TransformToGlobal(sfSprite* sprite, float pointX, float
/// \param image : New image /// \param image : New image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetImage(sfSprite* sprite, sfImage* image); CSFML_API void sfSprite_SetImage(sfSprite* sprite, const sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sub-rectangle of a sprite inside the source image /// Set the sub-rectangle of a sprite inside the source image
@ -344,7 +344,7 @@ CSFML_API void sfSprite_FlipY(sfSprite* sprite, sfBool flipped);
/// \return Pointer to the image (can be NULL) /// \return Pointer to the image (can be NULL)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfSprite_GetImage(sfSprite* sprite); CSFML_API const sfImage* sfSprite_GetImage(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sub-rectangle of a sprite inside the source image /// Get the sub-rectangle of a sprite inside the source image
@ -354,7 +354,7 @@ CSFML_API sfImage* sfSprite_GetImage(sfSprite* sprite);
/// \return Sub-rectangle /// \return Sub-rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIntRect sfSprite_GetSubRect(sfSprite* sprite); CSFML_API sfIntRect sfSprite_GetSubRect(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite width /// Get a sprite width
@ -364,7 +364,7 @@ CSFML_API sfIntRect sfSprite_GetSubRect(sfSprite* sprite);
/// \return Width of the sprite /// \return Width of the sprite
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetWidth(sfSprite* sprite); CSFML_API float sfSprite_GetWidth(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite height /// Get a sprite height
@ -374,7 +374,7 @@ CSFML_API float sfSprite_GetWidth(sfSprite* sprite);
/// \return Height of the sprite /// \return Height of the sprite
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetHeight(sfSprite* sprite); CSFML_API float sfSprite_GetHeight(const sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a given pixel in a sprite /// Get the color of a given pixel in a sprite
@ -386,7 +386,7 @@ CSFML_API float sfSprite_GetHeight(sfSprite* sprite);
/// \return Color of pixel (X, Y) /// \return Color of pixel (X, Y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfSprite_GetPixel(sfSprite* sprite, unsigned int x, unsigned int y); CSFML_API sfColor sfSprite_GetPixel(const sfSprite* sprite, unsigned int x, unsigned int y);
#endif // SFML_SPRITE_H #endif // SFML_SPRITE_H

View File

@ -165,7 +165,7 @@ CSFML_API void sfText_SetBlendMode(sfText* text, sfBlendMode mode);
/// \return Current X position /// \return Current X position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetX(sfText* text); CSFML_API float sfText_GetX(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top Y of a text /// Get the top Y of a text
@ -175,7 +175,7 @@ CSFML_API float sfText_GetX(sfText* text);
/// \return Current Y position /// \return Current Y position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetY(sfText* text); CSFML_API float sfText_GetY(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a text /// Get the horizontal scale of a text
@ -185,7 +185,7 @@ CSFML_API float sfText_GetY(sfText* text);
/// \return Current X scale factor (always positive) /// \return Current X scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetScaleX(sfText* text); CSFML_API float sfText_GetScaleX(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a text /// Get the vertical scale of a text
@ -195,7 +195,7 @@ CSFML_API float sfText_GetScaleX(sfText* text);
/// \return Current Y scale factor (always positive) /// \return Current Y scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetScaleY(sfText* text); CSFML_API float sfText_GetScaleY(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a text /// Get the orientation of a text
@ -205,7 +205,7 @@ CSFML_API float sfText_GetScaleY(sfText* text);
/// \return Current rotation, in degrees /// \return Current rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetRotation(sfText* text); CSFML_API float sfText_GetRotation(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a text /// Get the X position of the origin a text
@ -215,7 +215,7 @@ CSFML_API float sfText_GetRotation(sfText* text);
/// \return Current X origin position /// \return Current X origin position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetOriginX(sfText* text); CSFML_API float sfText_GetOriginX(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top Y of the origin of a text /// Get the top Y of the origin of a text
@ -225,7 +225,7 @@ CSFML_API float sfText_GetOriginX(sfText* text);
/// \return Current Y origin position /// \return Current Y origin position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetOriginY(sfText* text); CSFML_API float sfText_GetOriginY(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a text /// Get the color of a text
@ -235,7 +235,7 @@ CSFML_API float sfText_GetOriginY(sfText* text);
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfText_GetColor(sfText* text); CSFML_API sfColor sfText_GetColor(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a text /// Get the current blending mode of a text
@ -245,7 +245,7 @@ CSFML_API sfColor sfText_GetColor(sfText* text);
/// \return Current blending mode /// \return Current blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBlendMode sfText_GetBlendMode(sfText* text); CSFML_API sfBlendMode sfText_GetBlendMode(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a text /// Move a text
@ -287,7 +287,7 @@ CSFML_API void sfText_Rotate(sfText* text, float angle);
/// \param y : Value to fill with the y coordinate of the converted point /// \param y : Value to fill with the y coordinate of the converted point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfText_TransformToLocal(sfText* text, float pointX, float pointY, float* x, float* y); CSFML_API void sfText_TransformToLocal(const sfText* text, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point from the string's local coordinates into global coordinates /// Transform a point from the string's local coordinates into global coordinates
@ -300,7 +300,7 @@ CSFML_API void sfText_TransformToLocal(sfText* text, float pointX, float pointY,
/// \param y : Value to fill with the y coordinate of the converted point /// \param y : Value to fill with the y coordinate of the converted point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfText_TransformToGlobal(sfText* text, float pointX, float pointY, float* X, float* y); CSFML_API void sfText_TransformToGlobal(const sfText* text, float pointX, float pointY, float* X, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the string of a text (from a multibyte string) /// Set the string of a text (from a multibyte string)
@ -327,7 +327,7 @@ CSFML_API void sfText_SetUnicodeString(sfText* text, const sfUint32* string);
/// \param font : Font to use /// \param font : Font to use
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfText_SetFont(sfText* text, sfFont* font); CSFML_API void sfText_SetFont(sfText* text, const sfFont* font);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the size of a text /// Set the size of a text
@ -355,7 +355,7 @@ CSFML_API void sfText_SetStyle(sfText* text, unsigned long style);
/// \return String as UTF-32 /// \return String as UTF-32
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfUint32* sfText_GetUnicodeString(sfText* text); CSFML_API const sfUint32* sfText_GetUnicodeString(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the text of a text (returns an ANSI string) /// Get the text of a text (returns an ANSI string)
@ -365,7 +365,7 @@ CSFML_API const sfUint32* sfText_GetUnicodeString(sfText* text);
/// \return String an a locale-dependant ANSI string /// \return String an a locale-dependant ANSI string
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfText_GetString(sfText* text); CSFML_API const char* sfText_GetString(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the font used by a text /// Get the font used by a text
@ -375,7 +375,7 @@ CSFML_API const char* sfText_GetString(sfText* text);
/// \return Pointer to the font /// \return Pointer to the font
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFont* sfText_GetFont(sfText* text); CSFML_API const sfFont* sfText_GetFont(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the characters of a text /// Get the size of the characters of a text
@ -385,7 +385,7 @@ CSFML_API sfFont* sfText_GetFont(sfText* text);
/// \return Size of the characters /// \return Size of the characters
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfText_GetSize(sfText* text); CSFML_API float sfText_GetSize(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the style of a text /// Get the style of a text
@ -395,7 +395,7 @@ CSFML_API float sfText_GetSize(sfText* text);
/// \return Current string style (see sfTextStyle enum) /// \return Current string style (see sfTextStyle enum)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned long sfText_GetStyle(sfText* text); CSFML_API unsigned long sfText_GetStyle(const sfText* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the visual position of the Index-th character of the text, /// Return the visual position of the Index-th character of the text,
@ -408,7 +408,7 @@ CSFML_API unsigned long sfText_GetStyle(sfText* text);
/// \param y : Value to fill with the y coordinate of the position /// \param y : Value to fill with the y coordinate of the position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfText_GetCharacterPos(sfText* text, size_t index, float* x, float* y); CSFML_API void sfText_GetCharacterPos(const sfText* text, size_t index, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the bounding rectangle of a text on screen /// Get the bounding rectangle of a text on screen
@ -418,7 +418,7 @@ CSFML_API void sfText_GetCharacterPos(sfText* text, size_t index, float* x, floa
/// \return Rectangle contaning the string in screen coordinates /// \return Rectangle contaning the string in screen coordinates
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFloatRect sfText_GetRect(sfText* text); CSFML_API sfFloatRect sfText_GetRect(const sfText* text);
#endif // SFML_TEXT_H #endif // SFML_TEXT_H

View File

@ -115,7 +115,7 @@ CSFML_API void sfView_Reset(sfView* view, sfFloatRect rectangle);
/// \return X coordinate of the center of the view /// \return X coordinate of the center of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetCenterX(sfView* view); CSFML_API float sfView_GetCenterX(const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y coordinate of the center of a view /// Get the Y coordinate of the center of a view
@ -125,7 +125,7 @@ CSFML_API float sfView_GetCenterX(sfView* view);
/// \return Y coordinate of the center of the view /// \return Y coordinate of the center of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetCenterY(sfView* view); CSFML_API float sfView_GetCenterY(const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the view /// Get the width of the view
@ -135,7 +135,7 @@ CSFML_API float sfView_GetCenterY(sfView* view);
/// \return Width of the view /// \return Width of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetWidth(sfView* view); CSFML_API float sfView_GetWidth(const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the view /// Get the height of the view
@ -145,7 +145,7 @@ CSFML_API float sfView_GetWidth(sfView* view);
/// \return Height of the view /// \return Height of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetHeight(sfView* view); CSFML_API float sfView_GetHeight(const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current rotation of a view /// Get the current rotation of a view
@ -155,7 +155,7 @@ CSFML_API float sfView_GetHeight(sfView* view);
/// \return Rotation of the view, in degrees /// \return Rotation of the view, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetRotation(sfView* view); CSFML_API float sfView_GetRotation(const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target viewport of a view /// Get the target viewport of a view
@ -165,7 +165,7 @@ CSFML_API float sfView_GetRotation(sfView* view);
/// \return Viewport rectangle, expressed as a factor of the target size /// \return Viewport rectangle, expressed as a factor of the target size
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFloatRect sfView_GetViewport(sfView* view); CSFML_API sfFloatRect sfView_GetViewport(const sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a view /// Move a view

View File

@ -128,7 +128,7 @@ CSFML_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResp
/// \return sfTrue if status is success (code < 400) /// \return sfTrue if status is success (code < 400)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* ftpListingResponse); CSFML_API sfBool sfFtpListingResponse_IsOk(const sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
@ -138,7 +138,7 @@ CSFML_API sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* ftpListingRespo
/// \return Status code /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpListingResponse); CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(const sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
@ -148,7 +148,7 @@ CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpLi
/// \return The response message /// \return The response message
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* ftpListingResponse); CSFML_API const char* sfFtpListingResponse_GetMessage(const sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the number of filenames in the listing /// Get the number of filenames in the listing
@ -158,7 +158,7 @@ CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* ftpL
/// \return Total number of filenames /// \return Total number of filenames
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* ftpListingResponse); CSFML_API size_t sfFtpListingResponse_GetCount(const sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Index-th filename in the directory /// Get the Index-th filename in the directory
@ -169,7 +169,7 @@ CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* ftpListingR
/// \return Index-th filename /// \return Index-th filename
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpListingResponse_GetFilename(sfFtpListingResponse* ftpListingResponse, size_t index); CSFML_API const char* sfFtpListingResponse_GetFilename(const sfFtpListingResponse* ftpListingResponse, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp directory response /// Destroy an existing Ftp directory response
@ -188,7 +188,7 @@ CSFML_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirecto
/// \return sfTrue if status is success (code < 400) /// \return sfTrue if status is success (code < 400)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* ftpDirectoryResponse); CSFML_API sfBool sfFtpDirectoryResponse_IsOk(const sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
@ -198,7 +198,7 @@ CSFML_API sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* ftpDirector
/// \return Status code /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* ftpDirectoryResponse); CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
@ -208,7 +208,7 @@ CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* f
/// \return The response message /// \return The response message
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* ftpDirectoryResponse); CSFML_API const char* sfFtpDirectoryResponse_GetMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the directory returned in the response /// Get the directory returned in the response
@ -218,7 +218,7 @@ CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse*
/// \return Directory name /// \return Directory name
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* ftpDirectoryResponse); CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -238,7 +238,7 @@ CSFML_API void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse);
/// \return sfTrue if status is success (code < 400) /// \return sfTrue if status is success (code < 400)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfFtpResponse_IsOk(sfFtpResponse* ftpResponse); CSFML_API sfBool sfFtpResponse_IsOk(const sfFtpResponse* ftpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
@ -248,7 +248,7 @@ CSFML_API sfBool sfFtpResponse_IsOk(sfFtpResponse* ftpResponse);
/// \return Status code /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse); CSFML_API sfFtpStatus sfFtpResponse_GetStatus(const sfFtpResponse* ftpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
@ -258,7 +258,7 @@ CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse);
/// \return The response message /// \return The response message
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* ftpResponse); CSFML_API const char* sfFtpResponse_GetMessage(const sfFtpResponse* ftpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new Ftp /// Construct a new Ftp

View File

@ -164,7 +164,7 @@ CSFML_API void sfHttpResponse_Destroy(sfHttpResponse* httpResponse);
/// \return Value of the field (NULL if it doesn't exist) /// \return Value of the field (NULL if it doesn't exist)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfHttpResponse_GetField(sfHttpResponse* httpResponse, const char* field); CSFML_API const char* sfHttpResponse_GetField(const sfHttpResponse* httpResponse, const char* field);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a response /// Get the status of a response
@ -174,7 +174,7 @@ CSFML_API const char* sfHttpResponse_GetField(sfHttpResponse* httpResponse, cons
/// \return Status of the response /// \return Status of the response
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse); CSFML_API sfHttpStatus sfHttpResponse_GetStatus(const sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the major HTTP version of a response /// Get the major HTTP version of a response
@ -184,7 +184,7 @@ CSFML_API sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse);
/// \return HTTP major version of the response /// \return HTTP major version of the response
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfHttpResponse_GetMajorVersion(sfHttpResponse* httpResponse); CSFML_API unsigned int sfHttpResponse_GetMajorVersion(const sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minor HTTP version of a response /// Get the minor HTTP version of a response
@ -194,7 +194,7 @@ CSFML_API unsigned int sfHttpResponse_GetMajorVersion(sfHttpResponse* httpRespon
/// \return HTTP minor version of the response /// \return HTTP minor version of the response
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* httpResponse); CSFML_API unsigned int sfHttpResponse_GetMinorVersion(const sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the body of the response. The body can contain : /// Get the body of the response. The body can contain :
@ -208,7 +208,7 @@ CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* httpRespon
/// \return Body of the response (empty string if no body) /// \return Body of the response (empty string if no body)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfHttpResponse_GetBody(sfHttpResponse* httpResponse); CSFML_API const char* sfHttpResponse_GetBody(const sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new Http object /// Construct a new Http object
@ -251,7 +251,7 @@ CSFML_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short por
/// \return Server's response, or NULL if request is invalid /// \return Server's response, or NULL if request is invalid
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, sfHttpRequest* request, float timeout); CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, float timeout);
#endif // SFML_HTTP_H #endif // SFML_HTTP_H

View File

@ -56,7 +56,7 @@ CSFML_API void sfPacket_Destroy(sfPacket* packet);
/// \param sizeInBytes : Number of bytes to append /// \param sizeInBytes : Number of bytes to append
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPacket_Append(sfPacket* packet, void* data, size_t sizeInBytes); CSFML_API void sfPacket_Append(sfPacket* packet, const void* data, size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear all the data of a packet /// Clear all the data of a packet
@ -76,7 +76,7 @@ CSFML_API void sfPacket_Clear(sfPacket* packet);
/// \return Pointer to the data /// \return Pointer to the data
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfPacket_GetData(sfPacket* packet); CSFML_API const char* sfPacket_GetData(const sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the data contained in a packet /// Get the size of the data contained in a packet
@ -86,7 +86,7 @@ CSFML_API const char* sfPacket_GetData(sfPacket* packet);
/// \return Data size, in bytes /// \return Data size, in bytes
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API size_t sfPacket_GetDataSize(sfPacket* packet); CSFML_API size_t sfPacket_GetDataSize(const sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the reading position has reached the end of the packet /// Tell if the reading position has reached the end of the packet
@ -96,7 +96,7 @@ CSFML_API size_t sfPacket_GetDataSize(sfPacket* packet);
/// \return sfTrue if all data have been read into the packet /// \return sfTrue if all data have been read into the packet
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfPacket_EndOfPacket(sfPacket* packet); CSFML_API sfBool sfPacket_EndOfPacket(const sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the validity of packet /// Return the validity of packet
@ -106,7 +106,7 @@ CSFML_API sfBool sfPacket_EndOfPacket(sfPacket* packet);
/// \return sfTrue if last data extraction from packet was successful /// \return sfTrue if last data extraction from packet was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfPacket_CanRead(sfPacket* packet); CSFML_API sfBool sfPacket_CanRead(const sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Functions to extract data from a packet /// Functions to extract data from a packet

View File

@ -104,8 +104,8 @@ CSFML_API unsigned int sfSelectorUDP_Wait(sfSelectorUDP* selector, float timeout
/// \return The Index-th socket /// \return The Index-th socket
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketTCP* sfSelectorTCP_GetSocketReady(sfSelectorTCP* selector, unsigned int index); CSFML_API sfSocketTCP* sfSelectorTCP_GetSocketReady(const sfSelectorTCP* selector, unsigned int index);
CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* selector, unsigned int index); CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(const sfSelectorUDP* selector, unsigned int index);
#endif // SFML_SELECTOR_H #endif // SFML_SELECTOR_H

View File

@ -164,7 +164,7 @@ CSFML_API sfBool sfSocketTCP_Close(sfSocketTCP* socket);
/// \return True if the socket is valid /// \return True if the socket is valid
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketTCP_IsValid(sfSocketTCP* socket); CSFML_API sfBool sfSocketTCP_IsValid(const sfSocketTCP* socket);
#endif // SFML_SOCKETTCP_H #endif // SFML_SOCKETTCP_H

View File

@ -54,7 +54,7 @@ CSFML_API void sfClock_Destroy(sfClock* clock);
/// \param clock : Clock to get time from /// \param clock : Clock to get time from
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfClock_GetTime(sfClock* clock); CSFML_API float sfClock_GetTime(const sfClock* clock);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Restart a clock /// Restart a clock

View File

@ -41,7 +41,7 @@
/// \return sfTrue if key is down, sfFalse if key is up /// \return sfTrue if key is down, sfFalse if key is up
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code); CSFML_API sfBool sfInput_IsKeyDown(const sfInput* input, sfKeyCode code);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a mouse button /// Get the state of a mouse button
@ -52,7 +52,7 @@ CSFML_API sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code);
/// \return sfTrue if button is down, sfFalse if button is up /// \return sfTrue if button is down, sfFalse if button is up
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfInput_IsMouseButtonDown(sfInput* input, sfMouseButton button); CSFML_API sfBool sfInput_IsMouseButtonDown(const sfInput* input, sfMouseButton button);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a joystick button /// Get the state of a joystick button
@ -64,7 +64,7 @@ CSFML_API sfBool sfInput_IsMouseButtonDown(sfInput* input, sfMouseButton button)
/// \return sfTrue if button is down, sfFalse if button is up /// \return sfTrue if button is down, sfFalse if button is up
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfInput_IsJoystickButtonDown(sfInput* input, unsigned int joyId, unsigned int button); CSFML_API sfBool sfInput_IsJoystickButtonDown(const sfInput* input, unsigned int joyId, unsigned int button);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse X position /// Get the mouse X position
@ -74,7 +74,7 @@ CSFML_API sfBool sfInput_IsJoystickButtonDown(sfInput* input, unsigned int joyId
/// \return Current mouse left position, relative to owner window /// \return Current mouse left position, relative to owner window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API int sfInput_GetMouseX(sfInput* input); CSFML_API int sfInput_GetMouseX(const sfInput* input);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse Y position /// Get the mouse Y position
@ -84,7 +84,7 @@ CSFML_API int sfInput_GetMouseX(sfInput* input);
/// \return Current mouse top position, relative to owner window /// \return Current mouse top position, relative to owner window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API int sfInput_GetMouseY(sfInput* input); CSFML_API int sfInput_GetMouseY(const sfInput* input);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the joystick position on a given axis /// Get the joystick position on a given axis
@ -96,7 +96,7 @@ CSFML_API int sfInput_GetMouseY(sfInput* input);
/// \return Current joystick position, in the range [-100, 100] /// \return Current joystick position, in the range [-100, 100]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfInput_GetJoystickAxis(sfInput* input, unsigned int joyId, sfJoyAxis axis); CSFML_API float sfInput_GetJoystickAxis(const sfInput* input, unsigned int joyId, sfJoyAxis axis);
#endif // SFML_INPUT_H #endif // SFML_INPUT_H

View File

@ -71,7 +71,7 @@ typedef struct
/// \param settings : Creation settings (pass NULL to use default values) /// \param settings : Creation settings (pass NULL to use default values)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long style, sfContextSettings* settings); CSFML_API sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long style, const sfContextSettings* settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a window from an existing control /// Construct a window from an existing control
@ -80,7 +80,7 @@ CSFML_API sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigne
/// \param settings : Creation settings (pass NULL to use default values) /// \param settings : Creation settings (pass NULL to use default values)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings* settings); CSFML_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing window /// Destroy an existing window
@ -104,7 +104,7 @@ CSFML_API void sfWindow_Close(sfWindow* window);
/// \param window : Window object /// \param window : Window object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfWindow_IsOpened(sfWindow* window); CSFML_API sfBool sfWindow_IsOpened(const sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of a window /// Get the width of the rendering region of a window
@ -114,7 +114,7 @@ CSFML_API sfBool sfWindow_IsOpened(sfWindow* window);
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfWindow_GetWidth(sfWindow* window); CSFML_API unsigned int sfWindow_GetWidth(const sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rendering region of a window /// Get the height of the rendering region of a window
@ -124,7 +124,7 @@ CSFML_API unsigned int sfWindow_GetWidth(sfWindow* window);
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfWindow_GetHeight(sfWindow* window); CSFML_API unsigned int sfWindow_GetHeight(const sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
@ -134,7 +134,7 @@ CSFML_API unsigned int sfWindow_GetHeight(sfWindow* window);
/// \return Settings used to create the window /// \return Settings used to create the window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfContextSettings sfWindow_GetSettings(sfWindow* window); CSFML_API sfContextSettings sfWindow_GetSettings(const sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the event on top of events stack of a window, if any, and pop it /// Get the event on top of events stack of a window, if any, and pop it
@ -235,7 +235,7 @@ CSFML_API void sfWindow_EnableKeyRepeat(sfWindow* window, sfBool enabled);
/// \param pixels : Pointer to the pixels in memory, format must be RGBA 32 bits /// \param pixels : Pointer to the pixels in memory, format must be RGBA 32 bits
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, sfUint8* pixels); CSFML_API void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a window as the current target for rendering /// Activate or deactivate a window as the current target for rendering
@ -264,7 +264,7 @@ CSFML_API void sfWindow_Display(sfWindow* window);
/// \return Reference to the input /// \return Reference to the input
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfInput* sfWindow_GetInput(sfWindow* window); CSFML_API const sfInput* sfWindow_GetInput(sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Limit the framerate to a maximum fixed frequency for a window /// Limit the framerate to a maximum fixed frequency for a window
@ -283,7 +283,7 @@ CSFML_API void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit);
/// \return Time elapsed, in seconds /// \return Time elapsed, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfWindow_GetFrameTime(sfWindow* window); CSFML_API float sfWindow_GetFrameTime(const sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which /// Change the joystick threshold, ie. the value below which

View File

@ -85,7 +85,7 @@ void sfMusic_SetLoop(sfMusic* music, sfBool loop)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a music is looping /// Tell whether or not a music is looping
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfMusic_GetLoop(sfMusic* music) sfBool sfMusic_GetLoop(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetLoop(), sfFalse); CSFML_CALL_RETURN(music, GetLoop(), sfFalse);
} }
@ -94,7 +94,7 @@ sfBool sfMusic_GetLoop(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a music duration /// Get a music duration
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetDuration(sfMusic* music) float sfMusic_GetDuration(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetDuration(), 0.f); CSFML_CALL_RETURN(music, GetDuration(), 0.f);
} }
@ -130,7 +130,7 @@ void sfMusic_Stop(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of channels of a music (1 = mono, 2 = stereo) /// Return the number of channels of a music (1 = mono, 2 = stereo)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfMusic_GetChannelsCount(sfMusic* music) unsigned int sfMusic_GetChannelsCount(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetChannelsCount(), 0); CSFML_CALL_RETURN(music, GetChannelsCount(), 0);
} }
@ -139,7 +139,7 @@ unsigned int sfMusic_GetChannelsCount(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the stream sample rate of a music /// Get the stream sample rate of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfMusic_GetSampleRate(sfMusic* music) unsigned int sfMusic_GetSampleRate(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetSampleRate(), 0); CSFML_CALL_RETURN(music, GetSampleRate(), 0);
} }
@ -148,7 +148,7 @@ unsigned int sfMusic_GetSampleRate(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a music (stopped, paused, playing) /// Get the status of a music (stopped, paused, playing)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundStatus sfMusic_GetStatus(sfMusic* music) sfSoundStatus sfMusic_GetStatus(const sfMusic* music)
{ {
CSFML_CHECK_RETURN(music, sfStopped); CSFML_CHECK_RETURN(music, sfStopped);
@ -159,7 +159,7 @@ sfSoundStatus sfMusic_GetStatus(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a music /// Get the current playing position of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetPlayingOffset(sfMusic* music) float sfMusic_GetPlayingOffset(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetPlayingOffset(), 0.f); CSFML_CALL_RETURN(music, GetPlayingOffset(), 0.f);
} }
@ -237,7 +237,7 @@ void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a music /// Get the pitch of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetPitch(sfMusic* music) float sfMusic_GetPitch(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetPitch(), 0.f); CSFML_CALL_RETURN(music, GetPitch(), 0.f);
} }
@ -246,7 +246,7 @@ float sfMusic_GetPitch(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a music /// Get the volume of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetVolume(sfMusic* music) float sfMusic_GetVolume(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetVolume(), 0.f); CSFML_CALL_RETURN(music, GetVolume(), 0.f);
} }
@ -255,7 +255,7 @@ float sfMusic_GetVolume(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a music /// Get the position of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_GetPosition(sfMusic* music, float* x, float* y, float* z) void sfMusic_GetPosition(const sfMusic* music, float* x, float* y, float* z)
{ {
CSFML_CHECK(music); CSFML_CHECK(music);
@ -273,7 +273,7 @@ void sfMusic_GetPosition(sfMusic* music, float* x, float* y, float* z)
/// Tell if the music's position is relative to the listener's /// Tell if the music's position is relative to the listener's
/// position, or if it's absolute /// position, or if it's absolute
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfMusic_IsRelativeToListener(sfMusic* music) CSFML_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, IsRelativeToListener(), sfFalse); CSFML_CALL_RETURN(music, IsRelativeToListener(), sfFalse);
} }
@ -282,16 +282,16 @@ CSFML_API sfBool sfMusic_IsRelativeToListener(sfMusic* music)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a music /// Get the minimum distance of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetMinDistance(sfMusic* music) float sfMusic_GetMinDistance(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetMinDistance(), 0.f); CSFML_CALL_RETURN(music, GetMinDistance(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a a /// Get the attenuation factor of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetAttenuation(sfMusic* music) float sfMusic_GetAttenuation(const sfMusic* music)
{ {
CSFML_CALL_RETURN(music, GetAttenuation(), 0.f); CSFML_CALL_RETURN(music, GetAttenuation(), 0.f);
} }

View File

@ -78,7 +78,7 @@ void sfSound_Stop(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a sound buffer to a sound /// Bind a sound buffer to a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetBuffer(sfSound* sound, sfSoundBuffer* buffer) void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buffer)
{ {
if (buffer) if (buffer)
{ {
@ -91,7 +91,7 @@ void sfSound_SetBuffer(sfSound* sound, sfSoundBuffer* buffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sound buffer bound to a sound /// Get the sound buffer bound to a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundBuffer* sfSound_GetBuffer(sfSound* sound) const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound)
{ {
CSFML_CHECK_RETURN(sound, NULL) CSFML_CHECK_RETURN(sound, NULL)
@ -111,7 +111,7 @@ void sfSound_SetLoop(sfSound* sound, sfBool loop)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a sound is looping /// Tell whether or not a sound is looping
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSound_GetLoop(sfSound* sound) sfBool sfSound_GetLoop(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, GetLoop(), sfFalse) CSFML_CALL_RETURN(sound, GetLoop(), sfFalse)
} }
@ -120,7 +120,7 @@ sfBool sfSound_GetLoop(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a sound (stopped, paused, playing) /// Get the status of a sound (stopped, paused, playing)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundStatus sfSound_GetStatus(sfSound* sound) sfSoundStatus sfSound_GetStatus(const sfSound* sound)
{ {
CSFML_CHECK_RETURN(sound, sfStopped); CSFML_CHECK_RETURN(sound, sfStopped);
@ -200,7 +200,7 @@ void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a sound /// Get the pitch of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetPitch(sfSound* sound) float sfSound_GetPitch(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, GetPitch(), 0.f) CSFML_CALL_RETURN(sound, GetPitch(), 0.f)
} }
@ -209,7 +209,7 @@ float sfSound_GetPitch(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound /// Get the volume of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetVolume(sfSound* sound) float sfSound_GetVolume(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, GetVolume(), 0.f) CSFML_CALL_RETURN(sound, GetVolume(), 0.f)
} }
@ -218,7 +218,7 @@ float sfSound_GetVolume(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a sound /// Get the position of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_GetPosition(sfSound* sound, float* x, float* y, float* z) void sfSound_GetPosition(const sfSound* sound, float* x, float* y, float* z)
{ {
CSFML_CHECK(sound); CSFML_CHECK(sound);
@ -233,7 +233,7 @@ void sfSound_GetPosition(sfSound* sound, float* x, float* y, float* z)
/// Tell if the sound's position is relative to the listener's /// Tell if the sound's position is relative to the listener's
/// position, or if it's absolute /// position, or if it's absolute
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSound_IsRelativeToListener(sfSound* sound) CSFML_API sfBool sfSound_IsRelativeToListener(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, IsRelativeToListener(), sfFalse); CSFML_CALL_RETURN(sound, IsRelativeToListener(), sfFalse);
} }
@ -242,7 +242,7 @@ CSFML_API sfBool sfSound_IsRelativeToListener(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound /// Get the minimum distance of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetMinDistance(sfSound* sound) float sfSound_GetMinDistance(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, GetMinDistance(), 0.f); CSFML_CALL_RETURN(sound, GetMinDistance(), 0.f);
} }
@ -251,7 +251,7 @@ float sfSound_GetMinDistance(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound /// Get the attenuation factor of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetAttenuation(sfSound* sound) float sfSound_GetAttenuation(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, GetAttenuation(), 0.f); CSFML_CALL_RETURN(sound, GetAttenuation(), 0.f);
} }
@ -260,7 +260,7 @@ float sfSound_GetAttenuation(sfSound* sound)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound /// Get the current playing position of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetPlayingOffset(sfSound* sound) float sfSound_GetPlayingOffset(const sfSound* sound)
{ {
CSFML_CALL_RETURN(sound, GetPlayingOffset(), 0.f) CSFML_CALL_RETURN(sound, GetPlayingOffset(), 0.f)
} }

View File

@ -95,7 +95,7 @@ void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save a sound buffer to a file /// Save a sound buffer to a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSoundBuffer_SaveToFile(sfSoundBuffer* soundBuffer, const char* filename) sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
{ {
CSFML_CALL_RETURN(soundBuffer, SaveToFile(filename), sfFalse) CSFML_CALL_RETURN(soundBuffer, SaveToFile(filename), sfFalse)
} }
@ -104,7 +104,7 @@ sfBool sfSoundBuffer_SaveToFile(sfSoundBuffer* soundBuffer, const char* filename
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the samples contained in a sound buffer /// Return the samples contained in a sound buffer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const sfInt16* sfSoundBuffer_GetSamples(sfSoundBuffer* soundBuffer) const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(soundBuffer, GetSamples(), NULL) CSFML_CALL_RETURN(soundBuffer, GetSamples(), NULL)
} }
@ -113,7 +113,7 @@ const sfInt16* sfSoundBuffer_GetSamples(sfSoundBuffer* soundBuffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of samples contained in a sound buffer /// Return the number of samples contained in a sound buffer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
size_t sfSoundBuffer_GetSamplesCount(sfSoundBuffer* soundBuffer) size_t sfSoundBuffer_GetSamplesCount(const sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(soundBuffer, GetSamplesCount(), 0) CSFML_CALL_RETURN(soundBuffer, GetSamplesCount(), 0)
} }
@ -122,7 +122,7 @@ size_t sfSoundBuffer_GetSamplesCount(sfSoundBuffer* soundBuffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer /// Get the sample rate of a sound buffer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSoundBuffer_GetSampleRate(sfSoundBuffer* soundBuffer) unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(soundBuffer, GetSampleRate(), 0) CSFML_CALL_RETURN(soundBuffer, GetSampleRate(), 0)
} }
@ -131,7 +131,7 @@ unsigned int sfSoundBuffer_GetSampleRate(sfSoundBuffer* soundBuffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of channels of a sound buffer (1 = mono, 2 = stereo, ...) /// Return the number of channels of a sound buffer (1 = mono, 2 = stereo, ...)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSoundBuffer_GetChannelsCount(sfSoundBuffer* soundBuffer) unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(soundBuffer, GetChannelsCount(), 0) CSFML_CALL_RETURN(soundBuffer, GetChannelsCount(), 0)
} }
@ -140,7 +140,7 @@ unsigned int sfSoundBuffer_GetChannelsCount(sfSoundBuffer* soundBuffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer /// Get the duration of a sound buffer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundBuffer_GetDuration(sfSoundBuffer* soundBuffer) float sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(soundBuffer, GetDuration(), 0.f) CSFML_CALL_RETURN(soundBuffer, GetDuration(), 0.f)
} }

View File

@ -70,7 +70,7 @@ void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer recorder /// Get the sample rate of a sound buffer recorder
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSoundBufferRecorder_GetSampleRate(sfSoundBufferRecorder* soundBufferRecorder) unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBufferRecorder* soundBufferRecorder)
{ {
CSFML_CALL_RETURN(soundBufferRecorder, GetSampleRate(), 0); CSFML_CALL_RETURN(soundBufferRecorder, GetSampleRate(), 0);
} }
@ -80,7 +80,7 @@ unsigned int sfSoundBufferRecorder_GetSampleRate(sfSoundBufferRecorder* soundBuf
/// Get the sound buffer containing the captured audio data /// Get the sound buffer containing the captured audio data
/// of a sound buffer recorder /// of a sound buffer recorder
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(sfSoundBufferRecorder* soundBufferRecorder) const sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(const sfSoundBufferRecorder* soundBufferRecorder)
{ {
CSFML_CHECK_RETURN(soundBufferRecorder, NULL); CSFML_CHECK_RETURN(soundBufferRecorder, NULL);

View File

@ -38,7 +38,7 @@
struct sfSoundBufferRecorder struct sfSoundBufferRecorder
{ {
sf::SoundBufferRecorder This; sf::SoundBufferRecorder This;
sfSoundBuffer SoundBuffer; mutable sfSoundBuffer SoundBuffer;
}; };

View File

@ -74,7 +74,7 @@ void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound recorder /// Get the sample rate of a sound recorder
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSoundRecorder_GetSampleRate(sfSoundRecorder* soundRecorder) unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder* soundRecorder)
{ {
CSFML_CALL_RETURN(soundRecorder, GetSampleRate(), 0); CSFML_CALL_RETURN(soundRecorder, GetSampleRate(), 0);
} }

View File

@ -82,7 +82,7 @@ void sfSoundStream_Stop(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a sound stream (stopped, paused, playing) /// Get the status of a sound stream (stopped, paused, playing)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundStatus sfSoundStream_GetStatus(sfSoundStream* soundStream) sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream)
{ {
CSFML_CHECK_RETURN(soundStream, sfStopped); CSFML_CHECK_RETURN(soundStream, sfStopped);
@ -94,7 +94,7 @@ sfSoundStatus sfSoundStream_GetStatus(sfSoundStream* soundStream)
/// Return the number of channels of a sound stream /// Return the number of channels of a sound stream
/// (1 = mono, 2 = stereo) /// (1 = mono, 2 = stereo)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* soundStream) unsigned int sfSoundStream_GetChannelsCount(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetChannelsCount(), 0); CSFML_CALL_RETURN(soundStream, GetChannelsCount(), 0);
} }
@ -103,7 +103,7 @@ unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound stream /// Get the sample rate of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSoundStream_GetSampleRate(sfSoundStream* soundStream) unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetSampleRate(), 0); CSFML_CALL_RETURN(soundStream, GetSampleRate(), 0);
} }
@ -190,7 +190,7 @@ void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a sound stream /// Get the pitch of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetPitch(sfSoundStream* soundStream) float sfSoundStream_GetPitch(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetPitch(), 0.f); CSFML_CALL_RETURN(soundStream, GetPitch(), 0.f);
} }
@ -199,7 +199,7 @@ float sfSoundStream_GetPitch(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound stream /// Get the volume of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetVolume(sfSoundStream* soundStream) float sfSoundStream_GetVolume(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetVolume(), 0.f); CSFML_CALL_RETURN(soundStream, GetVolume(), 0.f);
} }
@ -208,7 +208,7 @@ float sfSoundStream_GetVolume(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a sound stream /// Get the position of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_GetPosition(sfSoundStream* soundStream, float* x, float* y, float* z) void sfSoundStream_GetPosition(const sfSoundStream* soundStream, float* x, float* y, float* z)
{ {
CSFML_CHECK(soundStream); CSFML_CHECK(soundStream);
@ -223,7 +223,7 @@ void sfSoundStream_GetPosition(sfSoundStream* soundStream, float* x, float* y, f
/// Tell if the sound stream's position is relative to the listener's /// Tell if the sound stream's position is relative to the listener's
/// position, or if it's absolute /// position, or if it's absolute
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundStream_IsRelativeToListener(sfSoundStream* soundStream) CSFML_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, IsRelativeToListener(), sfFalse); CSFML_CALL_RETURN(soundStream, IsRelativeToListener(), sfFalse);
} }
@ -232,7 +232,7 @@ CSFML_API sfBool sfSoundStream_IsRelativeToListener(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound stream /// Get the minimum distance of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetMinDistance(sfSoundStream* soundStream) float sfSoundStream_GetMinDistance(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetMinDistance(), 0.f); CSFML_CALL_RETURN(soundStream, GetMinDistance(), 0.f);
} }
@ -241,7 +241,7 @@ float sfSoundStream_GetMinDistance(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound stream /// Get the attenuation factor of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetAttenuation(sfSoundStream* soundStream) float sfSoundStream_GetAttenuation(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetAttenuation(), 0.f); CSFML_CALL_RETURN(soundStream, GetAttenuation(), 0.f);
} }
@ -250,7 +250,7 @@ float sfSoundStream_GetAttenuation(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a stream is looping /// Tell whether or not a stream is looping
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSoundStream_GetLoop(sfSoundStream* soundStream) sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetLoop(), sfFalse); CSFML_CALL_RETURN(soundStream, GetLoop(), sfFalse);
} }
@ -259,7 +259,7 @@ sfBool sfSoundStream_GetLoop(sfSoundStream* soundStream)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound stream /// Get the current playing position of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetPlayingOffset(sfSoundStream* soundStream) float sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(soundStream, GetPlayingOffset(), 0.f); CSFML_CALL_RETURN(soundStream, GetPlayingOffset(), 0.f);
} }

View File

@ -37,8 +37,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct sfSound struct sfSound
{ {
sf::Sound This; sf::Sound This;
sfSoundBuffer* Buffer; const sfSoundBuffer* Buffer;
}; };

View File

@ -98,7 +98,7 @@ void sfFont_Destroy(sfFont* font)
/// Get the base size of characters in a font; /// Get the base size of characters in a font;
/// All glyphs dimensions are based on this value /// All glyphs dimensions are based on this value
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfFont_GetCharacterSize(sfFont* font) unsigned int sfFont_GetCharacterSize(const sfFont* font)
{ {
CSFML_CALL_RETURN(font, GetCharacterSize(), 0); CSFML_CALL_RETURN(font, GetCharacterSize(), 0);
} }
@ -107,7 +107,7 @@ unsigned int sfFont_GetCharacterSize(sfFont* font)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the built-in default font (Arial) /// Get the built-in default font (Arial)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFont* sfFont_GetDefaultFont() const sfFont* sfFont_GetDefaultFont()
{ {
static sfFont defaultFont = {sf::Font::GetDefaultFont()}; static sfFont defaultFont = {sf::Font::GetDefaultFont()};

View File

@ -120,7 +120,7 @@ void sfImage_Destroy(sfImage* image)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the content of an image to a file /// Save the content of an image to a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfImage_SaveToFile(sfImage* image, const char* filename) sfBool sfImage_SaveToFile(const sfImage* image, const char* filename)
{ {
CSFML_CALL_PTR_RETURN(image, SaveToFile(filename), sfFalse); CSFML_CALL_PTR_RETURN(image, SaveToFile(filename), sfFalse);
} }
@ -141,7 +141,7 @@ void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha
/// This function does a slow pixel copy and should only /// This function does a slow pixel copy and should only
/// be used at initialization time /// be used at initialization time
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_Copy(sfImage* image, sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect) void sfImage_Copy(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect)
{ {
CSFML_CHECK(source); CSFML_CHECK(source);
sf::IntRect SFMLRect(sourceRect.Left, sourceRect.Top, sourceRect.Right, sourceRect.Bottom); sf::IntRect SFMLRect(sourceRect.Left, sourceRect.Top, sourceRect.Right, sourceRect.Bottom);
@ -175,7 +175,7 @@ void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y, sfColor co
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a pixel from an image /// Get a pixel from an image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfImage_GetPixel(sfImage* image, unsigned int x, unsigned int y) sfColor sfImage_GetPixel(const sfImage* image, unsigned int x, unsigned int y)
{ {
sfColor color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(image, color); CSFML_CHECK_RETURN(image, color);
@ -191,7 +191,7 @@ sfColor sfImage_GetPixel(sfImage* image, unsigned int x, unsigned int y)
/// Array size is sfImage_GetWidth() x sfImage_GetHeight() x 4 /// Array size is sfImage_GetWidth() x sfImage_GetHeight() x 4
/// This pointer becomes invalid if you reload or resize the image /// This pointer becomes invalid if you reload or resize the image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const sfUint8* sfImage_GetPixelsPtr(sfImage* image) const sfUint8* sfImage_GetPixelsPtr(const sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(image, GetPixelsPtr(), NULL); CSFML_CALL_PTR_RETURN(image, GetPixelsPtr(), NULL);
} }
@ -200,7 +200,7 @@ const sfUint8* sfImage_GetPixelsPtr(sfImage* image)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind the image for rendering /// Bind the image for rendering
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_Bind(sfImage* image) void sfImage_Bind(const sfImage* image)
{ {
CSFML_CALL_PTR(image, Bind()); CSFML_CALL_PTR(image, Bind());
} }
@ -218,7 +218,7 @@ void sfImage_SetSmooth(sfImage* image, sfBool smooth)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the width of the image /// Return the width of the image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfImage_GetWidth(sfImage* image) unsigned int sfImage_GetWidth(const sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(image, GetWidth(), 0); CSFML_CALL_PTR_RETURN(image, GetWidth(), 0);
} }
@ -227,7 +227,7 @@ unsigned int sfImage_GetWidth(sfImage* image)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the height of the image /// Return the height of the image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfImage_GetHeight(sfImage* image) unsigned int sfImage_GetHeight(const sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(image, GetHeight(), 0); CSFML_CALL_PTR_RETURN(image, GetHeight(), 0);
} }
@ -236,7 +236,7 @@ unsigned int sfImage_GetHeight(sfImage* image)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tells whether the smoothing filter is enabled or not on an image /// Tells whether the smoothing filter is enabled or not on an image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfImage_IsSmooth(sfImage* image) sfBool sfImage_IsSmooth(const sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(image, IsSmooth(), sfFalse); CSFML_CALL_PTR_RETURN(image, IsSmooth(), sfFalse);
} }

View File

@ -54,12 +54,12 @@ void sfIntRect_Offset(sfIntRect* rect, int offsetX, int offsetY)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if a point is inside a rectangle's area /// Check if a point is inside a rectangle's area
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfFloatRect_Contains(sfFloatRect* rect, float x, float y) sfBool sfFloatRect_Contains(const sfFloatRect* rect, float x, float y)
{ {
CSFML_CHECK_RETURN(rect, sfFalse) CSFML_CHECK_RETURN(rect, sfFalse)
return sf::FloatRect(rect->Left, rect->Top, rect->Right, rect->Bottom).Contains(x, y); return sf::FloatRect(rect->Left, rect->Top, rect->Right, rect->Bottom).Contains(x, y);
} }
sfBool sfIntRect_Contains(sfIntRect* rect, int x, int y) sfBool sfIntRect_Contains(const sfIntRect* rect, int x, int y)
{ {
CSFML_CHECK_RETURN(rect, sfFalse) CSFML_CHECK_RETURN(rect, sfFalse)
return sf::IntRect(rect->Left, rect->Top, rect->Right, rect->Bottom).Contains(x, y); return sf::IntRect(rect->Left, rect->Top, rect->Right, rect->Bottom).Contains(x, y);
@ -69,7 +69,7 @@ sfBool sfIntRect_Contains(sfIntRect* rect, int x, int y)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles /// Check intersection between two rectangles
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfFloatRect_Intersects(sfFloatRect* rect1, sfFloatRect* rect2, sfFloatRect* intersection) sfBool sfFloatRect_Intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection)
{ {
CSFML_CHECK_RETURN(rect1, sfFalse) CSFML_CHECK_RETURN(rect1, sfFalse)
CSFML_CHECK_RETURN(rect2, sfFalse) CSFML_CHECK_RETURN(rect2, sfFalse)
@ -94,7 +94,7 @@ sfBool sfFloatRect_Intersects(sfFloatRect* rect1, sfFloatRect* rect2, sfFloatRec
return SFMLRect1.Intersects(SFMLRect2); return SFMLRect1.Intersects(SFMLRect2);
} }
} }
sfBool sfIntRect_Intersects(sfIntRect* rect1, sfIntRect* rect2, sfIntRect* intersection) sfBool sfIntRect_Intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection)
{ {
CSFML_CHECK_RETURN(rect1, sfFalse) CSFML_CHECK_RETURN(rect1, sfFalse)
CSFML_CHECK_RETURN(rect2, sfFalse) CSFML_CHECK_RETURN(rect2, sfFalse)

View File

@ -63,7 +63,7 @@ void sfRenderImage_Destroy(sfRenderImage* renderImage)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of a renderimage /// Get the width of the rendering region of a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfRenderImage_GetWidth(sfRenderImage* renderImage) unsigned int sfRenderImage_GetWidth(const sfRenderImage* renderImage)
{ {
CSFML_CALL_RETURN(renderImage, GetWidth(), 0); CSFML_CALL_RETURN(renderImage, GetWidth(), 0);
} }
@ -72,7 +72,7 @@ unsigned int sfRenderImage_GetWidth(sfRenderImage* renderImage)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rendering region of a renderimage /// Get the height of the rendering region of a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfRenderImage_GetHeight(sfRenderImage* renderImage) unsigned int sfRenderImage_GetHeight(const sfRenderImage* renderImage)
{ {
CSFML_CALL_RETURN(renderImage, GetHeight(), 0); CSFML_CALL_RETURN(renderImage, GetHeight(), 0);
} }
@ -118,17 +118,17 @@ void sfRenderImage_Display(sfRenderImage* renderImage)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderimage /// Draw something on a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_DrawSprite(sfRenderImage* renderImage, sfSprite* sprite) void sfRenderImage_DrawSprite(sfRenderImage* renderImage, const sfSprite* sprite)
{ {
CSFML_CHECK(sprite); CSFML_CHECK(sprite);
CSFML_CALL(renderImage, Draw(sprite->This)); CSFML_CALL(renderImage, Draw(sprite->This));
} }
void sfRenderImage_DrawShape(sfRenderImage* renderImage, sfShape* shape) void sfRenderImage_DrawShape(sfRenderImage* renderImage, const sfShape* shape)
{ {
CSFML_CHECK(shape); CSFML_CHECK(shape);
CSFML_CALL(renderImage, Draw(shape->This)); CSFML_CALL(renderImage, Draw(shape->This));
} }
void sfRenderImage_DrawText(sfRenderImage* renderImage, sfText* text) void sfRenderImage_DrawText(sfRenderImage* renderImage, const sfText* text)
{ {
CSFML_CHECK(text); CSFML_CHECK(text);
CSFML_CALL(renderImage, Draw(text->This)); CSFML_CALL(renderImage, Draw(text->This));
@ -138,19 +138,19 @@ void sfRenderImage_DrawText(sfRenderImage* renderImage, sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderimage with a shader /// Draw something on a renderimage with a shader
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_DrawSpriteWithShader(sfRenderImage* renderImage, sfSprite* sprite, sfShader* shader) void sfRenderImage_DrawSpriteWithShader(sfRenderImage* renderImage, const sfSprite* sprite, const sfShader* shader)
{ {
CSFML_CHECK(sprite); CSFML_CHECK(sprite);
CSFML_CHECK(shader); CSFML_CHECK(shader);
CSFML_CALL(renderImage, Draw(sprite->This, shader->This)); CSFML_CALL(renderImage, Draw(sprite->This, shader->This));
} }
void sfRenderImage_DrawShapeWithShader(sfRenderImage* renderImage, sfShape* shape, sfShader* shader) void sfRenderImage_DrawShapeWithShader(sfRenderImage* renderImage, const sfShape* shape, const sfShader* shader)
{ {
CSFML_CHECK(shape); CSFML_CHECK(shape);
CSFML_CHECK(shader); CSFML_CHECK(shader);
CSFML_CALL(renderImage, Draw(shape->This, shader->This)); CSFML_CALL(renderImage, Draw(shape->This, shader->This));
} }
void sfRenderImage_DrawTextWithShader(sfRenderImage* renderImage, sfText* text, sfShader* shader) void sfRenderImage_DrawTextWithShader(sfRenderImage* renderImage, const sfText* text, const sfShader* shader)
{ {
CSFML_CHECK(text); CSFML_CHECK(text);
CSFML_CHECK(shader); CSFML_CHECK(shader);
@ -172,7 +172,7 @@ void sfRenderImage_Clear(sfRenderImage* renderImage, sfColor color)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current active view of a renderimage /// Change the current active view of a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_SetView(sfRenderImage* renderImage, sfView* view) void sfRenderImage_SetView(sfRenderImage* renderImage, const sfView* view)
{ {
CSFML_CHECK(view); CSFML_CHECK(view);
CSFML_CALL(renderImage, SetView(*view->This)); CSFML_CALL(renderImage, SetView(*view->This));
@ -183,7 +183,7 @@ void sfRenderImage_SetView(sfRenderImage* renderImage, sfView* view)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current active view of a renderimage /// Get the current active view of a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const sfView* sfRenderImage_GetView(sfRenderImage* renderImage) const sfView* sfRenderImage_GetView(const sfRenderImage* renderImage)
{ {
CSFML_CHECK_RETURN(renderImage, NULL); CSFML_CHECK_RETURN(renderImage, NULL);
@ -205,7 +205,7 @@ sfView* sfRenderImage_GetDefaultView(sfRenderImage* renderImage)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the viewport of a view applied to this target /// Get the viewport of a view applied to this target
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIntRect sfRenderImage_GetViewport(sfRenderImage* renderImage, sfView* view) sfIntRect sfRenderImage_GetViewport(const sfRenderImage* renderImage, const sfView* view)
{ {
sfIntRect rect = {0, 0, 0, 0}; sfIntRect rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(view, rect); CSFML_CHECK_RETURN(view, rect);
@ -224,7 +224,7 @@ sfIntRect sfRenderImage_GetViewport(sfRenderImage* renderImage, sfView* view)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Convert a point in image coordinates into view coordinates /// Convert a point in image coordinates into view coordinates
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_ConvertCoords(sfRenderImage* renderImage, unsigned int imageX, unsigned int imageY, float* viewX, float* viewY, sfView* targetView) void sfRenderImage_ConvertCoords(const sfRenderImage* renderImage, unsigned int imageX, unsigned int imageY, float* viewX, float* viewY, const sfView* targetView)
{ {
CSFML_CHECK(renderImage); CSFML_CHECK(renderImage);
@ -242,7 +242,7 @@ void sfRenderImage_ConvertCoords(sfRenderImage* renderImage, unsigned int imageX
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target image /// Get the target image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfRenderImage_GetImage(sfRenderImage* renderImage) const sfImage* sfRenderImage_GetImage(const sfRenderImage* renderImage)
{ {
CSFML_CHECK_RETURN(renderImage, NULL); CSFML_CHECK_RETURN(renderImage, NULL);

View File

@ -40,9 +40,9 @@
struct sfRenderImage struct sfRenderImage
{ {
sf::RenderImage This; sf::RenderImage This;
sfImage* Target; const sfImage* Target;
sfView* DefaultView; sfView* DefaultView;
sfView* CurrentView; const sfView* CurrentView;
}; };

View File

@ -39,7 +39,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new renderwindow /// Construct a new renderwindow
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, unsigned long style, sfContextSettings* settings) sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, unsigned long style, const sfContextSettings* settings)
{ {
// Convert video mode // Convert video mode
sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel); sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel);
@ -69,7 +69,7 @@ sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, unsig
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a renderwindow from an existing control /// Construct a renderwindow from an existing control
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings* settings) sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings)
{ {
// Convert context settings // Convert context settings
sf::ContextSettings params; sf::ContextSettings params;
@ -114,7 +114,7 @@ void sfRenderWindow_Close(sfRenderWindow* renderWindow)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a renderwindow is opened /// Tell whether or not a renderwindow is opened
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfRenderWindow_IsOpened(sfRenderWindow* renderWindow) sfBool sfRenderWindow_IsOpened(const sfRenderWindow* renderWindow)
{ {
CSFML_CALL_RETURN(renderWindow, IsOpened(), sfFalse); CSFML_CALL_RETURN(renderWindow, IsOpened(), sfFalse);
} }
@ -123,7 +123,7 @@ sfBool sfRenderWindow_IsOpened(sfRenderWindow* renderWindow)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of a window /// Get the width of the rendering region of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfRenderWindow_GetWidth(sfRenderWindow* renderWindow) unsigned int sfRenderWindow_GetWidth(const sfRenderWindow* renderWindow)
{ {
CSFML_CALL_RETURN(renderWindow, GetWidth(), 0); CSFML_CALL_RETURN(renderWindow, GetWidth(), 0);
} }
@ -132,7 +132,7 @@ unsigned int sfRenderWindow_GetWidth(sfRenderWindow* renderWindow)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rendering region of a window /// Get the height of the rendering region of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfRenderWindow_GetHeight(sfRenderWindow* renderWindow) unsigned int sfRenderWindow_GetHeight(const sfRenderWindow* renderWindow)
{ {
CSFML_CALL_RETURN(renderWindow, GetHeight(), 0); CSFML_CALL_RETURN(renderWindow, GetHeight(), 0);
} }
@ -141,7 +141,7 @@ unsigned int sfRenderWindow_GetHeight(sfRenderWindow* renderWindow)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfContextSettings sfRenderWindow_GetSettings(sfRenderWindow* renderWindow) sfContextSettings sfRenderWindow_GetSettings(const sfRenderWindow* renderWindow)
{ {
sfContextSettings settings = {0, 0, 0}; sfContextSettings settings = {0, 0, 0};
CSFML_CHECK_RETURN(renderWindow, settings); CSFML_CHECK_RETURN(renderWindow, settings);
@ -270,7 +270,7 @@ void sfRenderWindow_EnableKeyRepeat(sfRenderWindow* renderWindow, sfBool enabled
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the window's icon /// Change the window's icon
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, sfUint8* pixels) void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels)
{ {
CSFML_CALL(renderWindow, SetIcon(width, height, pixels)) CSFML_CALL(renderWindow, SetIcon(width, height, pixels))
} }
@ -317,7 +317,7 @@ void sfRenderWindow_Display(sfRenderWindow* renderWindow)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the input manager of a window /// Get the input manager of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfInput* sfRenderWindow_GetInput(sfRenderWindow* renderWindow) const sfInput* sfRenderWindow_GetInput(const sfRenderWindow* renderWindow)
{ {
CSFML_CHECK_RETURN(renderWindow, NULL); CSFML_CHECK_RETURN(renderWindow, NULL);
@ -337,7 +337,7 @@ void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get time elapsed since last frame of a window /// Get time elapsed since last frame of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfRenderWindow_GetFrameTime(sfRenderWindow* renderWindow) float sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow)
{ {
CSFML_CALL_RETURN(renderWindow, GetFrameTime(), 0.f); CSFML_CALL_RETURN(renderWindow, GetFrameTime(), 0.f);
} }
@ -356,17 +356,17 @@ void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* renderWindow, float thr
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderwindow /// Draw something on a renderwindow
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, sfSprite* sprite) void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, const sfSprite* sprite)
{ {
CSFML_CHECK(sprite); CSFML_CHECK(sprite);
CSFML_CALL(renderWindow, Draw(sprite->This)); CSFML_CALL(renderWindow, Draw(sprite->This));
} }
void sfRenderWindow_DrawShape(sfRenderWindow* renderWindow, sfShape* shape) void sfRenderWindow_DrawShape(sfRenderWindow* renderWindow, const sfShape* shape)
{ {
CSFML_CHECK(shape); CSFML_CHECK(shape);
CSFML_CALL(renderWindow, Draw(shape->This)); CSFML_CALL(renderWindow, Draw(shape->This));
} }
void sfRenderWindow_DrawText(sfRenderWindow* renderWindow, sfText* text) void sfRenderWindow_DrawText(sfRenderWindow* renderWindow, const sfText* text)
{ {
CSFML_CHECK(text); CSFML_CHECK(text);
CSFML_CALL(renderWindow, Draw(text->This)); CSFML_CALL(renderWindow, Draw(text->This));
@ -376,19 +376,19 @@ void sfRenderWindow_DrawText(sfRenderWindow* renderWindow, sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderwindow with a shader /// Draw something on a renderwindow with a shader
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderWindow_DrawSpriteWithShader(sfRenderWindow* renderWindow, sfSprite* sprite, sfShader* shader) void sfRenderWindow_DrawSpriteWithShader(sfRenderWindow* renderWindow, const sfSprite* sprite, const sfShader* shader)
{ {
CSFML_CHECK(sprite); CSFML_CHECK(sprite);
CSFML_CHECK(shader); CSFML_CHECK(shader);
CSFML_CALL(renderWindow, Draw(sprite->This, shader->This)); CSFML_CALL(renderWindow, Draw(sprite->This, shader->This));
} }
void sfRenderWindow_DrawShapeWithShader(sfRenderWindow* renderWindow, sfShape* shape, sfShader* shader) void sfRenderWindow_DrawShapeWithShader(sfRenderWindow* renderWindow, const sfShape* shape, const sfShader* shader)
{ {
CSFML_CHECK(shape); CSFML_CHECK(shape);
CSFML_CHECK(shader); CSFML_CHECK(shader);
CSFML_CALL(renderWindow, Draw(shape->This, shader->This)); CSFML_CALL(renderWindow, Draw(shape->This, shader->This));
} }
void sfRenderWindow_DrawTextWithShader(sfRenderWindow* renderWindow, sfText* text, sfShader* shader) void sfRenderWindow_DrawTextWithShader(sfRenderWindow* renderWindow, const sfText* text, const sfShader* shader)
{ {
CSFML_CHECK(text); CSFML_CHECK(text);
CSFML_CHECK(shader); CSFML_CHECK(shader);
@ -410,7 +410,7 @@ void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfColor color)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current active view of a renderwindow /// Change the current active view of a renderwindow
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderWindow_SetView(sfRenderWindow* renderWindow, sfView* view) void sfRenderWindow_SetView(sfRenderWindow* renderWindow, const sfView* view)
{ {
CSFML_CHECK(view); CSFML_CHECK(view);
CSFML_CALL(renderWindow, SetView(*view->This)); CSFML_CALL(renderWindow, SetView(*view->This));
@ -421,7 +421,7 @@ void sfRenderWindow_SetView(sfRenderWindow* renderWindow, sfView* view)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current active view of a renderwindow /// Get the current active view of a renderwindow
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const sfView* sfRenderWindow_GetView(sfRenderWindow* renderWindow) const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow)
{ {
CSFML_CHECK_RETURN(renderWindow, NULL); CSFML_CHECK_RETURN(renderWindow, NULL);
@ -443,7 +443,7 @@ sfView* sfRenderWindow_GetDefaultView(sfRenderWindow* renderWindow)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the viewport of a view applied to this target /// Get the viewport of a view applied to this target
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIntRect sfRenderWindow_GetViewport(sfRenderWindow* renderWindow, sfView* view) sfIntRect sfRenderWindow_GetViewport(const sfRenderWindow* renderWindow, const sfView* view)
{ {
sfIntRect rect = {0, 0, 0, 0}; sfIntRect rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(view, rect); CSFML_CHECK_RETURN(view, rect);
@ -462,7 +462,7 @@ sfIntRect sfRenderWindow_GetViewport(sfRenderWindow* renderWindow, sfView* view)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Convert a point in window coordinates into view coordinates /// Convert a point in window coordinates into view coordinates
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderWindow_ConvertCoords(sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, sfView* targetView) void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView)
{ {
CSFML_CHECK(renderWindow); CSFML_CHECK(renderWindow);

View File

@ -41,7 +41,7 @@ struct sfRenderWindow
sf::RenderWindow This; sf::RenderWindow This;
sfInput Input; sfInput Input;
sfView* DefaultView; sfView* DefaultView;
sfView* CurrentView; const sfView* CurrentView;
}; };

View File

@ -113,7 +113,7 @@ void sfShader_SetParameter4(sfShader* shader, const char* name, float x, float y
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a texture parameter in a shader /// Set a texture parameter in a shader
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShader_SetTexture(sfShader* shader, const char* name, sfImage* texture) void sfShader_SetTexture(sfShader* shader, const char* name, const sfImage* texture)
{ {
CSFML_CALL(shader, SetTexture(name, texture && texture->This ? *texture->This : sf::Shader::CurrentTexture)) CSFML_CALL(shader, SetTexture(name, texture && texture->This ? *texture->This : sf::Shader::CurrentTexture))
} }
@ -122,7 +122,7 @@ void sfShader_SetTexture(sfShader* shader, const char* name, sfImage* texture)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a shader for rendering /// Bind a shader for rendering
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShader_Bind(sfShader* shader) void sfShader_Bind(const sfShader* shader)
{ {
CSFML_CALL(shader, Bind()) CSFML_CALL(shader, Bind())
} }
@ -131,7 +131,7 @@ void sfShader_Bind(sfShader* shader)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Unbind a shader /// Unbind a shader
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShader_Unbind(sfShader* shader) void sfShader_Unbind(const sfShader* shader)
{ {
CSFML_CALL(shader, Unbind()) CSFML_CALL(shader, Unbind())
} }

View File

@ -185,7 +185,7 @@ void sfShape_SetBlendMode(sfShape* shape, sfBlendMode mode)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a shape /// Get the X position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetX(sfShape* shape) float sfShape_GetX(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetPosition().x, 0.f) CSFML_CALL_RETURN(shape, GetPosition().x, 0.f)
} }
@ -194,7 +194,7 @@ float sfShape_GetX(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a shape /// Get the Y position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetY(sfShape* shape) float sfShape_GetY(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetPosition().y, 0.f) CSFML_CALL_RETURN(shape, GetPosition().y, 0.f)
} }
@ -203,7 +203,7 @@ float sfShape_GetY(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a shape /// Get the horizontal scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetScaleX(sfShape* shape) float sfShape_GetScaleX(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetScale().x, 0.f) CSFML_CALL_RETURN(shape, GetScale().x, 0.f)
} }
@ -212,7 +212,7 @@ float sfShape_GetScaleX(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a shape /// Get the vertical scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetScaleY(sfShape* shape) float sfShape_GetScaleY(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetScale().y, 0.f) CSFML_CALL_RETURN(shape, GetScale().y, 0.f)
} }
@ -221,7 +221,7 @@ float sfShape_GetScaleY(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a shape /// Get the orientation of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetRotation(sfShape* shape) float sfShape_GetRotation(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetRotation(), 0.f) CSFML_CALL_RETURN(shape, GetRotation(), 0.f)
} }
@ -230,7 +230,7 @@ float sfShape_GetRotation(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a shape /// Get the X position of the origin a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetOriginX(sfShape* shape) float sfShape_GetOriginX(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetOrigin().x, 0.f) CSFML_CALL_RETURN(shape, GetOrigin().x, 0.f)
} }
@ -239,7 +239,7 @@ float sfShape_GetOriginX(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of the origin a shape /// Get the Y position of the origin a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetOriginY(sfShape* shape) float sfShape_GetOriginY(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetOrigin().y, 0.f) CSFML_CALL_RETURN(shape, GetOrigin().y, 0.f)
} }
@ -248,7 +248,7 @@ float sfShape_GetOriginY(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a shape /// Get the color of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfShape_GetColor(sfShape* shape) sfColor sfShape_GetColor(const sfShape* shape)
{ {
sfColor color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(shape, color) CSFML_CHECK_RETURN(shape, color)
@ -261,7 +261,7 @@ sfColor sfShape_GetColor(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a shape /// Get the current blending mode of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBlendMode sfShape_GetBlendMode(sfShape* shape) sfBlendMode sfShape_GetBlendMode(const sfShape* shape)
{ {
CSFML_CHECK_RETURN(shape, sfBlendNone) CSFML_CHECK_RETURN(shape, sfBlendNone)
@ -300,7 +300,7 @@ void sfShape_Rotate(sfShape* shape, float angle)
/// Transform a point from global coordinates into the shape's local coordinates /// Transform a point from global coordinates into the shape's local coordinates
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point) /// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_TransformToLocal(sfShape* shape, float pointX, float pointY, float* x, float* y) void sfShape_TransformToLocal(const sfShape* shape, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(shape) CSFML_CHECK(shape)
@ -314,7 +314,7 @@ void sfShape_TransformToLocal(sfShape* shape, float pointX, float pointY, float*
/// Transform a point from the shape's local coordinates into global coordinates /// Transform a point from the shape's local coordinates into global coordinates
/// (ie it applies the object's origin, translation, rotation and scale to the point) /// (ie it applies the object's origin, translation, rotation and scale to the point)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_TransformToGlobal(sfShape* shape, float pointX, float pointY, float* x, float* y) void sfShape_TransformToGlobal(const sfShape* shape, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(shape) CSFML_CHECK(shape)
@ -368,7 +368,7 @@ void sfShape_SetOutlineWidth(sfShape* shape, float width)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of a shape outline /// Get the width of a shape outline
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetOutlineWidth(sfShape* shape) float sfShape_GetOutlineWidth(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetOutlineWidth(), 0.f) CSFML_CALL_RETURN(shape, GetOutlineWidth(), 0.f)
} }
@ -377,7 +377,7 @@ float sfShape_GetOutlineWidth(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the number of points composing a shape /// Get the number of points composing a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfShape_GetNbPoints(sfShape* shape) unsigned int sfShape_GetNbPoints(const sfShape* shape)
{ {
CSFML_CALL_RETURN(shape, GetNbPoints(), 0) CSFML_CALL_RETURN(shape, GetNbPoints(), 0)
} }
@ -386,7 +386,7 @@ unsigned int sfShape_GetNbPoints(sfShape* shape)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a point of a shape /// Get a point of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_GetPointPosition(sfShape* shape, unsigned int index, float* x, float* y) void sfShape_GetPointPosition(const sfShape* shape, unsigned int index, float* x, float* y)
{ {
CSFML_CHECK(shape) CSFML_CHECK(shape)
@ -399,7 +399,7 @@ void sfShape_GetPointPosition(sfShape* shape, unsigned int index, float* x, floa
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a the color of a shape's point /// Get a the color of a shape's point
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfShape_GetPointColor(sfShape* shape, unsigned int index) sfColor sfShape_GetPointColor(const sfShape* shape, unsigned int index)
{ {
sfColor color = {255, 255, 255, 255}; sfColor color = {255, 255, 255, 255};
CSFML_CHECK_RETURN(shape, color) CSFML_CHECK_RETURN(shape, color)
@ -417,7 +417,7 @@ sfColor sfShape_GetPointColor(sfShape* shape, unsigned int index)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a the outline color of a shape's point /// Get a the outline color of a shape's point
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfShape_GetPointOutlineColor(sfShape* shape, unsigned int index) sfColor sfShape_GetPointOutlineColor(const sfShape* shape, unsigned int index)
{ {
sfColor color = {255, 255, 255, 255}; sfColor color = {255, 255, 255, 255};
CSFML_CHECK_RETURN(shape, color) CSFML_CHECK_RETURN(shape, color)

View File

@ -151,7 +151,7 @@ void sfSprite_SetBlendMode(sfSprite* sprite, sfBlendMode mode)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a sprite /// Get the X position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetX(sfSprite* sprite) float sfSprite_GetX(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetPosition().x, 0.f) CSFML_CALL_RETURN(sprite, GetPosition().x, 0.f)
} }
@ -160,7 +160,7 @@ float sfSprite_GetX(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a sprite /// Get the Y position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetY(sfSprite* sprite) float sfSprite_GetY(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetPosition().y, 0.f) CSFML_CALL_RETURN(sprite, GetPosition().y, 0.f)
} }
@ -169,7 +169,7 @@ float sfSprite_GetY(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a sprite /// Get the horizontal scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetScaleX(sfSprite* sprite) float sfSprite_GetScaleX(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetScale().x, 0.f) CSFML_CALL_RETURN(sprite, GetScale().x, 0.f)
} }
@ -178,7 +178,7 @@ float sfSprite_GetScaleX(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a sprite /// Get the vertical scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetScaleY(sfSprite* sprite) float sfSprite_GetScaleY(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetScale().y, 0.f) CSFML_CALL_RETURN(sprite, GetScale().y, 0.f)
} }
@ -187,7 +187,7 @@ float sfSprite_GetScaleY(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a sprite /// Get the orientation of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetRotation(sfSprite* sprite) float sfSprite_GetRotation(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetRotation(), 0.f) CSFML_CALL_RETURN(sprite, GetRotation(), 0.f)
} }
@ -196,7 +196,7 @@ float sfSprite_GetRotation(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a sprite /// Get the X position of the origin a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetOriginX(sfSprite* sprite) float sfSprite_GetOriginX(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetOrigin().x, 0.f) CSFML_CALL_RETURN(sprite, GetOrigin().x, 0.f)
} }
@ -205,7 +205,7 @@ float sfSprite_GetOriginX(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of the origin a sprite /// Get the Y position of the origin a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetOriginY(sfSprite* sprite) float sfSprite_GetOriginY(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetOrigin().y, 0.f) CSFML_CALL_RETURN(sprite, GetOrigin().y, 0.f)
} }
@ -214,7 +214,7 @@ float sfSprite_GetOriginY(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a sprite /// Get the color of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfSprite_GetColor(sfSprite* sprite) sfColor sfSprite_GetColor(const sfSprite* sprite)
{ {
sfColor color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(sprite, color) CSFML_CHECK_RETURN(sprite, color)
@ -227,7 +227,7 @@ sfColor sfSprite_GetColor(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a sprite /// Get the current blending mode of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBlendMode sfSprite_GetBlendMode(sfSprite* sprite) sfBlendMode sfSprite_GetBlendMode(const sfSprite* sprite)
{ {
CSFML_CHECK_RETURN(sprite, sfBlendNone) CSFML_CHECK_RETURN(sprite, sfBlendNone)
@ -266,7 +266,7 @@ void sfSprite_Rotate(sfSprite* sprite, float angle)
/// Transform a point from global coordinates into the sprite's local coordinates /// Transform a point from global coordinates into the sprite's local coordinates
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point) /// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_TransformToLocal(sfSprite* sprite, float pointX, float pointY, float* x, float* y) void sfSprite_TransformToLocal(const sfSprite* sprite, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(sprite) CSFML_CHECK(sprite)
@ -280,7 +280,7 @@ void sfSprite_TransformToLocal(sfSprite* sprite, float pointX, float pointY, flo
/// Transform a point from the sprite's local coordinates into global coordinates /// Transform a point from the sprite's local coordinates into global coordinates
/// (ie it applies the object's origin, translation, rotation and scale to the point) /// (ie it applies the object's origin, translation, rotation and scale to the point)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_TransformToGlobal(sfSprite* sprite, float pointX, float pointY, float* x, float* y) void sfSprite_TransformToGlobal(const sfSprite* sprite, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(sprite) CSFML_CHECK(sprite)
@ -293,7 +293,7 @@ void sfSprite_TransformToGlobal(sfSprite* sprite, float pointX, float pointY, fl
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the image of a sprite /// Change the image of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetImage(sfSprite* sprite, sfImage* image) void sfSprite_SetImage(sfSprite* sprite, const sfImage* image)
{ {
if (image) if (image)
{ {
@ -343,7 +343,7 @@ void sfSprite_FlipY(sfSprite* sprite, sfBool flipped)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the source image of a sprite /// Get the source image of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfSprite_GetImage(sfSprite* sprite) const sfImage* sfSprite_GetImage(const sfSprite* sprite)
{ {
CSFML_CHECK_RETURN(sprite, NULL) CSFML_CHECK_RETURN(sprite, NULL)
@ -354,7 +354,7 @@ sfImage* sfSprite_GetImage(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sub-rectangle of a sprite inside the source image /// Get the sub-rectangle of a sprite inside the source image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIntRect sfSprite_GetSubRect(sfSprite* sprite) sfIntRect sfSprite_GetSubRect(const sfSprite* sprite)
{ {
sfIntRect rect = {0, 0, 0, 0}; sfIntRect rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(sprite, rect) CSFML_CHECK_RETURN(sprite, rect)
@ -366,7 +366,7 @@ sfIntRect sfSprite_GetSubRect(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite width /// Get a sprite width
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetWidth(sfSprite* sprite) float sfSprite_GetWidth(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetSize().x, 0.f) CSFML_CALL_RETURN(sprite, GetSize().x, 0.f)
} }
@ -375,7 +375,7 @@ float sfSprite_GetWidth(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite height /// Get a sprite height
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetHeight(sfSprite* sprite) float sfSprite_GetHeight(const sfSprite* sprite)
{ {
CSFML_CALL_RETURN(sprite, GetSize().y, 0.f) CSFML_CALL_RETURN(sprite, GetSize().y, 0.f)
} }
@ -384,7 +384,7 @@ float sfSprite_GetHeight(sfSprite* sprite)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a given pixel in a sprite /// Get the color of a given pixel in a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfSprite_GetPixel(sfSprite* sprite, unsigned int x, unsigned int y) sfColor sfSprite_GetPixel(const sfSprite* sprite, unsigned int x, unsigned int y)
{ {
sfColor color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(sprite, color) CSFML_CHECK_RETURN(sprite, color)

View File

@ -38,9 +38,9 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct sfSprite struct sfSprite
{ {
sf::Sprite This; sf::Sprite This;
sfImage* Image; const sfImage* Image;
sfIntRect SubRect; sfIntRect SubRect;
}; };

View File

@ -147,7 +147,7 @@ void sfText_SetBlendMode(sfText* text, sfBlendMode mode)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a text /// Get the X position of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetX(sfText* text) float sfText_GetX(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetPosition().x, 0.f) CSFML_CALL_RETURN(text, GetPosition().x, 0.f)
} }
@ -156,7 +156,7 @@ float sfText_GetX(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a text /// Get the Y position of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetY(sfText* text) float sfText_GetY(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetPosition().y, 0.f) CSFML_CALL_RETURN(text, GetPosition().y, 0.f)
} }
@ -165,7 +165,7 @@ float sfText_GetY(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a text /// Get the horizontal scale of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetScaleX(sfText* text) float sfText_GetScaleX(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetScale().x, 0.f) CSFML_CALL_RETURN(text, GetScale().x, 0.f)
} }
@ -174,7 +174,7 @@ float sfText_GetScaleX(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a text /// Get the vertical scale of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetScaleY(sfText* text) float sfText_GetScaleY(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetScale().y, 0.f) CSFML_CALL_RETURN(text, GetScale().y, 0.f)
} }
@ -183,7 +183,7 @@ float sfText_GetScaleY(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a text /// Get the orientation of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetRotation(sfText* text) float sfText_GetRotation(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetRotation(), 0.f) CSFML_CALL_RETURN(text, GetRotation(), 0.f)
} }
@ -192,7 +192,7 @@ float sfText_GetRotation(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a text /// Get the X position of the origin a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetOriginX(sfText* text) float sfText_GetOriginX(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetOrigin().x, 0.f) CSFML_CALL_RETURN(text, GetOrigin().x, 0.f)
} }
@ -201,7 +201,7 @@ float sfText_GetOriginX(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top Y of the origin of a text /// Get the top Y of the origin of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetOriginY(sfText* text) float sfText_GetOriginY(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetOrigin().y, 0.f) CSFML_CALL_RETURN(text, GetOrigin().y, 0.f)
} }
@ -210,7 +210,7 @@ float sfText_GetOriginY(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a text /// Get the color of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfText_GetColor(sfText* text) sfColor sfText_GetColor(const sfText* text)
{ {
sfColor color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(text, color) CSFML_CHECK_RETURN(text, color)
@ -223,7 +223,7 @@ sfColor sfText_GetColor(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a text /// Get the current blending mode of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBlendMode sfText_GetBlendMode(sfText* text) sfBlendMode sfText_GetBlendMode(const sfText* text)
{ {
CSFML_CHECK_RETURN(text, sfBlendNone) CSFML_CHECK_RETURN(text, sfBlendNone)
@ -262,7 +262,7 @@ void sfText_Rotate(sfText* text, float angle)
/// Transform a point from global coordinates into the text's local coordinates /// Transform a point from global coordinates into the text's local coordinates
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point) /// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfText_TransformToLocal(sfText* text, float pointX, float pointY, float* x, float* y) void sfText_TransformToLocal(const sfText* text, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(text) CSFML_CHECK(text)
@ -276,7 +276,7 @@ void sfText_TransformToLocal(sfText* text, float pointX, float pointY, float* x,
/// Transform a point from the text's local coordinates into global coordinates /// Transform a point from the text's local coordinates into global coordinates
/// (ie it applies the object's origin, translation, rotation and scale to the point) /// (ie it applies the object's origin, translation, rotation and scale to the point)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfText_TransformToGlobal(sfText* text, float pointX, float pointY, float* x, float* y) void sfText_TransformToGlobal(const sfText* text, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(text) CSFML_CHECK(text)
@ -308,7 +308,7 @@ void sfText_SetUnicodeString(sfText* text, const sfUint32* string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the font of a string /// Set the font of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfText_SetFont(sfText* text, sfFont* font) void sfText_SetFont(sfText* text, const sfFont* font)
{ {
CSFML_CHECK(font); CSFML_CHECK(font);
@ -338,7 +338,7 @@ void sfText_SetStyle(sfText* text, unsigned long style)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the string of a text (returns a unicode string) /// Get the string of a text (returns a unicode string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const sfUint32* sfText_GetUnicodeString(sfText* text) const sfUint32* sfText_GetUnicodeString(const sfText* text)
{ {
CSFML_CHECK_RETURN(text, NULL) CSFML_CHECK_RETURN(text, NULL)
@ -349,7 +349,7 @@ const sfUint32* sfText_GetUnicodeString(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the string of a text (returns an ANSI string) /// Get the string of a text (returns an ANSI string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfText_GetString(sfText* text) const char* sfText_GetString(const sfText* text)
{ {
CSFML_CHECK_RETURN(text, NULL) CSFML_CHECK_RETURN(text, NULL)
@ -362,7 +362,7 @@ const char* sfText_GetString(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the font used by a text /// Get the font used by a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFont* sfText_GetFont(sfText* text) const sfFont* sfText_GetFont(const sfText* text)
{ {
CSFML_CHECK_RETURN(text, NULL) CSFML_CHECK_RETURN(text, NULL)
@ -373,7 +373,7 @@ sfFont* sfText_GetFont(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the characters of a text /// Get the size of the characters of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfText_GetSize(sfText* text) float sfText_GetSize(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetSize(), 0.f) CSFML_CALL_RETURN(text, GetSize(), 0.f)
} }
@ -382,7 +382,7 @@ float sfText_GetSize(sfText* text)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the style of a text /// Get the style of a text
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned long sfText_GetStyle(sfText* text) unsigned long sfText_GetStyle(const sfText* text)
{ {
CSFML_CALL_RETURN(text, GetStyle(), 0) CSFML_CALL_RETURN(text, GetStyle(), 0)
} }
@ -393,7 +393,7 @@ unsigned long sfText_GetStyle(sfText* text)
/// in coordinates relative to the text /// in coordinates relative to the text
/// (note : translation, origin, rotation and scale are not applied) /// (note : translation, origin, rotation and scale are not applied)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfText_GetCharacterPos(sfText* text, size_t index, float* x, float* y) void sfText_GetCharacterPos(const sfText* text, size_t index, float* x, float* y)
{ {
CSFML_CHECK(text); CSFML_CHECK(text);
@ -406,7 +406,7 @@ void sfText_GetCharacterPos(sfText* text, size_t index, float* x, float* y)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the bounding rectangle of a text on screen /// Get the bounding rectangle of a text on screen
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFloatRect sfText_GetRect(sfText* text) sfFloatRect sfText_GetRect(const sfText* text)
{ {
sfFloatRect rect = {0.f, 0.f, 0.f, 0.f}; sfFloatRect rect = {0.f, 0.f, 0.f, 0.f};
CSFML_CHECK_RETURN(text, rect) CSFML_CHECK_RETURN(text, rect)

View File

@ -39,10 +39,10 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct sfText struct sfText
{ {
sf::Text This; sf::Text This;
std::string String; const sfFont* Font;
sfFont* Font; mutable std::string String;
sfFloatRect Rect; mutable sfFloatRect Rect;
}; };

View File

@ -106,7 +106,7 @@ void sfView_Reset(sfView* View, sfFloatRect Rectangle)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X coordinate of the center of a view /// Get the X coordinate of the center of a view
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfView_GetCenterX(sfView* View) float sfView_GetCenterX(const sfView* View)
{ {
CSFML_CHECK_RETURN(View, 0.f); CSFML_CHECK_RETURN(View, 0.f);
@ -117,7 +117,7 @@ float sfView_GetCenterX(sfView* View)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y coordinate of the center of a view /// Get the Y coordinate of the center of a view
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfView_GetCenterY(sfView* View) float sfView_GetCenterY(const sfView* View)
{ {
CSFML_CHECK_RETURN(View, 0.f); CSFML_CHECK_RETURN(View, 0.f);
@ -128,7 +128,7 @@ float sfView_GetCenterY(sfView* View)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the view /// Get the width of the view
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfView_GetWidth(sfView* View) float sfView_GetWidth(const sfView* View)
{ {
CSFML_CHECK_RETURN(View, 0.f); CSFML_CHECK_RETURN(View, 0.f);
@ -139,7 +139,7 @@ float sfView_GetWidth(sfView* View)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the view /// Get the height of the view
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfView_GetHeight(sfView* View) float sfView_GetHeight(const sfView* View)
{ {
CSFML_CHECK_RETURN(View, 0.f); CSFML_CHECK_RETURN(View, 0.f);
@ -150,7 +150,7 @@ float sfView_GetHeight(sfView* View)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current rotation of a view /// Get the current rotation of a view
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfView_GetRotation(sfView* View) float sfView_GetRotation(const sfView* View)
{ {
CSFML_CALL_PTR_RETURN(View, GetRotation(), 0.f); CSFML_CALL_PTR_RETURN(View, GetRotation(), 0.f);
} }
@ -159,7 +159,7 @@ float sfView_GetRotation(sfView* View)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target viewport of a view /// Get the target viewport of a view
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFloatRect sfView_GetViewport(sfView* View) sfFloatRect sfView_GetViewport(const sfView* View)
{ {
sfFloatRect Rect = {0, 0, 0, 0}; sfFloatRect Rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(View, Rect); CSFML_CHECK_RETURN(View, Rect);

View File

@ -43,7 +43,7 @@ void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResponse)
/// Convenience function to check if the response status code /// Convenience function to check if the response status code
/// means a success /// means a success
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* ftpListingResponse) sfBool sfFtpListingResponse_IsOk(const sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CALL_RETURN(ftpListingResponse, IsOk(), sfFalse); CSFML_CALL_RETURN(ftpListingResponse, IsOk(), sfFalse);
} }
@ -51,7 +51,7 @@ sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* ftpListingResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpListingResponse) sfFtpStatus sfFtpListingResponse_GetStatus(const sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CHECK_RETURN(ftpListingResponse, sfFtpInvalidResponse); CSFML_CHECK_RETURN(ftpListingResponse, sfFtpInvalidResponse);
@ -61,7 +61,7 @@ sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpListingRespo
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* ftpListingResponse) const char* sfFtpListingResponse_GetMessage(const sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CHECK_RETURN(ftpListingResponse, NULL); CSFML_CHECK_RETURN(ftpListingResponse, NULL);
@ -71,7 +71,7 @@ const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* ftpListingResp
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the number of filenames in the listing /// Get the number of filenames in the listing
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* ftpListingResponse) size_t sfFtpListingResponse_GetCount(const sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CALL_RETURN(ftpListingResponse, GetCount(), 0); CSFML_CALL_RETURN(ftpListingResponse, GetCount(), 0);
} }
@ -79,7 +79,7 @@ size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* ftpListingResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Index-th filename in the directory /// Get the Index-th filename in the directory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfFtpListingResponse_GetFilename(sfFtpListingResponse* ftpListingResponse, size_t index) const char* sfFtpListingResponse_GetFilename(const sfFtpListingResponse* ftpListingResponse, size_t index)
{ {
CSFML_CHECK_RETURN(ftpListingResponse, NULL); CSFML_CHECK_RETURN(ftpListingResponse, NULL);
@ -99,7 +99,7 @@ void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirectoryResponse
/// Convenience function to check if the response status code /// Convenience function to check if the response status code
/// means a success /// means a success
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* ftpDirectoryResponse) sfBool sfFtpDirectoryResponse_IsOk(const sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CALL_RETURN(ftpDirectoryResponse, IsOk(), sfFalse); CSFML_CALL_RETURN(ftpDirectoryResponse, IsOk(), sfFalse);
} }
@ -107,7 +107,7 @@ sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* ftpDirectoryResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* ftpDirectoryResponse) sfFtpStatus sfFtpDirectoryResponse_GetStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CHECK_RETURN(ftpDirectoryResponse, sfFtpInvalidResponse); CSFML_CHECK_RETURN(ftpDirectoryResponse, sfFtpInvalidResponse);
@ -117,7 +117,7 @@ sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* ftpDirector
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* ftpDirectoryResponse) const char* sfFtpDirectoryResponse_GetMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL); CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL);
@ -127,7 +127,7 @@ const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* ftpDirecto
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the directory returned in the response /// Get the directory returned in the response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* ftpDirectoryResponse) const char* sfFtpDirectoryResponse_GetDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL); CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL);
@ -148,7 +148,7 @@ void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse)
/// Convenience function to check if the response status code /// Convenience function to check if the response status code
/// means a success /// means a success
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfFtpResponse_IsOk(sfFtpResponse* ftpResponse) sfBool sfFtpResponse_IsOk(const sfFtpResponse* ftpResponse)
{ {
CSFML_CALL_RETURN(ftpResponse, IsOk(), sfFalse); CSFML_CALL_RETURN(ftpResponse, IsOk(), sfFalse);
} }
@ -157,7 +157,7 @@ sfBool sfFtpResponse_IsOk(sfFtpResponse* ftpResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse) sfFtpStatus sfFtpResponse_GetStatus(const sfFtpResponse* ftpResponse)
{ {
CSFML_CHECK_RETURN(ftpResponse, sfFtpInvalidResponse); CSFML_CHECK_RETURN(ftpResponse, sfFtpInvalidResponse);
@ -168,7 +168,7 @@ sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfFtpResponse_GetMessage(sfFtpResponse* ftpResponse) const char* sfFtpResponse_GetMessage(const sfFtpResponse* ftpResponse)
{ {
CSFML_CHECK_RETURN(ftpResponse, NULL); CSFML_CHECK_RETURN(ftpResponse, NULL);

View File

@ -112,7 +112,7 @@ void sfHttpResponse_Destroy(sfHttpResponse* httpResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the value of a field; returns NULL if the field doesn't exist /// Get the value of a field; returns NULL if the field doesn't exist
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfHttpResponse_GetField(sfHttpResponse* httpResponse, const char* field) const char* sfHttpResponse_GetField(const sfHttpResponse* httpResponse, const char* field)
{ {
CSFML_CHECK_RETURN(httpResponse, NULL); CSFML_CHECK_RETURN(httpResponse, NULL);
if (!field) if (!field)
@ -125,7 +125,7 @@ const char* sfHttpResponse_GetField(sfHttpResponse* httpResponse, const char* fi
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a response /// Get the status of a response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse) sfHttpStatus sfHttpResponse_GetStatus(const sfHttpResponse* httpResponse)
{ {
CSFML_CHECK_RETURN(httpResponse, sfHttpInvalidResponse); CSFML_CHECK_RETURN(httpResponse, sfHttpInvalidResponse);
@ -136,7 +136,7 @@ sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the major HTTP version of a response /// Get the major HTTP version of a response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfHttpResponse_GetMajorVersion(sfHttpResponse* httpResponse) unsigned int sfHttpResponse_GetMajorVersion(const sfHttpResponse* httpResponse)
{ {
CSFML_CALL_RETURN(httpResponse, GetMajorHttpVersion(), 0); CSFML_CALL_RETURN(httpResponse, GetMajorHttpVersion(), 0);
} }
@ -145,7 +145,7 @@ unsigned int sfHttpResponse_GetMajorVersion(sfHttpResponse* httpResponse)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minor HTTP version of a response /// Get the minor HTTP version of a response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* httpResponse) unsigned int sfHttpResponse_GetMinorVersion(const sfHttpResponse* httpResponse)
{ {
CSFML_CALL_RETURN(httpResponse, GetMinorHttpVersion(), 0); CSFML_CALL_RETURN(httpResponse, GetMinorHttpVersion(), 0);
} }
@ -158,7 +158,7 @@ unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* httpResponse)
/// - nothing (for HEAD requests) /// - nothing (for HEAD requests)
/// - an error message (in case of an error) /// - an error message (in case of an error)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfHttpResponse_GetBody(sfHttpResponse* httpResponse) const char* sfHttpResponse_GetBody(const sfHttpResponse* httpResponse)
{ {
CSFML_CHECK_RETURN(httpResponse, NULL); CSFML_CHECK_RETURN(httpResponse, NULL);
@ -201,7 +201,7 @@ void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port)
/// not return instantly; use a thread if you don't want to block your /// not return instantly; use a thread if you don't want to block your
/// application. /// application.
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfHttpResponse* sfHttp_SendRequest(sfHttp* http, sfHttpRequest* request, float timeout) sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, float timeout)
{ {
CSFML_CHECK_RETURN(http, NULL); CSFML_CHECK_RETURN(http, NULL);
CSFML_CHECK_RETURN(request, NULL); CSFML_CHECK_RETURN(request, NULL);

View File

@ -79,7 +79,7 @@ void sfPacket_Destroy(sfPacket* packet)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Append data to the end of a packet /// Append data to the end of a packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPacket_Append(sfPacket* packet, void* data, size_t sizeInBytes) void sfPacket_Append(sfPacket* packet, const void* data, size_t sizeInBytes)
{ {
CSFML_CALL(packet, Append(data, sizeInBytes)); CSFML_CALL(packet, Append(data, sizeInBytes));
} }
@ -99,7 +99,7 @@ void sfPacket_Clear(sfPacket* packet)
/// Warning : the returned pointer may be invalid after you /// Warning : the returned pointer may be invalid after you
/// append data to the packet /// append data to the packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfPacket_GetData(sfPacket* packet) const char* sfPacket_GetData(const sfPacket* packet)
{ {
CSFML_CALL_RETURN(packet, GetData(), NULL); CSFML_CALL_RETURN(packet, GetData(), NULL);
} }
@ -108,7 +108,7 @@ const char* sfPacket_GetData(sfPacket* packet)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the data contained in a packet /// Get the size of the data contained in a packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
size_t sfPacket_GetDataSize(sfPacket* packet) size_t sfPacket_GetDataSize(const sfPacket* packet)
{ {
CSFML_CALL_RETURN(packet, GetDataSize(), 0); CSFML_CALL_RETURN(packet, GetDataSize(), 0);
} }
@ -117,7 +117,7 @@ size_t sfPacket_GetDataSize(sfPacket* packet)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the reading position has reached the end of the packet /// Tell if the reading position has reached the end of the packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfPacket_EndOfPacket(sfPacket* packet) sfBool sfPacket_EndOfPacket(const sfPacket* packet)
{ {
CSFML_CALL_RETURN(packet, EndOfPacket(), sfFalse); CSFML_CALL_RETURN(packet, EndOfPacket(), sfFalse);
} }
@ -126,7 +126,7 @@ sfBool sfPacket_EndOfPacket(sfPacket* packet)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if a packet is in a valid reading state /// Check if a packet is in a valid reading state
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfPacket_CanRead(sfPacket* packet) sfBool sfPacket_CanRead(const sfPacket* packet)
{ {
CSFML_CALL_RETURN(packet, operator bool(), sfFalse); CSFML_CALL_RETURN(packet, operator bool(), sfFalse);
} }

View File

@ -78,13 +78,13 @@ unsigned int sfSelectorUDP_Wait(sfSelectorUDP* selector, float timeout) {CSFML_C
/// ready for reading. The total number of sockets ready /// ready for reading. The total number of sockets ready
/// is the integer returned by the previous call to Wait() /// is the integer returned by the previous call to Wait()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketTCP* sfSelectorTCP_GetSocketReady(sfSelectorTCP* selector, unsigned int index) sfSocketTCP* sfSelectorTCP_GetSocketReady(const sfSelectorTCP* selector, unsigned int index)
{ {
CSFML_CHECK_RETURN(selector, NULL); CSFML_CHECK_RETURN(selector, NULL);
return selector->Sockets[selector->This.GetSocketReady(index)]; return selector->Sockets.find(selector->This.GetSocketReady(index))->second;
} }
sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* selector, unsigned int index) sfSocketUDP* sfSelectorUDP_GetSocketReady(const sfSelectorUDP* selector, unsigned int index)
{ {
CSFML_CHECK_RETURN(selector, NULL); CSFML_CHECK_RETURN(selector, NULL);
return selector->Sockets[selector->This.GetSocketReady(index)]; return selector->Sockets.find(selector->This.GetSocketReady(index))->second;
} }

View File

@ -183,7 +183,7 @@ sfBool sfSocketTCP_Close(sfSocketTCP* socket)
/// Check if a socket is in a valid state ; this function /// Check if a socket is in a valid state ; this function
/// can be called any time to check if the socket is OK /// can be called any time to check if the socket is OK
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSocketTCP_IsValid(sfSocketTCP* socket) sfBool sfSocketTCP_IsValid(const sfSocketTCP* socket)
{ {
CSFML_CALL_RETURN(socket, IsValid(), sfFalse); CSFML_CALL_RETURN(socket, IsValid(), sfFalse);
} }

View File

@ -47,7 +47,11 @@ sfSocketUDP* sfSocketUDP_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSocketUDP_Destroy(sfSocketUDP* socket) void sfSocketUDP_Destroy(sfSocketUDP* socket)
{ {
delete socket; if (socket)
{
socket->This.Close();
delete socket;
}
} }
@ -178,7 +182,7 @@ sfBool sfSocketUDP_Close(sfSocketUDP* socket)
/// Check if a socket is in a valid state ; this function /// Check if a socket is in a valid state ; this function
/// can be called any time to check if the socket is OK /// can be called any time to check if the socket is OK
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSocketUDP_IsValid(sfSocketUDP* socket) sfBool sfSocketUDP_IsValid(const sfSocketUDP* socket)
{ {
CSFML_CALL_RETURN(socket, IsValid(), sfFalse); CSFML_CALL_RETURN(socket, IsValid(), sfFalse);
} }

View File

@ -51,7 +51,7 @@ void sfClock_Destroy(sfClock* clock)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the time elapsed for a clock /// Get the time elapsed for a clock
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfClock_GetTime(sfClock* clock) float sfClock_GetTime(const sfClock* clock)
{ {
CSFML_CALL_RETURN(clock, GetElapsedTime(), 0.f) CSFML_CALL_RETURN(clock, GetElapsedTime(), 0.f)
} }

View File

@ -34,7 +34,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new window /// Construct a new window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long style, sfContextSettings* settings) sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long style, const sfContextSettings* settings)
{ {
// Convert video mode // Convert video mode
sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel); sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel);
@ -62,7 +62,7 @@ sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long sty
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a window from an existing control /// Construct a window from an existing control
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings* settings) sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings)
{ {
// Convert context settings // Convert context settings
sf::ContextSettings params; sf::ContextSettings params;
@ -104,7 +104,7 @@ void sfWindow_Close(sfWindow* window)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a window is opened /// Tell whether or not a window is opened
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfWindow_IsOpened(sfWindow* window) sfBool sfWindow_IsOpened(const sfWindow* window)
{ {
CSFML_CALL_RETURN(window, IsOpened(), sfFalse); CSFML_CALL_RETURN(window, IsOpened(), sfFalse);
} }
@ -113,7 +113,7 @@ sfBool sfWindow_IsOpened(sfWindow* window)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of a window /// Get the width of the rendering region of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfWindow_GetWidth(sfWindow* window) unsigned int sfWindow_GetWidth(const sfWindow* window)
{ {
CSFML_CALL_RETURN(window, GetWidth(), 0) CSFML_CALL_RETURN(window, GetWidth(), 0)
} }
@ -122,7 +122,7 @@ unsigned int sfWindow_GetWidth(sfWindow* window)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rendering region of a window /// Get the height of the rendering region of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfWindow_GetHeight(sfWindow* window) unsigned int sfWindow_GetHeight(const sfWindow* window)
{ {
CSFML_CALL_RETURN(window, GetHeight(), 0) CSFML_CALL_RETURN(window, GetHeight(), 0)
} }
@ -131,7 +131,7 @@ unsigned int sfWindow_GetHeight(sfWindow* window)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfContextSettings sfWindow_GetSettings(sfWindow* window) sfContextSettings sfWindow_GetSettings(const sfWindow* window)
{ {
sfContextSettings settings = {0, 0, 0}; sfContextSettings settings = {0, 0, 0};
CSFML_CHECK_RETURN(window, settings); CSFML_CHECK_RETURN(window, settings);
@ -259,7 +259,7 @@ void sfWindow_EnableKeyRepeat(sfWindow* window, sfBool enabled)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the window's icon /// Change the window's icon
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, sfUint8* pixels) void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels)
{ {
CSFML_CALL(window, SetIcon(width, height, pixels)) CSFML_CALL(window, SetIcon(width, height, pixels))
} }
@ -286,7 +286,7 @@ void sfWindow_Display(sfWindow* window)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the input manager of a window /// Get the input manager of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfInput* sfWindow_GetInput(sfWindow* window) const sfInput* sfWindow_GetInput(sfWindow* window)
{ {
CSFML_CHECK_RETURN(window, NULL); CSFML_CHECK_RETURN(window, NULL);
@ -306,7 +306,7 @@ void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get time elapsed since last frame of a window /// Get time elapsed since last frame of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfWindow_GetFrameTime(sfWindow* window) float sfWindow_GetFrameTime(const sfWindow* window)
{ {
CSFML_CALL_RETURN(window, GetFrameTime(), 0.f) CSFML_CALL_RETURN(window, GetFrameTime(), 0.f)
} }

View File

@ -28,6 +28,7 @@
</ResourceCompiler> </ResourceCompiler>
<Linker> <Linker>
<Add library="ws2_32" /> <Add library="ws2_32" />
<Add library="..\..\lib\mingw\libsfml-system-d.a" />
<Add directory="..\..\bin\static" /> <Add directory="..\..\bin\static" />
</Linker> </Linker>
</Target> </Target>
@ -52,6 +53,7 @@
</ResourceCompiler> </ResourceCompiler>
<Linker> <Linker>
<Add library="ws2_32" /> <Add library="ws2_32" />
<Add library="..\..\lib\mingw\libsfml-system.a" />
<Add directory="..\..\bin\static" /> <Add directory="..\..\bin\static" />
</Linker> </Linker>
</Target> </Target>

View File

@ -8,13 +8,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-audio", "sfml-audio.vc
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-graphics", "sfml-graphics.vcproj", "{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-graphics", "sfml-graphics.vcproj", "{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-main", "sfml-main.vcproj", "{2BD26A09-E1B6-42E2-A0D0-63987B76BB97}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-main", "sfml-main.vcproj", "{2BD26A09-E1B6-42E2-A0D0-63987B76BB97}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-network", "sfml-network.vcproj", "{823DDC98-42D5-4A38-88CF-9DC06C788AE4}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-network", "sfml-network.vcproj", "{823DDC98-42D5-4A38-88CF-9DC06C788AE4}"
ProjectSection(ProjectDependencies) = postProject
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-system", "sfml-system.vcproj", "{C061A27D-7CA0-4179-9869-672FA04A86A8}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-system", "sfml-system.vcproj", "{C061A27D-7CA0-4179-9869-672FA04A86A8}"
EndProject EndProject
@ -25,10 +28,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-window", "sfml-window.
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\samples\build\vc2005\opengl.vcproj", "{4CD9A872-16EF-4C53-81FC-C7E77E782718}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\samples\build\vc2005\opengl.vcproj", "{4CD9A872-16EF-4C53-81FC-C7E77E782718}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\samples\build\vc2005\sockets.vcproj", "{E6ED898F-218E-4467-8B1D-92E393283E1B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\samples\build\vc2005\sockets.vcproj", "{E6ED898F-218E-4467-8B1D-92E393283E1B}"
@ -38,58 +41,58 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\samples\bu
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound", "..\..\samples\build\vc2005\sound.vcproj", "{11E3764D-850E-4EDA-9823-F66383A11042}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound", "..\..\samples\build\vc2005\sound.vcproj", "{11E3764D-850E-4EDA-9823-F66383A11042}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound-capture", "..\..\samples\build\vc2005\sound-capture.vcproj", "{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound-capture", "..\..\samples\build\vc2005\sound-capture.vcproj", "{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voip", "..\..\samples\build\vc2005\voip.vcproj", "{4B169017-FFDD-4588-9658-6F1C9ABC6495}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voip", "..\..\samples\build\vc2005\voip.vcproj", "{4B169017-FFDD-4588-9658-6F1C9ABC6495}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\samples\build\vc2005\win32.vcproj", "{303EC049-639D-4F9C-9F33-D4B7F702275B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\samples\build\vc2005\win32.vcproj", "{303EC049-639D-4F9C-9F33-D4B7F702275B}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\samples\build\vc2005\window.vcproj", "{11E9ABEF-17A5-4FF7-91E5-994F34172F68}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\samples\build\vc2005\window.vcproj", "{11E9ABEF-17A5-4FF7-91E5-994F34172F68}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxwidgets", "..\..\samples\build\vc2005\wxwidgets.vcproj", "{8B3B274A-B3B7-4C6B-8D4A-5334E2116830}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxwidgets", "..\..\samples\build\vc2005\wxwidgets.vcproj", "{8B3B274A-B3B7-4C6B-8D4A-5334E2116830}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qt", "..\..\samples\build\vc2005\qt.vcproj", "{EAB1A0A4-8CCC-4A74-B3B5-9F60243581D2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qt", "..\..\samples\build\vc2005\qt.vcproj", "{EAB1A0A4-8CCC-4A74-B3B5-9F60243581D2}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\samples\build\vc2005\pong.vcproj", "{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\samples\build\vc2005\pong.vcproj", "{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2}
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{C6D36691-1669-4189-AAB8-06C9932C2A45}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{C6D36691-1669-4189-AAB8-06C9932C2A45}"
@ -98,16 +101,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{3EE1
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftp", "..\..\samples\build\vc2005\ftp.vcproj", "{7236920B-254C-43A3-9DC1-778B477226DF}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftp", "..\..\samples\build\vc2005\ftp.vcproj", "{7236920B-254C-43A3-9DC1-778B477226DF}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader", "..\..\samples\build\vc2005\shader.vcproj", "{E8B7727D-2308-4ADC-90AE-D3F46798447D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader", "..\..\samples\build\vc2005\shader.vcproj", "{E8B7727D-2308-4ADC-90AE-D3F46798447D}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED}
{FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B}
{C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8}
{2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97}
EndProjectSection EndProjectSection
EndProject EndProject
Global Global

View File

@ -89,7 +89,7 @@ public :
/// \return The index-th socket /// \return The index-th socket
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Type GetSocketReady(unsigned int index); Type GetSocketReady(unsigned int index) const;
private : private :

View File

@ -85,7 +85,7 @@ unsigned int Selector<Type>::Wait(float timeout)
/// is the integer returned by the previous call to Wait() /// is the integer returned by the previous call to Wait()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename Type> template <typename Type>
Type Selector<Type>::GetSocketReady(unsigned int index) Type Selector<Type>::GetSocketReady(unsigned int index) const
{ {
SocketHelper::SocketType socket = SelectorBase::GetSocketReady(index); SocketHelper::SocketType socket = SelectorBase::GetSocketReady(index);

View File

@ -94,7 +94,7 @@ public :
/// \return The index-th socket /// \return The index-th socket
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketHelper::SocketType GetSocketReady(unsigned int index); SocketHelper::SocketType GetSocketReady(unsigned int index) const;
private : private :

View File

@ -105,7 +105,7 @@ unsigned int SelectorBase::Wait(float timeout)
/// ready for reading. The total number of sockets ready /// ready for reading. The total number of sockets ready
/// is the integer returned by the previous call to Wait() /// is the integer returned by the previous call to Wait()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketHelper::SocketType SelectorBase::GetSocketReady(unsigned int index) SocketHelper::SocketType SelectorBase::GetSocketReady(unsigned int index) const
{ {
// The standard FD_xxx interface doesn't define a direct access, // The standard FD_xxx interface doesn't define a direct access,
// so we must go through the whole set to find the socket we're looking for // so we must go through the whole set to find the socket we're looking for