Changed internal naming convention (local variables now start with a lower case character)

Removed the AudioResource class

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1166 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-07-11 22:17:24 +00:00
parent 7cc00085d8
commit 45b150648d
245 changed files with 7865 additions and 8065 deletions

View File

@ -215,6 +215,10 @@
RelativePath="..\..\include\SFML\Audio\Music.h" RelativePath="..\..\include\SFML\Audio\Music.h"
> >
</File> </File>
<File
RelativePath="..\..\src\SFML\Audio\MusicStruct.h"
>
</File>
<File <File
RelativePath="..\..\src\SFML\Audio\Sound.cpp" RelativePath="..\..\src\SFML\Audio\Sound.cpp"
> >

View File

@ -268,6 +268,10 @@
RelativePath="..\..\src\SFML\Graphics\RenderImage.cpp" RelativePath="..\..\src\SFML\Graphics\RenderImage.cpp"
> >
</File> </File>
<File
RelativePath="..\..\include\SFML\Graphics\RenderImage.h"
>
</File>
<File <File
RelativePath="..\..\src\SFML\Graphics\RenderImageStruct.h" RelativePath="..\..\src\SFML\Graphics\RenderImageStruct.h"
> >

View File

@ -147,16 +147,10 @@
<References> <References>
</References> </References>
<Files> <Files>
<Filter <File
Name="Sources Files" RelativePath="..\..\src\SFML\Main\SFML_Main.cpp"
Filter="cpp;c;cc;cxx;def;odl;idl;hp"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
> >
<File </File>
RelativePath="..\..\src\SFML\Main\SFML_Main.cpp"
>
</File>
</Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>

View File

@ -34,10 +34,10 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the global volume of all the sounds /// Change the global volume of all the sounds
/// ///
/// \param Volume : New global volume, in the range [0, 100] /// \param volume : New global volume, in the range [0, 100]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetGlobalVolume(float Volume); CSFML_API void sfListener_SetGlobalVolume(float volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current value of the global volume of all the sounds /// Get the current value of the global volume of all the sounds
@ -50,44 +50,44 @@ CSFML_API float sfListener_GetGlobalVolume();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of the listener /// Change the position of the listener
/// ///
/// \param PosX : X position of the listener in the world /// \param x : X position of the listener in the world
/// \param PosY : Y position of the listener in the world /// \param y : Y position of the listener in the world
/// \param PosZ : Z position of the listener in the world /// \param z : Z position of the listener in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetPosition(float PosX, float PosY, float PosZ); CSFML_API void sfListener_SetPosition(float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current position of the listener /// Get the current position of the listener
/// ///
/// \param PosX : X position of the listener in the world /// \param x : X position of the listener in the world
/// \param PosY : Y position of the listener in the world /// \param y : Y position of the listener in the world
/// \param PosZ : Z position of the listener in the world /// \param z : Z position of the listener in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfListener_GetPosition(float* PosX, float* PosY, float* PosZ); CSFML_API void sfListener_GetPosition(float* x, float* y, float* z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the orientation of the listener (the point /// Change the orientation of the listener (the point
/// he must look at) /// he must look at)
/// ///
/// \param TargetX : X position of the point the listener must look at /// \param x : X position of the point the listener must look at
/// \param TargetY : X position of the point the listener must look at /// \param y : X position of the point the listener must look at
/// \param TargetZ : X position of the point the listener must look at /// \param z : X position of the point the listener must look at
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetTarget(float TargetX, float TargetY, float TargetZ); CSFML_API void sfListener_SetTarget(float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current orientation of the listener (the point /// Get the current orientation of the listener (the point
/// he's looking at) /// he's looking at)
/// ///
/// \param TargetX : X position of the point the listener is looking at /// \param x : X position of the point the listener is looking at
/// \param TargetY : X position of the point the listener is looking at /// \param y : X position of the point the listener is looking at
/// \param TargetZ : X position of the point the listener is looking at /// \param z : X position of the point the listener is looking at
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfListener_GetTarget(float* TargetX, float* TargetY, float* TargetZ); CSFML_API void sfListener_GetTarget(float* x, float* y, float* z);
#endif // SFML_LISTENER_H #endif // SFML_LISTENER_H

View File

@ -36,257 +36,257 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new music and load it from a file /// Create a new music and load it from a file
/// ///
/// \param Filename : Path of the music file to open /// \param filename : Path of the music file to open
/// ///
/// \return A new sfMusic object (NULL if failed) /// \return A new sfMusic object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfMusic* sfMusic_CreateFromFile(const char* Filename); CSFML_API sfMusic* sfMusic_CreateFromFile(const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new music and load it from a file in memory /// Create a new music and load it from a file in memory
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// ///
/// \return A new sfMusic object (NULL if failed) /// \return A new sfMusic object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfMusic* sfMusic_CreateFromMemory(const char* Data, size_t SizeInBytes); CSFML_API sfMusic* sfMusic_CreateFromMemory(const char* data, size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing music /// Destroy an existing music
/// ///
/// \param Music : Music to delete /// \param music : Music to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Destroy(sfMusic* Music); CSFML_API void sfMusic_Destroy(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a music loop state /// Set a music loop state
/// ///
/// \param Music : Music to set the loop state /// \param music : Music to set the loop state
/// \param Loop : sfTrue to play in loop, sfFalse to play once /// \param loop : sfTrue to play in loop, sfFalse to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetLoop(sfMusic* Music, sfBool Loop); CSFML_API void sfMusic_SetLoop(sfMusic* music, sfBool loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a music is looping /// Tell whether or not a music is looping
/// ///
/// \param Music : Music to get the loop state from /// \param music : Music to get the loop state from
/// ///
/// \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(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a music duration /// Get a music duration
/// ///
/// \param Music : Music to get the duration from /// \param music : Music to get the duration from
/// ///
/// \return Music duration, in seconds /// \return Music duration, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetDuration(sfMusic* Music); CSFML_API float sfMusic_GetDuration(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a music /// Start playing a music
/// ///
/// \param Music : Music to play /// \param music : Music to play
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Play(sfMusic* Music); CSFML_API void sfMusic_Play(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Pause a music /// Pause a music
/// ///
/// \param Music : Music to pause /// \param music : Music to pause
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Pause(sfMusic* Music); CSFML_API void sfMusic_Pause(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing a music /// Stop playing a music
/// ///
/// \param Music : Music to stop /// \param music : Music to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Stop(sfMusic* Music); CSFML_API 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)
/// ///
/// \param Music : Music to get the channels count from /// \param music : Music to get the channels count from
/// ///
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfMusic_GetChannelsCount(sfMusic* Music); CSFML_API unsigned int sfMusic_GetChannelsCount(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the stream sample rate of a music /// Get the stream sample rate of a music
/// ///
/// \param Music : Music to get the sample rate from /// \param music : Music to get the sample rate from
/// ///
/// \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(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a music (stopped, paused, playing) /// Get the status of a music (stopped, paused, playing)
/// ///
/// \param Music : Music to get the status from /// \param music : Music to get the status from
/// ///
/// \return Current status of the sound /// \return Current status of the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfMusic_GetStatus(sfMusic* Music); CSFML_API sfSoundStatus sfMusic_GetStatus(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a music /// Get the current playing position of a music
/// ///
/// \param Music : Music to get the position from /// \param music : Music to get the position from
/// ///
/// \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(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a music /// Set the pitch of a music
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param Pitch : New pitch /// \param pitch : New pitch
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPitch(sfMusic* Music, float Pitch); CSFML_API void sfMusic_SetPitch(sfMusic* music, float pitch);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the volume of a music /// Set the volume of a music
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param Volume : Volume (in range [0, 100]) /// \param volume : Volume (in range [0, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetVolume(sfMusic* Music, float Volume); CSFML_API void sfMusic_SetVolume(sfMusic* music, float volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a music /// Set the position of a music
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param X : X position of the sound in the world /// \param x : X position of the sound in the world
/// \param Y : Y position of the sound in the world /// \param y : Y position of the sound in the world
/// \param Z : Z position of the sound in the world /// \param z : Z position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPosition(sfMusic* Music, float X, float Y, float Z); CSFML_API void sfMusic_SetPosition(sfMusic* music, float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Make the music's position relative to the listener's /// Make the music's position relative to the listener's
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param Relative : True to set the position relative, false to set it absolute /// \param relative : True to set the position relative, false to set it absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetRelativeToListener(sfMusic* Music, sfBool Relative); CSFML_API void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relative);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance, /// Set the minimum distance - closer than this distance,
/// the listener will hear the music at its maximum volume. /// the listener will hear the music at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param MinDistance : New minimum distance for the music /// \param distance : New minimum distance for the music
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetMinDistance(sfMusic* Music, float MinDistance); CSFML_API void sfMusic_SetMinDistance(sfMusic* music, float distance);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the /// Set the attenuation factor - the higher the attenuation, the
/// more the sound will be attenuated with distance from listener. /// more the sound will be attenuated with distance from listener.
/// The default attenuation factor 1.0 /// The default attenuation factor 1.0
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param Attenuation : New attenuation factor for the sound /// \param attenuation : New attenuation factor for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetAttenuation(sfMusic* Music, float Attenuation); CSFML_API void sfMusic_SetAttenuation(sfMusic* music, float attenuation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of a music /// Set the current playing position of a music
/// ///
/// \param Music : Music to modify /// \param music : Music to modify
/// \param TimeOffset : New playing position, expressed in seconds /// \param timeOffset : New playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPlayingOffset(sfMusic* Music, float TimeOffset); CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a music /// Get the pitch of a music
/// ///
/// \param Music : Music to get the pitch from /// \param music : Music to get the pitch from
/// ///
/// \return Pitch value /// \return Pitch value
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetPitch(sfMusic* Music); CSFML_API float sfMusic_GetPitch(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a music /// Get the volume of a music
/// ///
/// \param Music : Music to get the volume from /// \param music : Music to get the volume from
/// ///
/// \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(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a music /// Get the position of a music
/// ///
/// \param Music : Music to get the position from /// \param music : Music to get the position from
/// \param X : X position of the sound in the world /// \param x : X position of the sound in the world
/// \param Y : Y position of the sound in the world /// \param y : Y position of the sound in the world
/// \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(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
/// ///
/// \param Music : Music to check /// \param music : Music to check
/// ///
/// \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(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a music /// Get the minimum distance of a music
/// ///
/// \param Music : Music to get the minimum distance from /// \param music : Music to get the minimum distance from
/// ///
/// \return Minimum distance for the music /// \return Minimum distance for the music
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetMinDistance(sfMusic* Music); CSFML_API float sfMusic_GetMinDistance(sfMusic* music);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a music /// Get the attenuation factor of a music
/// ///
/// \param Music : Music to get the attenuation factor from /// \param music : Music to get the attenuation factor from
/// ///
/// \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(sfMusic* music);
#endif // SFML_MUSIC_H #endif // SFML_MUSIC_H

View File

@ -44,225 +44,225 @@ CSFML_API sfSound* sfSound_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound /// Destroy an existing sound
/// ///
/// \param Sound : Sound to delete /// \param sound : Sound to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_Destroy(sfSound* Sound); CSFML_API void sfSound_Destroy(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a sound /// Start playing a sound
/// ///
/// \param Sound : Sound to play /// \param sound : Sound to play
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_Play(sfSound* Sound); CSFML_API void sfSound_Play(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Pause a sound /// Pause a sound
/// ///
/// \param Sound : Sound to pause /// \param sound : Sound to pause
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_Pause(sfSound* Sound); CSFML_API void sfSound_Pause(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing a sound /// Stop playing a sound
/// ///
/// \param Sound : Sound to stop /// \param sound : Sound to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_Stop(sfSound* Sound); CSFML_API void sfSound_Stop(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a sound buffer to a sound /// Bind a sound buffer to a sound
/// ///
/// \param Sound : Sound to set the loop state /// \param sound : Sound to set the loop state
/// \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, sfSoundBuffer* buffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sound buffer bound to a sound /// Get the sound buffer bound to a sound
/// ///
/// \param Sound : Sound to get the buffer from /// \param sound : Sound to get the buffer from
/// ///
/// \return Pointer to the sound's buffer /// \return Pointer to the sound's buffer
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSound_GetBuffer(sfSound* Sound); CSFML_API sfSoundBuffer* sfSound_GetBuffer(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a sound loop state /// Set a sound loop state
/// ///
/// \param Sound : Sound to set the loop state /// \param sound : Sound to set the loop state
/// \param Loop : sfTrue to play in loop, sfFalse to play once /// \param loop : sfTrue to play in loop, sfFalse to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetLoop(sfSound* Sound, sfBool Loop); CSFML_API void sfSound_SetLoop(sfSound* sound, sfBool loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a sound is looping /// Tell whether or not a sound is looping
/// ///
/// \param Sound : Sound to get the loop state from /// \param sound : Sound to get the loop state from
/// ///
/// \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(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a sound (stopped, paused, playing) /// Get the status of a sound (stopped, paused, playing)
/// ///
/// \param Sound : Sound to get the status from /// \param sound : Sound to get the status from
/// ///
/// \return Current status of the sound /// \return Current status of the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfSound_GetStatus(sfSound* Sound); CSFML_API sfSoundStatus sfSound_GetStatus(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a sound /// Set the pitch of a sound
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param Pitch : New pitch /// \param pitch : New pitch
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPitch(sfSound* Sound, float Pitch); CSFML_API void sfSound_SetPitch(sfSound* sound, float pitch);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the volume of a sound /// Set the volume of a sound
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param Volume : Volume (in range [0, 100]) /// \param volume : Volume (in range [0, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetVolume(sfSound* Sound, float Volume); CSFML_API void sfSound_SetVolume(sfSound* sound, float volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a sound /// Set the position of a sound
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param X : X position of the sound in the world /// \param x : X position of the sound in the world
/// \param Y : Y position of the sound in the world /// \param y : Y position of the sound in the world
/// \param Z : Z position of the sound in the world /// \param z : Z position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPosition(sfSound* Sound, float X, float Y, float Z); CSFML_API void sfSound_SetPosition(sfSound* sound, float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Make the sound's position relative to the listener's /// Make the sound's position relative to the listener's
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param Relative : True to set the position relative, false to set it absolute /// \param relative : True to set the position relative, false to set it absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetRelativeToListener(sfSound* Sound, sfBool Relative); CSFML_API void sfSound_SetRelativeToListener(sfSound* sound, sfBool relative);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance, /// Set the minimum distance - closer than this distance,
/// the listener will hear the sound at its maximum volume. /// the listener will hear the sound at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param MinDistance : New minimum distance for the sound /// \param distance : New minimum distance for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetMinDistance(sfSound* Sound, float MinDistance); CSFML_API void sfSound_SetMinDistance(sfSound* sound, float distance);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the /// Set the attenuation factor - the higher the attenuation, the
/// more the sound will be attenuated with distance from listener. /// more the sound will be attenuated with distance from listener.
/// The default attenuation factor is 1.0 /// The default attenuation factor is 1.0
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param Attenuation : New attenuation factor for the sound /// \param attenuation : New attenuation factor for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetAttenuation(sfSound* Sound, float Attenuation); CSFML_API void sfSound_SetAttenuation(sfSound* sound, float attenuation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of a sound /// Set the current playing position of a sound
/// ///
/// \param Sound : Sound to modify /// \param sound : Sound to modify
/// \param TimeOffset : New playing position, expressed in seconds /// \param timeOffset : New playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPlayingOffset(sfSound* Sound, float TimeOffset); CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a sound /// Get the pitch of a sound
/// ///
/// \param Sound : Sound to get the pitch from /// \param sound : Sound to get the pitch from
/// ///
/// \return Pitch value /// \return Pitch value
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetPitch(sfSound* Sound); CSFML_API float sfSound_GetPitch(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound /// Get the volume of a sound
/// ///
/// \param Sound : Sound to get the volume from /// \param sound : Sound to get the volume from
/// ///
/// \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(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a sound /// Get the position of a sound
/// ///
/// \param Sound : Sound to get the position from /// \param sound : Sound to get the position from
/// \param X : X position of the sound in the world /// \param x : X position of the sound in the world
/// \param Y : Y position of the sound in the world /// \param y : Y position of the sound in the world
/// \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(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
/// ///
/// \param Sound : Sound to check /// \param sound : Sound to check
/// ///
/// \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(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound /// Get the minimum distance of a sound
/// ///
/// \param Sound : Sound to get the minimum distance from /// \param sound : Sound to get the minimum distance from
/// ///
/// \return Minimum distance for the sound /// \return Minimum distance for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetMinDistance(sfSound* Sound); CSFML_API float sfSound_GetMinDistance(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound /// Get the attenuation factor of a sound
/// ///
/// \param Sound : Sound to get the attenuation factor from /// \param sound : Sound to get the attenuation factor from
/// ///
/// \return Attenuation factor for the sound /// \return Attenuation factor for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetAttenuation(sfSound* Sound); CSFML_API float sfSound_GetAttenuation(sfSound* sound);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound /// Get the current playing position of a sound
/// ///
/// \param Sound : Sound to get the position from /// \param sound : Sound to get the position from
/// ///
/// \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(sfSound* sound);
#endif // SFML_SOUND_H #endif // SFML_SOUND_H

View File

@ -35,107 +35,107 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file /// Create a new sound buffer and load it from a file
/// ///
/// \param Filename : Path of the music file to open /// \param filename : Path of the music file to open
/// ///
/// \return A new sfSoundBuffer object (NULL if failed) /// \return A new sfSoundBuffer object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* Filename); CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file in memory /// Create a new sound buffer and load it from a file in memory
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// ///
/// \return A new sfSoundBuffer object (NULL if failed) /// \return A new sfSoundBuffer object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const char* Data, size_t SizeInBytes); CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const char* data, size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from an array of /// Create a new sound buffer and load it from an array of
/// samples in memory - assumed format for samples is /// samples in memory - assumed format for samples is
/// 16 bits signed integer /// 16 bits signed integer
/// ///
/// \param Samples : Pointer to the samples in memory /// \param samples : Pointer to the samples in memory
/// \param SamplesCount : Number of samples pointed by Samples /// \param samplesCount : Number of samples pointed by Samples
/// \param ChannelsCount : Number of channels (1 = mono, 2 = stereo, ...) /// \param channelsCount : Number of channels (1 = mono, 2 = stereo, ...)
/// \param SampleRate : Frequency (number of samples to play per second) /// \param sampleRate : Frequency (number of samples to play per second)
/// ///
/// \return A new sfSoundBuffer object (NULL if failed) /// \return A new sfSoundBuffer object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* Samples, size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate); CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer /// Destroy an existing sound buffer
/// ///
/// \param SoundBuffer : Sound buffer to delete /// \param soundBuffer : Sound buffer to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundBuffer_Destroy(sfSoundBuffer* SoundBuffer); CSFML_API void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save a sound buffer to a file /// Save a sound buffer to a file
/// ///
/// \param SoundBuffer : Sound buffer to save /// \param soundBuffer : Sound buffer to save
/// \param Filename : Path of the sound file to write /// \param filename : Path of the sound file to write
/// ///
/// \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(sfSoundBuffer* soundBuffer, const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the samples contained in a sound buffer /// Return the samples contained in a sound buffer
/// ///
/// \param SoundBuffer : Sound buffer to get samples from /// \param soundBuffer : Sound buffer to get samples from
/// ///
/// \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(sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of samples contained in a sound buffer /// Return the number of samples contained in a sound buffer
/// ///
/// \param SoundBuffer : Sound buffer to get samples count from /// \param soundBuffer : Sound buffer to get samples count from
/// ///
/// \return Number of samples /// \return Number of samples
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API size_t sfSoundBuffer_GetSamplesCount(sfSoundBuffer* SoundBuffer); CSFML_API size_t sfSoundBuffer_GetSamplesCount(sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer /// Get the sample rate of a sound buffer
/// ///
/// \param SoundBuffer : Sound buffer to get sample rate from /// \param soundBuffer : Sound buffer to get sample rate from
/// ///
/// \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(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, ...)
/// ///
/// \param SoundBuffer : Sound buffer to get channels count from /// \param soundBuffer : Sound buffer to get channels count from
/// ///
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(sfSoundBuffer* SoundBuffer); CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer /// Get the duration of a sound buffer
/// ///
/// \param SoundBuffer : Sound buffer to get duration from /// \param soundBuffer : Sound buffer to get duration from
/// ///
/// \return Sound duration, in seconds /// \return Sound duration, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundBuffer_GetDuration(sfSoundBuffer* SoundBuffer); CSFML_API float sfSoundBuffer_GetDuration(sfSoundBuffer* soundBuffer);
#endif // SFML_SOUNDBUFFER_H #endif // SFML_SOUNDBUFFER_H

View File

@ -43,49 +43,49 @@ CSFML_API sfSoundBufferRecorder* sfSoundBufferRecorder_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer recorder /// Destroy an existing sound buffer recorder
/// ///
/// \param SoundBufferRecorder : Sound buffer recorder to delete /// \param soundBufferRecorder : Sound buffer recorder to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* SoundBufferRecorder); CSFML_API void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundBufferRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start the capture. /// Start the capture.
/// Warning : only one capture can happen at the same time /// Warning : only one capture can happen at the same time
/// ///
/// \param SoundBufferRecorder : Sound bufferrecorder to start /// \param soundBufferRecorder : Sound buffer recorder to start
/// \param SampleRate : Sound frequency (the more samples, the higher the quality) /// \param sampleRate : Sound frequency (the more samples, the higher the quality)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* SoundBufferRecorder, unsigned int SampleRate); CSFML_API void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop the capture /// Stop the capture
/// ///
/// \param SoundBufferRecorder : Sound buffer recorder to stop /// \param soundBufferRecorder : Sound buffer recorder to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* SoundBufferRecorder); CSFML_API void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer recorder /// Get the sample rate of a sound buffer recorder
/// ///
/// \param SoundBufferRecorder : Sound buffer recorder to get sample rate from /// \param soundBufferRecorder : Sound buffer recorder to get sample rate from
/// ///
/// \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(sfSoundBufferRecorder* soundBufferRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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
/// ///
/// \param SoundBufferRecorder : Sound buffer recorder to get the sound buffer from /// \param soundBufferRecorder : Sound buffer recorder to get the sound buffer from
/// ///
/// \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 sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(sfSoundBufferRecorder* soundBufferRecorder);
#endif // SFML_SOUNDBUFFERRECORDER_H #endif // SFML_SOUNDBUFFERRECORDER_H

View File

@ -41,54 +41,54 @@ typedef void (*sfSoundRecorderStopCallback)(void*);
/// Construct a new sound recorder with callback functions /// Construct a new sound recorder with callback functions
/// for processing captured samples /// for processing captured samples
/// ///
/// \param OnStart : Callback function which will be called when a new capture starts (can be NULL) /// \param onStart : Callback function which will be called when a new capture starts (can be NULL)
/// \param OnProcess : Callback function which will be called each time there's audio data to process /// \param onProcess : Callback function which will be called each time there's audio data to process
/// \param OnStop : Callback function which will be called when the current capture stops (can be NULL) /// \param onStop : Callback function which will be called when the current capture stops (can be NULL)
/// \param UserData : Data to pass to the callback function (can be NULL) /// \param userData : Data to pass to the callback function (can be NULL)
/// ///
/// \return A new sfSoundRecorder object (NULL if failed) /// \return A new sfSoundRecorder object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback OnStart, CSFML_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart,
sfSoundRecorderProcessCallback OnProcess, sfSoundRecorderProcessCallback onProcess,
sfSoundRecorderStopCallback OnStop, sfSoundRecorderStopCallback onStop,
void* UserData); void* userData);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound recorder /// Destroy an existing sound recorder
/// ///
/// \param SoundRecorder : Sound recorder to delete /// \param soundRecorder : Sound recorder to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundRecorder_Destroy(sfSoundRecorder* SoundRecorder); CSFML_API void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start the capture. /// Start the capture.
/// Warning : only one capture can happen at the same time /// Warning : only one capture can happen at the same time
/// ///
/// \param SoundRecorder : Sound recorder to start /// \param soundRecorder : Sound recorder to start
/// \param SampleRate : Sound frequency (the more samples, the higher the quality) /// \param sampleRate : Sound frequency (the more samples, the higher the quality)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundRecorder_Start(sfSoundRecorder* SoundRecorder, unsigned int SampleRate); CSFML_API void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop the capture /// Stop the capture
/// ///
/// \param SoundRecorder : Sound recorder to stop /// \param soundRecorder : Sound recorder to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundRecorder_Stop(sfSoundRecorder* SoundRecorder); CSFML_API void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound recorder /// Get the sample rate of a sound recorder
/// ///
/// \param SoundRecorder : Sound recorder to get sample rate from /// \param soundRecorder : Sound recorder to get sample rate from
/// ///
/// \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(sfSoundRecorder* soundRecorder);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the system supports sound capture. /// Tell if the system supports sound capture.

View File

@ -50,245 +50,245 @@ typedef void (*sfSoundStreamSeekCallback)(float, void*); ///<
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new sound stream /// Construct a new sound stream
/// ///
/// \param OnGetData : Function called when the stream needs more data (can't be NULL) /// \param onGetData : Function called when the stream needs more data (can't be NULL)
/// \param OnSeek : Function called when the stream seeks (can't be NULL) /// \param onSeek : Function called when the stream seeks (can't be NULL)
/// \param ChannelsCount : Number of channels to use (1 = mono, 2 = stereo) /// \param channelsCount : Number of channels to use (1 = mono, 2 = stereo)
/// \param SampleRate : Sample rate of the sound (44100 = CD quality) /// \param sampleRate : Sample rate of the sound (44100 = CD quality)
/// \param UserData : Data to pass to the callback functions /// \param userData : Data to pass to the callback functions
/// ///
/// \return A new sfSoundStream object (NULL if failed) /// \return A new sfSoundStream object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback OnGetData, CSFML_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback OnSeek, sfSoundStreamSeekCallback onSeek,
unsigned int ChannelsCount, unsigned int channelsCount,
unsigned int SampleRate, unsigned int sampleRate,
void* UserData); void* userData);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound stream /// Destroy an existing sound stream
/// ///
/// \param SoundStream : Sound stream to delete /// \param soundStream : Sound stream to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Destroy(sfSoundStream* SoundStreamStream); CSFML_API void sfSoundStream_Destroy(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a sound stream /// Start playing a sound stream
/// ///
/// \param SoundStream : Sound stream to play /// \param soundStream : Sound stream to play
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Play(sfSoundStream* SoundStream); CSFML_API void sfSoundStream_Play(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Pause a sound stream /// Pause a sound stream
/// ///
/// \param SoundStream : Sound stream to pause /// \param soundStream : Sound stream to pause
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Pause(sfSoundStream* SoundStream); CSFML_API void sfSoundStream_Pause(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing a sound stream /// Stop playing a sound stream
/// ///
/// \param SoundStream : Sound stream to stop /// \param soundStream : Sound stream to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Stop(sfSoundStream* SoundStream); CSFML_API 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)
/// ///
/// \param SoundStream : Sound stream to get the status from /// \param soundStream : Sound stream to get the status from
/// ///
/// \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(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)
/// ///
/// \param SoundStream : Sound stream to get the channels count from /// \param soundStream : Sound stream to get the channels count from
/// ///
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* SoundStream); CSFML_API unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sample rate of a sound stream /// Get the sample rate of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the sample rate from /// \param soundStream : Sound stream to get the sample rate from
/// ///
/// \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(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a sound stream /// Set the pitch of a sound stream
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param Pitch : New pitch /// \param pitch : New pitch
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetPitch(sfSoundStream* SoundStream, float Pitch); CSFML_API void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pitch);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the volume of a sound stream /// Set the volume of a sound stream
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param Volume : Volume (in range [0, 100]) /// \param volume : Volume (in range [0, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetVolume(sfSoundStream* SoundStream, float Volume); CSFML_API void sfSoundStream_SetVolume(sfSoundStream* soundStream, float volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a sound stream /// Set the position of a sound stream
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param X : X position of the sound stream in the world /// \param x : X position of the sound stream in the world
/// \param Y : Y position of the sound stream in the world /// \param y : Y position of the sound stream in the world
/// \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_SetPosition(sfSoundStream* SoundStream, float X, float Y, float Z); CSFML_API void sfSoundStream_SetPosition(sfSoundStream* soundStream, float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Make the sound stream's position relative to the listener's /// Make the sound stream's position relative to the listener's
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param Relative : True to set the position relative, false to set it absolute /// \param relative : True to set the position relative, false to set it absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetRelativeToListener(sfSoundStream* SoundStream, sfBool Relative); CSFML_API void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStream, sfBool relative);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance, /// Set the minimum distance - closer than this distance,
/// the listener will hear the sound stream at its maximum volume. /// the listener will hear the sound stream at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param MinDistance : New minimum distance for the sound stream /// \param distance : New minimum distance for the sound stream
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetMinDistance(sfSoundStream* SoundStream, float MinDistance); CSFML_API void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, float distance);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the /// Set the attenuation factor - the higher the attenuation, the
/// more the sound stream will be attenuated with distance from listener. /// more the sound stream will be attenuated with distance from listener.
/// The default attenuation factor 1.0 /// The default attenuation factor 1.0
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param Attenuation : New attenuation factor for the sound stream /// \param attenuation : New attenuation factor for the sound stream
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetAttenuation(sfSoundStream* SoundStream, float Attenuation); CSFML_API void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of a stream /// Set the current playing position of a stream
/// ///
/// \param SoundStream : Sound stream to modify /// \param soundStream : Sound stream to modify
/// \param TimeOffset : New playing position, expressed in seconds /// \param timeOffset : New playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* SoundStream, float TimeOffset); CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, float timeOffset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a stream loop state /// Set a stream loop state
/// ///
/// \param SoundStream : Stream to set the loop state /// \param soundStream : Stream to set the loop state
/// \param Loop : sfTrue to play in loop, sfFalse to play once /// \param loop : sfTrue to play in loop, sfFalse to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetLoop(sfSoundStream* SoundStream, sfBool Loop); CSFML_API void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a sound stream /// Get the pitch of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the pitch from /// \param soundStream : Sound stream to get the pitch from
/// ///
/// \return Pitch value /// \return Pitch value
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetPitch(sfSoundStream* SoundStream); CSFML_API float sfSoundStream_GetPitch(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound stream /// Get the volume of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the volume from /// \param soundStream : Sound stream to get the volume from
/// ///
/// \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(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of a sound stream /// Get the position of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the position from /// \param soundStream : Sound stream to get the position from
/// \param X : X position of the sound stream in the world /// \param x : X position of the sound stream in the world
/// \param Y : Y position of the sound stream in the world /// \param y : Y position of the sound stream in the world
/// \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(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
/// position, or if it's absolute /// position, or if it's absolute
/// ///
/// \param SoundStream : Sound stream to check /// \param soundStream : Sound stream to check
/// ///
/// \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(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound stream /// Get the minimum distance of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the minimum distance from /// \param soundStream : Sound stream to get the minimum distance from
/// ///
/// \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(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound stream /// Get the attenuation factor of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the attenuation factor from /// \param soundStream : Sound stream to get the attenuation factor from
/// ///
/// \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(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a stream is looping /// Tell whether or not a stream is looping
/// ///
/// \param SoundStream : Soundstream to get the loop state from /// \param soundStream : Soundstream to get the loop state from
/// ///
/// \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(sfSoundStream* soundStream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound stream /// Get the current playing position of a sound stream
/// ///
/// \param SoundStream : Sound stream to get the position from /// \param soundStream : Sound stream to get the position from
/// ///
/// \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(sfSoundStream* soundStream);
#endif // SFML_SOUNDSTREAM_H #endif // SFML_SOUNDSTREAM_H

View File

@ -59,49 +59,49 @@ CSFML_API sfColor sfCyan;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a color from its 3 RGB components /// Construct a color from its 3 RGB components
/// ///
/// \param R : Red component (0 .. 255) /// \param red : Red component (0 .. 255)
/// \param G : Green component (0 .. 255) /// \param green : Green component (0 .. 255)
/// \param B : Blue component (0 .. 255) /// \param blue : Blue component (0 .. 255)
/// ///
/// \return sfColor constructed from the components /// \return sfColor constructed from the components
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfColor_FromRGB(sfUint8 R, sfUint8 G, sfUint8 B); CSFML_API sfColor sfColor_FromRGB(sfUint8 red, sfUint8 green, sfUint8 blue);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a color from its 4 RGBA components /// Construct a color from its 4 RGBA components
/// ///
/// \param R : Red component (0 .. 255) /// \param red : Red component (0 .. 255)
/// \param G : Green component (0 .. 255) /// \param green : Green component (0 .. 255)
/// \param B : Blue component (0 .. 255) /// \param blue : Blue component (0 .. 255)
/// \param A : Alpha component (0 .. 255) /// \param alpha : Alpha component (0 .. 255)
/// ///
/// \return sfColor constructed from the components /// \return sfColor constructed from the components
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfColor_FromRGBA(sfUint8 R, sfUint8 G, sfUint8 B, sfUint8 A); CSFML_API sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add two colors /// Add two colors
/// ///
/// \param Color1 : First color /// \param color1 : First color
/// \param Color2 : Second color /// \param color2 : Second color
/// ///
/// \return Component-wise saturated addition of the two colors /// \return Component-wise saturated addition of the two colors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfColor_Add(sfColor Color1, sfColor Color2); CSFML_API sfColor sfColor_Add(sfColor color1, sfColor color2);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Modulate two colors /// Modulate two colors
/// ///
/// \param Color1 : First color /// \param color1 : First color
/// \param Color2 : Second color /// \param color2 : Second color
/// ///
/// \return Component-wise multiplication of the two colors /// \return Component-wise multiplication of the two colors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfColor_Modulate(sfColor Color1, sfColor Color2); CSFML_API sfColor sfColor_Modulate(sfColor color1, sfColor color2);
#endif // SFML_COLOR_H #endif // SFML_COLOR_H

View File

@ -43,46 +43,46 @@ CSFML_API sfFont* sfFont_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new font from a file /// Create a new font from a file
/// ///
/// \param Filename : Path of the font file to load /// \param filename : Path of the font file to load
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality /// \param charSize : Size of characters in bitmap - the bigger, the higher quality
/// \param Charset : Characters set to generate (just pass NULL to get the default charset) /// \param charset : Characters set to generate (just pass NULL to get the default charset)
/// ///
/// \return A new sfFont object, or NULL if it failed /// \return A new sfFont object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFont* sfFont_CreateFromFile(const char* Filename, unsigned int CharSize, const sfUint32* Charset); CSFML_API sfFont* sfFont_CreateFromFile(const char* filename, unsigned int charSize, const sfUint32* charset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image font a file in memory /// Create a new image font a file in memory
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality /// \param charSize : Size of characters in bitmap - the bigger, the higher quality
/// \param Charset : Characters set to generate (just pass NULL to get the default charset) /// \param charset : Characters set to generate (just pass NULL to get the default charset)
/// ///
/// \return A new sfFont object, or NULL if it failed /// \return A new sfFont object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFont* sfFont_CreateFromMemory(const char* Data, size_t SizeInBytes, unsigned int CharSize, const sfUint32* Charset); CSFML_API sfFont* sfFont_CreateFromMemory(const char* data, size_t sizeInBytes, unsigned int charSize, const sfUint32* charset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing font /// Destroy an existing font
/// ///
/// \param Font : Font to delete /// \param font : Font to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfFont_Destroy(sfFont* Font); CSFML_API 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
/// ///
/// \param Font : Font object /// \param font : Font object
/// ///
/// \return Base size of characters /// \return Base size of characters
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfFont_GetCharacterSize(sfFont* Font); CSFML_API unsigned int sfFont_GetCharacterSize(sfFont* font);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the built-in default font (Arial) /// Get the built-in default font (Arial)

View File

@ -45,186 +45,186 @@ CSFML_API sfImage* sfImage_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image filled with a color /// Create a new image filled with a color
/// ///
/// \param Width : Image width /// \param width : Image width
/// \param Height : Image height /// \param height : Image height
/// \param Col : Image color /// \param color : Image color
/// ///
/// \return A new sfImage object, or NULL if it failed /// \return A new sfImage object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfImage_CreateFromColor(unsigned int Width, unsigned int Height, sfColor Color); CSFML_API sfImage* sfImage_CreateFromColor(unsigned int width, unsigned int height, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image from an array of pixels in memory /// Create a new image from an array of pixels in memory
/// ///
/// \param Width : Image width /// \param width : Image width
/// \param Height : Image height /// \param height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA) /// \param data : Pointer to the pixels in memory (assumed format is RGBA)
/// ///
/// \return A new sfImage object, or NULL if it failed /// \return A new sfImage object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfImage_CreateFromPixels(unsigned int Width, unsigned int Height, const sfUint8* Data); CSFML_API sfImage* sfImage_CreateFromPixels(unsigned int width, unsigned int height, const sfUint8* data);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image from a file /// Create a new image from a file
/// ///
/// \param Filename : Path of the image file to load /// \param filename : Path of the image file to load
/// ///
/// \return A new sfImage object, or NULL if it failed /// \return A new sfImage object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfImage_CreateFromFile(const char* Filename); CSFML_API sfImage* sfImage_CreateFromFile(const char* filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image from a file in memory /// Create a new image from a file in memory
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// ///
/// \return A new sfImage object, or NULL if it failed /// \return A new sfImage object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfImage_CreateFromMemory(const char* Data, size_t SizeInBytes); CSFML_API sfImage* sfImage_CreateFromMemory(const char* data, size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing image /// Destroy an existing image
/// ///
/// \param Image : Image to delete /// \param image : Image to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_Destroy(sfImage* Image); CSFML_API void sfImage_Destroy(sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the content of an image to a file /// Save the content of an image to a file
/// ///
/// \param Image : Image to save /// \param image : Image to save
/// \param Filename : Path of the file to save (overwritten if already exist) /// \param filename : Path of the file to save (overwritten if already exist)
/// ///
/// \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(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
/// ///
/// \param Image : Image to modify /// \param image : Image to modify
/// \param ColorKey : Color to become transparent /// \param colorKey : Color to become transparent
/// \param Alpha : Alpha value to use for transparent pixels /// \param alpha : Alpha value to use for transparent pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_CreateMaskFromColor(sfImage* Image, sfColor ColorKey, sfUint8 Alpha); CSFML_API void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy pixels from another image onto this one. /// Copy pixels from another image onto this one.
/// 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
/// ///
/// \param Image : Destination image /// \param image : Destination image
/// \param Source : Source image to copy /// \param source : Source image to copy
/// \param DestX : X coordinate of the destination position /// \param destX : X coordinate of the destination position
/// \param DestY : Y coordinate of the destination position /// \param destY : Y coordinate of the destination position
/// \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, 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
/// given window /// given window
/// ///
/// \param Image : Destination image /// \param image : Destination image
/// \param Window : Window to capture /// \param window : Window to capture
/// \param SourceRect : Sub-rectangle of the screen to copy (empty by default - entire image) /// \param sourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
/// ///
/// \return True if creation was successful /// \return True if creation was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfImage_CopyScreen(sfImage* Image, sfRenderWindow* Window, sfIntRect SourceRect); CSFML_API sfBool sfImage_CopyScreen(sfImage* image, sfRenderWindow* window, sfIntRect sourceRect);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the color of a pixel of an image /// Change the color of a pixel of an image
/// Don't forget to call Update when you end modifying pixels /// Don't forget to call Update when you end modifying pixels
/// ///
/// \param Image : Image to modify /// \param image : Image to modify
/// \param X : X coordinate of pixel in the image /// \param x : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image /// \param y : Y coordinate of pixel in the image
/// \param Col : New color for pixel (X, Y) /// \param color : New color for pixel (X, Y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_SetPixel(sfImage* Image, unsigned int X, unsigned int Y, sfColor Color); CSFML_API void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a pixel from an image /// Get a pixel from an image
/// ///
/// \param Image : Image to read /// \param image : Image to read
/// \param X : X coordinate of pixel in the image /// \param x : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image /// \param y : Y coordinate of pixel in the image
/// ///
/// \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(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)
/// 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
/// ///
/// \param Image : Image to read /// \param image : Image to read
/// ///
/// \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(sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind the image for rendering /// Bind the image for rendering
/// ///
/// \param Image : Image to bind /// \param image : Image to bind
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_Bind(sfImage* Image); CSFML_API void sfImage_Bind(sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable image smooth filter /// Enable or disable image smooth filter
/// ///
/// \param Image : Image to modify /// \param image : Image to modify
/// \param Smooth : sfTrue to enable smoothing filter, false to disable it /// \param smooth : sfTrue to enable smoothing filter, false to disable it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfImage_SetSmooth(sfImage* Image, sfBool Smooth); CSFML_API void sfImage_SetSmooth(sfImage* image, sfBool smooth);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the width of the image /// Return the width of the image
/// ///
/// \param Image : Image to read /// \param image : Image to read
/// ///
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfImage_GetWidth(sfImage* Image); CSFML_API unsigned int sfImage_GetWidth(sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the height of the image /// Return the height of the image
/// ///
/// \param Image : Image to read /// \param image : Image to read
/// ///
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfImage_GetHeight(sfImage* Image); CSFML_API 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
/// ///
/// \param Image : Image to read /// \param image : Image to read
/// ///
/// \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(sfImage* image);
#endif // SFML_IMAGE_H #endif // SFML_IMAGE_H

View File

@ -35,7 +35,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new post-fx from a file /// Create a new post-fx from a file
/// ///
/// \param Filename : File to load /// \param filename : File to load
/// ///
/// \return A new sfPostFX object, or NULL if it failed /// \return A new sfPostFX object, or NULL if it failed
/// ///
@ -45,70 +45,70 @@ CSFML_API sfPostFX* sfPostFX_CreateFromFile(const char* Filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new post-fx from an effect source code /// Create a new post-fx from an effect source code
/// ///
/// \param Effect : Source code of the effect /// \param effect : Source code of the effect
/// ///
/// \return A new sfPostFX object, or NULL if it failed /// \return A new sfPostFX object, or NULL if it failed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfPostFX* sfPostFX_CreateFromMemory(const char* Effect); CSFML_API sfPostFX* sfPostFX_CreateFromMemory(const char* effect);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing post-fx /// Destroy an existing post-fx
/// ///
/// \param PostFX : PostFX to delete /// \param postFX : PostFX to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPostFX_Destroy(sfPostFX* PostFX); CSFML_API void sfPostFX_Destroy(sfPostFX* postFX);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (1 float) /// Change a parameter of a post-fx (1 float)
/// ///
/// \param PostFX : Post-effect to modify /// \param postFX : Post-effect to modify
/// \param Name : Parameter name in the effect /// \param name : Parameter name in the effect
/// \param X : Value to assign /// \param x : Value to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPostFX_SetParameter1(sfPostFX* PostFX, const char* Name, float X); CSFML_API void sfPostFX_SetParameter1(sfPostFX* postFX, const char* name, float x);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (2 floats) /// Change a parameter of a post-fx (2 floats)
/// ///
/// \param PostFX : Post-effect to modify /// \param postFX : Post-effect to modify
/// \param Name : Parameter name in the effect /// \param name : Parameter name in the effect
/// \param X, Y : Values to assign /// \param x, y : Values to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPostFX_SetParameter2(sfPostFX* PostFX, const char* Name, float X, float Y); CSFML_API void sfPostFX_SetParameter2(sfPostFX* postFX, const char* name, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (3 floats) /// Change a parameter of a post-fx (3 floats)
/// ///
/// \param PostFX : Post-effect to modify /// \param postFX : Post-effect to modify
/// \param Name : Parameter name in the effect /// \param name : Parameter name in the effect
/// \param X, Y, Z : Values to assign /// \param x, y, z : Values to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPostFX_SetParameter3(sfPostFX* PostFX, const char* Name, float X, float Y, float Z); CSFML_API void sfPostFX_SetParameter3(sfPostFX* postFX, const char* name, float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (4 floats) /// Change a parameter of a post-fx (4 floats)
/// ///
/// \param PostFX : Post-effect to modify /// \param postFX : Post-effect to modify
/// \param Name : Parameter name in the effect /// \param name : Parameter name in the effect
/// \param X, Y, Z, W : Values to assign /// \param x, y, z, w : Values to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPostFX_SetParameter4(sfPostFX* PostFX, const char* Name, float X, float Y, float Z, float W); CSFML_API void sfPostFX_SetParameter4(sfPostFX* postFX, const char* name, float x, float y, float z, float w);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a texture parameter in a post-fx /// Set a texture parameter in a post-fx
/// ///
/// \param PostFX : Post-effect to modify /// \param postFX : Post-effect to modify
/// \param Name : Texture name in the effect /// \param name : Texture name in the effect
/// \param Texture : Image to set (pass NULL to use content of current framebuffer) /// \param texture : Image to set (pass NULL to use content of current framebuffer)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPostFX_SetTexture(sfPostFX* PostFX, const char* Name, sfImage* Texture); CSFML_API void sfPostFX_SetTexture(sfPostFX* postFX, const char* name, sfImage* texture);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not the system supports post-effects /// Tell whether or not the system supports post-effects

View File

@ -55,39 +55,39 @@ typedef struct
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a rectangle by the given offset /// Move a rectangle by the given offset
/// ///
/// \param Rect : Rectangle to move /// \param rect : Rectangle to move
/// \param OffsetX : Horizontal offset /// \param offsetX : Horizontal offset
/// \param OffsetY : Vertical offset /// \param offsetY : Vertical offset
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfFloatRect_Offset(sfFloatRect* Rect, float OffsetX, float OffsetY); CSFML_API void sfFloatRect_Offset(sfFloatRect* rect, float offsetX, float offsetY);
CSFML_API void sfIntRect_Offset(sfIntRect* Rect, int OffsetX, int OffsetY); CSFML_API 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
/// ///
/// \param Rect : Rectangle to test /// \param rect : Rectangle to test
/// \param X : X coordinate of the point to test /// \param x : X coordinate of the point to test
/// \param Y : Y coordinate of the point to test /// \param y : Y coordinate of the point to test
/// ///
/// \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(sfFloatRect* rect, float x, float y);
CSFML_API sfBool sfIntRect_Contains(sfIntRect* Rect, int X, int Y); CSFML_API sfBool sfIntRect_Contains(sfIntRect* rect, int x, int y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles /// Check intersection between two rectangles
/// ///
/// \param Rect1 : First rectangle to test /// \param rect1 : First rectangle to test
/// \param Rect2 : Second rectangle to test /// \param rect2 : Second rectangle to test
/// \param OverlappingRect : Rectangle to be filled with overlapping rect (can be NULL) /// \param intersection : Rectangle to be filled with overlapping rect (can be NULL)
/// ///
/// \return sfTrue if rectangles overlap /// \return sfTrue if rectangles overlap
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfFloatRect_Intersects(sfFloatRect* Rect1, sfFloatRect* Rect2, sfFloatRect* OverlappingRect); CSFML_API sfBool sfFloatRect_Intersects(sfFloatRect* rect1, sfFloatRect* rect2, sfFloatRect* intersection);
CSFML_API sfBool sfIntRect_Intersects(sfIntRect* Rect1, sfIntRect* Rect2, sfIntRect* OverlappingRect); CSFML_API sfBool sfIntRect_Intersects(sfIntRect* rect1, sfIntRect* rect2, sfIntRect* intersection);
#endif // SFML_RECT_H #endif // SFML_RECT_H

View File

@ -37,101 +37,101 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new renderimage /// Construct a new renderimage
/// ///
/// \param Width : Width of the renderimage /// \param width : Width of the renderimage
/// \param Height : Height of the renderimage /// \param height : Height of the renderimage
/// \param DepthBuffer : Do you want a depth-buffer attached? (useful only if you're doing 3D OpenGL on the renderimage) /// \param depthBuffer : Do you want a depth-buffer attached? (useful only if you're doing 3D OpenGL on the renderimage)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfRenderImage* sfRenderImage_Create(unsigned int Width, unsigned int Height, sfBool DepthBuffer); CSFML_API sfRenderImage* sfRenderImage_Create(unsigned int width, unsigned int height, sfBool depthBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing renderimage /// Destroy an existing renderimage
/// ///
/// \param RenderImage : renderimage to destroy /// \param renderImage : renderimage to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_Destroy(sfRenderImage* RenderImage); CSFML_API 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
/// ///
/// \param RenderImage : Renderimage object /// \param renderImage : Renderimage object
/// ///
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderImage_GetWidth(sfRenderImage* RenderImage); CSFML_API 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
/// ///
/// \param RenderImage : Renderimage object /// \param renderImage : Renderimage object
/// ///
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderImage_GetHeight(sfRenderImage* RenderImage); CSFML_API unsigned int sfRenderImage_GetHeight(sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a renderimage as the current target for rendering /// Activate or deactivate a renderimage as the current target for rendering
/// ///
/// \param RenderImage : Renderimage object /// \param renderImage : Renderimage object
/// \param Active : sfTrue to activate, sfFalse to deactivate /// \param active : sfTrue to activate, sfFalse to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return True if operation was successful, false otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfRenderImage_SetActive(sfRenderImage* RenderImage, sfBool Active); CSFML_API sfBool sfRenderImage_SetActive(sfRenderImage* renderImage, sfBool active);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderimage /// Draw something on a renderimage
/// ///
/// \param RenderImage : Renderimage to draw in /// \param renderImage : Renderimage to draw in
/// \param PostFX / Sprite / String / shape : Object to draw /// \param postFX / sprite / string / shape : Object to draw
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_DrawPostFX(sfRenderImage* RenderImage, sfPostFX* PostFX); CSFML_API void sfRenderImage_DrawPostFX(sfRenderImage* renderImage, sfPostFX* postFX);
CSFML_API void sfRenderImage_DrawSprite(sfRenderImage* RenderImage, sfSprite* Sprite); CSFML_API void sfRenderImage_DrawSprite(sfRenderImage* renderImage, sfSprite* sprite);
CSFML_API void sfRenderImage_DrawShape (sfRenderImage* RenderImage, sfShape* Shape); CSFML_API void sfRenderImage_DrawShape (sfRenderImage* renderImage, sfShape* shape);
CSFML_API void sfRenderImage_DrawString(sfRenderImage* RenderImage, sfString* String); CSFML_API void sfRenderImage_DrawString(sfRenderImage* renderImage, sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear the renderimage with the given color /// Clear the renderimage with the given color
/// ///
/// \param RenderImage : Renderimage to modify /// \param renderImage : Renderimage to modify
/// \param Color : Fill color /// \param color : Fill color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_Clear(sfRenderImage* RenderImage, sfColor Color); CSFML_API void sfRenderImage_Clear(sfRenderImage* renderImage, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current active view of a renderimage /// Change the current active view of a renderimage
/// ///
/// \param RenderImage : Renderimage to modify /// \param renderImage : Renderimage to modify
/// \param NewView : 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, sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current active view of a renderimage /// Get the current active view of a renderimage
/// ///
/// \param RenderImage : Renderimage /// \param renderImage : Renderimage
/// ///
/// \return Current active view /// \return Current active view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfView* sfRenderImage_GetView(sfRenderImage* RenderImage); CSFML_API const sfView* sfRenderImage_GetView(sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the default view of a renderimage /// Get the default view of a renderimage
/// ///
/// \param RenderImage : Renderimage /// \param renderImage : Renderimage
/// ///
/// \return Default view of the renderimage /// \return Default view of the renderimage
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfView* sfRenderImage_GetDefaultView(sfRenderImage* RenderImage); CSFML_API sfView* sfRenderImage_GetDefaultView(sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell SFML to preserve external OpenGL states, at the expense of /// Tell SFML to preserve external OpenGL states, at the expense of
@ -141,21 +141,21 @@ CSFML_API sfView* sfRenderImage_GetDefaultView(sfRenderImage* RenderImage);
/// SFML to do internal optimizations and improve performances. /// SFML to do internal optimizations and improve performances.
/// This parameter is false by default /// This parameter is false by default
/// ///
/// \param RenderImage : Target renderimage /// \param renderImage : Target renderimage
/// \param Preserve : True to preserve OpenGL states, false to let SFML optimize /// \param preserve : True to preserve OpenGL states, false to let SFML optimize
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderImage_PreserveOpenGLStates(sfRenderImage* RenderImage, sfBool Preserve); CSFML_API void sfRenderImage_PreserveOpenGLStates(sfRenderImage* renderImage, sfBool preserve);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target image /// Get the target image
/// ///
/// \param RenderImage : Renderimage object /// \param renderImage : Renderimage object
/// ///
/// \return Pointer to the target image /// \return Pointer to the target image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfRenderImage_GetImage(sfRenderImage* RenderImage); CSFML_API sfImage* sfRenderImage_GetImage(sfRenderImage* renderImage);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check whether the system supports render images or not /// Check whether the system supports render images or not

View File

@ -41,298 +41,297 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new renderwindow /// Construct a new renderwindow
/// ///
/// \param Mode : Video mode to use /// \param mode : Video mode to use
/// \param Title : Title of the window /// \param title : Title of the window
/// \param Style : Window style /// \param style : Window style
/// \param Params : Creation settings /// \param settings : Creation settings
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode Mode, const char* Title, unsigned long Style, sfContextSettings Params); CSFML_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, unsigned long style, sfContextSettings settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a renderwindow from an existing control /// Construct a renderwindow from an existing control
/// ///
/// \param Handle : Platform-specific handle of the control /// \param handle : Platform-specific handle of the control
/// \param Params : Creation settings /// \param settings : Creation settings
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle Handle, sfContextSettings Params); CSFML_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing renderwindow /// Destroy an existing renderwindow
/// ///
/// \param RenderWindow : Renderwindow to destroy /// \param renderWindow : Renderwindow to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_Destroy(sfRenderWindow* RenderWindow); CSFML_API void sfRenderWindow_Destroy(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close a renderwindow (but doesn't destroy the internal data) /// Close a renderwindow (but doesn't destroy the internal data)
/// ///
/// \param RenderWindow : Renderwindow to close /// \param renderWindow : Renderwindow to close
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_Close(sfRenderWindow* RenderWindow); CSFML_API void sfRenderWindow_Close(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a renderwindow is opened /// Tell whether or not a renderwindow is opened
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfRenderWindow_IsOpened(sfRenderWindow* RenderWindow); CSFML_API 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
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderWindow_GetWidth(sfRenderWindow* RenderWindow); CSFML_API 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
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfRenderWindow_GetHeight(sfRenderWindow* RenderWindow); CSFML_API unsigned int sfRenderWindow_GetHeight(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
/// \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(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
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Event : Event to fill, if any /// \param event : Event to fill, if any
/// ///
/// \return sfTrue if an event was returned, sfFalse if events stack was empty /// \return sfTrue if an event was returned, sfFalse if events stack was empty
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfRenderWindow_GetEvent(sfRenderWindow* RenderWindow, sfEvent* Event); CSFML_API sfBool sfRenderWindow_GetEvent(sfRenderWindow* renderWindow, sfEvent* event);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable / disable vertical synchronization on a window /// Enable / disable vertical synchronization on a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Enabled : sfTrue to enable v-sync, sfFalse to deactivate /// \param enabled : sfTrue to enable v-sync, sfFalse to deactivate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_UseVerticalSync(sfRenderWindow* RenderWindow, sfBool Enabled); CSFML_API void sfRenderWindow_UseVerticalSync(sfRenderWindow* renderWindow, sfBool enabled);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Show or hide the mouse cursor on a window /// Show or hide the mouse cursor on a window
/// ///
/// \param RenderWindow : RenderWindow object /// \param renderWindow : RenderWindow object
/// \param Show : sfTrue to show, sfFalse to hide /// \param show : sfTrue to show, sfFalse to hide
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_ShowMouseCursor(sfRenderWindow* RenderWindow, sfBool Show); CSFML_API void sfRenderWindow_ShowMouseCursor(sfRenderWindow* renderWindow, sfBool show);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of the mouse cursor on a window /// Change the position of the mouse cursor on a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Left : Left coordinate of the cursor, relative to the window /// \param left : Left coordinate of the cursor, relative to the window
/// \param Top : Top coordinate of the cursor, relative to the window /// \param top : Top coordinate of the cursor, relative to the window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetCursorPosition(sfRenderWindow* RenderWindow, unsigned int Left, unsigned int Top); CSFML_API void sfRenderWindow_SetCursorPosition(sfRenderWindow* renderWindow, unsigned int left, unsigned int top);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of a window on screen. /// Change the position of a window on screen.
/// Only works for top-level windows /// Only works for top-level windows
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Left : Left position /// \param left : Left position
/// \param Top : Top position /// \param top : Top position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetPosition(sfRenderWindow* RenderWindow, int Left, int Top); CSFML_API void sfRenderWindow_SetPosition(sfRenderWindow* renderWindow, int left, int top);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the size of the rendering region of a window /// Change the size of the rendering region of a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Width : New Width /// \param width : New Width
/// \param Height : New Height /// \param height : New Height
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetSize(sfRenderWindow* RenderWindow, unsigned int Width, unsigned int Height); CSFML_API void sfRenderWindow_SetSize(sfRenderWindow* renderWindow, unsigned int width, unsigned int height);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Show or hide a window /// Show or hide a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param State : sfTrue to show, sfFalse to hide /// \param show : sfTrue to show, sfFalse to hide
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_Show(sfRenderWindow* RenderWindow, sfBool State); CSFML_API void sfRenderWindow_Show(sfRenderWindow* renderWindow, sfBool show);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable automatic key-repeat for keydown events. /// Enable or disable automatic key-repeat for keydown events.
/// Automatic key-repeat is enabled by default /// Automatic key-repeat is enabled by default
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Enabled : sfTrue to enable, sfFalse to disable /// \param enabled : sfTrue to enable, sfFalse to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_EnableKeyRepeat(sfRenderWindow* RenderWindow, sfBool Enabled); CSFML_API void sfRenderWindow_EnableKeyRepeat(sfRenderWindow* renderWindow, sfBool enabled);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the window's icon /// Change the window's icon
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Width : Icon's width, in pixels /// \param width : Icon's width, in pixels
/// \param Height : Icon's height, in pixels /// \param height : Icon's height, in pixels
/// \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, sfUint8* pixels);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a window as the current target for rendering /// Activate or deactivate a window as the current target for rendering
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Active : sfTrue to activate, sfFalse to deactivate /// \param active : sfTrue to activate, sfFalse to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return True if operation was successful, false otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfRenderWindow_SetActive(sfRenderWindow* RenderWindow, sfBool Active); CSFML_API sfBool sfRenderWindow_SetActive(sfRenderWindow* renderWindow, sfBool active);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Display a window on screen /// Display a window on screen
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_Display(sfRenderWindow* RenderWindow); CSFML_API void sfRenderWindow_Display(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the input manager of a window /// Get the input manager of a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
/// \return Reference to the input /// \return Reference to the input
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfInput* sfRenderWindow_GetInput(sfRenderWindow* RenderWindow); CSFML_API sfInput* sfRenderWindow_GetInput(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Limit the framerate to a maximum fixed frequency for a window /// Limit the framerate to a maximum fixed frequency for a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// /// \param limit : Framerate limit, in frames per seconds (use 0 to disable limit)
/// \param Limit : Framerate limit, in frames per seconds (use 0 to disable limit)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* RenderWindow, unsigned int Limit); CSFML_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get time elapsed since last frame of a window /// Get time elapsed since last frame of a window
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// ///
/// \return Time elapsed, in seconds /// \return Time elapsed, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfRenderWindow_GetFrameTime(sfRenderWindow* RenderWindow); CSFML_API float sfRenderWindow_GetFrameTime(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which /// Change the joystick threshold, ie. the value below which
/// no move event will be generated /// no move event will be generated
/// ///
/// \param RenderWindow : Renderwindow object /// \param renderWindow : Renderwindow object
/// \param Threshold : New threshold, in range [0, 100] /// \param threshold : New threshold, in range [0, 100]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* RenderWindow, float Threshold); CSFML_API void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderwindow /// Draw something on a renderwindow
/// ///
/// \param RenderWindow : Renderwindow to draw in /// \param renderWindow : Renderwindow to draw in
/// \param PostFX / Sprite / String / shape : Object to draw /// \param postFX / sprite / string / shape : Object to draw
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_DrawPostFX(sfRenderWindow* RenderWindow, sfPostFX* PostFX); CSFML_API void sfRenderWindow_DrawPostFX(sfRenderWindow* renderWindow, sfPostFX* postFX);
CSFML_API void sfRenderWindow_DrawSprite(sfRenderWindow* RenderWindow, sfSprite* Sprite); CSFML_API void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, sfSprite* sprite);
CSFML_API void sfRenderWindow_DrawShape (sfRenderWindow* RenderWindow, sfShape* Shape); CSFML_API void sfRenderWindow_DrawShape (sfRenderWindow* renderWindow, sfShape* shape);
CSFML_API void sfRenderWindow_DrawString(sfRenderWindow* RenderWindow, sfString* String); CSFML_API void sfRenderWindow_DrawString(sfRenderWindow* renderWindow, sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the content of a renderwindow to an image /// Save the content of a renderwindow to an image
/// ///
/// \param RenderWindow : Renderwindow to capture /// \param renderWindow : Renderwindow to capture
/// ///
/// \return Image instance containing the contents of the screen /// \return Image instance containing the contents of the screen
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfImage* sfRenderWindow_Capture(sfRenderWindow* RenderWindow); CSFML_API sfImage* sfRenderWindow_Capture(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear the screen with the given color /// Clear the screen with the given color
/// ///
/// \param RenderWindow : Renderwindow to modify /// \param renderWindow : Renderwindow to modify
/// \param Color : Fill color /// \param color : Fill color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_Clear(sfRenderWindow* RenderWindow, sfColor Color); CSFML_API void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current active view of a renderwindow /// Change the current active view of a renderwindow
/// ///
/// \param RenderWindow : Renderwindow to modify /// \param renderWindow : Renderwindow to modify
/// \param NewView : 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, sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current active view of a renderwindow /// Get the current active view of a renderwindow
/// ///
/// \param RenderWindow : Renderwindow /// \param renderWindow : Renderwindow
/// ///
/// \return Current active view /// \return Current active view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfView* sfRenderWindow_GetView(sfRenderWindow* RenderWindow); CSFML_API const sfView* sfRenderWindow_GetView(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the default view of a renderwindow /// Get the default view of a renderwindow
/// ///
/// \param RenderWindow : Renderwindow /// \param renderWindow : Renderwindow
/// ///
/// \return Default view of the render window /// \return Default view of the render window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfView* sfRenderWindow_GetDefaultView(sfRenderWindow* RenderWindow); CSFML_API sfView* sfRenderWindow_GetDefaultView(sfRenderWindow* renderWindow);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Convert a point in window coordinates into view coordinates /// Convert a point in window coordinates into view coordinates
/// ///
/// \param RenderWindow : Target Renderwindow /// \param renderWindow : Target Renderwindow
/// \param WindowX : X coordinate of the point to convert, relative to the window /// \param windowX : X coordinate of the point to convert, relative to the window
/// \param WindowY : Y coordinate of the point to convert, relative to the window /// \param windowY : Y coordinate of the point to convert, relative to the window
/// \param ViewX : Pointer to fill with the X coordinate of the converted point /// \param viewX : Pointer to fill with the X coordinate of the converted point
/// \param ViewY : Pointer to fill with the Y coordinate of the converted point /// \param viewY : Pointer to fill with the Y coordinate of the converted point
/// \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(sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, sfView* targetView);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell SFML to preserve external OpenGL states, at the expense of /// Tell SFML to preserve external OpenGL states, at the expense of
@ -342,11 +341,11 @@ CSFML_API void sfRenderWindow_ConvertCoords(sfRenderWindow* RenderWindow, unsign
/// SFML to do internal optimizations and improve performances. /// SFML to do internal optimizations and improve performances.
/// This parameter is false by default /// This parameter is false by default
/// ///
/// \param RenderWindow : Target Renderwindow /// \param renderWindow : Target Renderwindow
/// \param Preserve : True to preserve OpenGL states, false to let SFML optimize /// \param preserve : True to preserve OpenGL states, false to let SFML optimize
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRenderWindow_PreserveOpenGLStates(sfRenderWindow* RenderWindow, sfBool Preserve); CSFML_API void sfRenderWindow_PreserveOpenGLStates(sfRenderWindow* renderWindow, sfBool preserve);
#endif // SFML_RENDERWINDOW_H #endif // SFML_RENDERWINDOW_H

View File

@ -45,39 +45,39 @@ CSFML_API sfShape* sfShape_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shape made of a single line /// Create a new shape made of a single line
/// ///
/// \param P1X, P1Y : Position of the first point /// \param p1x, p1y : Position of the first point
/// \param P2X, P2Y : Position second point /// \param p2x, p2y : Position second point
/// \param Thickness : Line thickness /// \param thickness : Line thickness
/// \param Col : Color used to draw the line /// \param color : Color used to draw the line
/// \param Outline : Outline width /// \param outline : Outline width
/// \param OutlineCol : Color used to draw the outline /// \param outlineColor : Color used to draw the outline
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfShape* sfShape_CreateLine(float P1X, float P1Y, float P2X, float P2Y, float Thickness, sfColor Col, float Outline, sfColor OutlineCol); CSFML_API sfShape* sfShape_CreateLine(float p1x, float p1y, float p2x, float p2y, float thickness, sfColor color, float outline, sfColor outlineColor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shape made of a single rectangle /// Create a new shape made of a single rectangle
/// ///
/// \param P1X, P1Y : Position of the first point /// \param p1x, p1y : Position of the first point
/// \param P2X, P2Y : Position second point /// \param p2x, p2y : Position second point
/// \param Col : Color used to fill the rectangle /// \param color : Color used to fill the rectangle
/// \param Outline : Outline width /// \param outline : Outline width
/// \param OutlineCol : Color used to draw the outline /// \param outlineColor : Color used to draw the outline
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfShape* sfShape_CreateRectangle(float P1X, float P1Y, float P2X, float P2Y, sfColor Col, float Outline, sfColor OutlineCol); CSFML_API sfShape* sfShape_CreateRectangle(float p1x, float p1y, float p2x, float p2y, sfColor color, float outline, sfColor outlineColor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shape made of a single circle /// Create a new shape made of a single circle
/// ///
/// \param X, Y : Position of the center /// \param x, y : Position of the center
/// \param Radius : Radius /// \param radius : Radius
/// \param Col : Color used to fill the circle /// \param color : Color used to fill the circle
/// \param Outline : Outline width /// \param outline : Outline width
/// \param OutlineCol : Color used to draw the outline /// \param outlineColor : Color used to draw the outline
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfShape* sfShape_CreateCircle(float X, float Y, float Radius, sfColor Col, float Outline, sfColor OutlineCol); CSFML_API sfShape* sfShape_CreateCircle(float x, float y, float radius, sfColor color, float outline, sfColor outlineColor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Shape /// Destroy an existing Shape
@ -85,369 +85,370 @@ CSFML_API sfShape* sfShape_CreateCircle(float X, float Y, float Radius, sfColor
/// \param Shape : Shape to delete /// \param Shape : Shape to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_Destroy(sfShape* Shape); CSFML_API void sfShape_Destroy(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of a shape /// Set the X position of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param X : New X coordinate /// \param x : New X coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetX(sfShape* Shape, float X); CSFML_API void sfShape_SetX(sfShape* shape, float x);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y position of a shape /// Set the Y position of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetY(sfShape* Shape, float Y); CSFML_API void sfShape_SetY(sfShape* shape, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a shape /// Set the position of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param X : New X coordinate /// \param x : New X coordinate
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetPosition(sfShape* Shape, float X, float Y); CSFML_API void sfShape_SetPosition(sfShape* shape, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the horizontal scale of a shape /// Set the horizontal scale of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Scale : New scale (must be strictly positive) /// \param scale : New scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetScaleX(sfShape* Shape, float Scale); CSFML_API void sfShape_SetScaleX(sfShape* shape, float scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the vertical scale of a shape /// Set the vertical scale of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Scale : New scale (must be strictly positive) /// \param scale : New scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetScaleY(sfShape* Shape, float Scale); CSFML_API void sfShape_SetScaleY(sfShape* shape, float scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of a shape /// Set the scale of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param ScaleX : New horizontal scale (must be strictly positive) /// \param scaleX : New horizontal scale (must be strictly positive)
/// \param ScaleY : New vertical scale (must be strictly positive) /// \param scaleY : New vertical scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetScale(sfShape* Shape, float ScaleX, float ScaleY); CSFML_API void sfShape_SetScale(sfShape* shape, float scaleX, float scaleY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of a shape /// Set the orientation of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Rotation : Angle of rotation, in degrees /// \param rotation : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetRotation(sfShape* Shape, float Rotation); CSFML_API void sfShape_SetRotation(sfShape* shape, float rotation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the local origin of a shape, in coordinates relative to /// Set the local origin of a shape, in coordinates relative to
/// its left-top corner /// its left-top corner
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param X : X coordinate of the origin /// \param x : X coordinate of the origin
/// \param Y : Y coordinate of the origin /// \param y : Y coordinate of the origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetOrigin(sfShape* Shape, float X, float Y); CSFML_API void sfShape_SetOrigin(sfShape* shape, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of a shape /// Set the color of a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Color : New color /// \param color : New color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetColor(sfShape* Shape, sfColor Color); CSFML_API void sfShape_SetColor(sfShape* shape, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for a shape /// Set the blending mode for a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Mode : New blending mode /// \param mode : New blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetBlendMode(sfShape* Shape, sfBlendMode Mode); CSFML_API void sfShape_SetBlendMode(sfShape* shape, sfBlendMode mode);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a shape /// Get the X position of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current X position /// \return Current X position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetX(sfShape* Shape); CSFML_API float sfShape_GetX(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a shape /// Get the Y position of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current Y position /// \return Current Y position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetY(sfShape* Shape); CSFML_API float sfShape_GetY(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a shape /// Get the horizontal scale of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \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(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a shape /// Get the vertical scale of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \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(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a shape /// Get the orientation of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current rotation, in degrees /// \return Current rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetRotation(sfShape* Shape); CSFML_API float sfShape_GetRotation(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a shape /// Get the X position of the origin a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current X origin /// \return Current X origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetOriginX(sfShape* Shape); CSFML_API float sfShape_GetOriginX(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of the origin a shape /// Get the Y position of the origin a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current Y origin /// \return Current Y origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetOriginY(sfShape* Shape); CSFML_API float sfShape_GetOriginY(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a shape /// Get the color of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfShape_GetColor(sfShape* Shape); CSFML_API sfColor sfShape_GetColor(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a shape /// Get the current blending mode of a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Current blending mode /// \return Current blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBlendMode sfShape_GetBlendMode(sfShape* Shape); CSFML_API sfBlendMode sfShape_GetBlendMode(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a shape /// Move a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param OffsetX : Offset on the X axis /// \param offsetX : Offset on the X axis
/// \param OffsetY : Offset on the Y axis /// \param offsetY : Offset on the Y axis
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_Move(sfShape* Shape, float OffsetX, float OffsetY); CSFML_API void sfShape_Move(sfShape* shape, float offsetX, float offsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale a shape /// Scale a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param FactorX : Horizontal scaling factor (must be strictly positive) /// \param factorX : Horizontal scaling factor (must be strictly positive)
/// \param FactorY : Vertical scaling factor (must be strictly positive) /// \param factorY : Vertical scaling factor (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_Scale(sfShape* Shape, float FactorX, float FactorY); CSFML_API void sfShape_Scale(sfShape* shape, float factorX, float factorY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a shape /// Rotate a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Angle : Angle of rotation, in degrees /// \param angle : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_Rotate(sfShape* Shape, float Angle); CSFML_API 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)
/// ///
/// \param Shape : Shape object /// \param shape : Shape object
/// \param PointX : X coordinate of the point to transform /// \param pointX : X coordinate of the point to transform
/// \param PointY : Y coordinate of the point to transform /// \param pointY : Y coordinate of the point to transform
/// \param X : Value to fill with the X coordinate of the converted point /// \param x : Value to fill with the X coordinate of the converted point
/// \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(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
/// (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)
/// ///
/// \param Shape : Shape object /// \param shape : Shape object
/// \param PointX : X coordinate of the point to transform /// \param pointX : X coordinate of the point to transform
/// \param PointY : Y coordinate of the point to transform /// \param pointY : Y coordinate of the point to transform
/// \param X : Value to fill with the X coordinate of the converted point /// \param x : Value to fill with the X coordinate of the converted point
/// \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(sfShape* shape, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add a point to a shape /// Add a point to a shape
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param X, Y : Position of the point /// \param x, y : Position of the point
/// \param Col : Color of the point /// \param color : Color of the point
/// \param OutlineCol : Outline color of the point /// \param outlineColor : Outline color of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_AddPoint(sfShape* Shape, float X, float Y, sfColor Col, sfColor OutlineCol); CSFML_API void sfShape_AddPoint(sfShape* shape, float x, float y, sfColor color, sfColor outlineColor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable filling a shape. /// Enable or disable filling a shape.
/// Fill is enabled by default /// Fill is enabled by default
/// ///
/// \param Enable : True to enable, false to disable /// \param shape : Shape to modify
/// \param enable : True to enable, false to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_EnableFill(sfShape* Shape, sfBool Enable); CSFML_API void sfShape_EnableFill(sfShape* shape, sfBool enable);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable drawing a shape outline. /// Enable or disable drawing a shape outline.
/// Outline is enabled by default /// Outline is enabled by default
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Enable : True to enable, false to disable /// \param enable : True to enable, false to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_EnableOutline(sfShape* Shape, sfBool Enable); CSFML_API void sfShape_EnableOutline(sfShape* shape, sfBool enable);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the width of a shape outline /// Change the width of a shape outline
/// ///
/// \param Shape : Shape to modify /// \param shape : Shape to modify
/// \param Width : New width /// \param width : New width
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetOutlineWidth(sfShape* Shape, float Width); CSFML_API void sfShape_SetOutlineWidth(sfShape* shape, float width);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of a shape outline /// Get the width of a shape outline
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \param return Current outline width /// \param return Current outline width
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfShape_GetOutlineWidth(sfShape* Shape); CSFML_API float sfShape_GetOutlineWidth(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the number of points composing a shape /// Get the number of points composing a shape
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// ///
/// \return Total number of points /// \return Total number of points
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfShape_GetNbPoints(sfShape* Shape); CSFML_API unsigned int sfShape_GetNbPoints(sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a the position of a shape's point /// Get a the position of a shape's point
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// \param Index : Index of the point to get /// \param index : Index of the point to get
/// \param X : Variable to fill with the X coordinate of the point /// \param x : Variable to fill with the X coordinate of the point
/// \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(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
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// \param Index : Index of the point to get /// \param index : Index of the point to get
/// ///
/// \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(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
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// \param Index : Index of the point to get /// \param index : Index of the point to get
/// ///
/// \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(sfShape* shape, unsigned int index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the position of a shape's point /// Set a the position of a shape's point
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// \param Index : Index of the point to get /// \param index : Index of the point to get
/// \param X : X coordinate of the point /// \param x : X coordinate of the point
/// \param Y : Y coordinate of the point /// \param y : Y coordinate of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetPointPosition(sfShape* Shape, unsigned int Index, float X, float Y); CSFML_API void sfShape_SetPointPosition(sfShape* shape, unsigned int index, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the color of a shape's point /// Set a the color of a shape's point
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// \param Index : Index of the point to get /// \param index : Index of the point to get
/// \param Color : Color of the point /// \param color : Color of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetPointColor(sfShape* Shape, unsigned int Index, sfColor Color); CSFML_API void sfShape_SetPointColor(sfShape* shape, unsigned int index, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the outline color of a shape's point /// Set a the outline color of a shape's point
/// ///
/// \param Shape : Shape to read /// \param shape : Shape to read
/// \param Index : Index of the point to get /// \param index : Index of the point to get
/// \param Color : Outline color of the point /// \param color : Outline color of the point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShape_SetPointOutlineColor(sfShape* Shape, unsigned int Index, sfColor Color); CSFML_API void sfShape_SetPointOutlineColor(sfShape* shape, unsigned int index, sfColor color);
#endif // SFML_Shape_H #endif // SFML_Shape_H

View File

@ -46,347 +46,347 @@ CSFML_API sfSprite* sfSprite_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sprite /// Destroy an existing sprite
/// ///
/// \param Sprite : Sprite to delete /// \param sprite : Sprite to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_Destroy(sfSprite* Sprite); CSFML_API void sfSprite_Destroy(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of a sprite /// Set the X position of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param X : New X coordinate /// \param x : New X coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetX(sfSprite* Sprite, float X); CSFML_API void sfSprite_SetX(sfSprite* sprite, float x);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the T position of a sprite /// Set the T position of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetY(sfSprite* Sprite, float Y); CSFML_API void sfSprite_SetY(sfSprite* sprite, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a sprite /// Set the position of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param X : New X coordinate /// \param x : New X coordinate
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetPosition(sfSprite* Sprite, float X, float Y); CSFML_API void sfSprite_SetPosition(sfSprite* sprite, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the horizontal scale of a sprite /// Set the horizontal scale of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Scale : New scale (must be strictly positive) /// \param scale : New scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetScaleX(sfSprite* Sprite, float Scale); CSFML_API void sfSprite_SetScaleX(sfSprite* sprite, float scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the vertical scale of a sprite /// Set the vertical scale of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Scale : New scale (must be strictly positive) /// \param scale : New scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetScaleY(sfSprite* Sprite, float Scale); CSFML_API void sfSprite_SetScaleY(sfSprite* sprite, float scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of a sprite /// Set the scale of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param ScaleX : New horizontal scale (must be strictly positive) /// \param scaleX : New horizontal scale (must be strictly positive)
/// \param ScaleY : New vertical scale (must be strictly positive) /// \param scaleY : New vertical scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetScale(sfSprite* Sprite, float ScaleX, float ScaleY); CSFML_API void sfSprite_SetScale(sfSprite* sprite, float scaleX, float scaleY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of a sprite /// Set the orientation of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Rotation : Angle of rotation, in degrees /// \param rotation : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetRotation(sfSprite* Sprite, float Rotation); CSFML_API void sfSprite_SetRotation(sfSprite* sprite, float rotation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the local origin of a sprite, in coordinates relative to /// Set the local origin of a sprite, in coordinates relative to
/// its left-top corner /// its left-top corner
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param X : X coordinate of the origin /// \param x : X coordinate of the origin
/// \param Y : Y coordinate of the origin /// \param y : Y coordinate of the origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetOrigin(sfSprite* Sprite, float X, float Y); CSFML_API void sfSprite_SetOrigin(sfSprite* sprite, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of a sprite /// Set the color of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Color : New color /// \param color : New color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetColor(sfSprite* Sprite, sfColor Color); CSFML_API void sfSprite_SetColor(sfSprite* sprite, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for a sprite /// Set the blending mode for a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Mode : New blending mode /// \param mode : New blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetBlendMode(sfSprite* Sprite, sfBlendMode Mode); CSFML_API void sfSprite_SetBlendMode(sfSprite* sprite, sfBlendMode mode);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a sprite /// Get the X position of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current X position /// \return Current X position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetX(sfSprite* Sprite); CSFML_API float sfSprite_GetX(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a sprite /// Get the Y position of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current Y position /// \return Current Y position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetY(sfSprite* Sprite); CSFML_API float sfSprite_GetY(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a sprite /// Get the horizontal scale of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \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(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a sprite /// Get the vertical scale of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \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(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a sprite /// Get the orientation of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current rotation, in degrees /// \return Current rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetRotation(sfSprite* Sprite); CSFML_API float sfSprite_GetRotation(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a sprite /// Get the X position of the origin a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current X origin /// \return Current X origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetOriginX(sfSprite* Sprite); CSFML_API float sfSprite_GetOriginX(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of the origin a sprite /// Get the Y position of the origin a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current Y origin /// \return Current Y origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetOriginY(sfSprite* Sprite); CSFML_API float sfSprite_GetOriginY(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a sprite /// Get the color of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfSprite_GetColor(sfSprite* Sprite); CSFML_API sfColor sfSprite_GetColor(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a sprite /// Get the current blending mode of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Current blending mode /// \return Current blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBlendMode sfSprite_GetBlendMode(sfSprite* Sprite); CSFML_API sfBlendMode sfSprite_GetBlendMode(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a sprite /// Move a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param OffsetX : Offset on the X axis /// \param offsetX : Offset on the X axis
/// \param OffsetY : Offset on the Y axis /// \param offsetY : Offset on the Y axis
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_Move(sfSprite* Sprite, float OffsetX, float OffsetY); CSFML_API void sfSprite_Move(sfSprite* sprite, float offsetX, float offsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale a sprite /// Scale a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param FactorX : Horizontal scaling factor (must be strictly positive) /// \param factorX : Horizontal scaling factor (must be strictly positive)
/// \param FactorY : Vertical scaling factor (must be strictly positive) /// \param factorY : Vertical scaling factor (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_Scale(sfSprite* Sprite, float FactorX, float FactorY); CSFML_API void sfSprite_Scale(sfSprite* sprite, float factorX, float factorY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a sprite /// Rotate a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Angle : Angle of rotation, in degrees /// \param angle : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_Rotate(sfSprite* Sprite, float Angle); CSFML_API 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)
/// ///
/// \param Sprite : Sprite object /// \param sprite : Sprite object
/// \param PointX : X coordinate of the point to transform /// \param pointX : X coordinate of the point to transform
/// \param PointY : Y coordinate of the point to transform /// \param pointY : Y coordinate of the point to transform
/// \param X : Value to fill with the X coordinate of the converted point /// \param x : Value to fill with the X coordinate of the converted point
/// \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(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
/// (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)
/// ///
/// \param Sprite : Sprite object /// \param sprite : Sprite object
/// \param PointX : X coordinate of the point to transform /// \param pointX : X coordinate of the point to transform
/// \param PointY : Y coordinate of the point to transform /// \param pointY : Y coordinate of the point to transform
/// \param X : Value to fill with the X coordinate of the converted point /// \param x : Value to fill with the X coordinate of the converted point
/// \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(sfSprite* sprite, float pointX, float pointY, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the image of a sprite /// Change the image of a sprite
/// ///
/// \param Sprite : Sprite to modify /// \param Sprite : Sprite to modify
/// \param Image : New image /// \param image : New image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetImage(sfSprite* Sprite, sfImage* Image); CSFML_API void sfSprite_SetImage(sfSprite* sprite, sfImage* image);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sub-rectangle of a sprite inside the source image /// Set the sub-rectangle of a sprite inside the source image
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param SubRect : New sub-rectangle /// \param rectangle : New sub-rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_SetSubRect(sfSprite* Sprite, sfIntRect SubRect); CSFML_API void sfSprite_SetSubRect(sfSprite* sprite, sfIntRect rectangle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Resize a sprite (by changing its scale factors) /// Resize a sprite (by changing its scale factors)
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Width : New width (must be strictly positive) /// \param width : New width (must be strictly positive)
/// \param Height : New height (must be strictly positive) /// \param height : New height (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_Resize(sfSprite* Sprite, float Width, float Height); CSFML_API void sfSprite_Resize(sfSprite* sprite, float width, float height);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Flip a sprite horizontally /// Flip a sprite horizontally
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Flipped : sfTrue to flip the sprite /// \param flipped : sfTrue to flip the sprite
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_FlipX(sfSprite* Sprite, sfBool Flipped); CSFML_API void sfSprite_FlipX(sfSprite* sprite, sfBool flipped);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Flip a sprite vertically /// Flip a sprite vertically
/// ///
/// \param Sprite : Sprite to modify /// \param sprite : Sprite to modify
/// \param Flipped : sfTrue to flip the sprite /// \param flipped : sfTrue to flip the sprite
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSprite_FlipY(sfSprite* Sprite, sfBool Flipped); CSFML_API void sfSprite_FlipY(sfSprite* sprite, sfBool flipped);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the source image of a sprite /// Get the source image of a sprite
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \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 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
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Sub-rectangle /// \return Sub-rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIntRect sfSprite_GetSubRect(sfSprite* Sprite); CSFML_API sfIntRect sfSprite_GetSubRect(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite width /// Get a sprite width
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Width of the sprite /// \return Width of the sprite
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetWidth(sfSprite* Sprite); CSFML_API float sfSprite_GetWidth(sfSprite* sprite);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite height /// Get a sprite height
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// ///
/// \return Height of the sprite /// \return Height of the sprite
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfSprite_GetHeight(sfSprite* Sprite); CSFML_API 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
/// ///
/// \param Sprite : Sprite to read /// \param sprite : Sprite to read
/// \param X : X coordinate of the pixel to get /// \param x : X coordinate of the pixel to get
/// \param Y : Y coordinate of the pixel to get /// \param y : Y coordinate of the pixel to get
/// ///
/// \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(sfSprite* sprite, unsigned int x, unsigned int y);
#endif // SFML_SPRITE_H #endif // SFML_SPRITE_H

View File

@ -58,367 +58,367 @@ CSFML_API sfString* sfString_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing string /// Destroy an existing string
/// ///
/// \param String : String to delete /// \param string : String to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_Destroy(sfString* String); CSFML_API void sfString_Destroy(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of a string /// Set the X position of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param X : New X coordinate /// \param x : New X coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetX(sfString* String, float X); CSFML_API void sfString_SetX(sfString* string, float x);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y position of a string /// Set the Y position of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetY(sfString* String, float Y); CSFML_API void sfString_SetY(sfString* string, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a string /// Set the position of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Left : New left coordinate /// \param x : New X coordinate
/// \param Top : New top coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetPosition(sfString* String, float Left, float Top); CSFML_API void sfString_SetPosition(sfString* string, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the horizontal scale of a string /// Set the horizontal scale of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Scale : New scale (must be strictly positive) /// \param scale : New scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetScaleX(sfString* String, float Scale); CSFML_API void sfString_SetScaleX(sfString* string, float scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the vertical scale of a string /// Set the vertical scale of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Scale : New scale (must be strictly positive) /// \param scale : New scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetScaleY(sfString* String, float Scale); CSFML_API void sfString_SetScaleY(sfString* string, float scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of a string /// Set the scale of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param ScaleX : New horizontal scale (must be strictly positive) /// \param scaleX : New horizontal scale (must be strictly positive)
/// \param ScaleY : New vertical scale (must be strictly positive) /// \param scaleY : New vertical scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetScale(sfString* String, float ScaleX, float ScaleY); CSFML_API void sfString_SetScale(sfString* string, float scaleX, float scaleY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of a string /// Set the orientation of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Rotation : Angle of rotation, in degrees /// \param rotation : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetRotation(sfString* String, float Rotation); CSFML_API void sfString_SetRotation(sfString* string, float rotation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the local origin of a string, in coordinates /// Set the local origin of a string, in coordinates
/// relative to its left-top corner /// relative to its left-top corner
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param X : X coordinate of the origin /// \param x : X coordinate of the origin
/// \param Y : Y coordinate of the origin /// \param y : Y coordinate of the origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetOrigin(sfString* String, float X, float Y); CSFML_API void sfString_SetOrigin(sfString* string, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of a string /// Set the color of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Color : New color /// \param color : New color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetColor(sfString* String, sfColor Color); CSFML_API void sfString_SetColor(sfString* string, sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for a string /// Set the blending mode for a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Mode : New blending mode /// \param mode : New blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetBlendMode(sfString* String, sfBlendMode Mode); CSFML_API void sfString_SetBlendMode(sfString* string, sfBlendMode mode);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a string /// Get the X position of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current X position /// \return Current X position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetX(sfString* String); CSFML_API float sfString_GetX(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top Y of a string /// Get the top Y of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current Y position /// \return Current Y position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetY(sfString* String); CSFML_API float sfString_GetY(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a string /// Get the horizontal scale of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current X scale factor (always positive) /// \return Current X scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetScaleX(sfString* String); CSFML_API float sfString_GetScaleX(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a string /// Get the vertical scale of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current Y scale factor (always positive) /// \return Current Y scale factor (always positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetScaleY(sfString* String); CSFML_API float sfString_GetScaleY(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a string /// Get the orientation of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current rotation, in degrees /// \return Current rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetRotation(sfString* String); CSFML_API float sfString_GetRotation(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a string /// Get the X position of the origin a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current X origin position /// \return Current X origin position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetOriginX(sfString* String); CSFML_API float sfString_GetOriginX(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top Y of the origin of a string /// Get the top Y of the origin of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current Y origin position /// \return Current Y origin position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetOriginY(sfString* String); CSFML_API float sfString_GetOriginY(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a string /// Get the color of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfColor sfString_GetColor(sfString* String); CSFML_API sfColor sfString_GetColor(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a string /// Get the current blending mode of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current blending mode /// \return Current blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBlendMode sfString_GetBlendMode(sfString* String); CSFML_API sfBlendMode sfString_GetBlendMode(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a string /// Move a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param OffsetX : Offset on the X axis /// \param offsetX : Offset on the X axis
/// \param OffsetY : Offset on the Y axis /// \param offsetY : Offset on the Y axis
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_Move(sfString* String, float OffsetX, float OffsetY); CSFML_API void sfString_Move(sfString* string, float offsetX, float offsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale a string /// Scale a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param FactorX : Horizontal scaling factor (must be strictly positive) /// \param factorX : Horizontal scaling factor (must be strictly positive)
/// \param FactorY : Vertical scaling factor (must be strictly positive) /// \param factorY : Vertical scaling factor (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_Scale(sfString* String, float FactorX, float FactorY); CSFML_API void sfString_Scale(sfString* string, float factorX, float factorY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a string /// Rotate a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Angle : Angle of rotation, in degrees /// \param angle : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_Rotate(sfString* String, float Angle); CSFML_API void sfString_Rotate(sfString* string, float angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point from global coordinates into the string's local coordinates /// Transform a point from global coordinates into the string'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)
/// ///
/// \param String : String object /// \param string : String object
/// \param PointX : X coordinate of the point to transform /// \param pointX : X coordinate of the point to transform
/// \param PointY : Y coordinate of the point to transform /// \param pointY : Y coordinate of the point to transform
/// \param X : Value to fill with the X coordinate of the converted point /// \param x : Value to fill with the X coordinate of the converted point
/// \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 sfString_TransformToLocal(sfString* String, float PointX, float PointY, float* X, float* Y); CSFML_API void sfString_TransformToLocal(sfString* string, 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
/// (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)
/// ///
/// \param String : String object /// \param string : String object
/// \param PointX : X coordinate of the point to transform /// \param pointX : X coordinate of the point to transform
/// \param PointY : Y coordinate of the point to transform /// \param pointY : Y coordinate of the point to transform
/// \param X : Value to fill with the X coordinate of the converted point /// \param x : Value to fill with the X coordinate of the converted point
/// \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 sfString_TransformToGlobal(sfString* String, float PointX, float PointY, float* X, float* Y); CSFML_API void sfString_TransformToGlobal(sfString* string, float pointX, float pointY, float* X, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the text of a string (from a multibyte string) /// Set the text of a string (from a multibyte string)
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Text : New text /// \param text : New text
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetText(sfString* String, const char* Text); CSFML_API void sfString_SetText(sfString* string, const char* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the text of a string (from a unicode string) /// Set the text of a string (from a unicode string)
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Text : New text /// \param text : New text
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetUnicodeText(sfString* String, const sfUint32* Text); CSFML_API void sfString_SetUnicodeText(sfString* string, const sfUint32* text);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the font of a string /// Set the font of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Font : Font to use /// \param font : Font to use
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetFont(sfString* String, sfFont* Font); CSFML_API void sfString_SetFont(sfString* string, sfFont* font);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the size of a string /// Set the size of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Size : New size, in pixels /// \param size : New size, in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetSize(sfString* String, float Size); CSFML_API void sfString_SetSize(sfString* string, float size);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the style of a string /// Set the style of a string
/// ///
/// \param String : String to modify /// \param string : String to modify
/// \param Size : New style (see sfStringStyle enum) /// \param style : New style (see sfStringStyle enum)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfString_SetStyle(sfString* String, unsigned long Style); CSFML_API void sfString_SetStyle(sfString* string, unsigned long style);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the text of a string (returns a unicode string) /// Get the text of a string (returns a unicode string)
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Text as UTF-32 /// \return Text as UTF-32
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const sfUint32* sfString_GetUnicodeText(sfString* String); CSFML_API const sfUint32* sfString_GetUnicodeText(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the text of a string (returns an ANSI string) /// Get the text of a string (returns an ANSI string)
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Text an a locale-dependant ANSI string /// \return Text an a locale-dependant ANSI string
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfString_GetText(sfString* String); CSFML_API const char* sfString_GetText(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the font used by a string /// Get the font used by a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Pointer to the font /// \return Pointer to the font
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFont* sfString_GetFont(sfString* String); CSFML_API sfFont* sfString_GetFont(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the characters of a string /// Get the size of the characters of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Size of the characters /// \return Size of the characters
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfString_GetSize(sfString* String); CSFML_API float sfString_GetSize(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the style of a string /// Get the style of a string
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Current string style (see sfStringStyle enum) /// \return Current string style (see sfStringStyle enum)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned long sfString_GetStyle(sfString* String); CSFML_API unsigned long sfString_GetStyle(sfString* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the visual position of the Index-th character of the string, /// Return the visual position of the Index-th character of the string,
/// in coordinates relative to the string /// in coordinates relative to the string
/// (note : translation, origin, rotation and scale are not applied) /// (note : translation, origin, rotation and scale are not applied)
/// ///
/// \param String : String to read /// \param string : String to read
/// \param Index : Index of the character /// \param index : Index of the character
/// \param X : Value to fill with the X coordinate of the position /// \param x : Value to fill with the X coordinate of the position
/// \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 sfString_GetCharacterPos(sfString* String, size_t Index, float* X, float* Y); CSFML_API void sfString_GetCharacterPos(sfString* string, size_t index, float* x, float* y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the bounding rectangle of a string on screen /// Get the bounding rectangle of a string on screen
/// ///
/// \param String : String to read /// \param string : String to read
/// ///
/// \return Rectangle contaning the string in screen coordinates /// \return Rectangle contaning the string in screen coordinates
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFloatRect sfString_GetRect(sfString* String); CSFML_API sfFloatRect sfString_GetRect(sfString* string);
#endif // SFML_STRING_H #endif // SFML_STRING_H

View File

@ -42,47 +42,47 @@ CSFML_API sfView* sfView_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a view from a rectangle /// Construct a view from a rectangle
/// ///
/// \param Rect : Rectangle defining the bounds of the view /// \param rectangle : Rectangle defining the bounds of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfView* sfView_CreateFromRect(sfFloatRect Rect); CSFML_API sfView* sfView_CreateFromRect(sfFloatRect rectangle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing view /// Destroy an existing view
/// ///
/// \param View : View to destroy /// \param view : View to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_Destroy(sfView* View); CSFML_API void sfView_Destroy(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the center of a view /// Change the center of a view
/// ///
/// \param View : View to modify /// \param view : View to modify
/// \param X : X coordinate of the new center /// \param x : X coordinate of the new center
/// \param Y : Y coordinate of the new center /// \param y : Y coordinate of the new center
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_SetCenter(sfView* View, float X, float Y); CSFML_API void sfView_SetCenter(sfView* view, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the size of a view /// Change the size of a view
/// ///
/// \param View : View to modify /// \param view : View to modify
/// \param Width : New width /// \param width : New width
/// \param Height : New height /// \param height : New height
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_SetSize(sfView* View, float Width, float Height); CSFML_API void sfView_SetSize(sfView* view, float width, float height);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the angle of rotation of a view /// Set the angle of rotation of a view
/// ///
/// \param View : View to modify /// \param view : View to modify
/// \param Angle : New angle, in degrees /// \param angle : New angle, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_SetRotation(sfView* View, float Angle); CSFML_API void sfView_SetRotation(sfView* view, float angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the target viewport of a view /// Set the target viewport of a view
@ -91,109 +91,109 @@ CSFML_API void sfView_SetRotation(sfView* View, float Angle);
/// view are displayed, expressed as a factor (between 0 and 1) /// view are displayed, expressed as a factor (between 0 and 1)
/// of the size of the RenderTarget to which the view is applied. /// of the size of the RenderTarget to which the view is applied.
/// ///
/// \param View : View to modify /// \param view : View to modify
/// \param Viewport : New viewport /// \param viewport : New viewport
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_SetViewport(sfView* View, sfFloatRect Viewport); CSFML_API void sfView_SetViewport(sfView* view, sfFloatRect viewport);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Reset a view to the given rectangle. /// Reset a view to the given rectangle.
/// Note: this function resets the rotation angle to 0. /// Note: this function resets the rotation angle to 0.
/// ///
/// \param View : View to modify /// \param view : View to modify
/// \param Rectangle : Rectangle defining the position and size of the view /// \param rectangle : Rectangle defining the position and size of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_Reset(sfView* View, sfFloatRect Rectangle); CSFML_API 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
/// ///
/// \param View : View to read /// \param view : View to read
/// ///
/// \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(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y coordinate of the center of a view /// Get the Y coordinate of the center of a view
/// ///
/// \param View : View to read /// \param view : View to read
/// ///
/// \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(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the view /// Get the width of the view
/// ///
/// \param View : View to read /// \param view : View to read
/// ///
/// \return Width of the view /// \return Width of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetWidth(sfView* View); CSFML_API float sfView_GetWidth(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the view /// Get the height of the view
/// ///
/// \param View : View to read /// \param view : View to read
/// ///
/// \return Height of the view /// \return Height of the view
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfView_GetHeight(sfView* View); CSFML_API float sfView_GetHeight(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current rotation of a view /// Get the current rotation of a view
/// ///
/// \param View : View to read /// \param view : View to read
/// ///
/// \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(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target viewport of a view /// Get the target viewport of a view
/// ///
/// \param View : View to read /// \param view : View to read
/// ///
/// \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(sfView* view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a view /// Move a view
/// ///
/// \param View : View to move /// \param view : View to move
/// \param OffsetX : Offset to move the view, on X axis /// \param offsetX : Offset to move the view, on X axis
/// \param OffsetY : Offset to move the view, on Y axis /// \param offsetY : Offset to move the view, on Y axis
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_Move(sfView* View, float OffsetX, float OffsetY); CSFML_API void sfView_Move(sfView* view, float offsetX, float offsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a view /// Rotate a view
/// ///
/// \param View : View to rotate /// \param view : View to rotate
/// \param Angle : Angle in degrees /// \param angle : Angle in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_Rotate(sfView* View, float Angle); CSFML_API void sfView_Rotate(sfView* view, float angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Resize a view rectangle to simulate a zoom / unzoom effect /// Resize a view rectangle to simulate a zoom / unzoom effect
/// ///
/// \param View : View to zoom /// \param view : View to zoom
/// \param Factor : Zoom factor to apply, relative to the current zoom /// \param factor : Zoom factor to apply, relative to the current zoom
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfView_Zoom(sfView* View, float Factor); CSFML_API void sfView_Zoom(sfView* view, float factor);
#endif // SFML_VIEW_H #endif // SFML_VIEW_H

View File

@ -114,151 +114,151 @@ enum sfFtpStatus
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp listing response /// Destroy an existing Ftp listing response
/// ///
/// \param FtpResponse : Ftp listing response to destroy /// \param ftpListingResponse : Ftp listing response to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* FtpListingResponse); CSFML_API 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
/// ///
/// \param FtpListingResponse : Ftp listing response /// \param ftpListingResponse : Ftp listing response
/// ///
/// \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(sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
/// ///
/// \param FtpListingResponse : Ftp listing response /// \param ftpListingResponse : Ftp listing response
/// ///
/// \return Status code /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* FtpListingResponse); CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
/// ///
/// \param FtpListingResponse : Ftp listing response /// \param ftpListingResponse : Ftp listing response
/// ///
/// \return The response message /// \return The response message
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* FtpListingResponse); CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the number of filenames in the listing /// Get the number of filenames in the listing
/// ///
/// \param FtpListingResponse : Ftp listing response /// \param ftpListingResponse : Ftp listing response
/// ///
/// \return Total number of filenames /// \return Total number of filenames
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* FtpListingResponse); CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* ftpListingResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Index-th filename in the directory /// Get the Index-th filename in the directory
/// ///
/// \param FtpListingResponse : Ftp listing response /// \param ftpListingResponse : Ftp listing response
/// \param Index : Index of the filename to get /// \param index : Index of the filename to get
/// ///
/// \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(sfFtpListingResponse* ftpListingResponse, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp directory response /// Destroy an existing Ftp directory response
/// ///
/// \param FtpDirectoryResponse : Ftp directory response to destroy /// \param ftpDirectoryResponse : Ftp directory response to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* FtpDirectoryResponse); CSFML_API 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
/// ///
/// \param FtpDirectoryResponse : Ftp directory response /// \param ftpDirectoryResponse : Ftp directory response
/// ///
/// \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(sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
/// ///
/// \param FtpDirectoryResponse : Ftp directory response /// \param ftpDirectoryResponse : Ftp directory response
/// ///
/// \return Status code /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* FtpDirectoryResponse); CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
/// ///
/// \param FtpDirectoryResponse : Ftp directory response /// \param ftpDirectoryResponse : Ftp directory response
/// ///
/// \return The response message /// \return The response message
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* FtpDirectoryResponse); CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the directory returned in the response /// Get the directory returned in the response
/// ///
/// \param FtpDirectoryResponse : Ftp directory response /// \param ftpDirectoryResponse : Ftp directory response
/// ///
/// \return Directory name /// \return Directory name
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* FtpDirectoryResponse); CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* ftpDirectoryResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp response /// Destroy an existing Ftp response
/// ///
/// \param FtpResponse : Ftp response to destroy /// \param ftpResponse : Ftp response to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfFtpResponse_Destroy(sfFtpResponse* FtpResponse); CSFML_API 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
/// ///
/// \param FtpResponse : Ftp response /// \param ftpResponse : Ftp response
/// ///
/// \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(sfFtpResponse* ftpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
/// ///
/// \param FtpResponse : Ftp response /// \param ftpResponse : Ftp response
/// ///
/// \return Status code /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* FtpResponse); CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the full message contained in the response /// Get the full message contained in the response
/// ///
/// \param FtpResponse : Ftp response /// \param ftpResponse : Ftp response
/// ///
/// \return The response message /// \return The response message
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* FtpResponse); CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* ftpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new Ftp /// Construct a new Ftp
@ -271,179 +271,179 @@ CSFML_API sfFtp* sfFtp_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp /// Destroy an existing Ftp
/// ///
/// \param Ftp : Ftp to destroy /// \param ftp : Ftp to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfFtp_Destroy(sfFtp* Ftp); CSFML_API void sfFtp_Destroy(sfFtp* ftp);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Connect to the specified FTP server /// Connect to the specified FTP server
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param Server : FTP server to connect to /// \param server : FTP server to connect to
/// \param Port : Port used for connection (21 by default, standard FTP port) /// \param port : Port used for connection (21 by default, standard FTP port)
/// \param Timeout : Maximum time to wait (0 to use no timeout) /// \param timeout : Maximum time to wait (0 to use no timeout)
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* Ftp, sfIPAddress Server, unsigned short Port, float Timeout); CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIPAddress server, unsigned short port, float timeout);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Log in using anonymous account /// Log in using anonymous account
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* Ftp); CSFML_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Log in using a username and a password /// Log in using a username and a password
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param UserName : User name /// \param userName : User name
/// \param Password : Password /// \param password : Password
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Login(sfFtp* Ftp, const char* UserName, const char* Password); CSFML_API sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, const char* password);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close the connection with FTP server /// Close the connection with FTP server
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Disconnect(sfFtp* Ftp); CSFML_API sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a null command just to prevent from being disconnected /// Send a null command just to prevent from being disconnected
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* Ftp); CSFML_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current working directory /// Get the current working directory
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* Ftp); CSFML_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the contents of the given directory /// Get the contents of the given directory
/// (subdirectories and files) /// (subdirectories and files)
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param Directory : Directory to list ("" by default, the current one) /// \param directory : Directory to list ("" by default, the current one)
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* Ftp, const char* Directory); CSFML_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, const char* directory);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current working directory /// Change the current working directory
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param Directory : New directory, relative to the current one /// \param directory : New directory, relative to the current one
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* Ftp, const char* Directory); CSFML_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* directory);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Go to the parent directory of the current one /// Go to the parent directory of the current one
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* Ftp); CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new directory /// Create a new directory
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param Name : Name of the directory to create /// \param name : Name of the directory to create
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_MakeDirectory(sfFtp* Ftp, const char* Name); CSFML_API sfFtpResponse* sfFtp_MakeDirectory(sfFtp* ftp, const char* name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove an existing directory /// Remove an existing directory
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param Name : Name of the directory to remove /// \param name : Name of the directory to remove
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* Ftp, const char* Name); CSFML_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rename a file /// Rename a file
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param File : File to rename /// \param file : File to rename
/// \param NewName : New name /// \param newName : New name
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_RenameFile(sfFtp* Ftp, const char* File, const char* NewName); CSFML_API sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file, const char* newName);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove an existing file /// Remove an existing file
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param Name : File to remove /// \param name : File to remove
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* Ftp, const char* Name); CSFML_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Download a file from the server /// Download a file from the server
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param DistantFile : Path of the distant file to download /// \param distantFile : Path of the distant file to download
/// \param DestPath : Where to put to file on the local computer /// \param destPath : Where to put to file on the local computer
/// \param Mode : Transfer mode (binary by default) /// \param mode : Transfer mode (binary by default)
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Download(sfFtp* Ftp, const char* DistantFile, const char* DestPath, sfFtpTransferMode Mode); CSFML_API sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Upload a file to the server /// Upload a file to the server
/// ///
/// \param Ftp : Ftp instance /// \param ftp : Ftp instance
/// \param LocalFile : Path of the local file to upload /// \param localFile : Path of the local file to upload
/// \param DestPath : Where to put to file on the server /// \param destPath : Where to put to file on the server
/// \param Mode : Transfer mode (binary by default) /// \param mode : Transfer mode (binary by default)
/// ///
/// \return Server response to the request /// \return Server response to the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Upload(sfFtp* Ftp, const char* LocalFile, const char* DestPath, sfFtpTransferMode Mode); CSFML_API sfFtpResponse* sfFtp_Upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
#endif // SFML_FTP_H #endif // SFML_FTP_H

View File

@ -90,111 +90,111 @@ CSFML_API sfHttpRequest* sfHttpRequest_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Http request /// Destroy an existing Http request
/// ///
/// \param HttpRequest : Http request to destroy /// \param httpRequest : Http request to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_Destroy(sfHttpRequest* HttpRequest); CSFML_API void sfHttpRequest_Destroy(sfHttpRequest* httpRequest);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the value of a field; the field is added if it doesn't exist /// Set the value of a field; the field is added if it doesn't exist
/// ///
/// \param HttpRequest : Http request to modify /// \param httpRequest : Http request to modify
/// \param Field : Name of the field to set (case-insensitive) /// \param field : Name of the field to set (case-insensitive)
/// \param Value : Value of the field /// \param value : Value of the field
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetField(sfHttpRequest* HttpRequest, const char* Field, const char* Value); CSFML_API void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const char* field, const char* value);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the request method. /// Set the request method.
/// This parameter is sfHttpGet by default /// This parameter is sfHttpGet by default
/// ///
/// \param HttpRequest : Http request to modify /// \param httpRequest : Http request to modify
/// \param RequestMethod : Method to use for the request /// \param method : Method to use for the request
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetMethod(sfHttpRequest* HttpRequest, sfHttpMethod Method); CSFML_API void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHttpMethod method);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the target URI of the request. /// Set the target URI of the request.
/// This parameter is "/" by default /// This parameter is "/" by default
/// ///
/// \param HttpRequest : Http request to modify /// \param httpRequest : Http request to modify
/// \param URI : URI to request, local to the host /// \param URI : URI to request, local to the host
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetURI(sfHttpRequest* HttpRequest, const char* URI); CSFML_API void sfHttpRequest_SetURI(sfHttpRequest* httpRequest, const char* URI);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the HTTP version of the request. /// Set the HTTP version of the request.
/// This parameter is 1.0 by default /// This parameter is 1.0 by default
/// ///
/// \param HttpRequest : Http request to modify /// \param httpRequest : Http request to modify
/// \param Major : Major version number /// \param major : Major version number
/// \param Minor : Minor version number /// \param minor : Minor version number
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetHttpVersion(sfHttpRequest* HttpRequest, unsigned int Major, unsigned int Minor); CSFML_API void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the body of the request. This parameter is optional and /// Set the body of the request. This parameter is optional and
/// makes sense only for POST requests. /// makes sense only for POST requests.
/// This parameter is empty by default /// This parameter is empty by default
/// ///
/// \param HttpRequest : Http request to modify /// \param httpRequest : Http request to modify
/// \param Body : Content of the request body /// \param body : Content of the request body
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetBody(sfHttpRequest* HttpRequest, const char* Body); CSFML_API void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const char* body);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Http response /// Destroy an existing Http response
/// ///
/// \param HttpResponse : Http response to destroy /// \param httpResponse : Http response to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttpResponse_Destroy(sfHttpResponse* HttpResponse); CSFML_API 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
/// ///
/// \param HttpResponse : Http response /// \param httpResponse : Http response
/// \param Field : Field to get /// \param field : Field to get
/// ///
/// \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(sfHttpResponse* httpResponse, const char* field);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a response /// Get the status of a response
/// ///
/// \param HttpResponse : Http response /// \param httpResponse : Http response
/// ///
/// \return Status of the response /// \return Status of the response
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* HttpResponse); CSFML_API sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the major HTTP version of a response /// Get the major HTTP version of a response
/// ///
/// \param HttpResponse : Http response /// \param httpResponse : Http response
/// ///
/// \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(sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minor HTTP version of a response /// Get the minor HTTP version of a response
/// ///
/// \param HttpResponse : Http response /// \param httpResponse : Http response
/// ///
/// \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(sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the body of the response. The body can contain : /// Get the body of the response. The body can contain :
@ -203,12 +203,12 @@ CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* HttpRespon
/// - nothing (for HEAD requests) /// - nothing (for HEAD requests)
/// - an error message (in case of an error) /// - an error message (in case of an error)
/// ///
/// \param HttpResponse : Http response /// \param httpResponse : Http response
/// ///
/// \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(sfHttpResponse* httpResponse);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new Http object /// Construct a new Http object
@ -224,17 +224,17 @@ CSFML_API sfHttp* sfHttp_Create();
/// \param Http : Http to destroy /// \param Http : Http to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttp_Destroy(sfHttp* Http); CSFML_API void sfHttp_Destroy(sfHttp* http);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the target host of a Http server /// Set the target host of a Http server
/// ///
/// \param Http : Http object /// \param http : Http object
/// \param Host : Web server to connect to /// \param host : Web server to connect to
/// \param Port : Port to use for connection (0 to use the standard port of the protocol used) /// \param port : Port to use for connection (0 to use the standard port of the protocol used)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfHttp_SetHost(sfHttp* Http, const char* Host, unsigned short Port); CSFML_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a HTTP request and return the server's response. /// Send a HTTP request and return the server's response.
@ -244,14 +244,14 @@ CSFML_API void sfHttp_SetHost(sfHttp* Http, const char* Host, unsigned short Por
/// 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.
/// ///
/// \param Http : Http object /// \param http : Http object
/// \param Request : Request to send /// \param request : Request to send
/// \param Timeout : Maximum time to wait (0 to use no timeout) /// \param timeout : Maximum time to wait (0 to use no timeout)
/// ///
/// \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, sfHttpRequest* request, float timeout);
#endif // SFML_HTTP_H #endif // SFML_HTTP_H

View File

@ -43,62 +43,62 @@ typedef struct
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct an address from a string /// Construct an address from a string
/// ///
/// \param String : IP address ("xxx.xxx.xxx.xxx") or network name /// \param string : IP address ("xxx.xxx.xxx.xxx") or network name
/// ///
/// \return Resulting address /// \return Resulting address
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_FromString(const char* String); CSFML_API sfIPAddress sfIPAddress_FromString(const char* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct an address from 4 bytes /// Construct an address from 4 bytes
/// ///
/// \param Byte0 : First byte of the address /// \param byte0 : First byte of the address
/// \param Byte1 : Second byte of the address /// \param byte1 : Second byte of the address
/// \param Byte2 : Third byte of the address /// \param byte2 : Third byte of the address
/// \param Byte3 : Fourth byte of the address /// \param byte3 : Fourth byte of the address
/// ///
/// \return Resulting address /// \return Resulting address
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_FromBytes(sfUint8 Byte0, sfUint8 Byte1, sfUint8 Byte2, sfUint8 Byte3); CSFML_API sfIPAddress sfIPAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the address from a 32-bits integer /// Construct the address from a 32-bits integer
/// ///
/// \param Address : 4 bytes of the address packed into a 32-bits integer /// \param address : 4 bytes of the address packed into a 32-bits integer
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_FromInteger(sfUint32 Address); CSFML_API sfIPAddress sfIPAddress_FromInteger(sfUint32 address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if an address is a valid one /// Tell if an address is a valid one
/// ///
/// \param Address : Address to check /// \param address : Address to check
/// ///
/// \return sfTrue if address has a valid syntax /// \return sfTrue if address has a valid syntax
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfIPAddress_IsValid(sfIPAddress Address); CSFML_API sfBool sfIPAddress_IsValid(sfIPAddress address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a string representation of an address /// Get a string representation of an address
/// ///
/// \param Address : Address to convert /// \param address : Address to convert
/// \param String : Char array to fill (size must be >= 16) /// \param string : Char array to fill (size must be >= 16)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfIPAddress_ToString(sfIPAddress Address, char* String); CSFML_API void sfIPAddress_ToString(sfIPAddress address, char* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get an integer representation of the address /// Get an integer representation of the address
/// ///
/// \param Address : Address to convert /// \param address : Address to convert
/// ///
/// \return 32-bits integer containing the 4 bytes of the address, in system endianness /// \return 32-bits integer containing the 4 bytes of the address, in system endianness
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfUint32 sfIPAddress_ToInteger(sfIPAddress Address); CSFML_API sfUint32 sfIPAddress_ToInteger(sfIPAddress address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the computer's local IP address (from the LAN point of view) /// Get the computer's local IP address (from the LAN point of view)
@ -114,12 +114,12 @@ CSFML_API sfIPAddress sfIPAddress_GetLocalAddress();
/// distant website ; as a consequence, this function may be /// distant website ; as a consequence, this function may be
/// very slow -- use it as few as possible ! /// very slow -- use it as few as possible !
/// ///
/// \param Timeout : Maximum time to wait, in seconds (use 0 for no timeout) /// \param timeout : Maximum time to wait, in seconds (use 0 for no timeout)
/// ///
/// \return Public IP address /// \return Public IP address
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_GetPublicAddress(float Timeout); CSFML_API sfIPAddress sfIPAddress_GetPublicAddress(float timeout);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the computer's loopback address /// Get the computer's loopback address

View File

@ -43,106 +43,106 @@ CSFML_API sfPacket* sfPacket_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing packet /// Destroy an existing packet
/// ///
/// \param Packet : Packet to delete /// \param packet : Packet to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPacket_Destroy(sfPacket* Packet); CSFML_API void sfPacket_Destroy(sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Append data to the end of a packet /// Append data to the end of a packet
/// ///
/// \param Packet : Packet to fill /// \param packet : Packet to fill
/// \param Data : Pointer to the bytes to append /// \param data : Pointer to the bytes to append
/// \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, void* data, size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear all the data of a packet /// Clear all the data of a packet
/// ///
/// \param Packet : Packet to clear /// \param packet : Packet to clear
/// ///
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
CSFML_API void sfPacket_Clear(sfPacket* Packet); CSFML_API void sfPacket_Clear(sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a pointer to the data contained in a packet /// Get a pointer to the data contained in a 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
/// ///
/// \param Packet : Packet to get data from /// \param packet : Packet to get data from
/// ///
/// \return Pointer to the data /// \return Pointer to the data
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API const char* sfPacket_GetData(sfPacket* Packet); CSFML_API 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
/// ///
/// \param Packet : Packet to get data size from /// \param packet : Packet to get data size from
/// ///
/// \return Data size, in bytes /// \return Data size, in bytes
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API size_t sfPacket_GetDataSize(sfPacket* Packet); CSFML_API 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
/// ///
/// \param Packet : Packet to check /// \param packet : Packet to check
/// ///
/// \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(sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the validity of packet /// Return the validity of packet
/// ///
/// \param Packet : Packet to check /// \param packet : Packet to check
/// ///
/// \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(sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Functions to extract data from a packet /// Functions to extract data from a packet
/// ///
/// \param Packet : Packet to read /// \param packet : Packet to read
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfPacket_ReadBool(sfPacket* Packet); CSFML_API sfBool sfPacket_ReadBool(sfPacket* packet);
CSFML_API sfInt8 sfPacket_ReadInt8(sfPacket* Packet); CSFML_API sfInt8 sfPacket_ReadInt8(sfPacket* packet);
CSFML_API sfUint8 sfPacket_ReadUint8(sfPacket* Packet); CSFML_API sfUint8 sfPacket_ReadUint8(sfPacket* packet);
CSFML_API sfInt16 sfPacket_ReadInt16(sfPacket* Packet); CSFML_API sfInt16 sfPacket_ReadInt16(sfPacket* packet);
CSFML_API sfUint16 sfPacket_ReadUint16(sfPacket* Packet); CSFML_API sfUint16 sfPacket_ReadUint16(sfPacket* packet);
CSFML_API sfInt32 sfPacket_ReadInt32(sfPacket* Packet); CSFML_API sfInt32 sfPacket_ReadInt32(sfPacket* packet);
CSFML_API sfUint32 sfPacket_ReadUint32(sfPacket* Packet); CSFML_API sfUint32 sfPacket_ReadUint32(sfPacket* packet);
CSFML_API float sfPacket_ReadFloat(sfPacket* Packet); CSFML_API float sfPacket_ReadFloat(sfPacket* packet);
CSFML_API double sfPacket_ReadDouble(sfPacket* Packet); CSFML_API double sfPacket_ReadDouble(sfPacket* packet);
CSFML_API void sfPacket_ReadString(sfPacket* Packet, char* String); CSFML_API void sfPacket_ReadString(sfPacket* packet, char* string);
CSFML_API void sfPacket_ReadWideString(sfPacket* Packet, wchar_t* String); CSFML_API void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Functions to insert data into a packet /// Functions to insert data into a packet
/// ///
/// \param Packet : Packet to write /// \param packet : Packet to write
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfPacket_WriteBool(sfPacket* Packet, sfBool); CSFML_API void sfPacket_WriteBool(sfPacket* packet, sfBool);
CSFML_API void sfPacket_WriteInt8(sfPacket* Packet, sfInt8); CSFML_API void sfPacket_WriteInt8(sfPacket* packet, sfInt8);
CSFML_API void sfPacket_WriteUint8(sfPacket* Packet, sfUint8); CSFML_API void sfPacket_WriteUint8(sfPacket* packet, sfUint8);
CSFML_API void sfPacket_WriteInt16(sfPacket* Packet, sfInt16); CSFML_API void sfPacket_WriteInt16(sfPacket* packet, sfInt16);
CSFML_API void sfPacket_WriteUint16(sfPacket* Packet, sfUint16); CSFML_API void sfPacket_WriteUint16(sfPacket* packet, sfUint16);
CSFML_API void sfPacket_WriteInt32(sfPacket* Packet, sfInt32); CSFML_API void sfPacket_WriteInt32(sfPacket* packet, sfInt32);
CSFML_API void sfPacket_WriteUint32(sfPacket* Packet, sfUint32); CSFML_API void sfPacket_WriteUint32(sfPacket* packet, sfUint32);
CSFML_API void sfPacket_WriteFloat(sfPacket* Packet, float); CSFML_API void sfPacket_WriteFloat(sfPacket* packet, float);
CSFML_API void sfPacket_WriteDouble(sfPacket* Packet, double); CSFML_API void sfPacket_WriteDouble(sfPacket* packet, double);
CSFML_API void sfPacket_WriteString(sfPacket* Packet, const char* String); CSFML_API void sfPacket_WriteString(sfPacket* packet, const char* string);
CSFML_API void sfPacket_WriteWideString(sfPacket* Packet, const wchar_t* String); CSFML_API void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string);
#endif // SFML_PACKET_H #endif // SFML_PACKET_H

View File

@ -44,68 +44,68 @@ CSFML_API sfSelectorUDP* sfSelectorUDP_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing selector /// Destroy an existing selector
/// ///
/// \param Selector : Selector to delete /// \param selector : Selector to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Destroy(sfSelectorTCP* Selector); CSFML_API void sfSelectorTCP_Destroy(sfSelectorTCP* selector);
CSFML_API void sfSelectorUDP_Destroy(sfSelectorUDP* Selector); CSFML_API void sfSelectorUDP_Destroy(sfSelectorUDP* selector);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add a socket to watch to a selector /// Add a socket to watch to a selector
/// ///
/// \param Selector : Selector to add the socket to /// \param selector : Selector to add the socket to
/// \param Socket : Socket to add /// \param socket : Socket to add
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Add(sfSelectorTCP* Selector, sfSocketTCP* Socket); CSFML_API void sfSelectorTCP_Add(sfSelectorTCP* selector, sfSocketTCP* socket);
CSFML_API void sfSelectorUDP_Add(sfSelectorUDP* Selector, sfSocketUDP* Socket); CSFML_API void sfSelectorUDP_Add(sfSelectorUDP* selector, sfSocketUDP* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove a socket from a selector /// Remove a socket from a selector
/// ///
/// \param Selector : Selector to remove the socket from /// \param selector : Selector to remove the socket from
/// \param Socket : Socket to remove /// \param socket : Socket to remove
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Remove(sfSelectorTCP* Selector, sfSocketTCP* Socket); CSFML_API void sfSelectorTCP_Remove(sfSelectorTCP* selector, sfSocketTCP* socket);
CSFML_API void sfSelectorUDP_Remove(sfSelectorUDP* Selector, sfSocketUDP* Socket); CSFML_API void sfSelectorUDP_Remove(sfSelectorUDP* selector, sfSocketUDP* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove all sockets from a selector /// Remove all sockets from a selector
/// ///
/// \param Selector : Selector to remove the socket from /// \param selector : Selector to remove the socket from
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Clear(sfSelectorTCP* Selector); CSFML_API void sfSelectorTCP_Clear(sfSelectorTCP* selector);
CSFML_API void sfSelectorUDP_Clear(sfSelectorUDP* Selector); CSFML_API void sfSelectorUDP_Clear(sfSelectorUDP* selector);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Wait and collect sockets which are ready for reading. /// Wait and collect sockets which are ready for reading.
/// This functions will return either when at least one socket /// This functions will return either when at least one socket
/// is ready, or when the given time is out /// is ready, or when the given time is out
/// ///
/// \param Selector : Selector to check /// \param selector : Selector to check
/// \param Timeout : Maximum time to wait, in seconds (0 to disable timeout) /// \param timeout : Maximum time to wait, in seconds (0 to disable timeout)
/// ///
/// \return Number of sockets ready /// \return Number of sockets ready
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSelectorTCP_Wait(sfSelectorTCP* Selector, float Timeout); CSFML_API unsigned int sfSelectorTCP_Wait(sfSelectorTCP* selector, float timeout);
CSFML_API unsigned int sfSelectorUDP_Wait(sfSelectorUDP* Selector, float Timeout); CSFML_API unsigned int sfSelectorUDP_Wait(sfSelectorUDP* selector, float timeout);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// After a call to Wait(), get the Index-th socket which is /// After a call to Wait(), get the Index-th socket which is
/// 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()
/// ///
/// \param Selector : Selector to check /// \param selector : Selector to check
/// \param Index : Index of the socket to get /// \param index : Index of the socket to get
/// ///
/// \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(sfSelectorTCP* selector, unsigned int index);
CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* Selector, unsigned int Index); CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* selector, unsigned int index);
#endif // SFML_SELECTOR_H #endif // SFML_SELECTOR_H

View File

@ -45,116 +45,116 @@ CSFML_API sfSocketTCP* sfSocketTCP_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing TCP socket /// Destroy an existing TCP socket
/// ///
/// \param Socket : Socket to destroy /// \param socket : Socket to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSocketTCP_Destroy(sfSocketTCP* Socket); CSFML_API void sfSocketTCP_Destroy(sfSocketTCP* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the blocking state of a TCP socket. /// Change the blocking state of a TCP socket.
/// The default behaviour of a socket is blocking /// The default behaviour of a socket is blocking
/// ///
/// \param Socket : Socket to modify /// \param socket : Socket to modify
/// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking /// \param blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSocketTCP_SetBlocking(sfSocketTCP* Socket, sfBool Blocking); CSFML_API void sfSocketTCP_SetBlocking(sfSocketTCP* socket, sfBool blocking);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Connect a TCP socket to another computer on a specified port /// Connect a TCP socket to another computer on a specified port
/// ///
/// \param Socket : Socket to use for connecting /// \param socket : Socket to use for connecting
/// \param Port : Port to use for transfers (warning : ports < 1024 are reserved) /// \param port : Port to use for transfers (warning : ports < 1024 are reserved)
/// \param HostAddress : IP Address of the host to connect to /// \param host : IP Address of the host to connect to
/// \param Timeout : Maximum time to wait (0 to use no timeout) /// \param timeout : Maximum time to wait (0 to use no timeout)
/// ///
/// \return sfTrue if operation has been successful /// \return sfTrue if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Connect(sfSocketTCP* Socket, unsigned short Port, sfIPAddress HostAddress, float Timeout); CSFML_API sfSocketStatus sfSocketTCP_Connect(sfSocketTCP* socket, unsigned short port, sfIPAddress host, float timeout);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Listen to a specified port for incoming data or connections /// Listen to a specified port for incoming data or connections
/// ///
/// \param Socket : Socket to use for listening /// \param socket : Socket to use for listening
/// \param Port : Port to listen to /// \param port : Port to listen to
/// ///
/// \return sfTrue if operation has been successful /// \return sfTrue if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketTCP_Listen(sfSocketTCP* Socket, unsigned short Port); CSFML_API sfBool sfSocketTCP_Listen(sfSocketTCP* socket, unsigned short port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Wait for a connection (must be listening to a port). /// Wait for a connection (must be listening to a port).
/// This function is blocking, ie. it won't return before /// This function is blocking, ie. it won't return before
/// a connection has been accepted /// a connection has been accepted
/// ///
/// \param Socket : Socket to use for accepting /// \param socket : Socket to use for accepting
/// \param Connected : Pointer to a socket pointer that will be filled with the connected client /// \param connected : Pointer to a socket pointer that will be filled with the connected client
/// \param Address : Pointer to an address to fill with client infos /// \param address : Pointer to an address to fill with client infos
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* Socket, sfSocketTCP** Connected, sfIPAddress* Address); CSFML_API sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* socket, sfSocketTCP** connected, sfIPAddress* address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send an array of bytes to the host (must be connected first) /// Send an array of bytes to the host (must be connected first)
/// ///
/// \param Socket : Socket to use for sending /// \param socket : Socket to use for sending
/// \param Data : Pointer to the bytes to send /// \param data : Pointer to the bytes to send
/// \param Size : Number of bytes to send /// \param size : Number of bytes to send
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Send(sfSocketTCP* Socket, const char* Data, size_t Size); CSFML_API sfSocketStatus sfSocketTCP_Send(sfSocketTCP* socket, const char* data, size_t size);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive an array of bytes from the host (must be connected first) /// Receive an array of bytes from the host (must be connected first)
/// ///
/// \param Socket : Socket to use for receiving /// \param socket : Socket to use for receiving
/// \param Data : Pointer to a byte array to fill (make sure it is big enough) /// \param data : Pointer to a byte array to fill (make sure it is big enough)
/// \param MaxSize : Maximum number of bytes to read /// \param maxSize : Maximum number of bytes to read
/// \param SizeReceived : Number of bytes received /// \param sizeReceived : Number of bytes received
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* Socket, char* Data, size_t MaxSize, size_t* SizeReceived); CSFML_API sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* socket, char* data, size_t maxSize, size_t* sizeReceived);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a packet of data to the host (must be connected first) /// Send a packet of data to the host (must be connected first)
/// ///
/// \param Socket : Socket to use for sending /// \param socket : Socket to use for sending
/// \param Packet : Packet to send /// \param packet : Packet to send
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_SendPacket(sfSocketTCP* Socket, sfPacket* Packet); CSFML_API sfSocketStatus sfSocketTCP_SendPacket(sfSocketTCP* socket, sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive a packet from the host (must be connected first) /// Receive a packet from the host (must be connected first)
/// ///
/// \param Socket : Socket to use for receiving /// \param socket : Socket to use for receiving
/// \param Packet : Packet to fill with received data /// \param packet : Packet to fill with received data
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* Socket, sfPacket* Packet); CSFML_API sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* socket, sfPacket* packet);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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
/// ///
/// \param Socket : Socket to check /// \param socket : Socket to check
/// ///
/// \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(sfSocketTCP* socket);
#endif // SFML_SOCKETTCP_H #endif // SFML_SOCKETTCP_H

View File

@ -45,111 +45,111 @@ CSFML_API sfSocketUDP* sfSocketUDP_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing UDP socket /// Destroy an existing UDP socket
/// ///
/// \param Socket : Socket to destroy /// \param socket : Socket to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSocketUDP_Destroy(sfSocketUDP* Socket); CSFML_API void sfSocketUDP_Destroy(sfSocketUDP* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the blocking state of a UDP socket. /// Change the blocking state of a UDP socket.
/// The default behaviour of a socket is blocking /// The default behaviour of a socket is blocking
/// ///
/// \param Socket : Socket to modify /// \param socket : Socket to modify
/// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking /// \param blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSocketUDP_SetBlocking(sfSocketUDP* Socket, sfBool Blocking); CSFML_API void sfSocketUDP_SetBlocking(sfSocketUDP* socket, sfBool blocking);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a socket to a specific port /// Bind a socket to a specific port
/// ///
/// \param Socket : Socket to bind /// \param socket : Socket to bind
/// \param Port : Port to bind the socket to /// \param port : Port to bind the socket to
/// ///
/// \return True if operation has been successful /// \return True if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketUDP_Bind(sfSocketUDP* Socket, unsigned short Port); CSFML_API sfBool sfSocketUDP_Bind(sfSocketUDP* socket, unsigned short port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Unbind a socket from its previous port, if any /// Unbind a socket from its previous port, if any
/// ///
/// \param Socket : Socket to unbind /// \param socket : Socket to unbind
/// ///
/// \return sfTrue if operation has been successful /// \return sfTrue if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketUDP_Unbind(sfSocketUDP* Socket); CSFML_API sfBool sfSocketUDP_Unbind(sfSocketUDP* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send an array of bytes /// Send an array of bytes
/// ///
/// \param Socket : Socket to use for sending /// \param socket : Socket to use for sending
/// \param Data : Pointer to the bytes to send /// \param data : Pointer to the bytes to send
/// \param Size : Number of bytes to send /// \param size : Number of bytes to send
/// \param Address : Address of the computer to send the packet to /// \param address : Address of the computer to send the packet to
/// \param Port : Port to use for communication /// \param port : Port to use for communication
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_Send(sfSocketUDP* Socket, const char* Data, size_t Size, sfIPAddress Address, unsigned short Port); CSFML_API sfSocketStatus sfSocketUDP_Send(sfSocketUDP* socket, const char* data, size_t size, sfIPAddress address, unsigned short port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive an array of bytes. /// Receive an array of bytes.
/// This function is blocking, ie. it won't return before some /// This function is blocking, ie. it won't return before some
/// bytes have been received /// bytes have been received
/// ///
/// \param Socket : Socket to use for receiving /// \param socket : Socket to use for receiving
/// \param Data : Pointer to a byte array to fill (make sure it is big enough) /// \param data : Pointer to a byte array to fill (make sure it is big enough)
/// \param MaxSize : Maximum number of bytes to read /// \param maxSize : Maximum number of bytes to read
/// \param SizeReceived : Number of bytes received /// \param sizeReceived : Number of bytes received
/// \param Address : Address of the computer which sent the data /// \param address : Address of the computer which sent the data
/// \param Port : Port on which the remote computer sent the data /// \param port : Port on which the remote computer sent the data
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* Socket, char* Data, size_t MaxSize, size_t* SizeReceived, sfIPAddress* Address, unsigned short* Port); CSFML_API sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIPAddress* address, unsigned short* port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a packet of data /// Send a packet of data
/// ///
/// \param Socket : Socket to use for sending /// \param socket : Socket to use for sending
/// \param Packet : Packet to send /// \param packet : Packet to send
/// \param Address : Address of the computer to send the packet to /// \param address : Address of the computer to send the packet to
/// \param Port : Port to use for communication /// \param port : Port to use for communication
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* Socket, sfPacket* Packet, sfIPAddress Address, unsigned short Port); CSFML_API sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* socket, sfPacket* packet, sfIPAddress address, unsigned short port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive a packet. /// Receive a packet.
/// This function is blocking, ie. it won't return before a /// This function is blocking, ie. it won't return before a
/// packet is received /// packet is received
/// ///
/// \param Socket : Socket to use for receiving /// \param socket : Socket to use for receiving
/// \param Packet : Packet to fill with received data /// \param packet : Packet to fill with received data
/// \param Address : Address of the computer which sent the packet /// \param address : Address of the computer which sent the packet
/// \param Port : Port on which the remote computer sent the data /// \param port : Port on which the remote computer sent the data
/// ///
/// \return Socket status /// \return Socket status
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* Socket, sfPacket* Packet, sfIPAddress* Address, unsigned short* Port); CSFML_API sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* socket, sfPacket* packet, sfIPAddress* address, unsigned short* port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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
/// ///
/// \param Socket : Socket to check /// \param socket : Socket to check
/// ///
/// \return sfTrue if the socket is valid /// \return sfTrue if the socket is valid
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketUDP_IsValid(sfSocketUDP* Socket); CSFML_API sfBool sfSocketUDP_IsValid(sfSocketUDP* socket);
#endif // SFML_SOCKETUDP_H #endif // SFML_SOCKETUDP_H

View File

@ -43,26 +43,26 @@ CSFML_API sfClock* sfClock_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing clock /// Destroy an existing clock
/// ///
/// \param Clock : Clock to delete /// \param clock : Clock to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfClock_Destroy(sfClock* Clock); CSFML_API void sfClock_Destroy(sfClock* clock);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the time elapsed for a clock /// Get the time elapsed for a 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(sfClock* clock);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Restart a clock /// Restart a clock
/// ///
/// \param Clock : Clock to restart /// \param clock : Clock to restart
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfClock_Reset(sfClock* Clock); CSFML_API void sfClock_Reset(sfClock* clock);
#endif // SFML_CLOCK_H #endif // SFML_CLOCK_H

View File

@ -43,26 +43,26 @@ CSFML_API sfMutex* sfMutex_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing mutex /// Destroy an existing mutex
/// ///
/// \param Mutex : Mutex to delete /// \param mutex : Mutex to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMutex_Destroy(sfMutex* Mutex); CSFML_API void sfMutex_Destroy(sfMutex* mutex);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Lock a mutex /// Lock a mutex
/// ///
/// \param Mutex : Mutex to lock /// \param mutex : Mutex to lock
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMutex_Lock(sfMutex* Mutex); CSFML_API void sfMutex_Lock(sfMutex* mutex);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Unlock a mutex /// Unlock a mutex
/// ///
/// \param Mutex : Mutex to unlock /// \param mutex : Mutex to unlock
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfMutex_Unlock(sfMutex* Mutex); CSFML_API void sfMutex_Unlock(sfMutex* mutex);
#endif // SFML_MUTEX_H #endif // SFML_MUTEX_H

View File

@ -35,10 +35,10 @@
/// Set the seed for the random numbers generator. Using a known seed /// Set the seed for the random numbers generator. Using a known seed
/// allows you to reproduce the same sequence of random numbers /// allows you to reproduce the same sequence of random numbers
/// ///
/// \param Seed : Number to use as the seed /// \param seed : Number to use as the seed
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfRandom_SetSeed(unsigned int Seed); CSFML_API void sfRandom_SetSeed(unsigned int seed);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the seed used to generate random numbers the generator /// Get the seed used to generate random numbers the generator
@ -51,24 +51,24 @@ CSFML_API unsigned int sfRandom_GetSeed();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a random float number in a given range /// Get a random float number in a given range
/// ///
/// \return Start : Start of the range /// \return begin : Start of the range
/// \return End : End of the range /// \return end : End of the range
/// ///
/// \return Random number in [Begin, End] /// \return Random number in [begin, end]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfRandom_Float(float Begin, float End); CSFML_API float sfRandom_Float(float begin, float end);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a random integer number in a given range /// Get a random integer number in a given range
/// ///
/// \return Start : Start of the range /// \return begin : Start of the range
/// \return End : End of the range /// \return end : End of the range
/// ///
/// \return Random number in [Begin, End] /// \return Random number in [begin, end]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API int sfRandom_Int(int Begin, int End); CSFML_API int sfRandom_Int(int begin, int end);
#endif // SFML_RANDOMIZER_H #endif // SFML_RANDOMIZER_H

View File

@ -34,10 +34,10 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Make the current thread sleep for a given time /// Make the current thread sleep for a given time
/// ///
/// \param Duration : Time to sleep, in seconds /// \param duration : Time to sleep, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfSleep(float Duration); CSFML_API void sfSleep(float duration);
#endif // SFML_SLEEP_H #endif // SFML_SLEEP_H

View File

@ -35,35 +35,35 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new thread from a function pointer /// Construct a new thread from a function pointer
/// ///
/// \param Function : Entry point of the thread /// \param function : Entry point of the thread
/// \param UserData : Data to pass to the thread function /// \param userData : Data to pass to the thread function
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfThread* sfThread_Create(void (*Function)(void*), void* UserData); CSFML_API sfThread* sfThread_Create(void (*function)(void*), void* userData);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing thread /// Destroy an existing thread
/// ///
/// \param Thread : Thread to delete /// \param thread : Thread to delete
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfThread_Destroy(sfThread* Thread); CSFML_API void sfThread_Destroy(sfThread* thread);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Run a thread /// Run a thread
/// ///
/// \param Thread : Thread to launch /// \param thread : Thread to launch
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfThread_Launch(sfThread* Thread); CSFML_API void sfThread_Launch(sfThread* thread);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Wait until a thread finishes /// Wait until a thread finishes
/// ///
/// \param Thread : Thread to wait for /// \param thread : Thread to wait for
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfThread_Wait(sfThread* Thread); CSFML_API void sfThread_Wait(sfThread* thread);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Terminate a thread /// Terminate a thread
@ -71,10 +71,10 @@ CSFML_API void sfThread_Wait(sfThread* Thread);
/// you should rather try to make the thread function /// you should rather try to make the thread function
/// terminate by itself /// terminate by itself
/// ///
/// \param Thread : Thread to terminate /// \param thread : Thread to terminate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfThread_Terminate(sfThread* Thread); CSFML_API void sfThread_Terminate(sfThread* thread);
#endif // SFML_THREAD_H #endif // SFML_THREAD_H

View File

@ -43,19 +43,19 @@ CSFML_API sfContext* sfContext_Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing context /// Destroy an existing context
/// ///
/// \param Context : Context to destroy /// \param context : Context to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfContext_Destroy(sfContext* Context); CSFML_API void sfContext_Destroy(sfContext* context);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a context /// Activate or deactivate a context
/// ///
/// \param Context : Context to activate or deactivate /// \param context : Context to activate or deactivate
/// \param Active : sfTrue to activate, sfFalse to deactivate /// \param active : sfTrue to activate, sfFalse to deactivate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfContext_SetActive(sfContext* Context, sfBool Active); CSFML_API void sfContext_SetActive(sfContext* context, sfBool active);
#endif // SFML_CONTEXT_H #endif // SFML_CONTEXT_H

View File

@ -35,68 +35,68 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a key /// Get the state of a key
/// ///
/// \param Input : Input object /// \param input : Input object
/// \param KeyCode : Key to check /// \param code : Key to check
/// ///
/// \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 KeyCode); CSFML_API sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a mouse button /// Get the state of a mouse button
/// ///
/// \param Input : Input object /// \param input : Input object
/// \param Button : Button to check /// \param button : Button to check
/// ///
/// \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(sfInput* input, sfMouseButton button);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a joystick button /// Get the state of a joystick button
/// ///
/// \param Input : Input object /// \param input : Input object
/// \param JoyId : Identifier of the joystick to check (0 or 1) /// \param joyId : Identifier of the joystick to check (0 or 1)
/// \param Button : Button to check /// \param button : Button to check
/// ///
/// \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(sfInput* input, unsigned int joyId, unsigned int button);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse X position /// Get the mouse X position
/// ///
/// \param Input : Input object /// \param input : Input object
/// ///
/// \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(sfInput* input);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse Y position /// Get the mouse Y position
/// ///
/// \param Input : Input object /// \param input : Input object
/// ///
/// \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(sfInput* input);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the joystick position on a given axis /// Get the joystick position on a given axis
/// ///
/// \param Input : Input object /// \param input : Input object
/// \param JoyId : Identifier of the joystick to check (0 or 1) /// \param joyId : Identifier of the joystick to check (0 or 1)
/// \param Axis : Identifier of the axis to read /// \param axis : Identifier of the axis to read
/// ///
/// \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(sfInput* input, unsigned int joyId, sfJoyAxis axis);
#endif // SFML_INPUT_H #endif // SFML_INPUT_H

View File

@ -56,12 +56,12 @@ CSFML_API sfVideoMode sfVideoMode_GetDesktopMode();
/// Index must be in range [0, GetModesCount()[ /// Index must be in range [0, GetModesCount()[
/// Modes are sorted from best to worst /// Modes are sorted from best to worst
/// ///
/// \param Index : Index of video mode to get /// \param index : Index of video mode to get
/// ///
/// \return Corresponding video mode (invalid mode if index is out of range) /// \return Corresponding video mode (invalid mode if index is out of range)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfVideoMode sfVideoMode_GetMode(size_t Index); CSFML_API sfVideoMode sfVideoMode_GetMode(size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get valid video modes count /// Get valid video modes count
@ -74,13 +74,13 @@ CSFML_API size_t sfVideoMode_GetModesCount();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a video mode is supported /// Tell whether or not a video mode is supported
/// ///
/// \param Mode : Video mode to check /// \param mode : Video mode to check
/// ///
/// ///
/// \return True if video mode is supported, false otherwise /// \return True if video mode is supported, false otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfVideoMode_IsValid(sfVideoMode Mode); CSFML_API sfBool sfVideoMode_IsValid(sfVideoMode mode);
#endif // SFML_VIDEOMODE_H #endif // SFML_VIDEOMODE_H

View File

@ -63,225 +63,224 @@ typedef struct
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new window /// Construct a new window
/// ///
/// \param Mode : Video mode to use /// \param mode : Video mode to use
/// \param Title : Title of the window /// \param title : Title of the window
/// \param Style : Window style /// \param style : Window style
/// \param Params : Creation settings /// \param settings : Creation settings
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfWindow* sfWindow_Create(sfVideoMode Mode, const char* Title, unsigned long Style, sfContextSettings Params); CSFML_API sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long style, sfContextSettings settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a window from an existing control /// Construct a window from an existing control
/// ///
/// \param Handle : Platform-specific handle of the control /// \param handle : Platform-specific handle of the control
/// \param Params : Creation settings /// \param settings : Creation settings
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle Handle, sfContextSettings Params); CSFML_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings settings);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing window /// Destroy an existing window
/// ///
/// \param Window : Window to destroy /// \param window : Window to destroy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_Destroy(sfWindow* Window); CSFML_API void sfWindow_Destroy(sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close a window (but doesn't destroy the internal data) /// Close a window (but doesn't destroy the internal data)
/// ///
/// \param Window : Window to close /// \param window : Window to close
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_Close(sfWindow* Window); CSFML_API void sfWindow_Close(sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a window is opened /// Tell whether or not a window is opened
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfWindow_IsOpened(sfWindow* Window); CSFML_API 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
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
/// \return Width in pixels /// \return Width in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfWindow_GetWidth(sfWindow* Window); CSFML_API 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
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API unsigned int sfWindow_GetHeight(sfWindow* Window); CSFML_API unsigned int sfWindow_GetHeight(sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
/// \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(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
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Event : Event to fill, if any /// \param event : Event to fill, if any
/// ///
/// \return sfTrue if an event was returned, sfFalse if events stack was empty /// \return sfTrue if an event was returned, sfFalse if events stack was empty
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfWindow_GetEvent(sfWindow* Window, sfEvent* Event); CSFML_API sfBool sfWindow_GetEvent(sfWindow* window, sfEvent* event);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable / disable vertical synchronization on a window /// Enable / disable vertical synchronization on a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Enabled : sfTrue to enable v-sync, sfFalse to deactivate /// \param enabled : sfTrue to enable v-sync, sfFalse to deactivate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_UseVerticalSync(sfWindow* Window, sfBool Enabled); CSFML_API void sfWindow_UseVerticalSync(sfWindow* window, sfBool enabled);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Show or hide the mouse cursor on a window /// Show or hide the mouse cursor on a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Show : sfTrue to show, sfFalse to hide /// \param show : sfTrue to show, sfFalse to hide
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_ShowMouseCursor(sfWindow* Window, sfBool Show); CSFML_API void sfWindow_ShowMouseCursor(sfWindow* window, sfBool show);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of the mouse cursor on a window /// Change the position of the mouse cursor on a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Left : Left coordinate of the cursor, relative to the window /// \param left : Left coordinate of the cursor, relative to the window
/// \param Top : Top coordinate of the cursor, relative to the window /// \param top : Top coordinate of the cursor, relative to the window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_SetCursorPosition(sfWindow* Window, unsigned int Left, unsigned int Top); CSFML_API void sfWindow_SetCursorPosition(sfWindow* window, unsigned int left, unsigned int Top);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of a window on screen. /// Change the position of a window on screen.
/// Only works for top-level windows /// Only works for top-level windows
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Left : Left position /// \param left : Left position
/// \param Top : Top position /// \param top : Top position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_SetPosition(sfWindow* Window, int Left, int Top); CSFML_API void sfWindow_SetPosition(sfWindow* window, int left, int top);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the size of the rendering region of a window /// Change the size of the rendering region of a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Width : New Width /// \param width : New Width
/// \param Height : New Height /// \param height : New Height
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_SetSize(sfWindow* Window, unsigned int Width, unsigned int Height); CSFML_API void sfWindow_SetSize(sfWindow* window, unsigned int width, unsigned int height);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Show or hide a window /// Show or hide a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param State : sfTrue to show, sfFalse to hide /// \param show : sfTrue to show, sfFalse to hide
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_Show(sfWindow* Window, sfBool State); CSFML_API void sfWindow_Show(sfWindow* window, sfBool show);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable automatic key-repeat for keydown events. /// Enable or disable automatic key-repeat for keydown events.
/// Automatic key-repeat is enabled by default /// Automatic key-repeat is enabled by default
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Enabled : sfTrue to enable, sfFalse to disable /// \param enabled : sfTrue to enable, sfFalse to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_EnableKeyRepeat(sfWindow* Window, sfBool Enabled); CSFML_API void sfWindow_EnableKeyRepeat(sfWindow* window, sfBool enabled);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the window's icon /// Change the window's icon
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Width : Icon's width, in pixels /// \param width : Icon's width, in pixels
/// \param Height : Icon's height, in pixels /// \param height : Icon's height, in pixels
/// \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, sfUint8* pixels);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a window as the current target for rendering /// Activate or deactivate a window as the current target for rendering
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Active : sfTrue to activate, sfFalse to deactivate /// \param active : sfTrue to activate, sfFalse to deactivate
/// ///
/// \return True if operation was successful, false otherwise /// \return True if operation was successful, false otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfWindow_SetActive(sfWindow* Window, sfBool Active); CSFML_API sfBool sfWindow_SetActive(sfWindow* window, sfBool active);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Display a window on screen /// Display a window on screen
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_Display(sfWindow* Window); CSFML_API void sfWindow_Display(sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the input manager of a window /// Get the input manager of a window
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
/// \return Reference to the input /// \return Reference to the input
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfInput* sfWindow_GetInput(sfWindow* Window); CSFML_API 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
/// ///
/// \param Window : Window object /// \param window : Window object
/// /// \param limit : Framerate limit, in frames per seconds (use 0 to disable limit)
/// \param Limit : Framerate limit, in frames per seconds (use 0 to disable limit)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_SetFramerateLimit(sfWindow* Window, unsigned int Limit); CSFML_API 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
/// ///
/// \param Window : Window object /// \param window : Window object
/// ///
/// \return Time elapsed, in seconds /// \return Time elapsed, in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API float sfWindow_GetFrameTime(sfWindow* Window); CSFML_API float sfWindow_GetFrameTime(sfWindow* window);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which /// Change the joystick threshold, ie. the value below which
/// no move event will be generated /// no move event will be generated
/// ///
/// \param Window : Window object /// \param window : Window object
/// \param Threshold : New threshold, in range [0, 100] /// \param threshold : New threshold, in range [0, 100]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfWindow_SetJoystickThreshold(sfWindow* Window, float Threshold); CSFML_API void sfWindow_SetJoystickThreshold(sfWindow* window, float threshold);
#endif // SFML_WINDOW_H #endif // SFML_WINDOW_H

View File

@ -33,9 +33,9 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the global volume of all the sounds /// Change the global volume of all the sounds
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfListener_SetGlobalVolume(float Volume) void sfListener_SetGlobalVolume(float volume)
{ {
sf::Listener::SetGlobalVolume(Volume); sf::Listener::SetGlobalVolume(volume);
} }
@ -51,23 +51,23 @@ float sfListener_GetGlobalVolume()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of the listener /// Change the position of the listener
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfListener_SetPosition(float PosX, float PosY, float PosZ) void sfListener_SetPosition(float x, float y, float PosZ)
{ {
sf::Listener::SetPosition(sf::Vector3f(PosX, PosY, PosZ)); sf::Listener::SetPosition(sf::Vector3f(x, y, PosZ));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current position of the listener /// Get the current position of the listener
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfListener_GetPosition(float* PosX, float* PosY, float* PosZ) void sfListener_GetPosition(float* x, float* y, float* z)
{ {
if (PosX && PosY && PosZ) if (x && y && z)
{ {
sf::Vector3f Position = sf::Listener::GetPosition(); sf::Vector3f position = sf::Listener::GetPosition();
*PosX = Position.x; *x = position.x;
*PosY = Position.y; *y = position.y;
*PosZ = Position.z; *z = position.z;
} }
} }
@ -76,9 +76,9 @@ void sfListener_GetPosition(float* PosX, float* PosY, float* PosZ)
/// Change the orientation of the listener (the point /// Change the orientation of the listener (the point
/// he must look at) /// he must look at)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfListener_SetTarget(float TargetX, float TargetY, float TargetZ) void sfListener_SetTarget(float x, float y, float z)
{ {
sf::Listener::SetTarget(sf::Vector3f(TargetX, TargetY, TargetZ)); sf::Listener::SetTarget(sf::Vector3f(x, y, z));
} }
@ -86,13 +86,13 @@ void sfListener_SetTarget(float TargetX, float TargetY, float TargetZ)
/// Get the current orientation of the listener (the point /// Get the current orientation of the listener (the point
/// he's looking at) /// he's looking at)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfListener_GetTarget(float* TargetX, float* TargetY, float* TargetZ) void sfListener_GetTarget(float* x, float* y, float* z)
{ {
if (TargetX && TargetY && TargetZ) if (x && y && z)
{ {
sf::Vector3f Target = sf::Listener::GetTarget(); sf::Vector3f target = sf::Listener::GetTarget();
*TargetX = Target.x; *x = target.x;
*TargetY = Target.y; *y = target.y;
*TargetZ = Target.z; *z = target.z;
} }
} }

View File

@ -33,162 +33,162 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new music and load it from a file /// Create a new music and load it from a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfMusic* sfMusic_CreateFromFile(const char* Filename) sfMusic* sfMusic_CreateFromFile(const char* filename)
{ {
sfMusic* Music = new sfMusic; sfMusic* music = new sfMusic;
if (!Music->This.OpenFromFile(Filename)) if (!music->This.OpenFromFile(filename))
{ {
delete Music; delete music;
Music = NULL; music = NULL;
} }
return Music; return music;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new music and load it from a file in memory /// Create a new music and load it from a file in memory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfMusic* sfMusic_CreateFromMemory(const char* Data, size_t SizeInBytes) sfMusic* sfMusic_CreateFromMemory(const char* data, size_t sizeInBytes)
{ {
sfMusic* Music = new sfMusic; sfMusic* music = new sfMusic;
if (!Music->This.OpenFromMemory(Data, SizeInBytes)) if (!music->This.OpenFromMemory(data, sizeInBytes))
{ {
delete Music; delete music;
Music = NULL; music = NULL;
} }
return Music; return music;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing music /// Destroy an existing music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_Destroy(sfMusic* Music) void sfMusic_Destroy(sfMusic* music)
{ {
delete Music; delete music;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a music loop state /// Set a music loop state
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetLoop(sfMusic* Music, sfBool Loop) void sfMusic_SetLoop(sfMusic* music, sfBool loop)
{ {
CSFML_CALL(Music, SetLoop(Loop != 0)); CSFML_CALL(music, SetLoop(loop != 0));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a music is looping /// Tell whether or not a music is looping
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfMusic_GetLoop(sfMusic* Music) sfBool sfMusic_GetLoop(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetLoop(), sfFalse); CSFML_CALL_RETURN(music, GetLoop(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a music duration /// Get a music duration
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetDuration(sfMusic* Music) float sfMusic_GetDuration(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetDuration(), 0.f); CSFML_CALL_RETURN(music, GetDuration(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a music /// Start playing a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_Play(sfMusic* Music) void sfMusic_Play(sfMusic* music)
{ {
CSFML_CALL(Music, Play()); CSFML_CALL(music, Play());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Pause a music /// Pause a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_Pause(sfMusic* Music) void sfMusic_Pause(sfMusic* music)
{ {
CSFML_CALL(Music, Pause()); CSFML_CALL(music, Pause());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing a music /// Stop playing a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_Stop(sfMusic* Music) void sfMusic_Stop(sfMusic* music)
{ {
CSFML_CALL(Music, Stop()); CSFML_CALL(music, Stop());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetChannelsCount(), 0); CSFML_CALL_RETURN(music, GetChannelsCount(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetSampleRate(), 0); CSFML_CALL_RETURN(music, GetSampleRate(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfMusic* music)
{ {
CSFML_CHECK_RETURN(Music, sfStopped); CSFML_CHECK_RETURN(music, sfStopped);
return static_cast<sfSoundStatus>(Music->This.GetStatus()); return static_cast<sfSoundStatus>(music->This.GetStatus());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a music /// Get the current playing position of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetPlayingOffset(sfMusic* Music) float sfMusic_GetPlayingOffset(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetPlayingOffset(), 0.f); CSFML_CALL_RETURN(music, GetPlayingOffset(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a music /// Set the pitch of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetPitch(sfMusic* Music, float Pitch) void sfMusic_SetPitch(sfMusic* music, float pitch)
{ {
CSFML_CALL(Music, SetPitch(Pitch)); CSFML_CALL(music, SetPitch(pitch));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the volume of a music /// Set the volume of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetVolume(sfMusic* Music, float Volume) void sfMusic_SetVolume(sfMusic* music, float volume)
{ {
CSFML_CALL(Music, SetVolume(Volume)); CSFML_CALL(music, SetVolume(volume));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a music /// Set the position of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetPosition(sfMusic* Music, float X, float Y, float Z) void sfMusic_SetPosition(sfMusic* music, float x, float y, float z)
{ {
CSFML_CALL(Music, SetPosition(sf::Vector3f(X, Y, Z))); CSFML_CALL(music, SetPosition(sf::Vector3f(x, y, z)));
} }
@ -197,9 +197,9 @@ void sfMusic_SetPosition(sfMusic* Music, float X, float Y, float Z)
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetRelativeToListener(sfMusic* music, sfBool Relative) void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relative)
{ {
CSFML_CALL(music, SetRelativeToListener(Relative == sfTrue)); CSFML_CALL(music, SetRelativeToListener(relative == sfTrue));
} }
@ -208,9 +208,9 @@ void sfMusic_SetRelativeToListener(sfMusic* music, sfBool Relative)
/// the listener will hear the music at its maximum volume. /// the listener will hear the music at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetMinDistance(sfMusic* Music, float MinDistance) void sfMusic_SetMinDistance(sfMusic* music, float distance)
{ {
CSFML_CALL(Music, SetMinDistance(MinDistance)); CSFML_CALL(music, SetMinDistance(distance));
} }
@ -219,52 +219,52 @@ void sfMusic_SetMinDistance(sfMusic* Music, float MinDistance)
/// more the sound will be attenuated with distance from listener. /// more the sound will be attenuated with distance from listener.
/// The default attenuation factor 1.0 /// The default attenuation factor 1.0
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetAttenuation(sfMusic* Music, float Attenuation) void sfMusic_SetAttenuation(sfMusic* music, float attenuation)
{ {
CSFML_CALL(Music, SetAttenuation(Attenuation)); CSFML_CALL(music, SetAttenuation(attenuation));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of a stream /// Set the current playing position of a stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMusic_SetPlayingOffset(sfMusic* Music, float TimeOffset) void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset)
{ {
CSFML_CALL(Music, SetPlayingOffset(TimeOffset)); CSFML_CALL(music, SetPlayingOffset(timeOffset));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a music /// Get the pitch of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetPitch(sfMusic* Music) float sfMusic_GetPitch(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetPitch(), 0.f); CSFML_CALL_RETURN(music, GetPitch(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a music /// Get the volume of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetVolume(sfMusic* Music) float sfMusic_GetVolume(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetVolume(), 0.f); CSFML_CALL_RETURN(music, GetVolume(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfMusic* music, float* x, float* y, float* z)
{ {
CSFML_CHECK(Music); CSFML_CHECK(music);
if (X && Y && Z) if (x && y && z)
{ {
sf::Vector3f Position = Music->This.GetPosition(); sf::Vector3f position = music->This.GetPosition();
*X = Position.x; *x = position.x;
*Y = Position.y; *y = position.y;
*Z = Position.z; *z = position.z;
} }
} }
@ -273,25 +273,25 @@ 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(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, IsRelativeToListener(), sfFalse); CSFML_CALL_RETURN(music, IsRelativeToListener(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a music /// Get the minimum distance of a music
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetMinDistance(sfMusic* Music) float sfMusic_GetMinDistance(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 a
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfMusic_GetAttenuation(sfMusic* Music) float sfMusic_GetAttenuation(sfMusic* music)
{ {
CSFML_CALL_RETURN(Music, GetAttenuation(), 0.f); CSFML_CALL_RETURN(music, GetAttenuation(), 0.f);
} }

View File

@ -42,48 +42,48 @@ sfSound* sfSound_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound /// Destroy an existing sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_Destroy(sfSound* Sound) void sfSound_Destroy(sfSound* sound)
{ {
delete Sound; delete sound;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a sound /// Start playing a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_Play(sfSound* Sound) void sfSound_Play(sfSound* sound)
{ {
CSFML_CALL(Sound, Play()) CSFML_CALL(sound, Play())
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Pause a sound /// Pause a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_Pause(sfSound* Sound) void sfSound_Pause(sfSound* sound)
{ {
CSFML_CALL(Sound, Pause()) CSFML_CALL(sound, Pause())
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing a sound /// Stop playing a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_Stop(sfSound* Sound) void sfSound_Stop(sfSound* sound)
{ {
CSFML_CALL(Sound, Stop()) CSFML_CALL(sound, Stop())
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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, sfSoundBuffer* buffer)
{ {
if (Buffer) if (buffer)
{ {
CSFML_CALL(Sound, SetBuffer(Buffer->This)) CSFML_CALL(sound, SetBuffer(buffer->This))
Sound->Buffer = Buffer; sound->Buffer = buffer;
} }
} }
@ -91,67 +91,67 @@ 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) sfSoundBuffer* sfSound_GetBuffer(sfSound* sound)
{ {
CSFML_CHECK_RETURN(Sound, NULL) CSFML_CHECK_RETURN(sound, NULL)
return Sound->Buffer; return sound->Buffer;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a sound loop state /// Set a sound loop state
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetLoop(sfSound* Sound, sfBool Loop) void sfSound_SetLoop(sfSound* sound, sfBool loop)
{ {
CSFML_CALL(Sound, SetLoop(Loop == sfTrue)) CSFML_CALL(sound, SetLoop(loop == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a sound is looping /// Tell whether or not a sound is looping
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSound_GetLoop(sfSound* Sound) sfBool sfSound_GetLoop(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, GetLoop(), sfFalse) CSFML_CALL_RETURN(sound, GetLoop(), sfFalse)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSound* sound)
{ {
CSFML_CHECK_RETURN(Sound, sfStopped); CSFML_CHECK_RETURN(sound, sfStopped);
return static_cast<sfSoundStatus>(Sound->This.GetStatus()); return static_cast<sfSoundStatus>(sound->This.GetStatus());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a sound /// Set the pitch of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetPitch(sfSound* Sound, float Pitch) void sfSound_SetPitch(sfSound* sound, float pitch)
{ {
CSFML_CALL(Sound, SetPitch(Pitch)) CSFML_CALL(sound, SetPitch(pitch))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the volume of a sound /// Set the volume of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetVolume(sfSound* Sound, float Volume) void sfSound_SetVolume(sfSound* sound, float volume)
{ {
CSFML_CALL(Sound, SetVolume(Volume)) CSFML_CALL(sound, SetVolume(volume))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a sound /// Set the position of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetPosition(sfSound* Sound, float X, float Y, float Z) void sfSound_SetPosition(sfSound* sound, float x, float y, float z)
{ {
CSFML_CALL(Sound, SetPosition(sf::Vector3f(X, Y, Z))) CSFML_CALL(sound, SetPosition(sf::Vector3f(x, y, z)))
} }
@ -160,9 +160,9 @@ void sfSound_SetPosition(sfSound* Sound, float X, float Y, float Z)
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetRelativeToListener(sfSound* Sound, sfBool Relative) void sfSound_SetRelativeToListener(sfSound* sound, sfBool relative)
{ {
CSFML_CALL(Sound, SetRelativeToListener(Relative == sfTrue)); CSFML_CALL(sound, SetRelativeToListener(relative == sfTrue));
} }
@ -171,9 +171,9 @@ void sfSound_SetRelativeToListener(sfSound* Sound, sfBool Relative)
/// the listener will hear the sound at its maximum volume. /// the listener will hear the sound at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetMinDistance(sfSound* Sound, float MinDistance) void sfSound_SetMinDistance(sfSound* sound, float distance)
{ {
CSFML_CALL(Sound, SetMinDistance(MinDistance)); CSFML_CALL(sound, SetMinDistance(distance));
} }
@ -182,50 +182,50 @@ void sfSound_SetMinDistance(sfSound* Sound, float MinDistance)
/// more the sound will be attenuated with distance from listener. /// more the sound will be attenuated with distance from listener.
/// The default attenuation factor is 1.0 /// The default attenuation factor is 1.0
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetAttenuation(sfSound* Sound, float Attenuation) void sfSound_SetAttenuation(sfSound* sound, float attenuation)
{ {
CSFML_CALL(Sound, SetAttenuation(Attenuation)); CSFML_CALL(sound, SetAttenuation(attenuation));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of a sound /// Set the current playing position of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSound_SetPlayingOffset(sfSound* Sound, float TimeOffset) void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset)
{ {
CSFML_CALL(Sound, SetPlayingOffset(TimeOffset)); CSFML_CALL(sound, SetPlayingOffset(timeOffset));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a sound /// Get the pitch of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetPitch(sfSound* Sound) float sfSound_GetPitch(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, GetPitch(), 0.f) CSFML_CALL_RETURN(sound, GetPitch(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound /// Get the volume of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetVolume(sfSound* Sound) float sfSound_GetVolume(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, GetVolume(), 0.f) CSFML_CALL_RETURN(sound, GetVolume(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSound* sound, float* x, float* y, float* z)
{ {
CSFML_CHECK(Sound); CSFML_CHECK(sound);
sf::Vector3f Position = Sound->This.GetPosition(); sf::Vector3f position = sound->This.GetPosition();
if (X) *X = Position.x; if (x) *x = position.x;
if (Y) *Y = Position.y; if (y) *y = position.y;
if (Z) *Z = Position.z; if (z) *z = position.z;
} }
@ -233,34 +233,34 @@ 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(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, IsRelativeToListener(), sfFalse); CSFML_CALL_RETURN(sound, IsRelativeToListener(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound /// Get the minimum distance of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetMinDistance(sfSound* Sound) float sfSound_GetMinDistance(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, GetMinDistance(), 0.f); CSFML_CALL_RETURN(sound, GetMinDistance(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound /// Get the attenuation factor of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetAttenuation(sfSound* Sound) float sfSound_GetAttenuation(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, GetAttenuation(), 0.f); CSFML_CALL_RETURN(sound, GetAttenuation(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of a sound /// Get the current playing position of a sound
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSound_GetPlayingOffset(sfSound* Sound) float sfSound_GetPlayingOffset(sfSound* sound)
{ {
CSFML_CALL_RETURN(Sound, GetPlayingOffset(), 0.f) CSFML_CALL_RETURN(sound, GetPlayingOffset(), 0.f)
} }

View File

@ -33,34 +33,34 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file /// Create a new sound buffer and load it from a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* Filename) sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename)
{ {
sfSoundBuffer* Buffer = new sfSoundBuffer; sfSoundBuffer* buffer = new sfSoundBuffer;
if (!Buffer->This.LoadFromFile(Filename)) if (!buffer->This.LoadFromFile(filename))
{ {
delete Buffer; delete buffer;
Buffer = NULL; buffer = NULL;
} }
return Buffer; return buffer;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file in memory /// Create a new sound buffer and load it from a file in memory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const char* Data, size_t SizeInBytes) sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const char* data, size_t sizeInBytes)
{ {
sfSoundBuffer* Buffer = new sfSoundBuffer; sfSoundBuffer* buffer = new sfSoundBuffer;
if (!Buffer->This.LoadFromMemory(Data, SizeInBytes)) if (!buffer->This.LoadFromMemory(data, sizeInBytes))
{ {
delete Buffer; delete buffer;
Buffer = NULL; buffer = NULL;
} }
return Buffer; return buffer;
} }
@ -69,78 +69,78 @@ sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const char* Data, size_t SizeInByt
/// samples in memory - assumed format for samples is /// samples in memory - assumed format for samples is
/// 16 bits signed integer /// 16 bits signed integer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* Samples, size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate) sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate)
{ {
sfSoundBuffer* Buffer = new sfSoundBuffer; sfSoundBuffer* buffer = new sfSoundBuffer;
if (!Buffer->This.LoadFromSamples(Samples, SamplesCount, ChannelsCount, SampleRate)) if (!buffer->This.LoadFromSamples(samples, samplesCount, channelsCount, sampleRate))
{ {
delete Buffer; delete buffer;
Buffer = NULL; buffer = NULL;
} }
return Buffer; return buffer;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer /// Destroy an existing sound buffer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundBuffer_Destroy(sfSoundBuffer* SoundBuffer) void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer)
{ {
delete SoundBuffer; delete 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(sfSoundBuffer* soundBuffer, const char* filename)
{ {
CSFML_CALL_RETURN(SoundBuffer, SaveToFile(Filename), sfFalse) CSFML_CALL_RETURN(soundBuffer, SaveToFile(filename), sfFalse)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(SoundBuffer, GetSamples(), NULL) CSFML_CALL_RETURN(soundBuffer, GetSamples(), NULL)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(SoundBuffer, GetSamplesCount(), 0) CSFML_CALL_RETURN(soundBuffer, GetSamplesCount(), 0)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(SoundBuffer, GetSampleRate(), 0) CSFML_CALL_RETURN(soundBuffer, GetSampleRate(), 0)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(SoundBuffer, GetChannelsCount(), 0) CSFML_CALL_RETURN(soundBuffer, GetChannelsCount(), 0)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer /// Get the duration of a sound buffer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundBuffer_GetDuration(sfSoundBuffer* SoundBuffer) float sfSoundBuffer_GetDuration(sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(SoundBuffer, GetDuration(), 0.f) CSFML_CALL_RETURN(soundBuffer, GetDuration(), 0.f)
} }

View File

@ -42,9 +42,9 @@ sfSoundBufferRecorder* sfSoundBufferRecorder_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer recorder /// Destroy an existing sound buffer recorder
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* SoundBufferRecorder) void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundBufferRecorder)
{ {
delete SoundBufferRecorder; delete soundBufferRecorder;
} }
@ -52,27 +52,27 @@ void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* SoundBufferRecorder)
/// Start the capture. /// Start the capture.
/// Warning : only one capture can happen at the same time /// Warning : only one capture can happen at the same time
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* SoundBufferRecorder, unsigned int SampleRate) void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
{ {
CSFML_CALL(SoundBufferRecorder, Start(SampleRate)); CSFML_CALL(soundBufferRecorder, Start(sampleRate));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop the capture /// Stop the capture
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* SoundBufferRecorder) void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder)
{ {
CSFML_CALL(SoundBufferRecorder, Stop()); CSFML_CALL(soundBufferRecorder, Stop());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundBufferRecorder* soundBufferRecorder)
{ {
CSFML_CALL_RETURN(SoundBufferRecorder, GetSampleRate(), 0); CSFML_CALL_RETURN(soundBufferRecorder, GetSampleRate(), 0);
} }
@ -80,11 +80,11 @@ 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) sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(sfSoundBufferRecorder* soundBufferRecorder)
{ {
CSFML_CHECK_RETURN(SoundBufferRecorder, NULL); CSFML_CHECK_RETURN(soundBufferRecorder, NULL);
SoundBufferRecorder->SoundBuffer.This = SoundBufferRecorder->This.GetBuffer(); soundBufferRecorder->SoundBuffer.This = soundBufferRecorder->This.GetBuffer();
return &SoundBufferRecorder->SoundBuffer; return &soundBufferRecorder->SoundBuffer;
} }

View File

@ -34,21 +34,21 @@
/// Construct a new sound recorder with callback functions /// Construct a new sound recorder with callback functions
/// for processing captured samples /// for processing captured samples
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback OnStart, sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart,
sfSoundRecorderProcessCallback OnProcess, sfSoundRecorderProcessCallback onProcess,
sfSoundRecorderStopCallback OnStop, sfSoundRecorderStopCallback onStop,
void* UserData) void* userData)
{ {
return new sfSoundRecorder(OnStart, OnProcess, OnStop, UserData); return new sfSoundRecorder(onStart, onProcess, onStop, userData);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound recorder /// Destroy an existing sound recorder
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundRecorder_Destroy(sfSoundRecorder* SoundRecorder) void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder)
{ {
delete SoundRecorder; delete soundRecorder;
} }
@ -56,27 +56,27 @@ void sfSoundRecorder_Destroy(sfSoundRecorder* SoundRecorder)
/// Start the capture. /// Start the capture.
/// Warning : only one capture can happen at the same time /// Warning : only one capture can happen at the same time
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundRecorder_Start(sfSoundRecorder* SoundRecorder, unsigned int SampleRate) void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
{ {
CSFML_CALL(SoundRecorder, Start(SampleRate)); CSFML_CALL(soundRecorder, Start(sampleRate));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop the capture /// Stop the capture
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundRecorder_Stop(sfSoundRecorder* SoundRecorder) void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder)
{ {
CSFML_CALL(SoundRecorder, Stop()); CSFML_CALL(soundRecorder, Stop());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundRecorder* soundRecorder)
{ {
CSFML_CALL_RETURN(SoundRecorder, GetSampleRate(), 0); CSFML_CALL_RETURN(soundRecorder, GetSampleRate(), 0);
} }

View File

@ -33,60 +33,60 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new sound stream /// Construct a new sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback OnGetData, sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
sfSoundStreamSeekCallback OnSeek, sfSoundStreamSeekCallback onSeek,
unsigned int ChannelsCount, unsigned int channelsCount,
unsigned int SampleRate, unsigned int sampleRate,
void* UserData) void* userData)
{ {
return new sfSoundStream(OnGetData, OnSeek, ChannelsCount, SampleRate, UserData); return new sfSoundStream(onGetData, onSeek, channelsCount, sampleRate, userData);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sound stream /// Destroy an existing sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_Destroy(sfSoundStream* SoundStream) void sfSoundStream_Destroy(sfSoundStream* soundStream)
{ {
delete SoundStream; delete soundStream;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start playing a sound stream /// Start playing a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_Play(sfSoundStream* SoundStream) void sfSoundStream_Play(sfSoundStream* soundStream)
{ {
CSFML_CALL(SoundStream, Play()); CSFML_CALL(soundStream, Play());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Pause a sound stream /// Pause a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_Pause(sfSoundStream* SoundStream) void sfSoundStream_Pause(sfSoundStream* soundStream)
{ {
CSFML_CALL(SoundStream, Pause()); CSFML_CALL(soundStream, Pause());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing a sound stream /// Stop playing a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_Stop(sfSoundStream* SoundStream) void sfSoundStream_Stop(sfSoundStream* soundStream)
{ {
CSFML_CALL(SoundStream, Stop()); CSFML_CALL(soundStream, Stop());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundStream* soundStream)
{ {
CSFML_CHECK_RETURN(SoundStream, sfStopped); CSFML_CHECK_RETURN(soundStream, sfStopped);
return static_cast<sfSoundStatus>(SoundStream->This.GetStatus()); return static_cast<sfSoundStatus>(soundStream->This.GetStatus());
} }
@ -94,45 +94,45 @@ 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(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetChannelsCount(), 0); CSFML_CALL_RETURN(soundStream, GetChannelsCount(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetSampleRate(), 0); CSFML_CALL_RETURN(soundStream, GetSampleRate(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the pitch of a sound stream /// Set the pitch of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetPitch(sfSoundStream* SoundStream, float Pitch) void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pitch)
{ {
CSFML_CALL(SoundStream, SetPitch(Pitch)); CSFML_CALL(soundStream, SetPitch(pitch));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the volume of a sound stream /// Set the volume of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetVolume(sfSoundStream* SoundStream, float Volume) void sfSoundStream_SetVolume(sfSoundStream* soundStream, float volume)
{ {
CSFML_CALL(SoundStream, SetVolume(Volume)); CSFML_CALL(soundStream, SetVolume(volume));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a sound stream /// Set the position of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetPosition(sfSoundStream* SoundStream, float X, float Y, float Z) void sfSoundStream_SetPosition(sfSoundStream* soundStream, float x, float y, float z)
{ {
CSFML_CALL(SoundStream, SetPosition(X, Y, Z)); CSFML_CALL(soundStream, SetPosition(x, y, z));
} }
@ -141,9 +141,9 @@ void sfSoundStream_SetPosition(sfSoundStream* SoundStream, float X, float Y, flo
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetRelativeToListener(sfSoundStream* SoundStream, sfBool Relative) void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStream, sfBool relative)
{ {
CSFML_CALL(SoundStream, SetRelativeToListener(Relative == sfTrue)); CSFML_CALL(soundStream, SetRelativeToListener(relative == sfTrue));
} }
@ -152,9 +152,9 @@ void sfSoundStream_SetRelativeToListener(sfSoundStream* SoundStream, sfBool Rela
/// the listener will hear the sound stream at its maximum volume. /// the listener will hear the sound stream at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetMinDistance(sfSoundStream* SoundStream, float MinDistance) void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, float distance)
{ {
CSFML_CALL(SoundStream, SetMinDistance(MinDistance)); CSFML_CALL(soundStream, SetMinDistance(distance));
} }
@ -163,59 +163,59 @@ void sfSoundStream_SetMinDistance(sfSoundStream* SoundStream, float MinDistance)
/// more the sound stream will be attenuated with distance from listener. /// more the sound stream will be attenuated with distance from listener.
/// The default attenuation factor 1.0 /// The default attenuation factor 1.0
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetAttenuation(sfSoundStream* SoundStream, float Attenuation) void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation)
{ {
CSFML_CALL(SoundStream, SetAttenuation(Attenuation)); CSFML_CALL(soundStream, SetAttenuation(attenuation));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of a stream /// Set the current playing position of a stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetPlayingOffset(sfSoundStream* SoundStream, float TimeOffset) void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, float timeOffset)
{ {
CSFML_CALL(SoundStream, SetPlayingOffset(TimeOffset)); CSFML_CALL(soundStream, SetPlayingOffset(timeOffset));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a stream loop state /// Set a stream loop state
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSoundStream_SetLoop(sfSoundStream* SoundStream, sfBool Loop) void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop)
{ {
CSFML_CALL(SoundStream, SetLoop(Loop == sfTrue)); CSFML_CALL(soundStream, SetLoop(loop == sfTrue));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the pitch of a sound stream /// Get the pitch of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetPitch(sfSoundStream* SoundStream) float sfSoundStream_GetPitch(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetPitch(), 0.f); CSFML_CALL_RETURN(soundStream, GetPitch(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the volume of a sound stream /// Get the volume of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetVolume(sfSoundStream* SoundStream) float sfSoundStream_GetVolume(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetVolume(), 0.f); CSFML_CALL_RETURN(soundStream, GetVolume(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundStream* soundStream, float* x, float* y, float* z)
{ {
CSFML_CHECK(SoundStream); CSFML_CHECK(soundStream);
sf::Vector3f Position = SoundStream->This.GetPosition(); sf::Vector3f position = soundStream->This.GetPosition();
if (X) *X = Position.x; if (x) *x = position.x;
if (Y) *Y = Position.y; if (y) *y = position.y;
if (Z) *Z = Position.z; if (z) *z = position.z;
} }
@ -223,43 +223,43 @@ 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(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, IsRelativeToListener(), sfFalse); CSFML_CALL_RETURN(soundStream, IsRelativeToListener(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound stream /// Get the minimum distance of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetMinDistance(sfSoundStream* SoundStream) float sfSoundStream_GetMinDistance(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetMinDistance(), 0.f); CSFML_CALL_RETURN(soundStream, GetMinDistance(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound stream /// Get the attenuation factor of a sound stream
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSoundStream_GetAttenuation(sfSoundStream* SoundStream) float sfSoundStream_GetAttenuation(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetAttenuation(), 0.f); CSFML_CALL_RETURN(soundStream, GetAttenuation(), 0.f);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a stream is looping /// Tell whether or not a stream is looping
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSoundStream_GetLoop(sfSoundStream* SoundStream) sfBool sfSoundStream_GetLoop(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetLoop(), sfFalse); CSFML_CALL_RETURN(soundStream, GetLoop(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSoundStream* soundStream)
{ {
CSFML_CALL_RETURN(SoundStream, GetPlayingOffset(), 0.f); CSFML_CALL_RETURN(soundStream, GetPlayingOffset(), 0.f);
} }

View File

@ -46,51 +46,57 @@ sfColor sfCyan = { 0, 255, 255, 255};
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a color from its 3 RGB components /// Construct a color from its 3 RGB components
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfColor_FromRGB(sfUint8 R, sfUint8 G, sfUint8 B) sfColor sfColor_FromRGB(sfUint8 red, sfUint8 green, sfUint8 blue)
{ {
return sfColor_FromRGBA(R, G, B, 255); return sfColor_FromRGBA(red, green, blue, 255);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a color from its 4 RGBA components /// Construct a color from its 4 RGBA components
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfColor_FromRGBA(sfUint8 R, sfUint8 G, sfUint8 B, sfUint8 A) sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
{ {
sfColor Color; sfColor color;
Color.r = R; color.r = red;
Color.g = G; color.g = green;
Color.b = B; color.b = blue;
Color.a = A; color.a = alpha;
return Color; return color;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add two colors /// Add two colors
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfColor_Add(sfColor Color1, sfColor Color2) sfColor sfColor_Add(sfColor color1, sfColor color2)
{ {
int R = std::min(Color1.r + Color2.r, 255); int red = std::min(color1.r + color2.r, 255);
int G = std::min(Color1.g + Color2.g, 255); int green = std::min(color1.g + color2.g, 255);
int B = std::min(Color1.b + Color2.b, 255); int blue = std::min(color1.b + color2.b, 255);
int A = std::min(Color1.a + Color2.a, 255); int alpha = std::min(color1.a + color2.a, 255);
return sfColor_FromRGBA(static_cast<sfUint8>(R), static_cast<sfUint8>(G), static_cast<sfUint8>(B), static_cast<sfUint8>(A)); return sfColor_FromRGBA(static_cast<sfUint8>(red),
static_cast<sfUint8>(green),
static_cast<sfUint8>(blue),
static_cast<sfUint8>(alpha));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Modulate two colors /// Modulate two colors
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfColor_Modulate(sfColor Color1, sfColor Color2) sfColor sfColor_Modulate(sfColor color1, sfColor color2)
{ {
int R = Color1.r * Color2.r / 255; int red = color1.r * color2.r / 255;
int G = Color1.g * Color2.g / 255; int green = color1.g * color2.g / 255;
int B = Color1.b * Color2.b / 255; int blue = color1.b * color2.b / 255;
int A = Color1.a * Color2.a / 255; int alpha = color1.a * color2.a / 255;
return sfColor_FromRGBA(static_cast<sfUint8>(R), static_cast<sfUint8>(G), static_cast<sfUint8>(B), static_cast<sfUint8>(A)); return sfColor_FromRGBA(static_cast<sfUint8>(red),
static_cast<sfUint8>(green),
static_cast<sfUint8>(blue),
static_cast<sfUint8>(alpha));
} }

View File

@ -42,55 +42,55 @@ sfFont* sfFont_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new font from a file /// Create a new font from a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFont* sfFont_CreateFromFile(const char* Filename, unsigned int CharSize, const sfUint32* Charset) sfFont* sfFont_CreateFromFile(const char* filename, unsigned int charSize, const sfUint32* charset)
{ {
sfFont* Font = new sfFont; sfFont* font = new sfFont;
bool bSucceeded = false; bool success = false;
if (Charset) if (charset)
bSucceeded = Font->This.LoadFromFile(Filename, CharSize, Charset); success = font->This.LoadFromFile(filename, charSize, charset);
else else
bSucceeded = Font->This.LoadFromFile(Filename, CharSize); success = font->This.LoadFromFile(filename, charSize);
if (!bSucceeded) if (!success)
{ {
delete Font; delete font;
Font = NULL; font = NULL;
} }
return Font; return font;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new font from a file in memory /// Create a new font from a file in memory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFont* sfFont_CreateFromMemory(const char* Data, size_t SizeInBytes, unsigned int CharSize, const sfUint32* Charset) sfFont* sfFont_CreateFromMemory(const char* data, size_t sizeInBytes, unsigned int charSize, const sfUint32* charset)
{ {
sfFont* Font = new sfFont; sfFont* font = new sfFont;
bool bSucceeded = false; bool success = false;
if (Charset) if (charset)
bSucceeded = Font->This.LoadFromMemory(Data, SizeInBytes, CharSize, Charset); success = font->This.LoadFromMemory(data, sizeInBytes, charSize, charset);
else else
bSucceeded = Font->This.LoadFromMemory(Data, SizeInBytes, CharSize); success = font->This.LoadFromMemory(data, sizeInBytes, charSize);
if (!bSucceeded) if (!success)
{ {
delete Font; delete font;
Font = NULL; font = NULL;
} }
return Font; return font;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing font /// Destroy an existing font
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFont_Destroy(sfFont* Font) void sfFont_Destroy(sfFont* font)
{ {
delete Font; delete font;
} }
@ -98,9 +98,9 @@ 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(sfFont* font)
{ {
CSFML_CALL_RETURN(Font, GetCharacterSize(), 0); CSFML_CALL_RETURN(font, GetCharacterSize(), 0);
} }
@ -109,7 +109,7 @@ unsigned int sfFont_GetCharacterSize(sfFont* Font)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFont* sfFont_GetDefaultFont() sfFont* sfFont_GetDefaultFont()
{ {
static sfFont DefaultFont = {sf::Font::GetDefaultFont()}; static sfFont defaultFont = {sf::Font::GetDefaultFont()};
return &DefaultFont; return &defaultFont;
} }

View File

@ -43,96 +43,96 @@ sfImage* sfImage_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image filled with a color /// Create a new image filled with a color
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfImage_CreateFromColor(unsigned int Width, unsigned int Height, sfColor Color) sfImage* sfImage_CreateFromColor(unsigned int width, unsigned int height, sfColor color)
{ {
sfImage* Image = new sfImage; sfImage* image = new sfImage;
if (!Image->This->Create(Width, Height, sf::Color(Color.r, Color.g, Color.b, Color.a))) if (!image->This->Create(width, height, sf::Color(color.r, color.g, color.b, color.a)))
{ {
delete Image; delete image;
Image = NULL; image = NULL;
} }
return Image; return image;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image from an array of pixels in memory /// Create a new image from an array of pixels in memory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfImage_CreateFromPixels(unsigned int Width, unsigned int Height, const sfUint8* Data) sfImage* sfImage_CreateFromPixels(unsigned int width, unsigned int height, const sfUint8* data)
{ {
sfImage* Image = new sfImage; sfImage* image = new sfImage;
if (!Image->This->LoadFromPixels(Width, Height, Data)) if (!image->This->LoadFromPixels(width, height, data))
{ {
delete Image; delete image;
Image = NULL; image = NULL;
} }
return Image; return image;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image from a file /// Create a new image from a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfImage_CreateFromFile(const char* Filename) sfImage* sfImage_CreateFromFile(const char* filename)
{ {
sfImage* Image = new sfImage; sfImage* image = new sfImage;
if (!Image->This->LoadFromFile(Filename)) if (!image->This->LoadFromFile(filename))
{ {
delete Image; delete image;
Image = NULL; image = NULL;
} }
return Image; return image;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new image from a file in memory /// Create a new image from a file in memory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfImage_CreateFromMemory(const char* Data, size_t SizeInBytes) sfImage* sfImage_CreateFromMemory(const char* data, size_t sizeInBytes)
{ {
sfImage* Image = new sfImage; sfImage* image = new sfImage;
if (!Image->This->LoadFromMemory(Data, SizeInBytes)) if (!image->This->LoadFromMemory(data, sizeInBytes))
{ {
delete Image; delete image;
Image = NULL; image = NULL;
} }
return Image; return image;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing image /// Destroy an existing image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_Destroy(sfImage* Image) void sfImage_Destroy(sfImage* image)
{ {
delete Image; delete 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(sfImage* image, const char* filename)
{ {
CSFML_CALL_PTR_RETURN(Image, SaveToFile(Filename), sfFalse); CSFML_CALL_PTR_RETURN(image, SaveToFile(filename), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a transparency mask for an image from a specified colorkey /// Create a transparency mask for an image from a specified colorkey
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_CreateMaskFromColor(sfImage* Image, sfColor ColorKey, sfUint8 Alpha) void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha)
{ {
sf::Color SFMLColor(ColorKey.r, ColorKey.g, ColorKey.b, ColorKey.a); sf::Color SFMLColor(colorKey.r, colorKey.g, colorKey.b, colorKey.a);
CSFML_CALL_PTR(Image, CreateMaskFromColor(SFMLColor, Alpha)); CSFML_CALL_PTR(image, CreateMaskFromColor(SFMLColor, alpha));
} }
@ -141,11 +141,11 @@ 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, 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);
CSFML_CALL_PTR(Image, Copy(*Source->This, DestX, DestY, SFMLRect)); CSFML_CALL_PTR(image, Copy(*source->This, destX, destY, SFMLRect));
} }
@ -153,11 +153,11 @@ void sfImage_Copy(sfImage* Image, sfImage* Source, unsigned int DestX, unsigned
/// Create the image from the current contents of the /// Create the image from the current contents of the
/// given window /// given window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API sfBool sfImage_CopyScreen(sfImage* Image, sfRenderWindow* Window, sfIntRect SourceRect) CSFML_API sfBool sfImage_CopyScreen(sfImage* image, sfRenderWindow* window, sfIntRect sourceRect)
{ {
CSFML_CHECK_RETURN(Window, sfFalse); CSFML_CHECK_RETURN(window, sfFalse);
sf::IntRect SFMLRect(SourceRect.Left, SourceRect.Top, SourceRect.Right, SourceRect.Bottom); sf::IntRect SFMLRect(sourceRect.Left, sourceRect.Top, sourceRect.Right, sourceRect.Bottom);
CSFML_CALL_PTR_RETURN(Image, CopyScreen(Window->This, SFMLRect), sfFalse); CSFML_CALL_PTR_RETURN(image, CopyScreen(window->This, SFMLRect), sfFalse);
} }
@ -165,22 +165,22 @@ CSFML_API sfBool sfImage_CopyScreen(sfImage* Image, sfRenderWindow* Window, sfIn
/// Change the color of a pixel of an image /// Change the color of a pixel of an image
/// Don't forget to call Update when you end modifying pixels /// Don't forget to call Update when you end modifying pixels
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_SetPixel(sfImage* Image, unsigned int X, unsigned int Y, sfColor Color) void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color)
{ {
sf::Color SFMLColor(Color.r, Color.g, Color.b, Color.a); sf::Color SFMLColor(color.r, color.g, color.b, color.a);
CSFML_CALL_PTR(Image, SetPixel(X, Y, SFMLColor)); CSFML_CALL_PTR(image, SetPixel(x, y, SFMLColor));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(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);
sf::Color SFMLColor = Image->This->GetPixel(X, Y); sf::Color SFMLColor = image->This->GetPixel(x, y);
return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a); return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a);
} }
@ -191,52 +191,52 @@ 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(sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(Image, GetPixelsPtr(), NULL); CSFML_CALL_PTR_RETURN(image, GetPixelsPtr(), NULL);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind the image for rendering /// Bind the image for rendering
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_Bind(sfImage* Image) void sfImage_Bind(sfImage* image)
{ {
CSFML_CALL_PTR(Image, Bind()); CSFML_CALL_PTR(image, Bind());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable image smooth filter /// Enable or disable image smooth filter
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfImage_SetSmooth(sfImage* Image, sfBool Smooth) void sfImage_SetSmooth(sfImage* image, sfBool smooth)
{ {
CSFML_CALL_PTR(Image, SetSmooth(Smooth == sfTrue)); CSFML_CALL_PTR(image, SetSmooth(smooth == sfTrue));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the width of the image /// Return the width of the image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfImage_GetWidth(sfImage* Image) unsigned int sfImage_GetWidth(sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(Image, GetWidth(), 0); CSFML_CALL_PTR_RETURN(image, GetWidth(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the height of the image /// Return the height of the image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfImage_GetHeight(sfImage* Image) unsigned int sfImage_GetHeight(sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(Image, GetHeight(), 0); CSFML_CALL_PTR_RETURN(image, GetHeight(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfImage* image)
{ {
CSFML_CALL_PTR_RETURN(Image, IsSmooth(), sfFalse); CSFML_CALL_PTR_RETURN(image, IsSmooth(), sfFalse);
} }

View File

@ -34,88 +34,88 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new post-fx from a file /// Create a new post-fx from a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfPostFX* sfPostFX_CreateFromFile(const char* Filename) sfPostFX* sfPostFX_CreateFromFile(const char* filename)
{ {
sfPostFX* PostFX = new sfPostFX; sfPostFX* postFX = new sfPostFX;
if (!PostFX->This.LoadFromFile(Filename)) if (!postFX->This.LoadFromFile(filename))
{ {
delete PostFX; delete postFX;
PostFX = NULL; postFX = NULL;
} }
return PostFX; return postFX;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new post-fx from an effect source code /// Create a new post-fx from an effect source code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfPostFX* sfPostFX_CreateFromMemory(const char* Effect) sfPostFX* sfPostFX_CreateFromMemory(const char* effect)
{ {
sfPostFX* PostFX = new sfPostFX; sfPostFX* postFX = new sfPostFX;
if (!PostFX->This.LoadFromMemory(Effect)) if (!postFX->This.LoadFromMemory(effect))
{ {
delete PostFX; delete postFX;
PostFX = NULL; postFX = NULL;
} }
return PostFX; return postFX;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing post-fx /// Destroy an existing post-fx
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPostFX_Destroy(sfPostFX* PostFX) void sfPostFX_Destroy(sfPostFX* postFX)
{ {
delete PostFX; delete postFX;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (1 float) /// Change a parameter of a post-fx (1 float)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPostFX_SetParameter1(sfPostFX* PostFX, const char* Name, float X) void sfPostFX_SetParameter1(sfPostFX* postFX, const char* name, float x)
{ {
CSFML_CALL(PostFX, SetParameter(Name, X)) CSFML_CALL(postFX, SetParameter(name, x))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (2 floats) /// Change a parameter of a post-fx (2 floats)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPostFX_SetParameter2(sfPostFX* PostFX, const char* Name, float X, float Y) void sfPostFX_SetParameter2(sfPostFX* postFX, const char* name, float x, float y)
{ {
CSFML_CALL(PostFX, SetParameter(Name, X, Y)) CSFML_CALL(postFX, SetParameter(name, x, y))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (3 floats) /// Change a parameter of a post-fx (3 floats)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPostFX_SetParameter3(sfPostFX* PostFX, const char* Name, float X, float Y, float Z) void sfPostFX_SetParameter3(sfPostFX* postFX, const char* name, float x, float y, float z)
{ {
CSFML_CALL(PostFX, SetParameter(Name, X, Y, Z)) CSFML_CALL(postFX, SetParameter(name, x, y, z))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of a post-fx (4 floats) /// Change a parameter of a post-fx (4 floats)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPostFX_SetParameter4(sfPostFX* PostFX, const char* Name, float X, float Y, float Z, float W) void sfPostFX_SetParameter4(sfPostFX* postFX, const char* name, float x, float y, float z, float w)
{ {
CSFML_CALL(PostFX, SetParameter(Name, X, Y, Z, W)) CSFML_CALL(postFX, SetParameter(name, x, y, z, w))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a texture parameter in a post-fx /// Set a texture parameter in a post-fx
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPostFX_SetTexture(sfPostFX* PostFX, const char* Name, sfImage* Texture) void sfPostFX_SetTexture(sfPostFX* postFX, const char* name, sfImage* texture)
{ {
CSFML_CALL(PostFX, SetTexture(Name, Texture ? Texture->This : NULL)) CSFML_CALL(postFX, SetTexture(name, texture ? texture->This : NULL))
} }

View File

@ -33,86 +33,86 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a rectangle by the given offset /// Move a rectangle by the given offset
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFloatRect_Offset(sfFloatRect* Rect, float OffsetX, float OffsetY) void sfFloatRect_Offset(sfFloatRect* rect, float offsetX, float offsetY)
{ {
CSFML_CHECK(Rect) CSFML_CHECK(rect)
Rect->Left += OffsetX; rect->Left += offsetX;
Rect->Right += OffsetX; rect->Right += offsetX;
Rect->Top += OffsetY; rect->Top += offsetY;
Rect->Bottom += OffsetY; rect->Bottom += offsetY;
} }
void sfIntRect_Offset(sfIntRect* Rect, int OffsetX, int OffsetY) void sfIntRect_Offset(sfIntRect* rect, int offsetX, int offsetY)
{ {
CSFML_CHECK(Rect) CSFML_CHECK(rect)
Rect->Left += OffsetX; rect->Left += offsetX;
Rect->Right += OffsetX; rect->Right += offsetX;
Rect->Top += OffsetY; rect->Top += offsetY;
Rect->Bottom += OffsetY; rect->Bottom += 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(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(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);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles /// Check intersection between two rectangles
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfFloatRect_Intersects(sfFloatRect* Rect1, sfFloatRect* Rect2, sfFloatRect* OverlappingRect) sfBool sfFloatRect_Intersects(sfFloatRect* rect1, sfFloatRect* rect2, sfFloatRect* intersection)
{ {
CSFML_CHECK_RETURN(Rect1, sfFalse) CSFML_CHECK_RETURN(rect1, sfFalse)
CSFML_CHECK_RETURN(Rect2, sfFalse) CSFML_CHECK_RETURN(rect2, sfFalse)
sf::FloatRect SFMLRect1(Rect1->Left, Rect1->Top, Rect1->Right, Rect1->Bottom); sf::FloatRect SFMLRect1(rect1->Left, rect1->Top, rect1->Right, rect1->Bottom);
sf::FloatRect SFMLRect2(Rect2->Left, Rect2->Top, Rect2->Right, Rect2->Bottom); sf::FloatRect SFMLRect2(rect2->Left, rect2->Top, rect2->Right, rect2->Bottom);
if (OverlappingRect) if (intersection)
{ {
sf::FloatRect Overlap; sf::FloatRect overlap;
bool Intersect = SFMLRect1.Intersects(SFMLRect2, Overlap); bool intersects = SFMLRect1.Intersects(SFMLRect2, overlap);
OverlappingRect->Left = Overlap.Left; intersection->Left = overlap.Left;
OverlappingRect->Top = Overlap.Top; intersection->Top = overlap.Top;
OverlappingRect->Right = Overlap.Right; intersection->Right = overlap.Right;
OverlappingRect->Bottom = Overlap.Bottom; intersection->Bottom = overlap.Bottom;
return Intersect; return intersects;
} }
else else
{ {
return SFMLRect1.Intersects(SFMLRect2); return SFMLRect1.Intersects(SFMLRect2);
} }
} }
sfBool sfIntRect_Intersects(sfIntRect* Rect1, sfIntRect* Rect2, sfIntRect* OverlappingRect) sfBool sfIntRect_Intersects(sfIntRect* rect1, sfIntRect* rect2, sfIntRect* intersection)
{ {
CSFML_CHECK_RETURN(Rect1, sfFalse) CSFML_CHECK_RETURN(rect1, sfFalse)
CSFML_CHECK_RETURN(Rect2, sfFalse) CSFML_CHECK_RETURN(rect2, sfFalse)
sf::IntRect SFMLRect1(Rect1->Left, Rect1->Top, Rect1->Right, Rect1->Bottom); sf::IntRect SFMLRect1(rect1->Left, rect1->Top, rect1->Right, rect1->Bottom);
sf::IntRect SFMLRect2(Rect2->Left, Rect2->Top, Rect2->Right, Rect2->Bottom); sf::IntRect SFMLRect2(rect2->Left, rect2->Top, rect2->Right, rect2->Bottom);
if (OverlappingRect) if (intersection)
{ {
sf::IntRect Overlap; sf::IntRect overlap;
bool Intersect = SFMLRect1.Intersects(SFMLRect2, Overlap); bool intersects = SFMLRect1.Intersects(SFMLRect2, overlap);
OverlappingRect->Left = Overlap.Left; intersection->Left = overlap.Left;
OverlappingRect->Top = Overlap.Top; intersection->Top = overlap.Top;
OverlappingRect->Right = Overlap.Right; intersection->Right = overlap.Right;
OverlappingRect->Bottom = Overlap.Bottom; intersection->Bottom = overlap.Bottom;
return Intersect; return intersects;
} }
else else
{ {

View File

@ -37,122 +37,122 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new renderimage /// Construct a new renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfRenderImage* sfRenderImage_Create(unsigned int Width, unsigned int Height, sfBool DepthBuffer) sfRenderImage* sfRenderImage_Create(unsigned int width, unsigned int height, sfBool depthBuffer)
{ {
sfRenderImage* RenderImage = new sfRenderImage; sfRenderImage* renderImage = new sfRenderImage;
RenderImage->This.Create(Width, Height, DepthBuffer == sfTrue); renderImage->This.Create(width, height, depthBuffer == sfTrue);
RenderImage->Target = new sfImage(const_cast<sf::Image*>(&RenderImage->This.GetImage())); renderImage->Target = new sfImage(const_cast<sf::Image*>(&renderImage->This.GetImage()));
RenderImage->DefaultView = new sfView(const_cast<sf::View*>(&RenderImage->This.GetDefaultView())); renderImage->DefaultView = new sfView(const_cast<sf::View*>(&renderImage->This.GetDefaultView()));
RenderImage->CurrentView = RenderImage->DefaultView; renderImage->CurrentView = renderImage->DefaultView;
return RenderImage; return renderImage;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing renderimage /// Destroy an existing renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_Destroy(sfRenderImage* RenderImage) void sfRenderImage_Destroy(sfRenderImage* renderImage)
{ {
delete RenderImage->DefaultView; delete renderImage->DefaultView;
delete RenderImage->Target; delete renderImage->Target;
delete RenderImage; delete 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(sfRenderImage* renderImage)
{ {
CSFML_CALL_RETURN(RenderImage, GetWidth(), 0); CSFML_CALL_RETURN(renderImage, GetWidth(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfRenderImage* renderImage)
{ {
CSFML_CALL_RETURN(RenderImage, GetHeight(), 0); CSFML_CALL_RETURN(renderImage, GetHeight(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a renderimage as the current target for rendering /// Set a renderimage as the current target for rendering
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfRenderImage_SetActive(sfRenderImage* RenderImage, sfBool Active) sfBool sfRenderImage_SetActive(sfRenderImage* renderImage, sfBool active)
{ {
CSFML_CALL_RETURN(RenderImage, SetActive(Active == sfTrue), sfFalse) CSFML_CALL_RETURN(renderImage, SetActive(active == sfTrue), sfFalse)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something on a renderimage /// Draw something on a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_DrawPostFX(sfRenderImage* RenderImage, sfPostFX* PostFX) void sfRenderImage_DrawPostFX(sfRenderImage* renderImage, sfPostFX* postFX)
{ {
CSFML_CHECK(PostFX); CSFML_CHECK(postFX);
CSFML_CALL(RenderImage, Draw(PostFX->This)); CSFML_CALL(renderImage, Draw(postFX->This));
} }
void sfRenderImage_DrawShape(sfRenderImage* RenderImage, sfShape* Shape) void sfRenderImage_DrawShape(sfRenderImage* renderImage, sfShape* shape)
{ {
CSFML_CHECK(Shape); CSFML_CHECK(shape);
CSFML_CALL(RenderImage, Draw(Shape->This)); CSFML_CALL(renderImage, Draw(shape->This));
} }
void sfRenderImage_DrawSprite(sfRenderImage* RenderImage, sfSprite* Sprite) void sfRenderImage_DrawSprite(sfRenderImage* renderImage, sfSprite* sprite)
{ {
CSFML_CHECK(Sprite); CSFML_CHECK(sprite);
CSFML_CALL(RenderImage, Draw(Sprite->This)); CSFML_CALL(renderImage, Draw(sprite->This));
} }
void sfRenderImage_DrawString(sfRenderImage* RenderImage, sfString* String) void sfRenderImage_DrawString(sfRenderImage* renderImage, sfString* string)
{ {
CSFML_CHECK(String); CSFML_CHECK(string);
CSFML_CALL(RenderImage, Draw(String->This)); CSFML_CALL(renderImage, Draw(string->This));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear the renderimage with the given color /// Clear the renderimage with the given color
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_Clear(sfRenderImage* RenderImage, sfColor Color) void sfRenderImage_Clear(sfRenderImage* renderImage, sfColor color)
{ {
sf::Color SFMLColor(Color.r, Color.g, Color.b, Color.a); sf::Color SFMLColor(color.r, color.g, color.b, color.a);
CSFML_CALL(RenderImage, Clear(SFMLColor)); CSFML_CALL(renderImage, Clear(SFMLColor));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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, sfView* view)
{ {
CSFML_CHECK(View); CSFML_CHECK(view);
CSFML_CALL(RenderImage, SetView(*View->This)); CSFML_CALL(renderImage, SetView(*view->This));
RenderImage->CurrentView = View; renderImage->CurrentView = 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(sfRenderImage* renderImage)
{ {
CSFML_CHECK_RETURN(RenderImage, NULL); CSFML_CHECK_RETURN(renderImage, NULL);
return RenderImage->CurrentView; return renderImage->CurrentView;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the default view of a renderimage /// Get the default view of a renderimage
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfView* sfRenderImage_GetDefaultView(sfRenderImage* RenderImage) sfView* sfRenderImage_GetDefaultView(sfRenderImage* renderImage)
{ {
CSFML_CHECK_RETURN(RenderImage, NULL); CSFML_CHECK_RETURN(renderImage, NULL);
return RenderImage->DefaultView; return renderImage->DefaultView;
} }
@ -164,20 +164,20 @@ sfView* sfRenderImage_GetDefaultView(sfRenderImage* RenderImage)
/// SFML to do internal optimizations and improve performances. /// SFML to do internal optimizations and improve performances.
/// This parameter is false by default /// This parameter is false by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRenderImage_PreserveOpenGLStates(sfRenderImage* RenderImage, sfBool Preserve) void sfRenderImage_PreserveOpenGLStates(sfRenderImage* renderImage, sfBool preserve)
{ {
CSFML_CALL(RenderImage, PreserveOpenGLStates(Preserve == sfTrue)); CSFML_CALL(renderImage, PreserveOpenGLStates(preserve == sfTrue));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the target image /// Get the target image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfRenderImage_GetImage(sfRenderImage* RenderImage) sfImage* sfRenderImage_GetImage(sfRenderImage* renderImage)
{ {
CSFML_CHECK_RETURN(RenderImage, NULL); CSFML_CHECK_RETURN(renderImage, NULL);
return RenderImage->Target; return renderImage->Target;
} }

View File

@ -43,114 +43,114 @@ sfShape* sfShape_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shape made of a single line /// Create a new shape made of a single line
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfShape* sfShape_CreateLine(float P1X, float P1Y, float P2X, float P2Y, float Thickness, sfColor Col, float Outline, sfColor OutlineCol) sfShape* sfShape_CreateLine(float p1x, float p1y, float p2x, float p2y, float thickness, sfColor color, float outline, sfColor outlineColor)
{ {
sf::Color Color(Col.r, Col.g, Col.b, Col.a); sf::Color SFMLColor(color.r, color.g, color.b, color.a);
sf::Color OutlineColor(OutlineCol.r, OutlineCol.g, OutlineCol.b, OutlineCol.a); sf::Color SFMLOutlineColor(outlineColor.r, outlineColor.g, outlineColor.b, outlineColor.a);
sfShape* Shape = new sfShape; sfShape* shape = new sfShape;
Shape->This = sf::Shape::Line(P1X, P1Y, P2X, P2Y, Thickness, Color, Outline, OutlineColor); shape->This = sf::Shape::Line(p1x, p1y, p2x, p2y, thickness, SFMLColor, outline, SFMLOutlineColor);
return Shape; return shape;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shape made of a single rectangle /// Create a new shape made of a single rectangle
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfShape* sfShape_CreateRectangle(float P1X, float P1Y, float P2X, float P2Y, sfColor Col, float Outline, sfColor OutlineCol) sfShape* sfShape_CreateRectangle(float p1x, float p1y, float p2x, float p2y, sfColor color, float outline, sfColor outlineColor)
{ {
sf::Color Color(Col.r, Col.g, Col.b, Col.a); sf::Color SFMLColor(color.r, color.g, color.b, color.a);
sf::Color OutlineColor(OutlineCol.r, OutlineCol.g, OutlineCol.b, OutlineCol.a); sf::Color SFMLOutlineColor(outlineColor.r, outlineColor.g, outlineColor.b, outlineColor.a);
sfShape* Shape = new sfShape; sfShape* shape = new sfShape;
Shape->This = sf::Shape::Rectangle(P1X, P1Y, P2X, P2Y, Color, Outline, OutlineColor); shape->This = sf::Shape::Rectangle(p1x, p1y, p2x, p2y, SFMLColor, outline, SFMLOutlineColor);
return Shape; return shape;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new shape made of a single circle /// Create a new shape made of a single circle
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfShape* sfShape_CreateCircle(float X, float Y, float Radius, sfColor Col, float Outline, sfColor OutlineCol) sfShape* sfShape_CreateCircle(float x, float y, float radius, sfColor color, float outline, sfColor outlineColor)
{ {
sf::Color Color(Col.r, Col.g, Col.b, Col.a); sf::Color SFMLColor(color.r, color.g, color.b, color.a);
sf::Color OutlineColor(OutlineCol.r, OutlineCol.g, OutlineCol.b, OutlineCol.a); sf::Color SFMLOutlineColor(outlineColor.r, outlineColor.g, outlineColor.b, outlineColor.a);
sfShape* Shape = new sfShape; sfShape* shape = new sfShape;
Shape->This = sf::Shape::Circle(X, Y, Radius, Color, Outline, OutlineColor); shape->This = sf::Shape::Circle(x, y, radius, SFMLColor, outline, SFMLOutlineColor);
return Shape; return shape;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing shape /// Destroy an existing shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_Destroy(sfShape* Shape) void sfShape_Destroy(sfShape* shape)
{ {
delete Shape; delete shape;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of a shape /// Set the X position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetX(sfShape* Shape, float X) void sfShape_SetX(sfShape* shape, float x)
{ {
CSFML_CALL(Shape, SetX(X)) CSFML_CALL(shape, SetX(x))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y position of a shape /// Set the Y position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetY(sfShape* Shape, float Y) void sfShape_SetY(sfShape* shape, float y)
{ {
CSFML_CALL(Shape, SetY(Y)) CSFML_CALL(shape, SetY(y))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a shape /// Set the position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetPosition(sfShape* Shape, float X, float Y) void sfShape_SetPosition(sfShape* shape, float x, float y)
{ {
CSFML_CALL(Shape, SetPosition(sf::Vector2f(X, Y))) CSFML_CALL(shape, SetPosition(sf::Vector2f(x, y)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the horizontal scale of a shape /// Set the horizontal scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetScaleX(sfShape* Shape, float Scale) void sfShape_SetScaleX(sfShape* shape, float scale)
{ {
CSFML_CALL(Shape, SetScaleX(Scale)) CSFML_CALL(shape, SetScaleX(scale))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the vertical scale of a shape /// Set the vertical scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetScaleY(sfShape* Shape, float Scale) void sfShape_SetScaleY(sfShape* shape, float scale)
{ {
CSFML_CALL(Shape, SetScaleY(Scale)) CSFML_CALL(shape, SetScaleY(scale))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of a shape /// Set the scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetScale(sfShape* Shape, float ScaleX, float ScaleY) void sfShape_SetScale(sfShape* shape, float scaleX, float scaleY)
{ {
CSFML_CALL(Shape, SetScale(sf::Vector2f(ScaleX, ScaleY))) CSFML_CALL(shape, SetScale(sf::Vector2f(scaleX, scaleY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of a shape /// Set the orientation of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetRotation(sfShape* Shape, float Rotation) void sfShape_SetRotation(sfShape* shape, float rotation)
{ {
CSFML_CALL(Shape, SetRotation(Rotation)) CSFML_CALL(shape, SetRotation(rotation))
} }
@ -158,102 +158,102 @@ void sfShape_SetRotation(sfShape* Shape, float Rotation)
/// Set the local origin of a shape, in coordinates /// Set the local origin of a shape, in coordinates
/// relative to its left-top corner /// relative to its left-top corner
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetOrigin(sfShape* Shape, float X, float Y) void sfShape_SetOrigin(sfShape* shape, float x, float y)
{ {
CSFML_CALL(Shape, SetOrigin(sf::Vector2f(X, Y))) CSFML_CALL(shape, SetOrigin(sf::Vector2f(x, y)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of a shape /// Set the color of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetColor(sfShape* Shape, sfColor Color) void sfShape_SetColor(sfShape* shape, sfColor color)
{ {
CSFML_CALL(Shape, SetColor(sf::Color(Color.r, Color.g, Color.b, Color.a))) CSFML_CALL(shape, SetColor(sf::Color(color.r, color.g, color.b, color.a)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for a shape /// Set the blending mode for a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetBlendMode(sfShape* Shape, sfBlendMode Mode) void sfShape_SetBlendMode(sfShape* shape, sfBlendMode mode)
{ {
CSFML_CALL(Shape, SetBlendMode(static_cast<sf::Blend::Mode>(Mode))) CSFML_CALL(shape, SetBlendMode(static_cast<sf::Blend::Mode>(mode)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a shape /// Get the X position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetX(sfShape* Shape) float sfShape_GetX(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetPosition().x, 0.f) CSFML_CALL_RETURN(shape, GetPosition().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a shape /// Get the Y position of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetY(sfShape* Shape) float sfShape_GetY(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetPosition().y, 0.f) CSFML_CALL_RETURN(shape, GetPosition().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a shape /// Get the horizontal scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetScaleX(sfShape* Shape) float sfShape_GetScaleX(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetScale().x, 0.f) CSFML_CALL_RETURN(shape, GetScale().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a shape /// Get the vertical scale of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetScaleY(sfShape* Shape) float sfShape_GetScaleY(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetScale().y, 0.f) CSFML_CALL_RETURN(shape, GetScale().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a shape /// Get the orientation of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetRotation(sfShape* Shape) float sfShape_GetRotation(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetRotation(), 0.f) CSFML_CALL_RETURN(shape, GetRotation(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetOrigin().x, 0.f) CSFML_CALL_RETURN(shape, GetOrigin().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetOrigin().y, 0.f) CSFML_CALL_RETURN(shape, GetOrigin().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a shape /// Get the color of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfShape_GetColor(sfShape* Shape) sfColor sfShape_GetColor(sfShape* shape)
{ {
sfColor Color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(Shape, Color) CSFML_CHECK_RETURN(Shape, color)
sf::Color SFMLColor = Shape->This.GetColor(); sf::Color SFMLColor = shape->This.GetColor();
return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a); return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a);
} }
@ -261,38 +261,38 @@ 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(sfShape* shape)
{ {
CSFML_CHECK_RETURN(Shape, sfBlendNone) CSFML_CHECK_RETURN(shape, sfBlendNone)
return static_cast<sfBlendMode>(Shape->This.GetBlendMode()); return static_cast<sfBlendMode>(shape->This.GetBlendMode());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a shape /// Move a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_Move(sfShape* Shape, float OffsetX, float OffsetY) void sfShape_Move(sfShape* shape, float offsetX, float offsetY)
{ {
CSFML_CALL(Shape, Move(sf::Vector2f(OffsetX, OffsetY))) CSFML_CALL(shape, Move(sf::Vector2f(offsetX, offsetY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale a shape /// Scale a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_Scale(sfShape* Shape, float FactorX, float FactorY) void sfShape_Scale(sfShape* shape, float factorX, float factorY)
{ {
CSFML_CALL(Shape, Scale(sf::Vector2f(FactorX, FactorY))) CSFML_CALL(shape, Scale(sf::Vector2f(factorX, factorY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a shape /// Rotate a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_Rotate(sfShape* Shape, float Angle) void sfShape_Rotate(sfShape* shape, float angle)
{ {
CSFML_CALL(Shape, Rotate(Angle)) CSFML_CALL(shape, Rotate(angle))
} }
@ -300,13 +300,13 @@ 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(sfShape* shape, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(Shape) CSFML_CHECK(shape)
sf::Vector2f Point = Shape->This.TransformToLocal(sf::Vector2f(PointX, PointY)); sf::Vector2f point = shape->This.TransformToLocal(sf::Vector2f(pointX, pointY));
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
@ -314,25 +314,25 @@ 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(sfShape* shape, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(Shape) CSFML_CHECK(shape)
sf::Vector2f Point = Shape->This.TransformToGlobal(sf::Vector2f(PointX, PointY)); sf::Vector2f point = shape->This.TransformToGlobal(sf::Vector2f(pointX, pointY));
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add a point to a shape /// Add a point to a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_AddPoint(sfShape* Shape, float X, float Y, sfColor Col, sfColor OutlineCol) void sfShape_AddPoint(sfShape* shape, float x, float y, sfColor color, sfColor outlineColor)
{ {
sf::Color Color(Col.r, Col.g, Col.b, Col.a); sf::Color SFMLColor(color.r, color.g, color.b, color.a);
sf::Color OutlineColor(OutlineCol.r, OutlineCol.g, OutlineCol.b, OutlineCol.a); sf::Color SFMLOutlineColor(outlineColor.r, outlineColor.g, outlineColor.b, outlineColor.a);
CSFML_CALL(Shape, AddPoint(X, Y, Color, OutlineColor)) CSFML_CALL(shape, AddPoint(x, y, SFMLColor, SFMLOutlineColor))
} }
@ -340,9 +340,9 @@ void sfShape_AddPoint(sfShape* Shape, float X, float Y, sfColor Col, sfColor Out
/// Enable or disable filling a shape. /// Enable or disable filling a shape.
/// Fill is enabled by default /// Fill is enabled by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_EnableFill(sfShape* Shape, sfBool Enable) void sfShape_EnableFill(sfShape* shape, sfBool enable)
{ {
CSFML_CALL(Shape, EnableFill(Enable == sfTrue)) CSFML_CALL(shape, EnableFill(enable == sfTrue))
} }
@ -350,109 +350,109 @@ void sfShape_EnableFill(sfShape* Shape, sfBool Enable)
/// Enable or disable drawing a shape outline. /// Enable or disable drawing a shape outline.
/// Outline is enabled by default /// Outline is enabled by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_EnableOutline(sfShape* Shape, sfBool Enable) void sfShape_EnableOutline(sfShape* shape, sfBool enable)
{ {
CSFML_CALL(Shape, EnableOutline(Enable == sfTrue)) CSFML_CALL(shape, EnableOutline(enable == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the width of a shape outline /// Change the width of a shape outline
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetOutlineWidth(sfShape* Shape, float Width) void sfShape_SetOutlineWidth(sfShape* shape, float width)
{ {
CSFML_CALL(Shape, SetOutlineWidth(Width)) CSFML_CALL(shape, SetOutlineWidth(width))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of a shape outline /// Get the width of a shape outline
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfShape_GetOutlineWidth(sfShape* Shape) float sfShape_GetOutlineWidth(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetOutlineWidth(), 0.f) CSFML_CALL_RETURN(shape, GetOutlineWidth(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfShape* shape)
{ {
CSFML_CALL_RETURN(Shape, GetNbPoints(), 0) CSFML_CALL_RETURN(shape, GetNbPoints(), 0)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfShape* shape, unsigned int index, float* x, float* y)
{ {
CSFML_CHECK(Shape) CSFML_CHECK(shape)
sf::Vector2f Point = Shape->This.GetPointPosition(Index); sf::Vector2f point = shape->This.GetPointPosition(index);
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(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)
const sf::Color& SFMLColor = Shape->This.GetPointColor(Index); const sf::Color& SFMLColor = shape->This.GetPointColor(index);
Color.r = SFMLColor.r; color.r = SFMLColor.r;
Color.g = SFMLColor.g; color.g = SFMLColor.g;
Color.b = SFMLColor.b; color.b = SFMLColor.b;
Color.a = SFMLColor.a; color.a = SFMLColor.a;
return Color; return color;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(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)
const sf::Color& SFMLColor = Shape->This.GetPointOutlineColor(Index); const sf::Color& SFMLColor = shape->This.GetPointOutlineColor(index);
Color.r = SFMLColor.r; color.r = SFMLColor.r;
Color.g = SFMLColor.g; color.g = SFMLColor.g;
Color.b = SFMLColor.b; color.b = SFMLColor.b;
Color.a = SFMLColor.a; color.a = SFMLColor.a;
return Color; return color;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the position of a shape's point /// Set a the position of a shape's point
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetPointPosition(sfShape* Shape, unsigned int Index, float X, float Y) void sfShape_SetPointPosition(sfShape* shape, unsigned int index, float x, float y)
{ {
CSFML_CALL(Shape, SetPointPosition(Index, X, Y)); CSFML_CALL(shape, SetPointPosition(index, x, y));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the color of a shape's point /// Set a the color of a shape's point
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetPointColor(sfShape* Shape, unsigned int Index, sfColor Color) void sfShape_SetPointColor(sfShape* shape, unsigned int index, sfColor color)
{ {
CSFML_CALL(Shape, SetPointColor(Index, sf::Color(Color.r, Color.g, Color.b, Color.a))); CSFML_CALL(shape, SetPointColor(index, sf::Color(color.r, color.g, color.b, color.a)));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a the outline color of a shape's point /// Set a the outline color of a shape's point
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShape_SetPointOutlineColor(sfShape* Shape, unsigned int Index, sfColor Color) void sfShape_SetPointOutlineColor(sfShape* shape, unsigned int index, sfColor color)
{ {
CSFML_CALL(Shape, SetPointOutlineColor(Index, sf::Color(Color.r, Color.g, Color.b, Color.a))); CSFML_CALL(shape, SetPointOutlineColor(index, sf::Color(color.r, color.g, color.b, color.a)));
} }

View File

@ -37,86 +37,86 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSprite* sfSprite_Create() sfSprite* sfSprite_Create()
{ {
sfSprite* Sprite = new sfSprite; sfSprite* sprite = new sfSprite;
Sprite->Image = NULL; sprite->Image = NULL;
Sprite->SubRect.Left = Sprite->This.GetSubRect().Left; sprite->SubRect.Left = sprite->This.GetSubRect().Left;
Sprite->SubRect.Top = Sprite->This.GetSubRect().Top; sprite->SubRect.Top = sprite->This.GetSubRect().Top;
Sprite->SubRect.Right = Sprite->This.GetSubRect().Right; sprite->SubRect.Right = sprite->This.GetSubRect().Right;
Sprite->SubRect.Bottom = Sprite->This.GetSubRect().Bottom; sprite->SubRect.Bottom = sprite->This.GetSubRect().Bottom;
return Sprite; return sprite;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing sprite /// Destroy an existing sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_Destroy(sfSprite* Sprite) void sfSprite_Destroy(sfSprite* sprite)
{ {
delete Sprite; delete sprite;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of a sprite /// Set the X position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetX(sfSprite* Sprite, float X) void sfSprite_SetX(sfSprite* sprite, float x)
{ {
CSFML_CALL(Sprite, SetX(X)) CSFML_CALL(sprite, SetX(x))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y position of a sprite /// Set the Y position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetY(sfSprite* Sprite, float Y) void sfSprite_SetY(sfSprite* sprite, float y)
{ {
CSFML_CALL(Sprite, SetY(Y)) CSFML_CALL(sprite, SetY(y))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a sprite /// Set the position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetPosition(sfSprite* Sprite, float X, float Y) void sfSprite_SetPosition(sfSprite* sprite, float x, float y)
{ {
CSFML_CALL(Sprite, SetPosition(sf::Vector2f(X, Y))) CSFML_CALL(sprite, SetPosition(sf::Vector2f(x, y)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the horizontal scale of a sprite /// Set the horizontal scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetScaleX(sfSprite* Sprite, float Scale) void sfSprite_SetScaleX(sfSprite* sprite, float scale)
{ {
CSFML_CALL(Sprite, SetScaleX(Scale)) CSFML_CALL(sprite, SetScaleX(scale))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the vertical scale of a sprite /// Set the vertical scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetScaleY(sfSprite* Sprite, float Scale) void sfSprite_SetScaleY(sfSprite* sprite, float scale)
{ {
CSFML_CALL(Sprite, SetScaleY(Scale)) CSFML_CALL(sprite, SetScaleY(scale))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of a sprite /// Set the scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetScale(sfSprite* Sprite, float ScaleX, float ScaleY) void sfSprite_SetScale(sfSprite* sprite, float scaleX, float scaleY)
{ {
CSFML_CALL(Sprite, SetScale(sf::Vector2f(ScaleX, ScaleY))) CSFML_CALL(sprite, SetScale(sf::Vector2f(scaleX, scaleY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of a sprite /// Set the orientation of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetRotation(sfSprite* Sprite, float Rotation) void sfSprite_SetRotation(sfSprite* sprite, float rotation)
{ {
CSFML_CALL(Sprite, SetRotation(Rotation)) CSFML_CALL(sprite, SetRotation(rotation))
} }
@ -124,102 +124,102 @@ void sfSprite_SetRotation(sfSprite* Sprite, float Rotation)
/// Set the local origin of a sprite, in coordinates /// Set the local origin of a sprite, in coordinates
/// relative to its left-top corner /// relative to its left-top corner
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetOrigin(sfSprite* Sprite, float X, float Y) void sfSprite_SetOrigin(sfSprite* sprite, float x, float y)
{ {
CSFML_CALL(Sprite, SetOrigin(sf::Vector2f(X, Y))) CSFML_CALL(sprite, SetOrigin(sf::Vector2f(x, y)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of a sprite /// Set the color of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetColor(sfSprite* Sprite, sfColor Color) void sfSprite_SetColor(sfSprite* sprite, sfColor color)
{ {
CSFML_CALL(Sprite, SetColor(sf::Color(Color.r, Color.g, Color.b, Color.a))) CSFML_CALL(sprite, SetColor(sf::Color(color.r, color.g, color.b, color.a)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for a sprite /// Set the blending mode for a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetBlendMode(sfSprite* Sprite, sfBlendMode Mode) void sfSprite_SetBlendMode(sfSprite* sprite, sfBlendMode mode)
{ {
CSFML_CALL(Sprite, SetBlendMode(static_cast<sf::Blend::Mode>(Mode))) CSFML_CALL(sprite, SetBlendMode(static_cast<sf::Blend::Mode>(mode)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a sprite /// Get the X position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetX(sfSprite* Sprite) float sfSprite_GetX(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetPosition().x, 0.f) CSFML_CALL_RETURN(sprite, GetPosition().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a sprite /// Get the Y position of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetY(sfSprite* Sprite) float sfSprite_GetY(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetPosition().y, 0.f) CSFML_CALL_RETURN(sprite, GetPosition().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a sprite /// Get the horizontal scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetScaleX(sfSprite* Sprite) float sfSprite_GetScaleX(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetScale().x, 0.f) CSFML_CALL_RETURN(sprite, GetScale().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a sprite /// Get the vertical scale of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetScaleY(sfSprite* Sprite) float sfSprite_GetScaleY(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetScale().y, 0.f) CSFML_CALL_RETURN(sprite, GetScale().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a sprite /// Get the orientation of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetRotation(sfSprite* Sprite) float sfSprite_GetRotation(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetRotation(), 0.f) CSFML_CALL_RETURN(sprite, GetRotation(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetOrigin().x, 0.f) CSFML_CALL_RETURN(sprite, GetOrigin().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetOrigin().y, 0.f) CSFML_CALL_RETURN(sprite, GetOrigin().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a sprite /// Get the color of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfSprite_GetColor(sfSprite* Sprite) sfColor sfSprite_GetColor(sfSprite* sprite)
{ {
sfColor Color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(Sprite, Color) CSFML_CHECK_RETURN(sprite, color)
sf::Color SFMLColor = Sprite->This.GetColor(); sf::Color SFMLColor = sprite->This.GetColor();
return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a); return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a);
} }
@ -227,38 +227,38 @@ 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(sfSprite* sprite)
{ {
CSFML_CHECK_RETURN(Sprite, sfBlendNone) CSFML_CHECK_RETURN(sprite, sfBlendNone)
return static_cast<sfBlendMode>(Sprite->This.GetBlendMode()); return static_cast<sfBlendMode>(sprite->This.GetBlendMode());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a sprite /// Move a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_Move(sfSprite* Sprite, float OffsetX, float OffsetY) void sfSprite_Move(sfSprite* sprite, float offsetX, float offsetY)
{ {
CSFML_CALL(Sprite, Move(sf::Vector2f(OffsetX, OffsetY))) CSFML_CALL(sprite, Move(sf::Vector2f(offsetX, offsetY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale a sprite /// Scale a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_Scale(sfSprite* Sprite, float FactorX, float FactorY) void sfSprite_Scale(sfSprite* sprite, float factorX, float factorY)
{ {
CSFML_CALL(Sprite, Scale(sf::Vector2f(FactorX, FactorY))) CSFML_CALL(sprite, Scale(sf::Vector2f(factorX, factorY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a sprite /// Rotate a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_Rotate(sfSprite* Sprite, float Angle) void sfSprite_Rotate(sfSprite* sprite, float angle)
{ {
CSFML_CALL(Sprite, Rotate(Angle)) CSFML_CALL(sprite, Rotate(angle))
} }
@ -266,13 +266,13 @@ 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(sfSprite* sprite, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(Sprite) CSFML_CHECK(sprite)
sf::Vector2f Point = Sprite->This.TransformToLocal(sf::Vector2f(PointX, PointY)); sf::Vector2f point = sprite->This.TransformToLocal(sf::Vector2f(pointX, pointY));
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
@ -280,25 +280,25 @@ 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(sfSprite* sprite, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(Sprite) CSFML_CHECK(sprite)
sf::Vector2f Point = Sprite->This.TransformToGlobal(sf::Vector2f(PointX, PointY)); sf::Vector2f point = sprite->This.TransformToGlobal(sf::Vector2f(pointX, pointY));
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the image of a sprite /// Change the image of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetImage(sfSprite* Sprite, sfImage* Image) void sfSprite_SetImage(sfSprite* sprite, sfImage* image)
{ {
if (Image) if (image)
{ {
CSFML_CALL(Sprite, SetImage(*Image->This)) CSFML_CALL(sprite, SetImage(*image->This))
Sprite->Image = Image; sprite->Image = image;
} }
} }
@ -306,89 +306,89 @@ void sfSprite_SetImage(sfSprite* Sprite, sfImage* Image)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sub-rectangle of a sprite inside the source image /// Set the sub-rectangle of a sprite inside the source image
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_SetSubRect(sfSprite* Sprite, sfIntRect SubRect) void sfSprite_SetSubRect(sfSprite* sprite, sfIntRect rectangle)
{ {
CSFML_CALL(Sprite, SetSubRect(sf::IntRect(SubRect.Left, SubRect.Top, SubRect.Right, SubRect.Bottom))) CSFML_CALL(sprite, SetSubRect(sf::IntRect(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom)))
Sprite->SubRect = SubRect; sprite->SubRect = rectangle;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Resize a sprite (by changing its scale factors) /// Resize a sprite (by changing its scale factors)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_Resize(sfSprite* Sprite, float Width, float Height) void sfSprite_Resize(sfSprite* sprite, float width, float height)
{ {
CSFML_CALL(Sprite, Resize(sf::Vector2f(Width, Height))) CSFML_CALL(sprite, Resize(sf::Vector2f(width, height)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Flip a sprite horizontally /// Flip a sprite horizontally
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_FlipX(sfSprite* Sprite, sfBool Flipped) void sfSprite_FlipX(sfSprite* sprite, sfBool flipped)
{ {
CSFML_CALL(Sprite, FlipX(Flipped == sfTrue)) CSFML_CALL(sprite, FlipX(flipped == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Flip a sprite vertically /// Flip a sprite vertically
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSprite_FlipY(sfSprite* Sprite, sfBool Flipped) void sfSprite_FlipY(sfSprite* sprite, sfBool flipped)
{ {
CSFML_CALL(Sprite, FlipY(Flipped == sfTrue)) CSFML_CALL(sprite, FlipY(flipped == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the source image of a sprite /// Get the source image of a sprite
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfImage* sfSprite_GetImage(sfSprite* Sprite) sfImage* sfSprite_GetImage(sfSprite* sprite)
{ {
CSFML_CHECK_RETURN(Sprite, NULL) CSFML_CHECK_RETURN(sprite, NULL)
return Sprite->Image; return sprite->Image;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfSprite* sprite)
{ {
sfIntRect Rect = {0, 0, 0, 0}; sfIntRect rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(Sprite, Rect) CSFML_CHECK_RETURN(sprite, rect)
return Sprite->SubRect; return sprite->SubRect;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite width /// Get a sprite width
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetWidth(sfSprite* Sprite) float sfSprite_GetWidth(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetSize().x, 0.f) CSFML_CALL_RETURN(sprite, GetSize().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a sprite height /// Get a sprite height
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfSprite_GetHeight(sfSprite* Sprite) float sfSprite_GetHeight(sfSprite* sprite)
{ {
CSFML_CALL_RETURN(Sprite, GetSize().y, 0.f) CSFML_CALL_RETURN(sprite, GetSize().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(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)
sf::Color SFMLColor = Sprite->This.GetPixel(X, Y); sf::Color SFMLColor = sprite->This.GetPixel(x, y);
return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a); return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a);
} }

View File

@ -37,82 +37,82 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfString* sfString_Create() sfString* sfString_Create()
{ {
sfString* String = new sfString; sfString* string = new sfString;
String->Font = sfFont_GetDefaultFont(); string->Font = sfFont_GetDefaultFont();
return String; return string;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing string /// Destroy an existing string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_Destroy(sfString* String) void sfString_Destroy(sfString* string)
{ {
delete String; delete string;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of a string /// Set the X position of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetX(sfString* String, float X) void sfString_SetX(sfString* string, float x)
{ {
CSFML_CALL(String, SetX(X)) CSFML_CALL(string, SetX(x))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y position of a string /// Set the Y position of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetY(sfString* String, float Y) void sfString_SetY(sfString* string, float y)
{ {
CSFML_CALL(String, SetY(Y)) CSFML_CALL(string, SetY(y))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of a string /// Set the position of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetPosition(sfString* String, float X, float Y) void sfString_SetPosition(sfString* string, float x, float y)
{ {
CSFML_CALL(String, SetPosition(sf::Vector2f(X, Y))) CSFML_CALL(string, SetPosition(sf::Vector2f(x, y)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the horizontal scale of a string /// Set the horizontal scale of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetScaleX(sfString* String, float Scale) void sfString_SetScaleX(sfString* string, float scale)
{ {
CSFML_CALL(String, SetScaleX(Scale)) CSFML_CALL(string, SetScaleX(scale))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the vertical scale of a string /// Set the vertical scale of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetScaleY(sfString* String, float Scale) void sfString_SetScaleY(sfString* string, float scale)
{ {
CSFML_CALL(String, SetScaleY(Scale)) CSFML_CALL(string, SetScaleY(scale))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of a string /// Set the scale of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetScale(sfString* String, float ScaleX, float ScaleY) void sfString_SetScale(sfString* string, float scaleX, float scaleY)
{ {
CSFML_CALL(String, SetScale(sf::Vector2f(ScaleX, ScaleY))) CSFML_CALL(string, SetScale(sf::Vector2f(scaleX, scaleY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of a string /// Set the orientation of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetRotation(sfString* String, float Rotation) void sfString_SetRotation(sfString* string, float rotation)
{ {
CSFML_CALL(String, SetRotation(Rotation)) CSFML_CALL(string, SetRotation(rotation))
} }
@ -120,102 +120,102 @@ void sfString_SetRotation(sfString* String, float Rotation)
/// Set the local origin of a string, in coordinates /// Set the local origin of a string, in coordinates
/// relative to its left-top corner /// relative to its left-top corner
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetOrigin(sfString* String, float X, float Y) void sfString_SetOrigin(sfString* string, float x, float y)
{ {
CSFML_CALL(String, SetOrigin(sf::Vector2f(X, Y))) CSFML_CALL(string, SetOrigin(sf::Vector2f(x, y)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of a string /// Set the color of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetColor(sfString* String, sfColor Color) void sfString_SetColor(sfString* string, sfColor color)
{ {
CSFML_CALL(String, SetColor(sf::Color(Color.r, Color.g, Color.b, Color.a))) CSFML_CALL(string, SetColor(sf::Color(color.r, color.g, color.b, color.a)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for a string /// Set the blending mode for a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetBlendMode(sfString* String, sfBlendMode Mode) void sfString_SetBlendMode(sfString* string, sfBlendMode mode)
{ {
CSFML_CALL(String, SetBlendMode(static_cast<sf::Blend::Mode>(Mode))) CSFML_CALL(string, SetBlendMode(static_cast<sf::Blend::Mode>(mode)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of a string /// Get the X position of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetX(sfString* String) float sfString_GetX(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetPosition().x, 0.f) CSFML_CALL_RETURN(string, GetPosition().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the Y position of a string /// Get the Y position of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetY(sfString* String) float sfString_GetY(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetPosition().y, 0.f) CSFML_CALL_RETURN(string, GetPosition().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the horizontal scale of a string /// Get the horizontal scale of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetScaleX(sfString* String) float sfString_GetScaleX(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetScale().x, 0.f) CSFML_CALL_RETURN(string, GetScale().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the vertical scale of a string /// Get the vertical scale of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetScaleY(sfString* String) float sfString_GetScaleY(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetScale().y, 0.f) CSFML_CALL_RETURN(string, GetScale().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the orientation of a string /// Get the orientation of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetRotation(sfString* String) float sfString_GetRotation(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetRotation(), 0.f) CSFML_CALL_RETURN(string, GetRotation(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the X position of the origin a string /// Get the X position of the origin a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetOriginX(sfString* String) float sfString_GetOriginX(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetOrigin().x, 0.f) CSFML_CALL_RETURN(string, GetOrigin().x, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top Y of the origin of a string /// Get the top Y of the origin of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetOriginY(sfString* String) float sfString_GetOriginY(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetOrigin().y, 0.f) CSFML_CALL_RETURN(string, GetOrigin().y, 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of a string /// Get the color of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfString_GetColor(sfString* String) sfColor sfString_GetColor(sfString* string)
{ {
sfColor Color = {0, 0, 0, 0}; sfColor color = {0, 0, 0, 0};
CSFML_CHECK_RETURN(String, Color) CSFML_CHECK_RETURN(string, color)
sf::Color SFMLColor = String->This.GetColor(); sf::Color SFMLColor = string->This.GetColor();
return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a); return sfColor_FromRGBA(SFMLColor.r, SFMLColor.g, SFMLColor.b, SFMLColor.a);
} }
@ -223,38 +223,38 @@ sfColor sfString_GetColor(sfString* String)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode of a string /// Get the current blending mode of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBlendMode sfString_GetBlendMode(sfString* String) sfBlendMode sfString_GetBlendMode(sfString* string)
{ {
CSFML_CHECK_RETURN(String, sfBlendNone) CSFML_CHECK_RETURN(string, sfBlendNone)
return static_cast<sfBlendMode>(String->This.GetBlendMode()); return static_cast<sfBlendMode>(string->This.GetBlendMode());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move a string /// Move a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_Move(sfString* String, float OffsetX, float OffsetY) void sfString_Move(sfString* string, float offsetX, float offsetY)
{ {
CSFML_CALL(String, Move(sf::Vector2f(OffsetX, OffsetY))) CSFML_CALL(string, Move(sf::Vector2f(offsetX, offsetY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale a string /// Scale a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_Scale(sfString* String, float FactorX, float FactorY) void sfString_Scale(sfString* string, float factorX, float factorY)
{ {
CSFML_CALL(String, Scale(sf::Vector2f(FactorX, FactorY))) CSFML_CALL(string, Scale(sf::Vector2f(factorX, factorY)))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate a string /// Rotate a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_Rotate(sfString* String, float Angle) void sfString_Rotate(sfString* string, float angle)
{ {
CSFML_CALL(String, Rotate(Angle)) CSFML_CALL(string, Rotate(angle))
} }
@ -262,13 +262,13 @@ void sfString_Rotate(sfString* String, float Angle)
/// Transform a point from global coordinates into the string's local coordinates /// Transform a point from global coordinates into the string'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 sfString_TransformToLocal(sfString* String, float PointX, float PointY, float* X, float* Y) void sfString_TransformToLocal(sfString* string, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(String) CSFML_CHECK(string)
sf::Vector2f Point = String->This.TransformToLocal(sf::Vector2f(PointX, PointY)); sf::Vector2f point = string->This.TransformToLocal(sf::Vector2f(pointX, pointY));
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
@ -276,115 +276,115 @@ void sfString_TransformToLocal(sfString* String, float PointX, float PointY, flo
/// Transform a point from the string's local coordinates into global coordinates /// Transform a point from the string'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 sfString_TransformToGlobal(sfString* String, float PointX, float PointY, float* X, float* Y) void sfString_TransformToGlobal(sfString* string, float pointX, float pointY, float* x, float* y)
{ {
CSFML_CHECK(String) CSFML_CHECK(string)
sf::Vector2f Point = String->This.TransformToGlobal(sf::Vector2f(PointX, PointY)); sf::Vector2f point = string->This.TransformToGlobal(sf::Vector2f(pointX, pointY));
if (X) *X = Point.x; if (x) *x = point.x;
if (Y) *Y = Point.y; if (y) *y = point.y;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the text of a string (from a multibyte string) /// Set the text of a string (from a multibyte string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetText(sfString* String, const char* Text) void sfString_SetText(sfString* string, const char* text)
{ {
CSFML_CALL(String, SetText(Text)) CSFML_CALL(string, SetText(text))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the text of a string (from a unicode string) /// Set the text of a string (from a unicode string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetUnicodeText(sfString* String, const sfUint32* Text) void sfString_SetUnicodeText(sfString* string, const sfUint32* text)
{ {
sf::Unicode::UTF32String UTF32Text = Text; sf::Unicode::UTF32String UTF32Text = text;
CSFML_CALL(String, SetText(UTF32Text)) CSFML_CALL(string, SetText(UTF32Text))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the font of a string /// Set the font of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetFont(sfString* String, sfFont* Font) void sfString_SetFont(sfString* string, sfFont* font)
{ {
CSFML_CHECK(Font); CSFML_CHECK(font);
CSFML_CALL(String, SetFont(Font->This)) CSFML_CALL(string, SetFont(font->This))
String->Font = Font; string->Font = font;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the size of a string /// Set the size of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetSize(sfString* String, float Size) void sfString_SetSize(sfString* string, float size)
{ {
CSFML_CALL(String, SetSize(Size)) CSFML_CALL(string, SetSize(size))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the style of a string /// Set the style of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_SetStyle(sfString* String, unsigned long Style) void sfString_SetStyle(sfString* string, unsigned long style)
{ {
CSFML_CALL(String, SetStyle(Style)) CSFML_CALL(string, SetStyle(style))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the text of a string (returns a unicode string) /// Get the text of a string (returns a unicode string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const sfUint32* sfString_GetUnicodeText(sfString* String) const sfUint32* sfString_GetUnicodeText(sfString* string)
{ {
CSFML_CHECK_RETURN(String, NULL) CSFML_CHECK_RETURN(string, NULL)
return static_cast<const sf::Unicode::UTF32String&>(String->This.GetText()).c_str(); return static_cast<const sf::Unicode::UTF32String&>(string->This.GetText()).c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the text of a string (returns an ANSI string) /// Get the text of a string (returns an ANSI string)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfString_GetText(sfString* String) const char* sfString_GetText(sfString* string)
{ {
CSFML_CHECK_RETURN(String, NULL) CSFML_CHECK_RETURN(string, NULL)
String->Text = String->This.GetText(); string->Text = string->This.GetText();
return String->Text.c_str(); return string->Text.c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the font used by a string /// Get the font used by a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFont* sfString_GetFont(sfString* String) sfFont* sfString_GetFont(sfString* string)
{ {
CSFML_CHECK_RETURN(String, NULL) CSFML_CHECK_RETURN(string, NULL)
return String->Font; return string->Font;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the characters of a string /// Get the size of the characters of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfString_GetSize(sfString* String) float sfString_GetSize(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetSize(), 0.f) CSFML_CALL_RETURN(string, GetSize(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the style of a string /// Get the style of a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned long sfString_GetStyle(sfString* String) unsigned long sfString_GetStyle(sfString* string)
{ {
CSFML_CALL_RETURN(String, GetStyle(), 0) CSFML_CALL_RETURN(string, GetStyle(), 0)
} }
@ -393,29 +393,29 @@ unsigned long sfString_GetStyle(sfString* String)
/// in coordinates relative to the string /// in coordinates relative to the string
/// (note : translation, origin, rotation and scale are not applied) /// (note : translation, origin, rotation and scale are not applied)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfString_GetCharacterPos(sfString* String, size_t Index, float* X, float* Y) void sfString_GetCharacterPos(sfString* string, size_t index, float* x, float* y)
{ {
CSFML_CHECK(String); CSFML_CHECK(string);
sf::Vector2f Pos = String->This.GetCharacterPos(Index); sf::Vector2f pos = string->This.GetCharacterPos(index);
if (X) *X = Pos.x; if (x) *x = pos.x;
if (Y) *Y = Pos.y; if (y) *y = pos.y;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the bounding rectangle of a string on screen /// Get the bounding rectangle of a string on screen
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFloatRect sfString_GetRect(sfString* String) sfFloatRect sfString_GetRect(sfString* string)
{ {
sfFloatRect Rect = {0.f, 0.f, 0.f, 0.f}; sfFloatRect rect = {0.f, 0.f, 0.f, 0.f};
CSFML_CHECK_RETURN(String, Rect) CSFML_CHECK_RETURN(string, rect)
sf::FloatRect SFMLRect = String->This.GetRect(); sf::FloatRect SFMLRect = string->This.GetRect();
String->Rect.Left = SFMLRect.Left; string->Rect.Left = SFMLRect.Left;
String->Rect.Top = SFMLRect.Top; string->Rect.Top = SFMLRect.Top;
String->Rect.Right = SFMLRect.Right; string->Rect.Right = SFMLRect.Right;
String->Rect.Bottom = SFMLRect.Bottom; string->Rect.Bottom = SFMLRect.Bottom;
return String->Rect; return string->Rect;
} }

View File

@ -34,113 +34,113 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp directory response /// Destroy an existing Ftp directory response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFtpListingResponse_Destroy(sfFtpListingResponse* FtpListingResponse) void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResponse)
{ {
delete FtpListingResponse; delete 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(sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CALL_RETURN(FtpListingResponse, IsOk(), sfFalse); CSFML_CALL_RETURN(ftpListingResponse, IsOk(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* FtpListingResponse) sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CHECK_RETURN(FtpListingResponse, sfFtpInvalidResponse); CSFML_CHECK_RETURN(ftpListingResponse, sfFtpInvalidResponse);
return static_cast<sfFtpStatus>(FtpListingResponse->This.GetStatus()); return static_cast<sfFtpStatus>(ftpListingResponse->This.GetStatus());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CHECK_RETURN(FtpListingResponse, NULL); CSFML_CHECK_RETURN(ftpListingResponse, NULL);
return FtpListingResponse->This.GetMessage().c_str(); return ftpListingResponse->This.GetMessage().c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfFtpListingResponse* ftpListingResponse)
{ {
CSFML_CALL_RETURN(FtpListingResponse, GetCount(), 0); CSFML_CALL_RETURN(ftpListingResponse, GetCount(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfFtpListingResponse* ftpListingResponse, size_t index)
{ {
CSFML_CHECK_RETURN(FtpListingResponse, NULL); CSFML_CHECK_RETURN(ftpListingResponse, NULL);
return FtpListingResponse->This.GetFilename(Index).c_str(); return ftpListingResponse->This.GetFilename(index).c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp directory response /// Destroy an existing Ftp directory response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* FtpDirectoryResponse) void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
delete FtpDirectoryResponse; delete 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(sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CALL_RETURN(FtpDirectoryResponse, IsOk(), sfFalse); CSFML_CALL_RETURN(ftpDirectoryResponse, IsOk(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* FtpDirectoryResponse) sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CHECK_RETURN(FtpDirectoryResponse, sfFtpInvalidResponse); CSFML_CHECK_RETURN(ftpDirectoryResponse, sfFtpInvalidResponse);
return static_cast<sfFtpStatus>(FtpDirectoryResponse->This.GetStatus()); return static_cast<sfFtpStatus>(ftpDirectoryResponse->This.GetStatus());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CHECK_RETURN(FtpDirectoryResponse, NULL); CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL);
return FtpDirectoryResponse->This.GetMessage().c_str(); return ftpDirectoryResponse->This.GetMessage().c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the directory returned in the response /// Get the directory returned in the response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* FtpDirectoryResponse) const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* ftpDirectoryResponse)
{ {
CSFML_CHECK_RETURN(FtpDirectoryResponse, NULL); CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL);
return FtpDirectoryResponse->This.GetDirectory().c_str(); return ftpDirectoryResponse->This.GetDirectory().c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp response /// Destroy an existing Ftp response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFtpResponse_Destroy(sfFtpResponse* FtpResponse) void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse)
{ {
delete FtpResponse; delete ftpResponse;
} }
@ -148,31 +148,31 @@ 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(sfFtpResponse* ftpResponse)
{ {
CSFML_CALL_RETURN(FtpResponse, IsOk(), sfFalse); CSFML_CALL_RETURN(ftpResponse, IsOk(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the response status code /// Get the response status code
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* FtpResponse) sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse)
{ {
CSFML_CHECK_RETURN(FtpResponse, sfFtpInvalidResponse); CSFML_CHECK_RETURN(ftpResponse, sfFtpInvalidResponse);
return static_cast<sfFtpStatus>(FtpResponse->This.GetStatus()); return static_cast<sfFtpStatus>(ftpResponse->This.GetStatus());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfFtpResponse* ftpResponse)
{ {
CSFML_CHECK_RETURN(FtpResponse, NULL); CSFML_CHECK_RETURN(ftpResponse, NULL);
return FtpResponse->This.GetMessage().c_str(); return ftpResponse->This.GetMessage().c_str();
} }
@ -188,77 +188,77 @@ sfFtp* sfFtp_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Ftp /// Destroy an existing Ftp
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfFtp_Destroy(sfFtp* Ftp) void sfFtp_Destroy(sfFtp* ftp)
{ {
delete Ftp; delete ftp;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Connect to the specified FTP server /// Connect to the specified FTP server
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_Connect(sfFtp* Ftp, sfIPAddress Server, unsigned short Port, float Timeout) sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIPAddress server, unsigned short port, float timeout)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
sf::IPAddress SFMLServer(Server.Address); sf::IPAddress SFMLServer(server.Address);
return new sfFtpResponse(Ftp->This.Connect(SFMLServer, Port, Timeout)); return new sfFtpResponse(ftp->This.Connect(SFMLServer, port, timeout));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Log in using anonymous account /// Log in using anonymous account
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* Ftp) sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.Login()); return new sfFtpResponse(ftp->This.Login());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Log in using a username and a password /// Log in using a username and a password
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_Login(sfFtp* Ftp, const char* UserName, const char* Password) sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, const char* password)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.Login(UserName ? UserName : "", Password ? Password : "")); return new sfFtpResponse(ftp->This.Login(userName ? userName : "", password ? password : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close the connection with FTP server /// Close the connection with FTP server
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_Disconnect(sfFtp* Ftp) sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.Disconnect()); return new sfFtpResponse(ftp->This.Disconnect());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a null command just to prevent from being disconnected /// Send a null command just to prevent from being disconnected
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_KeepAlive(sfFtp* Ftp) sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.KeepAlive()); return new sfFtpResponse(ftp->This.KeepAlive());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current working directory /// Get the current working directory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* Ftp) sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpDirectoryResponse(Ftp->This.GetWorkingDirectory()); return new sfFtpDirectoryResponse(ftp->This.GetWorkingDirectory());
} }
@ -266,101 +266,101 @@ sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* Ftp)
/// Get the contents of the given directory /// Get the contents of the given directory
/// (subdirectories and files) /// (subdirectories and files)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* Ftp, const char* Directory) sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, const char* directory)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpListingResponse(Ftp->This.GetDirectoryListing(Directory ? Directory : "")); return new sfFtpListingResponse(ftp->This.GetDirectoryListing(directory ? directory : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current working directory /// Change the current working directory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* Ftp, const char* Directory) sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* directory)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.ChangeDirectory(Directory ? Directory : "")); return new sfFtpResponse(ftp->This.ChangeDirectory(directory ? directory : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Go to the parent directory of the current one /// Go to the parent directory of the current one
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_ParentDirectory(sfFtp* Ftp) sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.ParentDirectory()); return new sfFtpResponse(ftp->This.ParentDirectory());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a new directory /// Create a new directory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_MakeDirectory(sfFtp* Ftp, const char* Name) sfFtpResponse* sfFtp_MakeDirectory(sfFtp* ftp, const char* name)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.MakeDirectory(Name ? Name : "")); return new sfFtpResponse(ftp->This.MakeDirectory(name ? name : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove an existing directory /// Remove an existing directory
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* Ftp, const char* Name) sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* name)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.DeleteDirectory(Name ? Name : "")); return new sfFtpResponse(ftp->This.DeleteDirectory(name ? name : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rename a file /// Rename a file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_RenameFile(sfFtp* Ftp, const char* File, const char* NewName) sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file, const char* newName)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.RenameFile(File ? File : "", NewName ? NewName : "")); return new sfFtpResponse(ftp->This.RenameFile(file ? file : "", newName ? newName : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove an existing file /// Remove an existing file
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_DeleteFile(sfFtp* Ftp, const char* Name) sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.DeleteFile(Name ? Name : "")); return new sfFtpResponse(ftp->This.DeleteFile(name ? name : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Download a file from the server /// Download a file from the server
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_Download(sfFtp* Ftp, const char* DistantFile, const char* DestPath, sfFtpTransferMode Mode) sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.Download(DistantFile ? DistantFile : "", return new sfFtpResponse(ftp->This.Download(distantFile ? distantFile : "",
DestPath ? DestPath : "", destPath ? destPath : "",
static_cast<sf::Ftp::TransferMode>(Mode))); static_cast<sf::Ftp::TransferMode>(mode)));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Upload a file to the server /// Upload a file to the server
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_Upload(sfFtp* Ftp, const char* LocalFile, const char* DestPath, sfFtpTransferMode Mode) sfFtpResponse* sfFtp_Upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode)
{ {
CSFML_CHECK_RETURN(Ftp, NULL); CSFML_CHECK_RETURN(ftp, NULL);
return new sfFtpResponse(Ftp->This.Upload(LocalFile ? LocalFile : "", return new sfFtpResponse(ftp->This.Upload(localFile ? localFile : "",
DestPath ? DestPath : "", destPath ? destPath : "",
static_cast<sf::Ftp::TransferMode>(Mode))); static_cast<sf::Ftp::TransferMode>(mode)));
} }

View File

@ -42,20 +42,20 @@ sfHttpRequest* sfHttpRequest_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Http request /// Destroy an existing Http request
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpRequest_Destroy(sfHttpRequest* HttpRequest) void sfHttpRequest_Destroy(sfHttpRequest* httpRequest)
{ {
delete HttpRequest; delete httpRequest;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the value of a field; the field is added if it doesn't exist /// Set the value of a field; the field is added if it doesn't exist
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpRequest_SetField(sfHttpRequest* HttpRequest, const char* Field, const char* Value) void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const char* field, const char* value)
{ {
CSFML_CHECK(HttpRequest); CSFML_CHECK(httpRequest);
if (Field) if (field)
HttpRequest->This.SetField(Field, Value); httpRequest->This.SetField(field, value);
} }
@ -63,9 +63,9 @@ void sfHttpRequest_SetField(sfHttpRequest* HttpRequest, const char* Field, const
/// Set the request method. /// Set the request method.
/// This parameter is sfHttpGet by default /// This parameter is sfHttpGet by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpRequest_SetMethod(sfHttpRequest* HttpRequest, sfHttpMethod Method) void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHttpMethod method)
{ {
CSFML_CALL(HttpRequest, SetMethod(static_cast<sf::Http::Request::Method>(Method))); CSFML_CALL(httpRequest, SetMethod(static_cast<sf::Http::Request::Method>(method)));
} }
@ -73,9 +73,9 @@ void sfHttpRequest_SetMethod(sfHttpRequest* HttpRequest, sfHttpMethod Method)
/// Set the target URI of the request. /// Set the target URI of the request.
/// This parameter is "/" by default /// This parameter is "/" by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpRequest_SetURI(sfHttpRequest* HttpRequest, const char* URI) void sfHttpRequest_SetURI(sfHttpRequest* httpRequest, const char* URI)
{ {
CSFML_CALL(HttpRequest, SetURI(URI ? URI : "")); CSFML_CALL(httpRequest, SetURI(URI ? URI : ""));
} }
@ -83,9 +83,9 @@ void sfHttpRequest_SetURI(sfHttpRequest* HttpRequest, const char* URI)
/// Set the HTTP version of the request. /// Set the HTTP version of the request.
/// This parameter is 1.0 by default /// This parameter is 1.0 by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpRequest_SetHttpVersion(sfHttpRequest* HttpRequest, unsigned int Major, unsigned int Minor) void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor)
{ {
CSFML_CALL(HttpRequest, SetHttpVersion(Major, Minor)); CSFML_CALL(httpRequest, SetHttpVersion(major, minor));
} }
@ -94,60 +94,60 @@ void sfHttpRequest_SetHttpVersion(sfHttpRequest* HttpRequest, unsigned int Major
/// makes sense only for POST requests. /// makes sense only for POST requests.
/// This parameter is empty by default /// This parameter is empty by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpRequest_SetBody(sfHttpRequest* HttpRequest, const char* Body) void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const char* body)
{ {
CSFML_CALL(HttpRequest, SetBody(Body ? Body : "")); CSFML_CALL(httpRequest, SetBody(body ? body : ""));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Http response /// Destroy an existing Http response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttpResponse_Destroy(sfHttpResponse* HttpResponse) void sfHttpResponse_Destroy(sfHttpResponse* httpResponse)
{ {
delete HttpResponse; delete 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(sfHttpResponse* httpResponse, const char* field)
{ {
CSFML_CHECK_RETURN(HttpResponse, NULL); CSFML_CHECK_RETURN(httpResponse, NULL);
if (!Field) if (!field)
return NULL; return NULL;
return HttpResponse->This.GetField(Field).c_str(); return httpResponse->This.GetField(field).c_str();
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the status of a response /// Get the status of a response
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* HttpResponse) sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse)
{ {
CSFML_CHECK_RETURN(HttpResponse, sfHttpInvalidResponse); CSFML_CHECK_RETURN(httpResponse, sfHttpInvalidResponse);
return static_cast<sfHttpStatus>(HttpResponse->This.GetStatus()); return static_cast<sfHttpStatus>(httpResponse->This.GetStatus());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfHttpResponse* httpResponse)
{ {
CSFML_CALL_RETURN(HttpResponse, GetMajorHttpVersion(), 0); CSFML_CALL_RETURN(httpResponse, GetMajorHttpVersion(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfHttpResponse* httpResponse)
{ {
CSFML_CALL_RETURN(HttpResponse, GetMinorHttpVersion(), 0); CSFML_CALL_RETURN(httpResponse, GetMinorHttpVersion(), 0);
} }
@ -158,11 +158,11 @@ 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(sfHttpResponse* httpResponse)
{ {
CSFML_CHECK_RETURN(HttpResponse, NULL); CSFML_CHECK_RETURN(httpResponse, NULL);
return HttpResponse->This.GetBody().c_str(); return httpResponse->This.GetBody().c_str();
} }
@ -178,18 +178,18 @@ sfHttp* sfHttp_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing Http object /// Destroy an existing Http object
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttp_Destroy(sfHttp* Http) void sfHttp_Destroy(sfHttp* http)
{ {
delete Http; delete http;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the target host of a Http server /// Set the target host of a Http server
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfHttp_SetHost(sfHttp* Http, const char* Host, unsigned short Port) void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port)
{ {
CSFML_CALL(Http, SetHost(Host ? Host : "", Port)); CSFML_CALL(http, SetHost(host ? host : "", port));
} }
@ -201,13 +201,13 @@ 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, sfHttpRequest* request, float timeout)
{ {
CSFML_CHECK_RETURN(Http, NULL); CSFML_CHECK_RETURN(http, NULL);
CSFML_CHECK_RETURN(Request, NULL); CSFML_CHECK_RETURN(request, NULL);
sfHttpResponse* Response = new sfHttpResponse; sfHttpResponse* response = new sfHttpResponse;
Response->This = Http->This.SendRequest(Request->This, Timeout); response->This = http->This.SendRequest(request->This, timeout);
return Response; return response;
} }

View File

@ -35,20 +35,20 @@ namespace
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Helper function for converting a SFML address to a CSFML one /// Helper function for converting a SFML address to a CSFML one
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIPAddress FromSFMLAddress(sf::IPAddress Address) sfIPAddress FromSFMLAddress(sf::IPAddress address)
{ {
sfIPAddress Result; sfIPAddress result;
strncpy(Result.Address, Address.ToString().c_str(), 16); strncpy(result.Address, address.ToString().c_str(), 16);
return Result; return result;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Helper function for converting a CSFML address to a SFML one /// Helper function for converting a CSFML address to a SFML one
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sf::IPAddress ToSFMLAddress(sfIPAddress Address) sf::IPAddress ToSFMLAddress(sfIPAddress address)
{ {
return sf::IPAddress(Address.Address); return sf::IPAddress(address.Address);
} }
} }
@ -56,55 +56,55 @@ namespace
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct an address from a string /// Construct an address from a string
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIPAddress sfIPAddress_FromString(const char* String) sfIPAddress sfIPAddress_FromString(const char* string)
{ {
return FromSFMLAddress(sf::IPAddress(String)); return FromSFMLAddress(sf::IPAddress(string));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct an address from 4 bytes /// Construct an address from 4 bytes
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIPAddress sfIPAddress_FromBytes(sfUint8 Byte0, sfUint8 Byte1, sfUint8 Byte2, sfUint8 Byte3) sfIPAddress sfIPAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3)
{ {
return FromSFMLAddress(sf::IPAddress(Byte0, Byte1, Byte2, Byte3)); return FromSFMLAddress(sf::IPAddress(byte0, byte1, byte2, byte3));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the address from a 32-bits integer /// Construct the address from a 32-bits integer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIPAddress sfIPAddress_FromInteger(sfUint32 Address) sfIPAddress sfIPAddress_FromInteger(sfUint32 address)
{ {
return FromSFMLAddress(sf::IPAddress(Address)); return FromSFMLAddress(sf::IPAddress(address));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if an address is a valid one /// Tell if an address is a valid one
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfIPAddress_IsValid(sfIPAddress Address) sfBool sfIPAddress_IsValid(sfIPAddress address)
{ {
return ToSFMLAddress(Address).IsValid() ? sfTrue : sfFalse; return ToSFMLAddress(address).IsValid() ? sfTrue : sfFalse;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a string representation of an address /// Get a string representation of an address
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfIPAddress_ToString(sfIPAddress Address, char* String) void sfIPAddress_ToString(sfIPAddress address, char* string)
{ {
if (String) if (string)
strcpy(String, Address.Address); strcpy(string, address.Address);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get an integer representation of the address /// Get an integer representation of the address
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfUint32 sfIPAddress_ToInteger(sfIPAddress Address) sfUint32 sfIPAddress_ToInteger(sfIPAddress address)
{ {
return ToSFMLAddress(Address).ToInteger(); return ToSFMLAddress(address).ToInteger();
} }
@ -123,9 +123,9 @@ sfIPAddress sfIPAddress_GetLocalAddress()
/// distant website ; as a consequence, this function may be /// distant website ; as a consequence, this function may be
/// very slow -- use it as few as possible ! /// very slow -- use it as few as possible !
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfIPAddress sfIPAddress_GetPublicAddress(float Timeout) sfIPAddress sfIPAddress_GetPublicAddress(float timeout)
{ {
return FromSFMLAddress(sf::IPAddress::GetPublicAddress(Timeout)); return FromSFMLAddress(sf::IPAddress::GetPublicAddress(timeout));
} }

View File

@ -36,24 +36,24 @@ namespace
/// Helper function to read a variable from a packet /// Helper function to read a variable from a packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
T PacketRead(sfPacket* Packet, T Default = 0) T PacketRead(sfPacket* packet, T def = 0)
{ {
CSFML_CHECK_RETURN(Packet, Default); CSFML_CHECK_RETURN(packet, def);
T Value; T value;
Packet->This >> Value; packet->This >> value;
return Value; return value;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Helper function to write a variable to a packet /// Helper function to write a variable to a packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
void PacketWrite(sfPacket* Packet, T Value) void PacketWrite(sfPacket* packet, T value)
{ {
CSFML_CHECK(Packet); CSFML_CHECK(packet);
Packet->This << Value; packet->This << value;
} }
} }
@ -70,27 +70,27 @@ sfPacket* sfPacket_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing packet /// Destroy an existing packet
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPacket_Destroy(sfPacket* Packet) void sfPacket_Destroy(sfPacket* packet)
{ {
delete Packet; delete 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, void* data, size_t sizeInBytes)
{ {
CSFML_CALL(Packet, Append(Data, SizeInBytes)); CSFML_CALL(packet, Append(data, sizeInBytes));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear all the data of a packet /// Clear all the data of a packet
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
void sfPacket_Clear(sfPacket* Packet) void sfPacket_Clear(sfPacket* packet)
{ {
CSFML_CALL(Packet, Clear()); CSFML_CALL(packet, Clear());
} }
@ -99,36 +99,36 @@ 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(sfPacket* packet)
{ {
CSFML_CALL_RETURN(Packet, GetData(), NULL); CSFML_CALL_RETURN(packet, GetData(), NULL);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfPacket* packet)
{ {
CSFML_CALL_RETURN(Packet, GetDataSize(), 0); CSFML_CALL_RETURN(packet, GetDataSize(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfPacket* packet)
{ {
CSFML_CALL_RETURN(Packet, EndOfPacket(), sfFalse); CSFML_CALL_RETURN(packet, EndOfPacket(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfPacket* packet)
{ {
CSFML_CALL_RETURN(Packet, operator bool(), sfFalse); CSFML_CALL_RETURN(packet, operator bool(), sfFalse);
} }
@ -138,30 +138,30 @@ sfBool sfPacket_CanRead(sfPacket* Packet)
/// \param Packet : Packet to read /// \param Packet : Packet to read
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfPacket_ReadBool(sfPacket* Packet) {return PacketRead<sfUint8>(Packet);} sfBool sfPacket_ReadBool(sfPacket* packet) {return PacketRead<sfUint8>(packet);}
sfInt8 sfPacket_ReadInt8(sfPacket* Packet) {return PacketRead<sfInt8>(Packet);} sfInt8 sfPacket_ReadInt8(sfPacket* packet) {return PacketRead<sfInt8>(packet);}
sfUint8 sfPacket_ReadUint8(sfPacket* Packet) {return PacketRead<sfUint8>(Packet);} sfUint8 sfPacket_ReadUint8(sfPacket* packet) {return PacketRead<sfUint8>(packet);}
sfInt16 sfPacket_ReadInt16(sfPacket* Packet) {return PacketRead<sfInt16>(Packet);} sfInt16 sfPacket_ReadInt16(sfPacket* packet) {return PacketRead<sfInt16>(packet);}
sfUint16 sfPacket_ReadUint16(sfPacket* Packet) {return PacketRead<sfUint16>(Packet);} sfUint16 sfPacket_ReadUint16(sfPacket* packet) {return PacketRead<sfUint16>(packet);}
sfInt32 sfPacket_ReadInt32(sfPacket* Packet) {return PacketRead<sfInt32>(Packet);} sfInt32 sfPacket_ReadInt32(sfPacket* packet) {return PacketRead<sfInt32>(packet);}
sfUint32 sfPacket_ReadUint32(sfPacket* Packet) {return PacketRead<sfUint32>(Packet);} sfUint32 sfPacket_ReadUint32(sfPacket* packet) {return PacketRead<sfUint32>(packet);}
float sfPacket_ReadFloat(sfPacket* Packet) {return PacketRead<float>(Packet);} float sfPacket_ReadFloat(sfPacket* packet) {return PacketRead<float>(packet);}
double sfPacket_ReadDouble(sfPacket* Packet) {return PacketRead<double>(Packet);} double sfPacket_ReadDouble(sfPacket* packet) {return PacketRead<double>(packet);}
void sfPacket_ReadString(sfPacket* Packet, char* String) void sfPacket_ReadString(sfPacket* packet, char* string)
{ {
CSFML_CHECK(Packet); CSFML_CHECK(packet);
if (String) if (string)
Packet->This >> String; packet->This >> string;
} }
void sfPacket_ReadWideString(sfPacket* Packet, wchar_t* String) void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string)
{ {
CSFML_CHECK(Packet); CSFML_CHECK(packet);
if (String) if (string)
Packet->This >> String; packet->This >> string;
} }
@ -171,28 +171,28 @@ void sfPacket_ReadWideString(sfPacket* Packet, wchar_t* String)
/// \param Packet : Packet to write /// \param Packet : Packet to write
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfPacket_WriteBool(sfPacket* Packet, sfBool Value) {PacketWrite(Packet, static_cast<sfUint8>(Value));} void sfPacket_WriteBool(sfPacket* packet, sfBool value) {PacketWrite(packet, static_cast<sfUint8>(value));}
void sfPacket_WriteInt8(sfPacket* Packet, sfInt8 Value) {PacketWrite(Packet, Value);} void sfPacket_WriteInt8(sfPacket* packet, sfInt8 value) {PacketWrite(packet, value);}
void sfPacket_WriteUint8(sfPacket* Packet, sfUint8 Value) {PacketWrite(Packet, Value);} void sfPacket_WriteUint8(sfPacket* packet, sfUint8 value) {PacketWrite(packet, value);}
void sfPacket_WriteInt16(sfPacket* Packet, sfInt16 Value) {PacketWrite(Packet, Value);} void sfPacket_WriteInt16(sfPacket* packet, sfInt16 value) {PacketWrite(packet, value);}
void sfPacket_WriteUint16(sfPacket* Packet, sfUint16 Value) {PacketWrite(Packet, Value);} void sfPacket_WriteUint16(sfPacket* packet, sfUint16 value) {PacketWrite(packet, value);}
void sfPacket_WriteInt32(sfPacket* Packet, sfInt32 Value) {PacketWrite(Packet, Value);} void sfPacket_WriteInt32(sfPacket* packet, sfInt32 value) {PacketWrite(packet, value);}
void sfPacket_WriteUint32(sfPacket* Packet, sfUint32 Value) {PacketWrite(Packet, Value);} void sfPacket_WriteUint32(sfPacket* packet, sfUint32 value) {PacketWrite(packet, value);}
void sfPacket_WriteFloat(sfPacket* Packet, float Value) {PacketWrite(Packet, Value);} void sfPacket_WriteFloat(sfPacket* packet, float value) {PacketWrite(packet, value);}
void sfPacket_WriteDouble(sfPacket* Packet, double Value) {PacketWrite(Packet, Value);} void sfPacket_WriteDouble(sfPacket* packet, double value) {PacketWrite(packet, value);}
void sfPacket_WriteString(sfPacket* Packet, const char* String) void sfPacket_WriteString(sfPacket* packet, const char* string)
{ {
CSFML_CHECK(Packet); CSFML_CHECK(packet);
if (String) if (string)
Packet->This << String; packet->This << string;
} }
void sfPacket_WriteWideString(sfPacket* Packet, const wchar_t* String) void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string)
{ {
CSFML_CHECK(Packet); CSFML_CHECK(packet);
if (String) if (string)
Packet->This << String; packet->This << string;
} }

View File

@ -40,37 +40,37 @@ sfSelectorUDP* sfSelectorUDP_Create() {return new sfSelectorUDP;}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing selector /// Destroy an existing selector
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSelectorTCP_Destroy(sfSelectorTCP* Selector) {delete Selector;} void sfSelectorTCP_Destroy(sfSelectorTCP* selector) {delete selector;}
void sfSelectorUDP_Destroy(sfSelectorUDP* Selector) {delete Selector;} void sfSelectorUDP_Destroy(sfSelectorUDP* selector) {delete selector;}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Add a socket to watch to a selector /// Add a socket to watch to a selector
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSelectorTCP_Add(sfSelectorTCP* Selector, sfSocketTCP* Socket) {CSFML_CALL(Selector, Add(Socket->This)); Selector->Sockets[Socket->This] = Socket;} void sfSelectorTCP_Add(sfSelectorTCP* selector, sfSocketTCP* socket) {CSFML_CALL(selector, Add(socket->This)); selector->Sockets[socket->This] = socket;}
void sfSelectorUDP_Add(sfSelectorUDP* Selector, sfSocketUDP* Socket) {CSFML_CALL(Selector, Add(Socket->This)); Selector->Sockets[Socket->This] = Socket;} void sfSelectorUDP_Add(sfSelectorUDP* selector, sfSocketUDP* socket) {CSFML_CALL(selector, Add(socket->This)); selector->Sockets[socket->This] = socket;}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove a socket from a selector /// Remove a socket from a selector
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSelectorTCP_Remove(sfSelectorTCP* Selector, sfSocketTCP* Socket) {CSFML_CALL(Selector, Remove(Socket->This)); Selector->Sockets.erase(Socket->This);} void sfSelectorTCP_Remove(sfSelectorTCP* selector, sfSocketTCP* socket) {CSFML_CALL(selector, Remove(socket->This)); selector->Sockets.erase(socket->This);}
void sfSelectorUDP_Remove(sfSelectorUDP* Selector, sfSocketUDP* Socket) {CSFML_CALL(Selector, Remove(Socket->This)); Selector->Sockets.erase(Socket->This);} void sfSelectorUDP_Remove(sfSelectorUDP* selector, sfSocketUDP* socket) {CSFML_CALL(selector, Remove(socket->This)); selector->Sockets.erase(socket->This);}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove all sockets from a selector /// Remove all sockets from a selector
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSelectorTCP_Clear(sfSelectorTCP* Selector) {CSFML_CALL(Selector, Clear()); Selector->Sockets.clear();} void sfSelectorTCP_Clear(sfSelectorTCP* selector) {CSFML_CALL(selector, Clear()); selector->Sockets.clear();}
void sfSelectorUDP_Clear(sfSelectorUDP* Selector) {CSFML_CALL(Selector, Clear()); Selector->Sockets.clear();} void sfSelectorUDP_Clear(sfSelectorUDP* selector) {CSFML_CALL(selector, Clear()); selector->Sockets.clear();}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Wait and collect sockets which are ready for reading. /// Wait and collect sockets which are ready for reading.
/// This functions will return either when at least one socket /// This functions will return either when at least one socket
/// is ready, or when the given time is out /// is ready, or when the given time is out
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int sfSelectorTCP_Wait(sfSelectorTCP* Selector, float Timeout) {CSFML_CALL_RETURN(Selector, Wait(Timeout), 0);} unsigned int sfSelectorTCP_Wait(sfSelectorTCP* selector, float timeout) {CSFML_CALL_RETURN(selector, Wait(timeout), 0);}
unsigned int sfSelectorUDP_Wait(sfSelectorUDP* Selector, float Timeout) {CSFML_CALL_RETURN(Selector, Wait(Timeout), 0);} unsigned int sfSelectorUDP_Wait(sfSelectorUDP* selector, float timeout) {CSFML_CALL_RETURN(selector, Wait(timeout), 0);}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -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(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[selector->This.GetSocketReady(index)];
} }
sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* Selector, unsigned int Index) sfSocketUDP* sfSelectorUDP_GetSocketReady(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[selector->This.GetSocketReady(index)];
} }

View File

@ -45,12 +45,12 @@ sfSocketTCP* sfSocketTCP_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing TCP socket /// Destroy an existing TCP socket
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSocketTCP_Destroy(sfSocketTCP* Socket) void sfSocketTCP_Destroy(sfSocketTCP* socket)
{ {
if (Socket) if (socket)
{ {
Socket->This.Close(); socket->This.Close();
delete Socket; delete socket;
} }
} }
@ -59,31 +59,31 @@ void sfSocketTCP_Destroy(sfSocketTCP* Socket)
/// Change the blocking state of a TCP socket. /// Change the blocking state of a TCP socket.
/// The default behaviour of a socket is blocking /// The default behaviour of a socket is blocking
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSocketTCP_SetBlocking(sfSocketTCP* Socket, sfBool Blocking) void sfSocketTCP_SetBlocking(sfSocketTCP* socket, sfBool blocking)
{ {
CSFML_CALL(Socket, SetBlocking(Blocking == sfTrue)); CSFML_CALL(socket, SetBlocking(blocking == sfTrue));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Connect a TCP socket to another computer on a specified port /// Connect a TCP socket to another computer on a specified port
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketTCP_Connect(sfSocketTCP* Socket, unsigned short Port, sfIPAddress HostAddress, float Timeout) sfSocketStatus sfSocketTCP_Connect(sfSocketTCP* socket, unsigned short port, sfIPAddress host, float timeout)
{ {
sf::IPAddress Address(HostAddress.Address); sf::IPAddress address(host.Address);
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
return static_cast<sfSocketStatus>(Socket->This.Connect(Port, Address, Timeout)); return static_cast<sfSocketStatus>(socket->This.Connect(port, address, timeout));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Listen to a specified port for incoming data or connections /// Listen to a specified port for incoming data or connections
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSocketTCP_Listen(sfSocketTCP* Socket, unsigned short Port) sfBool sfSocketTCP_Listen(sfSocketTCP* socket, unsigned short port)
{ {
CSFML_CALL_RETURN(Socket, Listen(Port), sfFalse); CSFML_CALL_RETURN(socket, Listen(port), sfFalse);
} }
@ -92,25 +92,25 @@ sfBool sfSocketTCP_Listen(sfSocketTCP* Socket, unsigned short Port)
/// This function is blocking, ie. it won't return before /// This function is blocking, ie. it won't return before
/// a connection has been accepted /// a connection has been accepted
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* Socket, sfSocketTCP** Connected, sfIPAddress* Address) sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* socket, sfSocketTCP** connected, sfIPAddress* address)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
CSFML_CHECK_RETURN(Connected, sfSocketError); CSFML_CHECK_RETURN(connected, sfSocketError);
// Call SFML internal function // Call SFML internal function
sf::IPAddress ClientAddress; sf::IPAddress clientAddress;
sf::SocketTCP Client; sf::SocketTCP client;
sf::Socket::Status Status = Socket->This.Accept(Client, &ClientAddress); sf::Socket::Status status = socket->This.Accept(client, &clientAddress);
if (Status != sf::Socket::Done) if (status != sf::Socket::Done)
return static_cast<sfSocketStatus>(Status); return static_cast<sfSocketStatus>(status);
// Convert the client socket returned // Convert the client socket returned
*Connected = sfSocketTCP_Create(); *connected = sfSocketTCP_Create();
(*Connected)->This = Client; (*connected)->This = client;
// Convert the address if needed // Convert the address if needed
if (Address) if (address)
strncpy(Address->Address, ClientAddress.ToString().c_str(), 16); strncpy(address->Address, clientAddress.ToString().c_str(), 16);
return sfSocketDone; return sfSocketDone;
} }
@ -119,29 +119,29 @@ sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* Socket, sfSocketTCP** Connected,
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send an array of bytes to the host (must be connected first) /// Send an array of bytes to the host (must be connected first)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketTCP_Send(sfSocketTCP* Socket, const char* Data, size_t Size) sfSocketStatus sfSocketTCP_Send(sfSocketTCP* socket, const char* data, size_t size)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
return static_cast<sfSocketStatus>(Socket->This.Send(Data, Size)); return static_cast<sfSocketStatus>(socket->This.Send(data, size));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive an array of bytes from the host (must be connected first) /// Receive an array of bytes from the host (must be connected first)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* Socket, char* Data, size_t MaxSize, size_t* SizeReceived) sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* socket, char* data, size_t maxSize, size_t* sizeReceived)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
if (SizeReceived) if (sizeReceived)
{ {
return static_cast<sfSocketStatus>(Socket->This.Receive(Data, MaxSize, *SizeReceived)); return static_cast<sfSocketStatus>(socket->This.Receive(data, maxSize, *sizeReceived));
} }
else else
{ {
std::size_t Size = 0; std::size_t size = 0;
return static_cast<sfSocketStatus>(Socket->This.Receive(Data, MaxSize, Size)); return static_cast<sfSocketStatus>(socket->This.Receive(data, maxSize, size));
} }
} }
@ -149,24 +149,24 @@ sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* Socket, char* Data, size_t MaxSi
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a packet of data to the host (must be connected first) /// Send a packet of data to the host (must be connected first)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketTCP_SendPacket(sfSocketTCP* Socket, sfPacket* Packet) sfSocketStatus sfSocketTCP_SendPacket(sfSocketTCP* socket, sfPacket* packet)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
CSFML_CHECK_RETURN(Packet, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError);
return static_cast<sfSocketStatus>(Socket->This.Send(Packet->This)); return static_cast<sfSocketStatus>(socket->This.Send(packet->This));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive a packet from the host (must be connected first) /// Receive a packet from the host (must be connected first)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* Socket, sfPacket* Packet) sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* socket, sfPacket* packet)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
CSFML_CHECK_RETURN(Packet, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError);
return static_cast<sfSocketStatus>(Socket->This.Receive(Packet->This)); return static_cast<sfSocketStatus>(socket->This.Receive(packet->This));
} }
@ -174,7 +174,7 @@ sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* Socket, sfPacket* Packet)
/// 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(sfSocketTCP* socket)
{ {
CSFML_CALL_RETURN(Socket, IsValid(), sfFalse); CSFML_CALL_RETURN(socket, IsValid(), sfFalse);
} }

View File

@ -45,9 +45,9 @@ sfSocketUDP* sfSocketUDP_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing UDP socket /// Destroy an existing UDP socket
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSocketUDP_Destroy(sfSocketUDP* Socket) void sfSocketUDP_Destroy(sfSocketUDP* socket)
{ {
delete Socket; delete socket;
} }
@ -55,41 +55,41 @@ void sfSocketUDP_Destroy(sfSocketUDP* Socket)
/// Change the blocking state of a UDP socket. /// Change the blocking state of a UDP socket.
/// The default behaviour of a socket is blocking /// The default behaviour of a socket is blocking
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfSocketUDP_SetBlocking(sfSocketUDP* Socket, sfBool Blocking) void sfSocketUDP_SetBlocking(sfSocketUDP* socket, sfBool blocking)
{ {
CSFML_CALL(Socket, SetBlocking(Blocking == sfTrue)); CSFML_CALL(socket, SetBlocking(blocking == sfTrue));
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a socket to a specific port /// Bind a socket to a specific port
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSocketUDP_Bind(sfSocketUDP* Socket, unsigned short Port) sfBool sfSocketUDP_Bind(sfSocketUDP* socket, unsigned short port)
{ {
CSFML_CALL_RETURN(Socket, Bind(Port), sfFalse); CSFML_CALL_RETURN(socket, Bind(port), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Unbind a socket from its previous port, if any /// Unbind a socket from its previous port, if any
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfSocketUDP_Unbind(sfSocketUDP* Socket) sfBool sfSocketUDP_Unbind(sfSocketUDP* socket)
{ {
CSFML_CALL_RETURN(Socket, Unbind(), sfFalse); CSFML_CALL_RETURN(socket, Unbind(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send an array of bytes /// Send an array of bytes
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketUDP_Send(sfSocketUDP* Socket, const char* Data, size_t Size, sfIPAddress Address, unsigned short Port) sfSocketStatus sfSocketUDP_Send(sfSocketUDP* socket, const char* data, size_t size, sfIPAddress address, unsigned short port)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError) CSFML_CHECK_RETURN(socket, sfSocketError)
// Convert the address // Convert the address
sf::IPAddress Receiver(Address.Address); sf::IPAddress receiver(address.Address);
return static_cast<sfSocketStatus>(Socket->This.Send(Data, Size, Receiver, Port)); return static_cast<sfSocketStatus>(socket->This.Send(data, size, receiver, port));
} }
@ -98,27 +98,27 @@ sfSocketStatus sfSocketUDP_Send(sfSocketUDP* Socket, const char* Data, size_t Si
/// This function is blocking, ie. it won't return before some /// This function is blocking, ie. it won't return before some
/// bytes have been received /// bytes have been received
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* Socket, char* Data, size_t MaxSize, size_t* SizeReceived, sfIPAddress* Address, unsigned short* Port) sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIPAddress* address, unsigned short* port)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(Socket, sfSocketError);
// Call SFML internal function // Call SFML internal function
sf::IPAddress Sender; sf::IPAddress sender;
unsigned short SenderPort; unsigned short senderPort;
std::size_t Received; std::size_t received;
sf::Socket::Status Status = Socket->This.Receive(Data, MaxSize, Received, Sender, SenderPort); sf::Socket::Status status = socket->This.Receive(data, maxSize, received, sender, senderPort);
if (Status != sf::Socket::Done) if (status != sf::Socket::Done)
return static_cast<sfSocketStatus>(Status); return static_cast<sfSocketStatus>(status);
if (SizeReceived) if (sizeReceived)
*SizeReceived = Received; *sizeReceived = received;
if (Address) if (address)
strncpy(Address->Address, Sender.ToString().c_str(), 16); strncpy(address->Address, sender.ToString().c_str(), 16);
if (Port) if (port)
*Port = SenderPort; *port = senderPort;
return sfSocketDone; return sfSocketDone;
} }
@ -127,15 +127,15 @@ sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* Socket, char* Data, size_t MaxSi
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a packet of data /// Send a packet of data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* Socket, sfPacket* Packet, sfIPAddress Address, unsigned short Port) sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* socket, sfPacket* packet, sfIPAddress address, unsigned short port)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
CSFML_CHECK_RETURN(Packet, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError);
// Convert the address // Convert the address
sf::IPAddress Receiver(Address.Address); sf::IPAddress receiver(address.Address);
return static_cast<sfSocketStatus>(Socket->This.Send(Packet->This, Receiver, Port)); return static_cast<sfSocketStatus>(socket->This.Send(packet->This, receiver, port));
} }
@ -144,22 +144,22 @@ sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* Socket, sfPacket* Packet, sfI
/// This function is blocking, ie. it won't return before a /// This function is blocking, ie. it won't return before a
/// packet is received /// packet is received
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* Socket, sfPacket* Packet, sfIPAddress* Address, unsigned short* Port) sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* socket, sfPacket* packet, sfIPAddress* address, unsigned short* port)
{ {
CSFML_CHECK_RETURN(Socket, sfSocketError); CSFML_CHECK_RETURN(socket, sfSocketError);
CSFML_CHECK_RETURN(Packet, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError);
sf::IPAddress Sender; sf::IPAddress sender;
unsigned short SenderPort; unsigned short senderPort;
sf::Socket::Status Status = Socket->This.Receive(Packet->This, Sender, SenderPort); sf::Socket::Status status = socket->This.Receive(packet->This, sender, senderPort);
if (Status != sf::Socket::Done) if (status != sf::Socket::Done)
return static_cast<sfSocketStatus>(Status); return static_cast<sfSocketStatus>(status);
if (Address) if (address)
strncpy(Address->Address, Sender.ToString().c_str(), 16); strncpy(address->Address, sender.ToString().c_str(), 16);
if (Port) if (port)
*Port = SenderPort; *port = senderPort;
return sfSocketDone; return sfSocketDone;
} }
@ -169,7 +169,7 @@ sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* Socket, sfPacket* Packet,
/// 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(sfSocketUDP* socket)
{ {
CSFML_CALL_RETURN(Socket, IsValid(), sfFalse); CSFML_CALL_RETURN(socket, IsValid(), sfFalse);
} }

View File

@ -42,25 +42,25 @@ sfClock* sfClock_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing clock /// Destroy an existing clock
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfClock_Destroy(sfClock* Clock) void sfClock_Destroy(sfClock* clock)
{ {
delete Clock; delete clock;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the time elapsed for a clock /// Get the time elapsed for a clock
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfClock_GetTime(sfClock* Clock) float sfClock_GetTime(sfClock* clock)
{ {
CSFML_CALL_RETURN(Clock, GetElapsedTime(), 0.f) CSFML_CALL_RETURN(clock, GetElapsedTime(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Restart a clock /// Restart a clock
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfClock_Reset(sfClock* Clock) void sfClock_Reset(sfClock* clock)
{ {
CSFML_CALL(Clock, Reset()) CSFML_CALL(clock, Reset())
} }

View File

@ -42,25 +42,25 @@ sfMutex* sfMutex_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing mutex /// Destroy an existing mutex
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMutex_Destroy(sfMutex* Mutex) void sfMutex_Destroy(sfMutex* mutex)
{ {
delete Mutex; delete mutex;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Lock a mutex /// Lock a mutex
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMutex_Lock(sfMutex* Mutex) void sfMutex_Lock(sfMutex* mutex)
{ {
CSFML_CALL(Mutex, Lock()) CSFML_CALL(mutex, Lock())
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Unlock a mutex /// Unlock a mutex
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfMutex_Unlock(sfMutex* Mutex) void sfMutex_Unlock(sfMutex* mutex)
{ {
CSFML_CALL(Mutex, Unlock()) CSFML_CALL(mutex, Unlock())
} }

View File

@ -34,9 +34,9 @@
/// Set the seed for the random numbers generator. Using a known seed /// Set the seed for the random numbers generator. Using a known seed
/// allows you to reproduce the same sequence of random numbers /// allows you to reproduce the same sequence of random numbers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfRandom_SetSeed(unsigned int Seed) void sfRandom_SetSeed(unsigned int seed)
{ {
sf::Randomizer::SetSeed(Seed); sf::Randomizer::SetSeed(seed);
} }
@ -52,16 +52,16 @@ unsigned int sfRandom_GetSeed()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a random float number in a given range /// Get a random float number in a given range
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfRandom_Float(float Begin, float End) float sfRandom_Float(float begin, float end)
{ {
return sf::Randomizer::Random(Begin, End); return sf::Randomizer::Random(begin, end);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a random integer number in a given range /// Get a random integer number in a given range
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int sfRandom_Int(int Begin, int End) int sfRandom_Int(int begin, int end)
{ {
return sf::Randomizer::Random(Begin, End); return sf::Randomizer::Random(begin, end);
} }

View File

@ -33,36 +33,36 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new thread from a function pointer /// Construct a new thread from a function pointer
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfThread* sfThread_Create(void (*Function)(void*), void* UserData) sfThread* sfThread_Create(void (*function)(void*), void* userData)
{ {
return new sfThread(Function, UserData); return new sfThread(function, userData);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing thread /// Destroy an existing thread
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfThread_Destroy(sfThread* Thread) void sfThread_Destroy(sfThread* thread)
{ {
delete Thread; delete thread;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Run a thread /// Run a thread
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfThread_Launch(sfThread* Thread) void sfThread_Launch(sfThread* thread)
{ {
CSFML_CALL(Thread, Launch()); CSFML_CALL(thread, Launch());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Wait until a thread finishes /// Wait until a thread finishes
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfThread_Wait(sfThread* Thread) void sfThread_Wait(sfThread* thread)
{ {
CSFML_CALL(Thread, Wait()); CSFML_CALL(thread, Wait());
} }
@ -72,7 +72,7 @@ void sfThread_Wait(sfThread* Thread)
/// you should rather try to make the thread function /// you should rather try to make the thread function
/// terminate by itself /// terminate by itself
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfThread_Terminate(sfThread* Thread) void sfThread_Terminate(sfThread* thread)
{ {
CSFML_CALL(Thread, Terminate()); CSFML_CALL(thread, Terminate());
} }

View File

@ -42,16 +42,16 @@ sfContext* sfContext_Create()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing context /// Destroy an existing context
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfContext_Destroy(sfContext* Context) void sfContext_Destroy(sfContext* context)
{ {
delete Context; delete context;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a context /// Activate or deactivate a context
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfContext_SetActive(sfContext* Context, sfBool Active) void sfContext_SetActive(sfContext* context, sfBool active)
{ {
CSFML_CALL(Context, SetActive(Active == sfTrue)) CSFML_CALL(context, SetActive(active == sfTrue))
} }

View File

@ -33,51 +33,51 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a key /// Get the state of a key
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfInput_IsKeyDown(sfInput* Input, sfKeyCode KeyCode) sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code)
{ {
CSFML_CALL_PTR_RETURN(Input, IsKeyDown((sf::Key::Code)KeyCode), sfFalse); CSFML_CALL_PTR_RETURN(input, IsKeyDown((sf::Key::Code)code), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a mouse button /// Get the state of a mouse button
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfInput_IsMouseButtonDown(sfInput* Input, sfMouseButton Button) sfBool sfInput_IsMouseButtonDown(sfInput* input, sfMouseButton button)
{ {
CSFML_CALL_PTR_RETURN(Input, IsMouseButtonDown((sf::Mouse::Button)Button), sfFalse); CSFML_CALL_PTR_RETURN(input, IsMouseButtonDown((sf::Mouse::Button)button), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a joystick button /// Get the state of a joystick button
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfInput_IsJoystickButtonDown(sfInput* Input, unsigned int JoyId, unsigned int Button) sfBool sfInput_IsJoystickButtonDown(sfInput* input, unsigned int joyId, unsigned int button)
{ {
CSFML_CALL_PTR_RETURN(Input, IsJoystickButtonDown(JoyId, Button), sfFalse); CSFML_CALL_PTR_RETURN(input, IsJoystickButtonDown(joyId, button), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse X position /// Get the mouse X position
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int sfInput_GetMouseX(sfInput* Input) int sfInput_GetMouseX(sfInput* input)
{ {
CSFML_CALL_PTR_RETURN(Input, GetMouseX(), 0); CSFML_CALL_PTR_RETURN(input, GetMouseX(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse Y position /// Get the mouse Y position
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int sfInput_GetMouseY(sfInput* Input) int sfInput_GetMouseY(sfInput* input)
{ {
CSFML_CALL_PTR_RETURN(Input, GetMouseY(), 0); CSFML_CALL_PTR_RETURN(input, GetMouseY(), 0);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the joystick position on a given axis /// Get the joystick position on a given axis
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfInput_GetJoystickAxis(sfInput* Input, unsigned int JoyId, sfJoyAxis Axis) float sfInput_GetJoystickAxis(sfInput* input, unsigned int joyId, sfJoyAxis axis)
{ {
CSFML_CALL_PTR_RETURN(Input, GetJoystickAxis(JoyId, (sf::Joy::Axis)Axis), 0.f); CSFML_CALL_PTR_RETURN(input, GetJoystickAxis(joyId, (sf::Joy::Axis)axis), 0.f);
} }

View File

@ -36,13 +36,13 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfVideoMode sfVideoMode_GetDesktopMode() sfVideoMode sfVideoMode_GetDesktopMode()
{ {
sf::VideoMode Desktop = sf::VideoMode::GetDesktopMode(); sf::VideoMode desktop = sf::VideoMode::GetDesktopMode();
sfVideoMode Ret; sfVideoMode ret;
Ret.Width = Desktop.Width; ret.Width = desktop.Width;
Ret.Height = Desktop.Height; ret.Height = desktop.Height;
Ret.BitsPerPixel = Desktop.BitsPerPixel; ret.BitsPerPixel = desktop.BitsPerPixel;
return Ret; return ret;
} }
@ -51,15 +51,15 @@ sfVideoMode sfVideoMode_GetDesktopMode()
/// Index must be in range [0, GetModesCount()[ /// Index must be in range [0, GetModesCount()[
/// Modes are sorted from best to worst /// Modes are sorted from best to worst
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfVideoMode sfVideoMode_GetMode(size_t Index) sfVideoMode sfVideoMode_GetMode(size_t index)
{ {
sf::VideoMode Mode = sf::VideoMode::GetMode(Index); sf::VideoMode mode = sf::VideoMode::GetMode(index);
sfVideoMode Ret; sfVideoMode ret;
Ret.Width = Mode.Width; ret.Width = mode.Width;
Ret.Height = Mode.Height; ret.Height = mode.Height;
Ret.BitsPerPixel = Mode.BitsPerPixel; ret.BitsPerPixel = mode.BitsPerPixel;
return Ret; return ret;
} }
@ -75,8 +75,8 @@ size_t sfVideoMode_GetModesCount()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a video mode is supported /// Tell whether or not a video mode is supported
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfVideoMode_IsValid(sfVideoMode Mode) sfBool sfVideoMode_IsValid(sfVideoMode mode)
{ {
sf::VideoMode VideoMode(Mode.Width, Mode.Height, Mode.BitsPerPixel); sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel);
return VideoMode.IsValid() ? sfTrue : sfFalse; return videoMode.IsValid() ? sfTrue : sfFalse;
} }

View File

@ -33,161 +33,161 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a new window /// Construct a new window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfWindow* sfWindow_Create(sfVideoMode Mode, const char* Title, unsigned long Style, sfContextSettings Params) sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, unsigned long style, 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);
// Create the window // Create the window
sfWindow* Window = new sfWindow; sfWindow* window = new sfWindow;
sf::ContextSettings Settings(Params.DepthBits, Params.StencilBits, Params.AntialiasingLevel); sf::ContextSettings params(settings.DepthBits, settings.StencilBits, settings.AntialiasingLevel);
Window->This.Create(VideoMode, Title, Style, Settings); window->This.Create(videoMode, title, style, params);
Window->Input.This = &Window->This.GetInput(); window->Input.This = &window->This.GetInput();
return Window; return window;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct a window from an existing control /// Construct a window from an existing control
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfWindow* sfWindow_CreateFromHandle(sfWindowHandle Handle, sfContextSettings Params) sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, sfContextSettings settings)
{ {
sfWindow* Window = new sfWindow; sfWindow* window = new sfWindow;
sf::ContextSettings Settings(Params.DepthBits, Params.StencilBits, Params.AntialiasingLevel); sf::ContextSettings params(settings.DepthBits, settings.StencilBits, settings.AntialiasingLevel);
Window->This.Create(Handle, Settings); window->This.Create(handle, params);
Window->Input.This = &Window->This.GetInput(); window->Input.This = &window->This.GetInput();
return Window; return window;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destroy an existing window /// Destroy an existing window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_Destroy(sfWindow* Window) void sfWindow_Destroy(sfWindow* window)
{ {
delete Window; delete window;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close a window (but doesn't destroy the internal data) /// Close a window (but doesn't destroy the internal data)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_Close(sfWindow* Window) void sfWindow_Close(sfWindow* window)
{ {
CSFML_CALL(Window, Close()); CSFML_CALL(window, Close());
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not a window is opened /// Tell whether or not a window is opened
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfWindow_IsOpened(sfWindow* Window) sfBool sfWindow_IsOpened(sfWindow* window)
{ {
CSFML_CALL_RETURN(Window, IsOpened(), sfFalse); CSFML_CALL_RETURN(window, IsOpened(), sfFalse);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfWindow* window)
{ {
CSFML_CALL_RETURN(Window, GetWidth(), 0) CSFML_CALL_RETURN(window, GetWidth(), 0)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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(sfWindow* window)
{ {
CSFML_CALL_RETURN(Window, GetHeight(), 0) CSFML_CALL_RETURN(window, GetHeight(), 0)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the creation settings of a window /// Get the creation settings of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfContextSettings sfWindow_GetSettings(sfWindow* Window) sfContextSettings sfWindow_GetSettings(sfWindow* window)
{ {
sfContextSettings Settings = {0, 0, 0}; sfContextSettings settings = {0, 0, 0};
CSFML_CHECK_RETURN(Window, Settings); CSFML_CHECK_RETURN(window, settings);
const sf::ContextSettings& Params = Window->This.GetSettings(); const sf::ContextSettings& params = window->This.GetSettings();
Settings.DepthBits = Params.DepthBits; settings.DepthBits = params.DepthBits;
Settings.StencilBits = Params.StencilBits; settings.StencilBits = params.StencilBits;
Settings.AntialiasingLevel = Params.AntialiasingLevel; settings.AntialiasingLevel = params.AntialiasingLevel;
return Settings; return settings;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfWindow_GetEvent(sfWindow* Window, sfEvent* Event) sfBool sfWindow_GetEvent(sfWindow* window, sfEvent* event)
{ {
CSFML_CHECK_RETURN(Window, sfFalse); CSFML_CHECK_RETURN(window, sfFalse);
CSFML_CHECK_RETURN(Event, sfFalse); CSFML_CHECK_RETURN(event, sfFalse);
// Get the event // Get the event
sf::Event SFMLEvent; sf::Event SFMLEvent;
sfBool Ret = Window->This.GetEvent(SFMLEvent); sfBool ret = window->This.GetEvent(SFMLEvent);
// No event, return // No event, return
if (!Ret) if (!ret)
return sfFalse; return sfFalse;
// Convert its type // Convert its type
Event->Type = static_cast<sfEventType>(SFMLEvent.Type); event->Type = static_cast<sfEventType>(SFMLEvent.Type);
// Fill its fields // Fill its fields
switch (Event->Type) switch (event->Type)
{ {
case sfEvtResized : case sfEvtResized :
Event->Size.Width = SFMLEvent.Size.Width; event->Size.Width = SFMLEvent.Size.Width;
Event->Size.Height = SFMLEvent.Size.Height; event->Size.Height = SFMLEvent.Size.Height;
break; break;
case sfEvtTextEntered : case sfEvtTextEntered :
Event->Text.Unicode = SFMLEvent.Text.Unicode; event->Text.Unicode = SFMLEvent.Text.Unicode;
break; break;
case sfEvtKeyReleased : case sfEvtKeyReleased :
case sfEvtKeyPressed : case sfEvtKeyPressed :
Event->Key.Code = static_cast<sfKeyCode>(SFMLEvent.Key.Code); event->Key.Code = static_cast<sfKeyCode>(SFMLEvent.Key.Code);
Event->Key.Alt = SFMLEvent.Key.Alt ? sfTrue : sfFalse; event->Key.Alt = SFMLEvent.Key.Alt ? sfTrue : sfFalse;
Event->Key.Control = SFMLEvent.Key.Control ? sfTrue : sfFalse; event->Key.Control = SFMLEvent.Key.Control ? sfTrue : sfFalse;
Event->Key.Shift = SFMLEvent.Key.Shift ? sfTrue : sfFalse; event->Key.Shift = SFMLEvent.Key.Shift ? sfTrue : sfFalse;
break; break;
case sfEvtMouseWheelMoved : case sfEvtMouseWheelMoved :
Event->MouseWheel.Delta = SFMLEvent.MouseWheel.Delta; event->MouseWheel.Delta = SFMLEvent.MouseWheel.Delta;
break; break;
case sfEvtMouseButtonPressed : case sfEvtMouseButtonPressed :
case sfEvtMouseButtonReleased : case sfEvtMouseButtonReleased :
Event->MouseButton.Button = static_cast<sfMouseButton>(SFMLEvent.MouseButton.Button); event->MouseButton.Button = static_cast<sfMouseButton>(SFMLEvent.MouseButton.Button);
Event->MouseButton.X = SFMLEvent.MouseButton.X; event->MouseButton.X = SFMLEvent.MouseButton.X;
Event->MouseButton.Y = SFMLEvent.MouseButton.Y; event->MouseButton.Y = SFMLEvent.MouseButton.Y;
break; break;
case sfEvtMouseMoved : case sfEvtMouseMoved :
Event->MouseMove.X = SFMLEvent.MouseMove.X; event->MouseMove.X = SFMLEvent.MouseMove.X;
Event->MouseMove.Y = SFMLEvent.MouseMove.Y; event->MouseMove.Y = SFMLEvent.MouseMove.Y;
break; break;
case sfEvtJoyButtonPressed : case sfEvtJoyButtonPressed :
case sfEvtJoyButtonReleased : case sfEvtJoyButtonReleased :
Event->JoyButton.JoystickId = SFMLEvent.JoyButton.JoystickId; event->JoyButton.JoystickId = SFMLEvent.JoyButton.JoystickId;
Event->JoyButton.Button = SFMLEvent.JoyButton.Button; event->JoyButton.Button = SFMLEvent.JoyButton.Button;
break; break;
case sfEvtJoyMoved : case sfEvtJoyMoved :
Event->JoyMove.JoystickId = SFMLEvent.JoyMove.JoystickId; event->JoyMove.JoystickId = SFMLEvent.JoyMove.JoystickId;
Event->JoyMove.Axis = static_cast<sfJoyAxis>(SFMLEvent.JoyMove.Axis); event->JoyMove.Axis = static_cast<sfJoyAxis>(SFMLEvent.JoyMove.Axis);
Event->JoyMove.Position = SFMLEvent.JoyMove.Position; event->JoyMove.Position = SFMLEvent.JoyMove.Position;
break; break;
default : default :
@ -201,27 +201,27 @@ sfBool sfWindow_GetEvent(sfWindow* Window, sfEvent* Event)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable / disable vertical synchronization on a window /// Enable / disable vertical synchronization on a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_UseVerticalSync(sfWindow* Window, sfBool Enabled) void sfWindow_UseVerticalSync(sfWindow* window, sfBool enabled)
{ {
CSFML_CALL(Window, UseVerticalSync(Enabled == sfTrue)) CSFML_CALL(window, UseVerticalSync(enabled == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Show or hide the mouse cursor on a window /// Show or hide the mouse cursor on a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_ShowMouseCursor(sfWindow* Window, sfBool Show) void sfWindow_ShowMouseCursor(sfWindow* window, sfBool show)
{ {
CSFML_CALL(Window, ShowMouseCursor(Show == sfTrue)) CSFML_CALL(window, ShowMouseCursor(show == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of the mouse cursor on a window /// Change the position of the mouse cursor on a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_SetCursorPosition(sfWindow* Window, unsigned int Left, unsigned int Top) void sfWindow_SetCursorPosition(sfWindow* window, unsigned int left, unsigned int top)
{ {
CSFML_CALL(Window, SetCursorPosition(Left, Top)) CSFML_CALL(window, SetCursorPosition(left, top))
} }
@ -229,27 +229,27 @@ void sfWindow_SetCursorPosition(sfWindow* Window, unsigned int Left, unsigned in
/// Change the position of a window on screen. /// Change the position of a window on screen.
/// Only works for top-level windows /// Only works for top-level windows
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_SetPosition(sfWindow* Window, int Left, int Top) void sfWindow_SetPosition(sfWindow* window, int left, int top)
{ {
CSFML_CALL(Window, SetPosition(Left, Top)) CSFML_CALL(window, SetPosition(left, top))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the size of the rendering region of a window /// Change the size of the rendering region of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_SetSize(sfWindow* Window, unsigned int Width, unsigned int Height) void sfWindow_SetSize(sfWindow* window, unsigned int width, unsigned int height)
{ {
CSFML_CALL(Window, SetSize(Width, Height)) CSFML_CALL(window, SetSize(width, height))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Show or hide a window /// Show or hide a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_Show(sfWindow* Window, sfBool State) void sfWindow_Show(sfWindow* window, sfBool show)
{ {
CSFML_CALL(Window, Show(State == sfTrue)) CSFML_CALL(window, Show(show == sfTrue))
} }
@ -257,75 +257,72 @@ void sfWindow_Show(sfWindow* Window, sfBool State)
/// Enable or disable automatic key-repeat for keydown events. /// Enable or disable automatic key-repeat for keydown events.
/// Automatic key-repeat is enabled by default /// Automatic key-repeat is enabled by default
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_EnableKeyRepeat(sfWindow* Window, sfBool Enabled) void sfWindow_EnableKeyRepeat(sfWindow* window, sfBool enabled)
{ {
CSFML_CALL(Window, EnableKeyRepeat(Enabled == sfTrue)) CSFML_CALL(window, EnableKeyRepeat(enabled == sfTrue))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// 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, sfUint8* pixels)
{ {
CSFML_CALL(Window, SetIcon(Width, Height, Pixels)) CSFML_CALL(window, SetIcon(width, height, pixels))
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate or deactivate a window as the current target for rendering /// Activate or deactivate a window as the current target for rendering
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfWindow_SetActive(sfWindow* Window, sfBool Active) sfBool sfWindow_SetActive(sfWindow* window, sfBool active)
{ {
CSFML_CALL_RETURN(Window, SetActive(Active == sfTrue), sfFalse) CSFML_CALL_RETURN(window, SetActive(active == sfTrue), sfFalse)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Display a window on screen /// Display a window on screen
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_Display(sfWindow* Window) void sfWindow_Display(sfWindow* window)
{ {
CSFML_CALL(Window, Display()) CSFML_CALL(window, Display())
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the input manager of a window /// Get the input manager of a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfInput* sfWindow_GetInput(sfWindow* Window) sfInput* sfWindow_GetInput(sfWindow* window)
{ {
CSFML_CHECK_RETURN(Window, NULL); CSFML_CHECK_RETURN(window, NULL);
return &Window->Input; return &window->Input;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Limit the framerate to a maximum fixed frequency for a window /// Limit the framerate to a maximum fixed frequency for a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_SetFramerateLimit(sfWindow* Window, unsigned int Limit) void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit)
{ {
CSFML_CALL(Window, SetFramerateLimit(Limit)) CSFML_CALL(window, SetFramerateLimit(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(sfWindow* window)
{ {
CSFML_CALL_RETURN(Window, GetFrameTime(), 0.f) CSFML_CALL_RETURN(window, GetFrameTime(), 0.f)
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which /// Change the joystick threshold, ie. the value below which
/// no move event will be generated /// no move event will be generated
///
/// \param Threshold : New threshold, in range [0, 100]
///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfWindow_SetJoystickThreshold(sfWindow* Window, float Threshold) void sfWindow_SetJoystickThreshold(sfWindow* window, float threshold)
{ {
CSFML_CALL(Window, SetJoystickThreshold(Threshold)) CSFML_CALL(window, SetJoystickThreshold(threshold))
} }

View File

@ -347,14 +347,6 @@
RelativePath="..\..\src\SFML\Audio\AudioDevice.hpp" RelativePath="..\..\src\SFML\Audio\AudioDevice.hpp"
> >
</File> </File>
<File
RelativePath="..\..\src\SFML\Audio\AudioResource.cpp"
>
</File>
<File
RelativePath="..\..\src\SFML\Audio\AudioResource.hpp"
>
</File>
<File <File
RelativePath="..\..\src\SFML\Audio\Listener.cpp" RelativePath="..\..\src\SFML\Audio\Listener.cpp"
> >
@ -368,7 +360,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Audio\Music.hpp" RelativePath="..\..\include\SFML\Audio\Music.hpp"
> >
</File> </File>
<File <File
@ -380,7 +372,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Audio\Sound.hpp" RelativePath="..\..\include\SFML\Audio\Sound.hpp"
> >
</File> </File>
<File <File
@ -388,7 +380,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Audio\SoundBuffer.hpp" RelativePath="..\..\include\SFML\Audio\SoundBuffer.hpp"
> >
</File> </File>
<File <File
@ -396,7 +388,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Audio\SoundBufferRecorder.hpp" RelativePath="..\..\include\SFML\Audio\SoundBufferRecorder.hpp"
> >
</File> </File>
<File <File
@ -412,7 +404,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Audio\SoundRecorder.hpp" RelativePath="..\..\include\SFML\Audio\SoundRecorder.hpp"
> >
</File> </File>
<File <File
@ -420,7 +412,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Audio\SoundStream.hpp" RelativePath="..\..\include\SFML\Audio\SoundStream.hpp"
> >
</File> </File>
</Files> </Files>

View File

@ -147,16 +147,10 @@
<References> <References>
</References> </References>
<Files> <Files>
<Filter <File
Name="Sources Files" RelativePath="..\..\src\SFML\Main\SFML_Main.cpp"
Filter="cpp;c;cc;cxx;def;odl;idl;hp"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
> >
<File </File>
RelativePath="..\..\src\SFML\Main\SFML_Main.cpp"
>
</File>
</Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>

View File

@ -343,7 +343,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\Win32\SocketHelper.hpp" RelativePath="..\..\include\SFML\Network\Win32\SocketHelper.hpp"
> >
</File> </File>
</Filter> </Filter>
@ -368,7 +368,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\IPAddress.hpp" RelativePath="..\..\include\SFML\Network\IPAddress.hpp"
> >
</File> </File>
<File <File
@ -376,15 +376,15 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\Packet.hpp" RelativePath="..\..\include\SFML\Network\Packet.hpp"
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\Selector.hpp" RelativePath="..\..\include\SFML\Network\Selector.hpp"
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\Selector.inl" RelativePath="..\..\include\SFML\Network\Selector.inl"
> >
</File> </File>
<File <File
@ -396,7 +396,11 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\SocketHelper.hpp" RelativePath="..\..\include\SFML\Network\SocketHelper.hpp"
>
</File>
<File
RelativePath="..\..\include\SFML\Network\Sockets.hpp"
> >
</File> </File>
<File <File
@ -404,7 +408,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\SocketTCP.hpp" RelativePath="..\..\include\SFML\Network\SocketTCP.hpp"
> >
</File> </File>
<File <File
@ -412,7 +416,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Network\SocketUDP.hpp" RelativePath="..\..\include\SFML\Network\SocketUDP.hpp"
> >
</File> </File>
</Files> </Files>

View File

@ -372,7 +372,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\Clock.hpp" RelativePath="..\..\include\SFML\System\Clock.hpp"
> >
</File> </File>
<File <File
@ -380,7 +380,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\Lock.hpp" RelativePath="..\..\include\SFML\System\Lock.hpp"
> >
</File> </File>
<File <File
@ -388,11 +388,11 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\Mutex.hpp" RelativePath="..\..\include\SFML\System\Mutex.hpp"
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\NonCopyable.hpp" RelativePath="..\..\include\SFML\System\NonCopyable.hpp"
> >
</File> </File>
<File <File
@ -404,7 +404,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\Randomizer.hpp" RelativePath="..\..\include\SFML\System\Randomizer.hpp"
> >
</File> </File>
<File <File
@ -424,7 +424,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\Sleep.hpp" RelativePath="..\..\include\SFML\System\Sleep.hpp"
> >
</File> </File>
<File <File
@ -432,7 +432,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\System\Thread.hpp" RelativePath="..\..\include\SFML\System\Thread.hpp"
> >
</File> </File>
<File <File
@ -463,6 +463,22 @@
RelativePath="..\..\include\SFML\System\Unicode.inl" RelativePath="..\..\include\SFML\System\Unicode.inl"
> >
</File> </File>
<File
RelativePath="..\..\include\SFML\System\Vector2.hpp"
>
</File>
<File
RelativePath="..\..\include\SFML\System\Vector2.inl"
>
</File>
<File
RelativePath="..\..\include\SFML\System\Vector3.hpp"
>
</File>
<File
RelativePath="..\..\include\SFML\System\Vector3.inl"
>
</File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>

View File

@ -428,7 +428,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\Event.hpp" RelativePath="..\..\include\SFML\Window\Event.hpp"
> >
</File> </File>
<File <File
@ -436,7 +436,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\Input.hpp" RelativePath="..\..\include\SFML\Window\Input.hpp"
> >
</File> </File>
<File <File
@ -448,7 +448,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\VideoMode.hpp" RelativePath="..\..\include\SFML\Window\VideoMode.hpp"
> >
</File> </File>
<File <File
@ -460,11 +460,11 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\Window.hpp" RelativePath="..\..\include\SFML\Window\Window.hpp"
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\WindowHandle.hpp" RelativePath="..\..\include\SFML\Window\WindowHandle.hpp"
> >
</File> </File>
<File <File
@ -476,11 +476,11 @@
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\WindowListener.hpp" RelativePath="..\..\include\SFML\Window\WindowListener.hpp"
> >
</File> </File>
<File <File
RelativePath="..\..\src\SFML\Window\WindowStyle.hpp" RelativePath="..\..\include\SFML\Window\WindowStyle.hpp"
> >
</File> </File>
</Files> </Files>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{160AE11E-138A-4B77-9642-EA74F9A79B4D}</ProjectGuid> <ProjectGuid>{160AE11E-138A-4B77-9642-EA74F9A79B4D}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -21,7 +21,7 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9D4738F7-34EA-433A-A765-AF85A52A174D}</ProjectGuid> <ProjectGuid>{9D4738F7-34EA-433A-A765-AF85A52A174D}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -19,7 +19,7 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{16E177F3-A0FF-4091-8521-562E0EBAA3AB}</ProjectGuid> <ProjectGuid>{16E177F3-A0FF-4091-8521-562E0EBAA3AB}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
@ -21,7 +21,7 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F2F48990-F81E-41BA-AD01-168F6178C807}</ProjectGuid> <ProjectGuid>{F2F48990-F81E-41BA-AD01-168F6178C807}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
@ -21,7 +21,7 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C1FBB9AF-B69A-4D06-9BDC-EAC7606296FF}</ProjectGuid> <ProjectGuid>{C1FBB9AF-B69A-4D06-9BDC-EAC7606296FF}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -19,10 +19,11 @@
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@ -1,67 +0,0 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
////////////////////////////////////////////////////////////
#ifndef SFML_AUDIORESOURCE_HPP
#define SFML_AUDIORESOURCE_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
namespace sf
{
////////////////////////////////////////////////////////////
/// Abstract base class for every class that owns a
/// device-dependant resource -- allow them to initialize / shutdown
/// even when the audio context is not created
////////////////////////////////////////////////////////////
class SFML_API AudioResource
{
protected :
////////////////////////////////////////////////////////////
/// Default constructor
///
////////////////////////////////////////////////////////////
AudioResource();
////////////////////////////////////////////////////////////
/// Copy constructor
///
////////////////////////////////////////////////////////////
AudioResource(const AudioResource&);
////////////////////////////////////////////////////////////
/// Destructor
///
////////////////////////////////////////////////////////////
virtual ~AudioResource();
};
} // namespace sf
#endif // SFML_AUDIORESOURCE_HPP

View File

@ -47,10 +47,10 @@ public :
/// Change the global volume of all the sounds. /// Change the global volume of all the sounds.
/// The default volume is 100 /// The default volume is 100
/// ///
/// \param Volume : New global volume, in the range [0, 100] /// \param volume : New global volume, in the range [0, 100]
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void SetGlobalVolume(float Volume); static void SetGlobalVolume(float volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current value of the global volume of all the sounds /// Get the current value of the global volume of all the sounds
@ -64,19 +64,19 @@ public :
/// Change the position of the listener (take 3 values). /// Change the position of the listener (take 3 values).
/// The default position is (0, 0, 0) /// The default position is (0, 0, 0)
/// ///
/// \param X, Y, Z : Position of the listener in the world /// \param x, y, z : Position of the listener in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void SetPosition(float X, float Y, float Z); static void SetPosition(float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the position of the listener (take a 3D vector). /// Change the position of the listener (take a 3D vector).
/// The default position is (0, 0, 0) /// The default position is (0, 0, 0)
/// ///
/// \param Position : Position of the listener in the world /// \param position : Position of the listener in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void SetPosition(const Vector3f& Position); static void SetPosition(const Vector3f& position);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current position of the listener /// Get the current position of the listener
@ -91,20 +91,20 @@ public :
/// he must look at) (take 3 values). /// he must look at) (take 3 values).
/// The default target is (0, 0, -1) /// The default target is (0, 0, -1)
/// ///
/// \param X, Y, Z : Position of the point the listener must look at /// \param x, y, z : Position of the point the listener must look at
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void SetTarget(float X, float Y, float Z); static void SetTarget(float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the orientation of the listener (the point /// Change the orientation of the listener (the point
/// he must look at) (take a 3D vector). /// he must look at) (take a 3D vector).
/// The default target is (0, 0, -1) /// The default target is (0, 0, -1)
/// ///
/// \param Target : Position of the point the listener must look at /// \param target : Position of the point the listener must look at
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void SetTarget(const Vector3f& Target); static void SetTarget(const Vector3f& target);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current orientation of the listener (the point /// Get the current orientation of the listener (the point

View File

@ -52,11 +52,11 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the music with a buffer size /// Construct the music with a buffer size
/// ///
/// \param BufferSize : Size of the internal buffer, expressed in number of samples /// \param bufferSize : Size of the internal buffer, expressed in number of samples
/// (ie. size taken by the music in memory) (44100 by default) /// (ie. size taken by the music in memory) (44100 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Music(std::size_t BufferSize = 44100); Music(std::size_t bufferSize = 44100);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
@ -67,23 +67,23 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Open a music file (doesn't play it -- call Play() for that) /// Open a music file (doesn't play it -- call Play() for that)
/// ///
/// \param Filename : Path of the music file to open /// \param filename : Path of the music file to open
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool OpenFromFile(const std::string& Filename); bool OpenFromFile(const std::string& filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Open a music file from memory (doesn't play it -- call Play() for that) /// Open a music file from memory (doesn't play it -- call Play() for that)
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool OpenFromMemory(const char* Data, std::size_t SizeInBytes); bool OpenFromMemory(const char* data, std::size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the music duration /// Get the music duration
@ -99,13 +99,13 @@ private :
/// /see SoundStream::OnGetData /// /see SoundStream::OnGetData
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool OnGetData(Chunk& Data); virtual bool OnGetData(Chunk& data);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see SoundStream::OnSeek /// /see SoundStream::OnSeek
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void OnSeek(float TimeOffset); virtual void OnSeek(float timeOffset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data

View File

@ -28,9 +28,9 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
#include <SFML/System/Resource.hpp> #include <SFML/System/Resource.hpp>
#include <SFML/System/Vector3.hpp> #include <SFML/System/Vector3.hpp>
#include <SFML/Audio/AudioResource.hpp>
#include <cstdlib> #include <cstdlib>
@ -42,7 +42,7 @@ class SoundBuffer;
/// Sound defines the properties of a sound such as position, /// Sound defines the properties of a sound such as position,
/// volume, pitch, etc. /// volume, pitch, etc.
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API Sound : public AudioResource class SFML_API Sound
{ {
public : public :
@ -65,22 +65,22 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the sound from its parameters /// Construct the sound from its parameters
/// ///
/// \param Buffer : Sound buffer to play (NULL by default) /// \param buffer : Sound buffer to play (NULL by default)
/// \param Loop : Loop flag (false by default) /// \param loop : Loop flag (false by default)
/// \param Pitch : Value of the pitch (1 by default) /// \param pitch : Value of the pitch (1 by default)
/// \param Volume : Volume (100 by default) /// \param volume : Volume (100 by default)
/// \param Position : Position (0, 0, 0 by default) /// \param position : Position (0, 0, 0 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound(const SoundBuffer& Buffer, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, const Vector3f& Position = Vector3f(0, 0, 0)); Sound(const SoundBuffer& buffer, bool loop = false, float pitch = 1.f, float volume = 100.f, const Vector3f& position = Vector3f(0, 0, 0));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy constructor /// Copy constructor
/// ///
/// \param Copy : Instance to copy /// \param copy : Instance to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound(const Sound& Copy); Sound(const Sound& copy);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
@ -109,93 +109,93 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the source buffer /// Set the source buffer
/// ///
/// \param Buffer : New sound buffer to bind to the sound /// \param buffer : New sound buffer to bind to the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetBuffer(const SoundBuffer& Buffer); void SetBuffer(const SoundBuffer& buffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound loop state. /// Set the sound loop state.
/// This parameter is disabled by default /// This parameter is disabled by default
/// ///
/// \param Loop : True to play in loop, false to play once /// \param loop : True to play in loop, false to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetLoop(bool Loop); void SetLoop(bool loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound pitch. /// Set the sound pitch.
/// The default pitch is 1 /// The default pitch is 1
/// ///
/// \param Pitch : New pitch /// \param pitch : New pitch
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPitch(float Pitch); void SetPitch(float pitch);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound volume. /// Set the sound volume.
/// The default volume is 100 /// The default volume is 100
/// ///
/// \param Volume : Volume (in range [0, 100]) /// \param volume : Volume (in range [0, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetVolume(float Volume); void SetVolume(float volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound position (take 3 values). /// Set the sound position (take 3 values).
/// The default position is (0, 0, 0) /// The default position is (0, 0, 0)
/// ///
/// \param X, Y, Z : Position of the sound in the world /// \param x, y, z : Position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPosition(float X, float Y, float Z); void SetPosition(float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound position (take a 3D vector). /// Set the sound position (take a 3D vector).
/// The default position is (0, 0, 0) /// The default position is (0, 0, 0)
/// ///
/// \param Position : Position of the sound in the world /// \param position : Position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPosition(const Vector3f& Position); void SetPosition(const Vector3f& position);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Make the sound's position relative to the listener's /// Make the sound's position relative to the listener's
/// position, or absolute. /// position, or absolute.
/// The default value is false (absolute) /// The default value is false (absolute)
/// ///
/// \param Relative : True to set the position relative, false to set it absolute /// \param relative : True to set the position relative, false to set it absolute
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetRelativeToListener(bool Relative); void SetRelativeToListener(bool relative);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance, /// Set the minimum distance - closer than this distance,
/// the listener will hear the sound at its maximum volume. /// the listener will hear the sound at its maximum volume.
/// The default minimum distance is 1.0 /// The default minimum distance is 1.0
/// ///
/// \param MinDistance : New minimum distance for the sound /// \param distance : New minimum distance for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetMinDistance(float MinDistance); void SetMinDistance(float distance);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the /// Set the attenuation factor - the higher the attenuation, the
/// more the sound will be attenuated with distance from listener. /// more the sound will be attenuated with distance from listener.
/// The default attenuation factor 1.0 /// The default attenuation factor 1.0
/// ///
/// \param Attenuation : New attenuation factor for the sound /// \param attenuation : New attenuation factor for the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetAttenuation(float Attenuation); void SetAttenuation(float attenuation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of the sound /// Set the current playing position of the sound
/// ///
/// \param TimeOffset : New playing position, expressed in seconds /// \param timeOffset : New playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPlayingOffset(float TimeOffset); void SetPlayingOffset(float timeOffset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the source buffer /// Get the source buffer
@ -286,7 +286,7 @@ public :
/// \return Reference to the sound /// \return Reference to the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound& operator =(const Sound& Other); Sound& operator =(const Sound& other);
private : private :

View File

@ -28,8 +28,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Config.hpp>
#include <SFML/System/Resource.hpp> #include <SFML/System/Resource.hpp>
#include <SFML/Audio/AudioResource.hpp>
#include <string> #include <string>
#include <vector> #include <vector>
@ -40,7 +40,7 @@ namespace sf
/// SoundBuffer is the low-level for loading and manipulating /// SoundBuffer is the low-level for loading and manipulating
/// sound buffers /// sound buffers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API SoundBuffer : public AudioResource, public Resource<SoundBuffer> class SFML_API SoundBuffer : public Resource<SoundBuffer>
{ {
public : public :
@ -53,10 +53,10 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy constructor /// Copy constructor
/// ///
/// \param Copy : Instance to copy /// \param copy : Instance to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundBuffer(const SoundBuffer& Copy); SoundBuffer(const SoundBuffer& copy);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
@ -67,47 +67,47 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the sound buffer from a file /// Load the sound buffer from a file
/// ///
/// \param Filename : Path of the sound file to load /// \param filename : Path of the sound file to load
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename); bool LoadFromFile(const std::string& filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the sound buffer from a file in memory /// Load the sound buffer from a file in memory
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromMemory(const char* Data, std::size_t SizeInBytes); bool LoadFromMemory(const char* data, std::size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the sound buffer from an array of samples - assumed format for /// Load the sound buffer from an array of samples - assumed format for
/// samples is 16 bits signed integer /// samples is 16 bits signed integer
/// ///
/// \param Samples : Pointer to the samples in memory /// \param samples : Pointer to the samples in memory
/// \param SamplesCount : Number of samples pointed by Samples /// \param samplesCount : Number of samples pointed by Samples
/// \param ChannelsCount : Number of channels (1 = mono, 2 = stereo, ...) /// \param channelsCount : Number of channels (1 = mono, 2 = stereo, ...)
/// \param SampleRate : Frequency (number of samples to play per second) /// \param sampleRate : Frequency (number of samples to play per second)
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromSamples(const Int16* Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate); bool LoadFromSamples(const Int16* samples, std::size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the sound buffer to a file /// Save the sound buffer to a file
/// ///
/// \param Filename : Path of the sound file to write /// \param filename : Path of the sound file to write
/// ///
/// \return True if saving has been successful /// \return True if saving has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool SaveToFile(const std::string& Filename) const; bool SaveToFile(const std::string& filename) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the sound samples /// Return the sound samples
@ -152,12 +152,12 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Assignment operator /// Assignment operator
/// ///
/// \param Other : Instance to assign /// \param other : Instance to assign
/// ///
/// \return Reference to the sound buffer /// \return Reference to the sound buffer
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundBuffer& operator =(const SoundBuffer& Other); SoundBuffer& operator =(const SoundBuffer& other);
private : private :
@ -166,13 +166,13 @@ private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Update the internal buffer with the audio samples /// Update the internal buffer with the audio samples
/// ///
/// \param ChannelsCount : Number of channels /// \param channelsCount : Number of channels
/// \param SampleRate : Sample rate /// \param sampleRate : Sample rate
/// ///
/// \return True on success /// \return True on success
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Update(unsigned int ChannelsCount, unsigned int SampleRate); bool Update(unsigned int channelsCount, unsigned int sampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data

View File

@ -63,7 +63,7 @@ private :
/// /see SoundBuffer::OnProcessSamples /// /see SoundBuffer::OnProcessSamples
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool OnProcessSamples(const Int16* Samples, std::size_t SamplesCount); virtual bool OnProcessSamples(const Int16* samples, std::size_t samplesCount);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see SoundBuffer::OnStop /// /see SoundBuffer::OnStop

View File

@ -52,11 +52,11 @@ public :
/// Start the capture. /// Start the capture.
/// Warning : only one capture can happen at the same time /// Warning : only one capture can happen at the same time
/// ///
/// \param SampleRate : Sound frequency (the more samples, the higher the quality) /// \param sampleRate : Sound frequency (the more samples, the higher the quality)
/// (44100 by default = CD quality) /// (44100 by default = CD quality)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Start(unsigned int SampleRate = 44100); void Start(unsigned int sampleRate = 44100);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop the capture /// Stop the capture
@ -102,13 +102,13 @@ private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Process a new chunk of recorded samples /// Process a new chunk of recorded samples
/// ///
/// \param Samples : Pointer to the new chunk of recorded samples /// \param samples : Pointer to the new chunk of recorded samples
/// \param SamplesCount : Number of samples pointed by Samples /// \param samplesCount : Number of samples pointed by Samples
/// ///
/// \return False to stop recording audio data, true to continue /// \return False to stop recording audio data, true to continue
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool OnProcessSamples(const Int16* Samples, std::size_t SamplesCount) = 0; virtual bool OnProcessSamples(const Int16* samples, std::size_t samplesCount) = 0;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop recording audio data /// Stop recording audio data

View File

@ -117,10 +117,10 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the current playing position of the stream /// Set the current playing position of the stream
/// ///
/// \param TimeOffset : New playing position, expressed in seconds /// \param timeOffset : New playing position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPlayingOffset(float TimeOffset); void SetPlayingOffset(float timeOffset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current playing position of the stream /// Get the current playing position of the stream
@ -134,10 +134,10 @@ public :
/// Set the stream loop state. /// Set the stream loop state.
/// This parameter is disabled by default /// This parameter is disabled by default
/// ///
/// \param Loop : True to play in loop, false to play once /// \param loop : True to play in loop, false to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetLoop(bool Loop); void SetLoop(bool loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not the stream is looping /// Tell whether or not the stream is looping
@ -158,11 +158,11 @@ protected :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the audio stream parameters, you must call it before Play() /// Set the audio stream parameters, you must call it before Play()
/// ///
/// \param ChannelsCount : Number of channels /// \param channelsCount : Number of channels
/// \param SampleRate : Sample rate /// \param sampleRate : Sample rate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Initialize(unsigned int ChannelsCount, unsigned int SampleRate); void Initialize(unsigned int channelsCount, unsigned int sampleRate);
private : private :
@ -175,31 +175,31 @@ private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Called each time new audio data is needed to feed the stream /// Called each time new audio data is needed to feed the stream
/// ///
/// \param Data : New chunk of data to stream /// \param data : New chunk of data to stream
/// ///
/// \return True to continue playback, false to stop /// \return True to continue playback, false to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool OnGetData(Chunk& Data) = 0; virtual bool OnGetData(Chunk& data) = 0;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Called to move the current reading position /// Called to move the current reading position
/// ///
/// \param TimeOffset : New read position, expressed in seconds /// \param timeOffset : New read position, expressed in seconds
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void OnSeek(float TimeOffset) = 0; virtual void OnSeek(float timeOffset) = 0;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Fill a new buffer with audio data, and push it to the /// Fill a new buffer with audio data, and push it to the
/// playing queue /// playing queue
/// ///
/// \param Buffer : Buffer to fill /// \param buffer : Buffer to fill
/// ///
/// \return True if the derived class has requested to stop /// \return True if the derived class has requested to stop
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool FillAndPushBuffer(unsigned int Buffer); bool FillAndPushBuffer(unsigned int buffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Fill the buffers queue with all available buffers /// Fill the buffers queue with all available buffers

View File

@ -50,53 +50,13 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the color from its 4 RGBA components /// Construct the color from its 4 RGBA components
/// ///
/// \param R : Red component (0 .. 255) /// \param red : Red component (0 .. 255)
/// \param G : Green component (0 .. 255) /// \param green : Green component (0 .. 255)
/// \param B : Blue component (0 .. 255) /// \param blue : Blue component (0 .. 255)
/// \param A : Alpha component (0 .. 255) (255 by default) /// \param alpha : Alpha (opacity) component (0 .. 255) (255 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A = 255); Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha = 255);
////////////////////////////////////////////////////////////
/// Operator += overload to add a color
///
/// \param Other : Color to add
///
/// \return Component-wise saturated addition of the two colors
///
////////////////////////////////////////////////////////////
Color& operator +=(const Color& Other);
////////////////////////////////////////////////////////////
/// Operator *= overload to modulate a color
///
/// \param Other : Color to modulate
///
/// \return Component-wise multiplication of the two colors
///
////////////////////////////////////////////////////////////
Color& operator *=(const Color& Other);
////////////////////////////////////////////////////////////
/// Compare two colors (for equality)
///
/// \param Other : Color to compare
///
/// \return True if colors are equal
///
////////////////////////////////////////////////////////////
bool operator ==(const Color& Other) const;
////////////////////////////////////////////////////////////
/// Compare two colors (for difference)
///
/// \param Other : Color to compare
///
/// \return True if colors are different
///
////////////////////////////////////////////////////////////
bool operator !=(const Color& Other) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Static member data // Static member data
@ -119,27 +79,71 @@ public :
Uint8 a; ///< Alpha (transparency) component Uint8 a; ///< Alpha (transparency) component
}; };
////////////////////////////////////////////////////////////
/// Compare two colors (for equality)
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return True if colors are equal
///
////////////////////////////////////////////////////////////
bool operator ==(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Compare two colors (for difference)
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return True if colors are different
///
////////////////////////////////////////////////////////////
bool operator !=(const Color& left, const Color& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator + overload to add two colors /// Operator + overload to add two colors
/// ///
/// \param Color1 : First color /// \param left : Left operand
/// \param Color2 : Second color /// \param right : Right operand
/// ///
/// \return Component-wise saturated addition of the two colors /// \return Component-wise saturated addition of the two colors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_API Color operator +(const Color& Color1, const Color& Color2); SFML_API Color operator +(const Color& left, const Color& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator * overload to modulate two colors /// Operator * overload to modulate two colors
/// ///
/// \param Color1 : First color /// \param left : Left operand
/// \param Color2 : Second color /// \param right : Right operand
/// ///
/// \return Component-wise multiplication of the two colors /// \return Component-wise multiplication of the two colors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SFML_API Color operator *(const Color& Color1, const Color& Color2); SFML_API Color operator *(const Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Operator += overload to add a color
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return Component-wise saturated addition of the two colors
///
////////////////////////////////////////////////////////////
Color& operator +=(Color& left, const Color& right);
////////////////////////////////////////////////////////////
/// Operator *= overload to modulate a color
///
/// \param left : Left operand
/// \param right : Right operand
///
/// \return Component-wise multiplication of the two colors
///
////////////////////////////////////////////////////////////
Color& operator *=(Color& left, const Color& right);
} // namespace sf } // namespace sf

View File

@ -62,13 +62,13 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
/// \param Position : Position of the object (0, 0 by default) /// \param position : Position of the object ((0, 0) by default)
/// \param Scale : Scale factor (1, 1 by default) /// \param scale : Scale factor ((1, 1) by default)
/// \param Rotation : Orientation, in degrees (0 by default) /// \param rotation : Orientation, in degrees (0 by default)
/// \param Col : Color of the object (white by default) /// \param color : Color of the object (white by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Drawable(const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255)); Drawable(const Vector2f& position = Vector2f(0, 0), const Vector2f& scale = Vector2f(1, 1), float rotation = 0.f, const Color& color = Color(255, 255, 255));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Virtual destructor /// Virtual destructor
@ -79,44 +79,44 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of the object (take 2 values) /// Set the position of the object (take 2 values)
/// ///
/// \param X : New X coordinate /// \param x : New X coordinate
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPosition(float X, float Y); void SetPosition(float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of the object (take a 2D vector) /// Set the position of the object (take a 2D vector)
/// ///
/// \param Position : New position /// \param position : New position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPosition(const Vector2f& Position); void SetPosition(const Vector2f& position);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X position of the object /// Set the X position of the object
/// ///
/// \param X : New X coordinate /// \param x : New X coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetX(float X); void SetX(float x);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y position of the object /// Set the Y position of the object
/// ///
/// \param Y : New Y coordinate /// \param y : New Y coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetY(float Y); void SetY(float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of the object (take 2 values) /// Set the scale of the object (take 2 values)
/// ///
/// \param ScaleX : New horizontal scale (must be strictly positive) /// \param factorX : New horizontal scale (must be strictly positive)
/// \param ScaleY : New vertical scale (must be strictly positive) /// \param factorY : New vertical scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetScale(float ScaleX, float ScaleY); void SetScale(float factorX, float factorY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the scale of the object (take a 2D vector) /// Set the scale of the object (take a 2D vector)
@ -124,70 +124,70 @@ public :
/// \param Scale : New scale (both values must be strictly positive) /// \param Scale : New scale (both values must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetScale(const Vector2f& Scale); void SetScale(const Vector2f& scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the X scale factor of the object /// Set the X scale factor of the object
/// ///
/// \param X : New X scale factor /// \param factor : New X scale factor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetScaleX(float FactorX); void SetScaleX(float factor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the Y scale factor of the object /// Set the Y scale factor of the object
/// ///
/// \param Y : New Y scale factor /// \param factor : New Y scale factor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetScaleY(float FactorY); void SetScaleY(float factor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the local origin of the object, in coordinates relative to the /// Set the local origin of the object, in coordinates relative to the
/// top-left of the object (take 2 values). /// top-left of the object (take 2 values).
/// The default origin is (0, 0) /// The default origin is (0, 0)
/// ///
/// \param OriginX : X coordinate of the origin /// \param x : X coordinate of the origin
/// \param OriginY : Y coordinate of the origin /// \param y : Y coordinate of the origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetOrigin(float OriginX, float OriginY); void SetOrigin(float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the local origin of the object, in coordinates relative to the /// Set the local origin of the object, in coordinates relative to the
/// top-left of the object (take a 2D vector). /// top-left of the object (take a 2D vector).
/// The default origin is (0, 0) /// The default origin is (0, 0)
/// ///
/// \param Origin : New origin /// \param origin : New origin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetOrigin(const Vector2f& Origin); void SetOrigin(const Vector2f& origin);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of the object /// Set the orientation of the object
/// ///
/// \param Rotation : Angle of rotation, in degrees /// \param angle : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetRotation(float Rotation); void SetRotation(float angle);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of the object. /// Set the color of the object.
/// The default color is white /// The default color is white
/// ///
/// \param Col : New color /// \param color : New color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetColor(const Color& Col); void SetColor(const Color& color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for the object. /// Set the blending mode for the object.
/// The default blend mode is Blend::Alpha /// The default blend mode is Blend::Alpha
/// ///
/// \param Mode : New blending mode /// \param mode : New blending mode
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetBlendMode(Blend::Mode Mode); void SetBlendMode(Blend::Mode mode);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the position of the object /// Get the position of the object
@ -241,36 +241,36 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move the object of a given offset (take 2 values) /// Move the object of a given offset (take 2 values)
/// ///
/// \param OffsetX : X offset /// \param offsetX : X offset
/// \param OffsetY : Y offset /// \param offsetY : Y offset
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Move(float OffsetX, float OffsetY); void Move(float offsetX, float offsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move the object of a given offset (take a 2D vector) /// Move the object of a given offset (take a 2D vector)
/// ///
/// \param Offset : Amount of units to move the object of /// \param offset : Amount of units to move the object of
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Move(const Vector2f& Offset); void Move(const Vector2f& offset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale the object (take 2 values) /// Scale the object (take 2 values)
/// ///
/// \param FactorX : Scaling factor on X (must be strictly positive) /// \param factorX : Scaling factor on X (must be strictly positive)
/// \param FactorY : Scaling factor on Y (must be strictly positive) /// \param factorY : Scaling factor on Y (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Scale(float FactorX, float FactorY); void Scale(float factorX, float factorY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale the object (take a 2D vector) /// Scale the object (take a 2D vector)
/// ///
/// \param Factor : Scaling factors (both values must be strictly positive) /// \param factor : Scaling factors (both values must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Scale(const Vector2f& Factor); void Scale(const Vector2f& factor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Rotate the object /// Rotate the object
@ -284,23 +284,23 @@ public :
/// Transform a point from global coordinates into local coordinates /// Transform a point from global coordinates into 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)
/// ///
/// \param Point : Point to transform /// \param point : Point to transform
/// ///
/// \return Transformed point /// \return Transformed point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sf::Vector2f TransformToLocal(const sf::Vector2f& Point) const; sf::Vector2f TransformToLocal(const sf::Vector2f& point) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point from local coordinates into global coordinates /// Transform a point from 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)
/// ///
/// \param Point : Point to transform /// \param point : Point to transform
/// ///
/// \return Transformed point /// \return Transformed point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sf::Vector2f TransformToGlobal(const sf::Vector2f& Point) const; sf::Vector2f TransformToGlobal(const sf::Vector2f& point) const;
protected : protected :
@ -327,18 +327,18 @@ private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw the object into the specified window /// Draw the object into the specified window
/// ///
/// \param Target : Target into which render the object /// \param target : Target into which render the object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Draw(RenderTarget& Target) const; void Draw(RenderTarget& target) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Render the specific geometry of the object /// Render the specific geometry of the object
/// ///
/// \param Target : Target into which render the object /// \param target : Target into which render the object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const = 0; virtual void Render(RenderTarget& target) const = 0;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data

View File

@ -64,27 +64,27 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the font from a file /// Load the font from a file
/// ///
/// \param Filename : Font file to load /// \param filename : Font file to load
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default) /// \param charSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
/// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters) /// \param charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
/// ///
/// \return True if loading was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset); bool LoadFromFile(const std::string& filename, unsigned int charSize = 30, const Unicode::Text& charset = ourDefaultCharset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the font from a file in memory /// Load the font from a file in memory
/// ///
/// \param Data : Pointer to the data to load /// \param data : Pointer to the data to load
/// \param SizeInBytes : Size of the data, in bytes /// \param sizeInBytes : Size of the data, in bytes
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default) /// \param charSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
/// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters) /// \param charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
/// ///
/// \return True if loading was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromMemory(const char* Data, std::size_t SizeInBytes, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset); bool LoadFromMemory(const char* data, std::size_t sizeInBytes, unsigned int charSize = 30, const Unicode::Text& charset = ourDefaultCharset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the base size of characters in the font; /// Get the base size of characters in the font;
@ -99,12 +99,12 @@ public :
/// Get the description of a glyph (character) /// Get the description of a glyph (character)
/// given by its unicode value /// given by its unicode value
/// ///
/// \param CodePoint : Unicode value of the character to get /// \param codePoint : Unicode value of the character to get
/// ///
/// \return Glyph's visual settings, or an invalid glyph if character not found /// \return Glyph's visual settings, or an invalid glyph if character not found
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Glyph& GetGlyph(Uint32 CodePoint) const; const Glyph& GetGlyph(Uint32 codePoint) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the image containing the rendered characters (glyphs) /// Get the image containing the rendered characters (glyphs)

View File

@ -57,30 +57,30 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy constructor /// Copy constructor
/// ///
/// \param Copy : instance to copy /// \param copy : instance to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image(const Image& Copy); Image(const Image& copy);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct an empty image /// Construct an empty image
/// ///
/// \param Width : Image width /// \param width : Image width
/// \param Height : Image height /// \param height : Image height
/// \param Col : Image color (black by default) /// \param color : Image color (black by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255)); Image(unsigned int width, unsigned int height, const Color& color = Color(0, 0, 0));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the image from pixels in memory /// Construct the image from pixels in memory
/// ///
/// \param Width : Image width /// \param width : Image width
/// \param Height : Image height /// \param height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA) /// \param pixels : Pointer to the pixels in memory (assumed format is RGBA)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image(unsigned int Width, unsigned int Height, const Uint8* Data); Image(unsigned int width, unsigned int height, const Uint8* pixels);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
@ -96,108 +96,108 @@ public :
/// \return True if loading was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename); bool LoadFromFile(const std::string& filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the image from a file in memory /// Load the image from a file in memory
/// ///
/// \param Data : Pointer to the file data in memory /// \param data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes /// \param sizeInBytes : Size of the data to load, in bytes
/// ///
/// \return True if loading was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromMemory(const char* Data, std::size_t SizeInBytes); bool LoadFromMemory(const char* data, std::size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the image directly from an array of pixels /// Load the image directly from an array of pixels
/// ///
/// \param Width : Image width /// \param width : Image width
/// \param Height : Image height /// \param height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA) /// \param pixels : Pointer to the pixels in memory (assumed format is RGBA)
/// ///
/// \return True if loading was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromPixels(unsigned int Width, unsigned int Height, const Uint8* Data); bool LoadFromPixels(unsigned int width, unsigned int height, const Uint8* pixels);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the content of the image to a file /// Save the content of the image to a file
/// ///
/// \param Filename : Path of the file to save (overwritten if already exist) /// \param filename : Path of the file to save (overwritten if already exist)
/// ///
/// \return True if saving was successful /// \return True if saving was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool SaveToFile(const std::string& Filename) const; bool SaveToFile(const std::string& filename) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create an empty image /// Create an empty image
/// ///
/// \param Width : Image width /// \param width : Image width
/// \param Height : Image height /// \param height : Image height
/// \param Col : Image color (black by default) /// \param color : Image color (black by default)
/// ///
/// \return True if creation was successful /// \return True if creation was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Create(unsigned int Width, unsigned int Height, Color Col = Color(0, 0, 0, 255)); bool Create(unsigned int width, unsigned int height, const Color& color = Color(0, 0, 0));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create transparency mask from a specified colorkey /// Create transparency mask from a specified colorkey
/// ///
/// \param ColorKey : Color to become transparent /// \param transparentColor : Color to become transparent
/// \param Alpha : Alpha value to use for transparent pixels (0 by default) /// \param alpha : Alpha value to assign to transparent pixels (0 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void CreateMaskFromColor(Color ColorKey, Uint8 Alpha = 0); void CreateMaskFromColor(const Color& transparentColor, Uint8 alpha = 0);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy pixels from another image onto this one. /// Copy pixels from another image onto this one.
/// 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
/// ///
/// \param Source : Source image to copy /// \param source : Source image to copy
/// \param DestX : X coordinate of the destination position /// \param destX : X coordinate of the destination position
/// \param DestY : Y coordinate of the destination position /// \param destY : Y coordinate of the destination position
/// \param SourceRect : Sub-rectangle of the source image to copy (empty by default - entire image) /// \param sourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)
/// \param ApplyAlpha : Should the copy take in account the source transparency? (false by default) /// \param applyAlpha : Should the copy take in account the source transparency? (false by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Copy(const Image& Source, unsigned int DestX, unsigned int DestY, const IntRect& SourceRect = IntRect(0, 0, 0, 0), bool ApplyAlpha = false); void Copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect = IntRect(0, 0, 0, 0), bool applyAlpha = false);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the image from the current contents of the /// Create the image from the current contents of the
/// given window /// given window
/// ///
/// \param Window : Window to capture /// \param window : Window to capture
/// \param SourceRect : Sub-rectangle of the screen to copy (empty by default - entire image) /// \param sourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
/// ///
/// \return True if copy was successful /// \return True if copy was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool CopyScreen(RenderWindow& Window, const IntRect& SourceRect = IntRect(0, 0, 0, 0)); bool CopyScreen(RenderWindow& window, const IntRect& sourceRect = IntRect(0, 0, 0, 0));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the color of a pixel /// Change the color of a pixel
/// ///
/// \param X : X coordinate of pixel in the image /// \param x : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image /// \param y : Y coordinate of pixel in the image
/// \param Col : New color for pixel (X, Y) /// \param color : New color for pixel (x, y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPixel(unsigned int X, unsigned int Y, const Color& Col); void SetPixel(unsigned int x, unsigned int y, const Color& color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a pixel from the image /// Get a pixel from the image
/// ///
/// \param X : X coordinate of pixel in the image /// \param x : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image /// \param y : Y coordinate of pixel in the image
/// ///
/// \return Color of pixel (X, Y) /// \return Color of pixel (x, y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Color& GetPixel(unsigned int X, unsigned int Y) const; const Color& GetPixel(unsigned int x, unsigned int y) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a read-only pointer to the array of pixels (RGBA 8 bits integers components) /// Get a read-only pointer to the array of pixels (RGBA 8 bits integers components)
@ -219,10 +219,10 @@ public :
/// Enable or disable image smooth filter. /// Enable or disable image smooth filter.
/// This parameter is enabled by default /// This parameter is enabled by default
/// ///
/// \param Smooth : True to enable smoothing filter, false to disable it /// \param smooth : True to enable smoothing filter, false to disable it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetSmooth(bool Smooth); void SetSmooth(bool smooth);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the width of the image /// Return the width of the image
@ -252,33 +252,33 @@ public :
/// Convert a subrect expressed in pixels, into float /// Convert a subrect expressed in pixels, into float
/// texture coordinates /// texture coordinates
/// ///
/// \param Rect : Sub-rectangle of image to convert /// \param rectangle : Sub-rectangle of image to convert
/// \param Adjust : Pass true to apply the half-texel adjustment /// \param adjust : Pass true to apply the half-texel adjustment (true by default)
/// ///
/// \return Texture coordinates corresponding to the sub-rectangle /// \return Texture coordinates corresponding to the sub-rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
FloatRect GetTexCoords(const IntRect& Rect, bool Adjust = true) const; FloatRect GetTexCoords(const IntRect& rectangle, bool adjust = true) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a valid texture size according to hardware support /// Get a valid texture size according to hardware support
/// ///
/// \param Size : Size to convert /// \param Size : size to convert
/// ///
/// \return Valid nearest size (greater than or equal to specified size) /// \return Valid nearest size (greater than or equal to specified size)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static unsigned int GetValidTextureSize(unsigned int Size); static unsigned int GetValidTextureSize(unsigned int size);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Assignment operator /// Assignment operator
/// ///
/// \param Other : instance to assign /// \param other : instance to assign
/// ///
/// \return Reference to the image /// \return Reference to the image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image& operator =(const Image& Other); Image& operator =(const Image& other);
private : private :
@ -309,10 +309,10 @@ private :
/// its content. /// its content.
/// For internal use only (see RenderImage class). /// For internal use only (see RenderImage class).
/// ///
/// \param Source : RenderImage that will update the image /// \param source : RenderImage that will update the image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void ExternalUpdate(RenderImage& Source); void ExternalUpdate(RenderImage& source);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Reset the image attributes /// Reset the image attributes

View File

@ -61,33 +61,33 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Build a matrix from a set of transformations /// Build a matrix from a set of transformations
/// ///
/// \param Center : Origin for the transformations /// \param origin : Origin for the transformations
/// \param Translation : Translation offset /// \param translation : Translation offset
/// \param Rotation : Rotation angle in degrees /// \param rotation : Rotation angle in degrees
/// \param Scale : Scaling factors /// \param scale : Scaling factors
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale); void SetFromTransformations(const Vector2f& origin, const Vector2f& translation, float rotation, const Vector2f& scale);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Build a matrix from a projection /// Build a matrix from a projection
/// ///
/// \param Center : Center of the view /// \param center : Center of the view
/// \param Size : Size of the view /// \param size : Size of the view
/// \param Rotation : Angle of rotation of the view rectangle, in degrees /// \param rotation : Angle of rotation of the view rectangle, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetFromProjection(const Vector2f& Center, const Vector2f& Size, float Rotation); void SetFromProjection(const Vector2f& center, const Vector2f& size, float rotation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point by the matrix /// Transform a point by the matrix
/// ///
/// \param Point : Point to transform /// \param point : Point to transform
/// ///
/// \return Transformed point /// \return Transformed point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Vector2f Transform(const Vector2f& Point) const; Vector2f Transform(const Vector2f& point) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the inverse of the matrix /// Return the inverse of the matrix
@ -109,34 +109,34 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator () overloads to access the matrix elements /// Operator () overloads to access the matrix elements
/// ///
/// \param Row : Element row (0 based) /// \param row : Element row (0 based)
/// \param Col : Element column (0 based) /// \param column : Element column (0 based)
/// ///
/// \return Matrix element (Row, Col) /// \return Matrix element (Row, Col)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float operator ()(unsigned int Row, unsigned int Col) const; float operator ()(unsigned int row, unsigned int column) const;
float& operator ()(unsigned int Row, unsigned int Col); float& operator ()(unsigned int row, unsigned int column);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator * overload to multiply two matrices /// Operator * overload to multiply two matrices
/// ///
/// \param Mat : Matrix to multiply /// \param right : Matrix to multiply
/// ///
/// \return this * Mat /// \return this * right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Matrix3 operator *(const Matrix3& Mat) const; Matrix3 operator *(const Matrix3& right) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator *= overload to multiply-assign two matrices /// Operator *= overload to multiply-assign two matrices
/// ///
/// \param Mat : Matrix to multiply /// \param right : Matrix to multiply
/// ///
/// \return this * Mat /// \return this * right
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Matrix3& operator *=(const Matrix3& Mat); Matrix3& operator *=(const Matrix3& right);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Static member data // Static member data

View File

@ -52,22 +52,22 @@ inline Matrix3::Matrix3(float a00, float a01, float a02,
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Build a matrix from a set of transformations /// Build a matrix from a set of transformations
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
inline void Matrix3::SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale) inline void Matrix3::SetFromTransformations(const Vector2f& origin, const Vector2f& translation, float rotation, const Vector2f& scale)
{ {
// Combine the transformations // Combine the transformations
float Angle = Rotation * 3.141592654f / 180.f; float angle = rotation * 3.141592654f / 180.f;
float Cos = static_cast<float>(cos(Angle)); float cosine = static_cast<float>(cos(angle));
float Sin = static_cast<float>(sin(Angle)); float sine = static_cast<float>(sin(angle));
float SxCos = Scale.x * Cos; float sxCos = scale.x * cosine;
float SyCos = Scale.y * Cos; float syCos = scale.y * cosine;
float SxSin = Scale.x * Sin; float sxSin = scale.x * sine;
float SySin = Scale.y * Sin; float sySin = scale.y * sine;
float Tx = -Center.x * SxCos - Center.y * SySin + Translation.x; float tx = -origin.x * sxCos - origin.y * sySin + translation.x;
float Ty = Center.x * SxSin - Center.y * SyCos + Translation.y; float ty = origin.x * sxSin - origin.y * syCos + translation.y;
// Rebuild the matrix // Rebuild the matrix
myData[0] = SxCos; myData[4] = SySin; myData[8] = 0.f; myData[12] = Tx; myData[0] = sxCos; myData[4] = sySin; myData[8] = 0.f; myData[12] = tx;
myData[1] = -SxSin; myData[5] = SyCos; myData[9] = 0.f; myData[13] = Ty; myData[1] = -sxSin; myData[5] = syCos; myData[9] = 0.f; myData[13] = ty;
myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f; myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f; myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
} }
@ -76,36 +76,36 @@ inline void Matrix3::SetFromTransformations(const Vector2f& Center, const Vector
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Build a matrix from a projection /// Build a matrix from a projection
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
inline void Matrix3::SetFromProjection(const Vector2f& Center, const Vector2f& Size, float Rotation) inline void Matrix3::SetFromProjection(const Vector2f& center, const Vector2f& size, float rotation)
{ {
// Rotation components // Rotation components
float Angle = Rotation * 3.141592654f / 180.f; float angle = rotation * 3.141592654f / 180.f;
float Cos = static_cast<float>(cos(Angle)); float cosine = static_cast<float>(cos(angle));
float Sin = static_cast<float>(sin(Angle)); float sine = static_cast<float>(sin(angle));
float Tx = -Center.x * Cos - Center.y * Sin + Center.x; float tx = -center.x * cosine - center.y * sine + center.x;
float Ty = Center.x * Sin - Center.y * Cos + Center.y; float ty = center.x * sine - center.y * cosine + center.y;
// Projection components // Projection components
float A = 2.f / Size.x; float a = 2.f / size.x;
float B = -2.f / Size.y; float b = -2.f / size.y;
float C = -A * Center.x; float c = -a * center.x;
float D = -B * Center.y; float d = -b * center.y;
// Rebuild the projection matrix // Rebuild the projection matrix
myData[0] = A * Cos; myData[4] = A * Sin; myData[8] = 0.f; myData[12] = A * Tx + C; myData[0] = a * cosine; myData[4] = a * sine; myData[8] = 0.f; myData[12] = a * tx + c;
myData[1] = -B * Sin; myData[5] = B * Cos; myData[9] = 0.f; myData[13] = B * Ty + D; myData[1] = -b * sine; myData[5] = b * cosine; myData[9] = 0.f; myData[13] = b * ty + d;
myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f; myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f; myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Transform a point by the matrix /// Transform a point by the matrix
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
inline Vector2f Matrix3::Transform(const Vector2f& Point) const inline Vector2f Matrix3::Transform(const Vector2f& point) const
{ {
return Vector2f(myData[0] * Point.x + myData[4] * Point.y + myData[12], return Vector2f(myData[0] * point.x + myData[4] * point.y + myData[12],
myData[1] * Point.x + myData[5] * Point.y + myData[13]); myData[1] * point.x + myData[5] * point.y + myData[13]);
} }
@ -115,22 +115,22 @@ inline Vector2f Matrix3::Transform(const Vector2f& Point) const
inline Matrix3 Matrix3::GetInverse() const inline Matrix3 Matrix3::GetInverse() const
{ {
// Compute the determinant // Compute the determinant
float Det = myData[0] * (myData[15] * myData[5] - myData[7] * myData[13]) - float det = myData[0] * (myData[15] * myData[5] - myData[7] * myData[13]) -
myData[1] * (myData[15] * myData[4] - myData[7] * myData[12]) + myData[1] * (myData[15] * myData[4] - myData[7] * myData[12]) +
myData[3] * (myData[13] * myData[4] - myData[5] * myData[12]); myData[3] * (myData[13] * myData[4] - myData[5] * myData[12]);
// Compute the inverse if determinant is not zero // Compute the inverse if determinant is not zero
if ((Det < -1E-7f) || (Det > 1E-7f)) if ((det < -1E-7f) || (det > 1E-7f))
{ {
return Matrix3( (myData[15] * myData[5] - myData[7] * myData[13]) / Det, return Matrix3( (myData[15] * myData[5] - myData[7] * myData[13]) / det,
-(myData[15] * myData[4] - myData[7] * myData[12]) / Det, -(myData[15] * myData[4] - myData[7] * myData[12]) / det,
(myData[13] * myData[4] - myData[5] * myData[12]) / Det, (myData[13] * myData[4] - myData[5] * myData[12]) / det,
-(myData[15] * myData[1] - myData[3] * myData[13]) / Det, -(myData[15] * myData[1] - myData[3] * myData[13]) / det,
(myData[15] * myData[0] - myData[3] * myData[12]) / Det, (myData[15] * myData[0] - myData[3] * myData[12]) / det,
-(myData[13] * myData[0] - myData[1] * myData[12]) / Det, -(myData[13] * myData[0] - myData[1] * myData[12]) / det,
(myData[7] * myData[1] - myData[3] * myData[5]) / Det, (myData[7] * myData[1] - myData[3] * myData[5]) / det,
-(myData[7] * myData[0] - myData[3] * myData[4]) / Det, -(myData[7] * myData[0] - myData[3] * myData[4]) / det,
(myData[5] * myData[0] - myData[1] * myData[4]) / Det); (myData[5] * myData[0] - myData[1] * myData[4]) / det);
} }
else else
{ {
@ -152,9 +152,9 @@ inline const float* Matrix3::Get4x4Elements() const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator () overloads to access the matrix elements /// Operator () overloads to access the matrix elements
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const inline float Matrix3::operator ()(unsigned int row, unsigned int column) const
{ {
switch (Row + Col * 3) switch (row + column * 3)
{ {
case 0 : return myData[0]; case 0 : return myData[0];
case 1 : return myData[1]; case 1 : return myData[1];
@ -169,9 +169,9 @@ inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const
default : return myData[0]; default : return myData[0];
} }
} }
inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col) inline float& Matrix3::operator ()(unsigned int row, unsigned int column)
{ {
switch (Row + Col * 3) switch (row + column * 3)
{ {
case 0 : return myData[0]; case 0 : return myData[0];
case 1 : return myData[1]; case 1 : return myData[1];
@ -191,24 +191,24 @@ inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator * overload to multiply two matrices /// Operator * overload to multiply two matrices
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
inline Matrix3 Matrix3::operator *(const Matrix3& Mat) const inline Matrix3 Matrix3::operator *(const Matrix3& right) const
{ {
return Matrix3(myData[0] * Mat.myData[0] + myData[4] * Mat.myData[1] + myData[12] * Mat.myData[3], return Matrix3(myData[0] * right.myData[0] + myData[4] * right.myData[1] + myData[12] * right.myData[3],
myData[0] * Mat.myData[4] + myData[4] * Mat.myData[5] + myData[12] * Mat.myData[7], myData[0] * right.myData[4] + myData[4] * right.myData[5] + myData[12] * right.myData[7],
myData[0] * Mat.myData[12] + myData[4] * Mat.myData[13] + myData[12] * Mat.myData[15], myData[0] * right.myData[12] + myData[4] * right.myData[13] + myData[12] * right.myData[15],
myData[1] * Mat.myData[0] + myData[5] * Mat.myData[1] + myData[13] * Mat.myData[3], myData[1] * right.myData[0] + myData[5] * right.myData[1] + myData[13] * right.myData[3],
myData[1] * Mat.myData[4] + myData[5] * Mat.myData[5] + myData[13] * Mat.myData[7], myData[1] * right.myData[4] + myData[5] * right.myData[5] + myData[13] * right.myData[7],
myData[1] * Mat.myData[12] + myData[5] * Mat.myData[13] + myData[13] * Mat.myData[15], myData[1] * right.myData[12] + myData[5] * right.myData[13] + myData[13] * right.myData[15],
myData[3] * Mat.myData[0] + myData[7] * Mat.myData[1] + myData[15] * Mat.myData[3], myData[3] * right.myData[0] + myData[7] * right.myData[1] + myData[15] * right.myData[3],
myData[3] * Mat.myData[4] + myData[7] * Mat.myData[5] + myData[15] * Mat.myData[7], myData[3] * right.myData[4] + myData[7] * right.myData[5] + myData[15] * right.myData[7],
myData[3] * Mat.myData[12] + myData[7] * Mat.myData[13] + myData[15] * Mat.myData[15]); myData[3] * right.myData[12] + myData[7] * right.myData[13] + myData[15] * right.myData[15]);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Operator *= overload to multiply-assign two matrices /// Operator *= overload to multiply-assign two matrices
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
inline Matrix3& Matrix3::operator *=(const Matrix3& Mat) inline Matrix3& Matrix3::operator *=(const Matrix3& right)
{ {
return *this = *this * Mat; return *this = *this * right;
} }

View File

@ -53,10 +53,10 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy constructor /// Copy constructor
/// ///
/// \param Copy : Instance to copy /// \param copy : Instance to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
PostFX(const PostFX& Copy); PostFX(const PostFX& copy);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
@ -67,77 +67,77 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the effect from a file /// Load the effect from a file
/// ///
/// \param Filename : Path of the effect file to load /// \param filename : Path of the effect file to load
/// ///
/// \return True on success /// \return True on success
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename); bool LoadFromFile(const std::string& filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the effect from a text in memory /// Load the effect from a text in memory
/// ///
/// \param Effect : String containing the effect code /// \param effect : String containing the code of the effect
/// ///
/// \return True on success /// \return True on success
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromMemory(const std::string& Effect); bool LoadFromMemory(const std::string& effect);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of the effect (1 float) /// Change a parameter of the effect (1 float)
/// ///
/// \param Name : Parameter name in the effect /// \param name : Name of the parameter in the effect
/// \param X : Value to assign /// \param x : Value to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X); void SetParameter(const std::string& name, float x);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of the effect (2 floats) /// Change a parameter of the effect (2 floats)
/// ///
/// \param Name : Parameter name in the effect /// \param name : Name of the parameter in the effect
/// \param X, Y : Values to assign /// \param x, y : Values to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X, float Y); void SetParameter(const std::string& Name, float x, float y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of the effect (3 floats) /// Change a parameter of the effect (3 floats)
/// ///
/// \param Name : Parameter name in the effect /// \param name : Name of the parameter in the effect
/// \param X, Y, Z : Values to assign /// \param x, y, z : Values to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X, float Y, float Z); void SetParameter(const std::string& Name, float x, float y, float z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of the effect (4 floats) /// Change a parameter of the effect (4 floats)
/// ///
/// \param Name : Parameter name in the effect /// \param name : Name of the parameter in the effect
/// \param X, Y, Z, W : Values to assign /// \param x, y, z, w : Values to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X, float Y, float Z, float W); void SetParameter(const std::string& Name, float x, float y, float Z, float w);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set a texture parameter /// Set a texture parameter
/// ///
/// \param Name : Texture name in the effect /// \param name : Name of the texture in the effect
/// \param Texture : Image to set (pass NULL to use content of current framebuffer) /// \param texture : Image to set (pass NULL to use content of current framebuffer)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetTexture(const std::string& Name, const Image* Texture); void SetTexture(const std::string& name, const Image* texture);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Assignment operator /// Assignment operator
/// ///
/// \param Other : Instance to assign /// \param other : Instance to assign
/// ///
/// \return Reference to the post-effect /// \return Reference to the post-effect
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
PostFX& operator =(const PostFX& Other); PostFX& operator =(const PostFX& other);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not the system supports post-effects /// Tell whether or not the system supports post-effects
@ -153,7 +153,7 @@ protected :
/// /see Drawable::Render /// /see Drawable::Render
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Render(RenderTarget& Target) const; virtual void Render(RenderTarget& target) const;
private : private :
@ -161,12 +161,12 @@ private :
/// Preprocess a SFML effect file /// Preprocess a SFML effect file
/// to convert it to a valid GLSL fragment shader /// to convert it to a valid GLSL fragment shader
/// ///
/// \param File : Stream containing the code to process /// \param file : Stream containing the code to process
/// ///
/// \return Valid fragment shader source code /// \return Valid fragment shader source code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static std::string PreprocessEffect(std::istream& File); static std::string PreprocessEffect(std::istream& file);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the program and attach the shaders /// Create the program and attach the shaders

View File

@ -52,13 +52,13 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the rectangle from its coordinates /// Construct the rectangle from its coordinates
/// ///
/// \param LeftCoord : Left coordinate of the rectangle /// \param left : Left coordinate of the rectangle
/// \param TopCoord : Top coordinate of the rectangle /// \param top : Top coordinate of the rectangle
/// \param RightCoord : Right coordinate of the rectangle /// \param right : Right coordinate of the rectangle
/// \param BottomCoord : Bottom coordinate of the rectangle /// \param bottom : Bottom coordinate of the rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord); Rect(T left, T top, T right, T bottom);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the rectangle /// Get the size of the rectangle
@ -79,62 +79,62 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move the whole rectangle by the given offset /// Move the whole rectangle by the given offset
/// ///
/// \param OffsetX : Horizontal offset /// \param offsetX : Horizontal offset
/// \param OffsetY : Vertical offset /// \param offsetY : Vertical offset
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Offset(T OffsetX, T OffsetY); void Offset(T offsetX, T offsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move the whole rectangle by the given offset /// Move the whole rectangle by the given offset
/// ///
/// \param Off : Offset to apply to the current position /// \param offset : Offset to apply to the current position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Offset(const Vector2<T>& Off); void Offset(const Vector2<T>& offset);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if a point is inside the rectangle's area /// Check if a point is inside the rectangle's area
/// ///
/// \param X : X coordinate of the point to test /// \param x : X coordinate of the point to test
/// \param Y : Y coordinate of the point to test /// \param y : Y coordinate of the point to test
/// ///
/// \return True if the point is inside /// \return True if the point is inside
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Contains(T X, T Y) const; bool Contains(T x, T y) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if a point is inside the rectangle's area /// Check if a point is inside the rectangle's area
/// ///
/// \param Point : Point to test /// \param point : Point to test
/// ///
/// \return True if the point is inside /// \return True if the point is inside
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Contains(const Vector2<T>& Point) const; bool Contains(const Vector2<T>& point) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles /// Check intersection between two rectangles
/// ///
/// \param Rectangle : Rectangle to test /// \param rectangle : Rectangle to test
/// ///
/// \return True if rectangles overlap /// \return True if rectangles overlap
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Intersects(const Rect<T>& Rectangle) const; bool Intersects(const Rect<T>& rectangle) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles and return the /// Check intersection between two rectangles and return the
/// resulting rectangle /// resulting rectangle
/// ///
/// \param Rectangle : Rectangle to test /// \param rectangle : Rectangle to test
/// \param OverlappingRect : Rectangle to be filled with the overlapping rect /// \param intersection : Rectangle to be filled with the intersection of both rectangles
/// ///
/// \return True if rectangles overlap /// \return True if rectangles overlap
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Intersects(const Rect<T>& Rectangle, Rect<T>& OverlappingRect) const; bool Intersects(const Rect<T>& rectangle, Rect<T>& intersection) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data

View File

@ -41,11 +41,11 @@ Bottom(0)
/// Construct the color from its coordinates /// Construct the color from its coordinates
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
Rect<T>::Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) : Rect<T>::Rect(T left, T top, T right, T bottom) :
Left (LeftCoord), Left (left),
Top (TopCoord), Top (top),
Right (RightCoord), Right (right),
Bottom(BottomCoord) Bottom(bottom)
{ {
} }
@ -75,12 +75,12 @@ Vector2<T> Rect<T>::GetCenter() const
/// Move the whole rectangle by the given offset /// Move the whole rectangle by the given offset
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
void Rect<T>::Offset(T OffsetX, T OffsetY) void Rect<T>::Offset(T offsetX, T offsetY)
{ {
Left += OffsetX; Left += offsetX;
Right += OffsetX; Right += offsetX;
Top += OffsetY; Top += offsetY;
Bottom += OffsetY; Bottom += offsetY;
} }
@ -88,9 +88,9 @@ void Rect<T>::Offset(T OffsetX, T OffsetY)
/// Move the whole rectangle by the given offset /// Move the whole rectangle by the given offset
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
void Rect<T>::Offset(const Vector2<T>& Off) void Rect<T>::Offset(const Vector2<T>& offset)
{ {
Offset(Off.x, Off.y); Offset(offset.x, offset.y);
} }
@ -98,9 +98,9 @@ void Rect<T>::Offset(const Vector2<T>& Off)
/// Check if a point is inside the rectangle's area /// Check if a point is inside the rectangle's area
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
bool Rect<T>::Contains(T X, T Y) const bool Rect<T>::Contains(T x, T y) const
{ {
return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom); return (x >= Left) && (x <= Right) && (y >= Top) && (y <= Bottom);
} }
@ -108,9 +108,9 @@ bool Rect<T>::Contains(T X, T Y) const
/// Check if a point is inside the rectangle's area /// Check if a point is inside the rectangle's area
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
bool Rect<T>::Contains(const Vector2<T>& Point) const bool Rect<T>::Contains(const Vector2<T>& point) const
{ {
return Contains(Point.x, Point.y); return Contains(point.x, point.y);
} }
@ -118,16 +118,16 @@ bool Rect<T>::Contains(const Vector2<T>& Point) const
/// Check intersection between two rectangles /// Check intersection between two rectangles
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
bool Rect<T>::Intersects(const Rect<T>& Rectangle) const bool Rect<T>::Intersects(const Rect<T>& rectangle) const
{ {
// Compute overlapping rect // Compute overlapping rect
Rect<T> Overlapping(std::max(Left, Rectangle.Left), Rect<T> overlapping(std::max(Left, rectangle.Left),
std::max(Top, Rectangle.Top), std::max(Top, rectangle.Top),
std::min(Right, Rectangle.Right), std::min(Right, rectangle.Right),
std::min(Bottom, Rectangle.Bottom)); std::min(Bottom, rectangle.Bottom));
// If overlapping rect is valid, then there is intersection // If overlapping rect is valid, then there is intersection
return (Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom); return (overlapping.Left < overlapping.Right) && (overlapping.Top < overlapping.Bottom);
} }
@ -136,23 +136,23 @@ bool Rect<T>::Intersects(const Rect<T>& Rectangle) const
/// resulting rectangle /// resulting rectangle
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
bool Rect<T>::Intersects(const Rect<T>& Rectangle, Rect<T>& OverlappingRect) const bool Rect<T>::Intersects(const Rect<T>& rectangle, Rect<T>& intersection) const
{ {
// Compute overlapping rect // Compute overlapping rect
Rect<T> Overlapping(std::max(Left, Rectangle.Left), Rect<T> overlapping(std::max(Left, rectangle.Left),
std::max(Top, Rectangle.Top), std::max(Top, rectangle.Top),
std::min(Right, Rectangle.Right), std::min(Right, rectangle.Right),
std::min(Bottom, Rectangle.Bottom)); std::min(Bottom, rectangle.Bottom));
// If overlapping rect is valid, then there is intersection // If overlapping rect is valid, then there is intersection
if ((Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom)) if ((overlapping.Left < overlapping.Right) && (overlapping.Top < overlapping.Bottom))
{ {
OverlappingRect = Overlapping; intersection = overlapping;
return true; return true;
} }
else else
{ {
OverlappingRect = Rect<T>(0, 0, 0, 0); intersection = Rect<T>(0, 0, 0, 0);
return false; return false;
} }
} }

View File

@ -63,25 +63,25 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the render image from its dimensions /// Create the render image from its dimensions
/// ///
/// \param Width : Width of the render image /// \param width : Width of the render image
/// \param Height : Height of the render image /// \param height : Height of the render image
/// \param DepthBuffer : Do you want a depth buffer attached? (false by default) /// \param depthBuffer : Do you want a depth buffer attached? (false by default)
/// ///
/// \return True if creation has been successful /// \return True if creation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Create(unsigned int Width, unsigned int Height, bool DepthBuffer = false); bool Create(unsigned int width, unsigned int height, bool depthBuffer = false);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate of deactivate the render-image as the current target /// Activate of deactivate the render-image as the current target
/// for rendering /// for rendering
/// ///
/// \param Active : True to activate, false to deactivate (true by default) /// \param active : True to activate, false to deactivate (true by default)
/// ///
/// \return True if operation was successful, false otherwise /// \return True if operation was successful, false otherwise
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool SetActive(bool Active = true); bool SetActive(bool active = true);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of the image /// Get the width of the rendering region of the image
@ -123,19 +123,19 @@ private :
/// /see RenderTarget::Activate /// /see RenderTarget::Activate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool Activate(bool Active); virtual bool Activate(bool active);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Update the pixels of the target image. /// Update the pixels of the target image.
/// This function is called automatically by the image when it /// This function is called automatically by the image when it
/// needs to update its pixels, and is only meant for internal use. /// needs to update its pixels, and is only meant for internal use.
/// ///
/// \param Target : Target image to update /// \param target : Target image to update
/// ///
/// \return True if the new pixels are flipped vertically /// \return True if the new pixels are flipped vertically
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool UpdateImage(Image& Target); bool UpdateImage(Image& target);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data

View File

@ -53,18 +53,18 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clear the entire target with a single color /// Clear the entire target with a single color
/// ///
/// \param FillColor : Color to use to clear the render target /// \param color : Color to use to clear the render target
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Clear(const Color& FillColor = Color(0, 0, 0)); void Clear(const Color& color = Color(0, 0, 0));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw something into the target /// Draw something into the target
/// ///
/// \param Object : Object to draw /// \param object : Object to draw
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Draw(const Drawable& Object); virtual void Draw(const Drawable& object);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the width of the rendering region of the target /// Get the width of the rendering region of the target
@ -85,10 +85,10 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the current active view. /// Change the current active view.
/// ///
/// \param NewView : New view to use (pass GetDefaultView() to set the default view) /// \param view : New view to use (pass GetDefaultView() to set the default view)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetView(const View& NewView); void SetView(const View& view);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current view /// Get the current view
@ -114,10 +114,10 @@ public :
/// SFML to do internal optimizations and improve performances. /// SFML to do internal optimizations and improve performances.
/// This parameter is false by default /// This parameter is false by default
/// ///
/// \param Preserve : True to preserve OpenGL states, false to let SFML optimize /// \param preserve : True to preserve OpenGL states, false to let SFML optimize
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void PreserveOpenGLStates(bool Preserve); void PreserveOpenGLStates(bool preserve);
protected : protected :
@ -138,12 +138,12 @@ private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Activate the target for rendering /// Activate the target for rendering
/// ///
/// \param Active : True to activate rendering, false to deactivate /// \param active : True to activate rendering, false to deactivate
/// ///
/// \return True if activation succeeded /// \return True if activation succeeded
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool Activate(bool Active) = 0; virtual bool Activate(bool active) = 0;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the OpenGL render states needed for the SFML rendering /// Set the OpenGL render states needed for the SFML rendering

Some files were not shown because too many files have changed in this diff Show More