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:
parent
7cc00085d8
commit
45b150648d
245 changed files with 7865 additions and 8065 deletions
|
@ -34,10 +34,10 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
|
@ -50,44 +50,44 @@ CSFML_API float sfListener_GetGlobalVolume();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Change the position of the listener
|
||||
///
|
||||
/// \param PosX : X position of the listener in the world
|
||||
/// \param PosY : Y position of the listener in the world
|
||||
/// \param PosZ : Z position of the listener in the world
|
||||
/// \param x : X position of the listener in the world
|
||||
/// \param y : Y 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
|
||||
///
|
||||
/// \param PosX : X position of the listener in the world
|
||||
/// \param PosY : Y position of the listener in the world
|
||||
/// \param PosZ : Z position of the listener in the world
|
||||
/// \param x : X position of the listener in the world
|
||||
/// \param y : Y 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
|
||||
/// he must look at)
|
||||
///
|
||||
/// \param TargetX : X position of the point the listener must look at
|
||||
/// \param TargetY : X position of the point the listener must look at
|
||||
/// \param TargetZ : X position of the point the listener must look at
|
||||
/// \param x : X position of the point the listener must look at
|
||||
/// \param y : 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
|
||||
/// he's looking at)
|
||||
///
|
||||
/// \param TargetX : X position of the point the listener is looking at
|
||||
/// \param TargetY : X position of the point the listener is looking at
|
||||
/// \param TargetZ : X position of the point the listener is looking at
|
||||
/// \param x : X position of the point the listener is looking at
|
||||
/// \param y : 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
|
||||
|
|
|
@ -36,257 +36,257 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
/// \param Data : Pointer to the file data in memory
|
||||
/// \param SizeInBytes : Size of the data to load, in bytes
|
||||
/// \param data : Pointer to the file data in memory
|
||||
/// \param sizeInBytes : Size of the data to load, in bytes
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to set the loop state
|
||||
/// \param Loop : sfTrue to play in loop, sfFalse to play once
|
||||
/// \param music : Music to set the loop state
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfMusic_GetLoop(sfMusic* Music);
|
||||
CSFML_API sfBool sfMusic_GetLoop(sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetDuration(sfMusic* Music);
|
||||
CSFML_API float sfMusic_GetDuration(sfMusic* 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \param Music : Music to get the channels count from
|
||||
/// \param music : Music to get the channels count from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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)
|
||||
///
|
||||
/// \param Music : Music to get the status from
|
||||
/// \param music : Music to get the status from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to get the position from
|
||||
/// \param music : Music to get the position from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param Pitch : New pitch
|
||||
/// \param music : Music to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param Volume : Volume (in range [0, 100])
|
||||
/// \param music : Music to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param X : X 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 music : Music to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// position, or absolute.
|
||||
/// The default value is false (absolute)
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param Relative : True to set the position relative, false to set it absolute
|
||||
/// \param music : Music to modify
|
||||
/// \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,
|
||||
/// the listener will hear the music at its maximum volume.
|
||||
/// The default minimum distance is 1.0
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param MinDistance : New minimum distance for the music
|
||||
/// \param music : Music to modify
|
||||
/// \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
|
||||
/// more the sound will be attenuated with distance from listener.
|
||||
/// The default attenuation factor 1.0
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param Attenuation : New attenuation factor for the sound
|
||||
/// \param music : Music to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to modify
|
||||
/// \param TimeOffset : New playing position, expressed in seconds
|
||||
/// \param music : Music to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Music : Music to get the pitch from
|
||||
/// \param music : Music to get the pitch from
|
||||
///
|
||||
/// \return Pitch value
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetPitch(sfMusic* Music);
|
||||
CSFML_API float sfMusic_GetPitch(sfMusic* 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])
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetVolume(sfMusic* Music);
|
||||
CSFML_API float sfMusic_GetVolume(sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the position of a music
|
||||
///
|
||||
/// \param Music : Music to get the position from
|
||||
/// \param X : X 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 music : Music to get the position from
|
||||
/// \param x : X 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfMusic_IsRelativeToListener(sfMusic* Music);
|
||||
CSFML_API sfBool sfMusic_IsRelativeToListener(sfMusic* 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetMinDistance(sfMusic* Music);
|
||||
CSFML_API float sfMusic_GetMinDistance(sfMusic* 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfMusic_GetAttenuation(sfMusic* Music);
|
||||
CSFML_API float sfMusic_GetAttenuation(sfMusic* music);
|
||||
|
||||
|
||||
#endif // SFML_MUSIC_H
|
||||
|
|
|
@ -44,225 +44,225 @@ CSFML_API sfSound* sfSound_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to set the loop state
|
||||
/// \param Buffer : Buffer to bind
|
||||
/// \param sound : Sound to set the loop state
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to get the buffer from
|
||||
/// \param sound : Sound to get the buffer from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to set the loop state
|
||||
/// \param Loop : sfTrue to play in loop, sfFalse to play once
|
||||
/// \param sound : Sound to set the loop state
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSound_GetLoop(sfSound* Sound);
|
||||
CSFML_API sfBool sfSound_GetLoop(sfSound* sound);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSoundStatus sfSound_GetStatus(sfSound* Sound);
|
||||
CSFML_API sfSoundStatus sfSound_GetStatus(sfSound* sound);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Set the pitch of a sound
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param Pitch : New pitch
|
||||
/// \param sound : Sound to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param Volume : Volume (in range [0, 100])
|
||||
/// \param sound : Sound to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param X : X 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 sound : Sound to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// position, or absolute.
|
||||
/// The default value is false (absolute)
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param Relative : True to set the position relative, false to set it absolute
|
||||
/// \param sound : Sound to modify
|
||||
/// \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,
|
||||
/// the listener will hear the sound at its maximum volume.
|
||||
/// The default minimum distance is 1.0
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param MinDistance : New minimum distance for the sound
|
||||
/// \param sound : Sound to modify
|
||||
/// \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
|
||||
/// more the sound will be attenuated with distance from listener.
|
||||
/// The default attenuation factor is 1.0
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param Attenuation : New attenuation factor for the sound
|
||||
/// \param sound : Sound to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to modify
|
||||
/// \param TimeOffset : New playing position, expressed in seconds
|
||||
/// \param sound : Sound to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sound : Sound to get the pitch from
|
||||
/// \param sound : Sound to get the pitch from
|
||||
///
|
||||
/// \return Pitch value
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSound_GetPitch(sfSound* Sound);
|
||||
CSFML_API float sfSound_GetPitch(sfSound* 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])
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSound_GetVolume(sfSound* Sound);
|
||||
CSFML_API float sfSound_GetVolume(sfSound* sound);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the position of a sound
|
||||
///
|
||||
/// \param Sound : Sound to get the position from
|
||||
/// \param X : X 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 sound : Sound to get the position from
|
||||
/// \param x : X 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSound_IsRelativeToListener(sfSound* Sound);
|
||||
CSFML_API sfBool sfSound_IsRelativeToListener(sfSound* 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSound_GetMinDistance(sfSound* Sound);
|
||||
CSFML_API float sfSound_GetMinDistance(sfSound* 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSound_GetAttenuation(sfSound* Sound);
|
||||
CSFML_API float sfSound_GetAttenuation(sfSound* 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSound_GetPlayingOffset(sfSound* Sound);
|
||||
CSFML_API float sfSound_GetPlayingOffset(sfSound* sound);
|
||||
|
||||
|
||||
#endif // SFML_SOUND_H
|
||||
|
|
|
@ -35,107 +35,107 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
/// \param Data : Pointer to the file data in memory
|
||||
/// \param SizeInBytes : Size of the data to load, in bytes
|
||||
/// \param data : Pointer to the file data in memory
|
||||
/// \param sizeInBytes : Size of the data to load, in bytes
|
||||
///
|
||||
/// \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
|
||||
/// samples in memory - assumed format for samples is
|
||||
/// 16 bits signed integer
|
||||
///
|
||||
/// \param Samples : Pointer to the samples in memory
|
||||
/// \param SamplesCount : Number of samples pointed by Samples
|
||||
/// \param ChannelsCount : Number of channels (1 = mono, 2 = stereo, ...)
|
||||
/// \param SampleRate : Frequency (number of samples to play per second)
|
||||
/// \param samples : Pointer to the samples in memory
|
||||
/// \param samplesCount : Number of samples pointed by Samples
|
||||
/// \param channelsCount : Number of channels (1 = mono, 2 = stereo, ...)
|
||||
/// \param sampleRate : Frequency (number of samples to play per second)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundBuffer : Sound buffer to save
|
||||
/// \param Filename : Path of the sound file to write
|
||||
/// \param soundBuffer : Sound buffer to save
|
||||
/// \param filename : Path of the sound file to write
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
/// \param SoundBuffer : Sound buffer to get samples count from
|
||||
/// \param soundBuffer : Sound buffer to get samples count from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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, ...)
|
||||
///
|
||||
/// \param SoundBuffer : Sound buffer to get channels count from
|
||||
/// \param soundBuffer : Sound buffer to get channels count from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundBuffer : Sound buffer to get duration from
|
||||
/// \param soundBuffer : Sound buffer to get duration from
|
||||
///
|
||||
/// \return Sound duration, in seconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundBuffer_GetDuration(sfSoundBuffer* SoundBuffer);
|
||||
CSFML_API float sfSoundBuffer_GetDuration(sfSoundBuffer* soundBuffer);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDBUFFER_H
|
||||
|
|
|
@ -43,49 +43,49 @@ CSFML_API sfSoundBufferRecorder* sfSoundBufferRecorder_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
/// Warning : only one capture can happen at the same time
|
||||
///
|
||||
/// \param SoundBufferRecorder : Sound bufferrecorder to start
|
||||
/// \param SampleRate : Sound frequency (the more samples, the higher the quality)
|
||||
/// \param soundBufferRecorder : Sound buffer recorder to start
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(sfSoundBufferRecorder* SoundBufferRecorder);
|
||||
CSFML_API sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(sfSoundBufferRecorder* soundBufferRecorder);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDBUFFERRECORDER_H
|
||||
|
|
|
@ -41,54 +41,54 @@ typedef void (*sfSoundRecorderStopCallback)(void*);
|
|||
/// Construct a new sound recorder with callback functions
|
||||
/// for processing captured samples
|
||||
///
|
||||
/// \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 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 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 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)
|
||||
///
|
||||
/// \return A new sfSoundRecorder object (NULL if failed)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback OnStart,
|
||||
sfSoundRecorderProcessCallback OnProcess,
|
||||
sfSoundRecorderStopCallback OnStop,
|
||||
void* UserData);
|
||||
CSFML_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart,
|
||||
sfSoundRecorderProcessCallback onProcess,
|
||||
sfSoundRecorderStopCallback onStop,
|
||||
void* userData);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
/// Warning : only one capture can happen at the same time
|
||||
///
|
||||
/// \param SoundRecorder : Sound recorder to start
|
||||
/// \param SampleRate : Sound frequency (the more samples, the higher the quality)
|
||||
/// \param soundRecorder : Sound recorder to start
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundRecorder : Sound recorder to get sample rate from
|
||||
/// \param soundRecorder : Sound recorder to get sample rate from
|
||||
///
|
||||
/// \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.
|
||||
|
|
|
@ -50,245 +50,245 @@ typedef void (*sfSoundStreamSeekCallback)(float, void*); ///<
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new sound stream
|
||||
///
|
||||
/// \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 ChannelsCount : Number of channels to use (1 = mono, 2 = stereo)
|
||||
/// \param SampleRate : Sample rate of the sound (44100 = CD quality)
|
||||
/// \param UserData : Data to pass to the callback functions
|
||||
/// \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 channelsCount : Number of channels to use (1 = mono, 2 = stereo)
|
||||
/// \param sampleRate : Sample rate of the sound (44100 = CD quality)
|
||||
/// \param userData : Data to pass to the callback functions
|
||||
///
|
||||
/// \return A new sfSoundStream object (NULL if failed)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback OnGetData,
|
||||
sfSoundStreamSeekCallback OnSeek,
|
||||
unsigned int ChannelsCount,
|
||||
unsigned int SampleRate,
|
||||
void* UserData);
|
||||
CSFML_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
|
||||
sfSoundStreamSeekCallback onSeek,
|
||||
unsigned int channelsCount,
|
||||
unsigned int sampleRate,
|
||||
void* userData);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSoundStatus sfSoundStream_GetStatus(sfSoundStream* SoundStream);
|
||||
CSFML_API sfSoundStatus sfSoundStream_GetStatus(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Return the number of channels of a sound stream
|
||||
/// (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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* SoundStream);
|
||||
CSFML_API unsigned int sfSoundStream_GetChannelsCount(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API unsigned int sfSoundStream_GetSampleRate(sfSoundStream* SoundStream);
|
||||
CSFML_API unsigned int sfSoundStream_GetSampleRate(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Set the pitch of a sound stream
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param Pitch : New pitch
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param Volume : Volume (in range [0, 100])
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param X : X 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 soundStream : Sound stream to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// position, or absolute.
|
||||
/// The default value is false (absolute)
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param Relative : True to set the position relative, false to set it absolute
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \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,
|
||||
/// the listener will hear the sound stream at its maximum volume.
|
||||
/// The default minimum distance is 1.0
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param MinDistance : New minimum distance for the sound stream
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \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
|
||||
/// more the sound stream will be attenuated with distance from listener.
|
||||
/// The default attenuation factor 1.0
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param Attenuation : New attenuation factor for the sound stream
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundStream : Sound stream to modify
|
||||
/// \param TimeOffset : New playing position, expressed in seconds
|
||||
/// \param soundStream : Sound stream to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundStream : Stream to set the loop state
|
||||
/// \param Loop : sfTrue to play in loop, sfFalse to play once
|
||||
/// \param soundStream : Stream to set the loop state
|
||||
/// \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
|
||||
///
|
||||
/// \param SoundStream : Sound stream to get the pitch from
|
||||
/// \param soundStream : Sound stream to get the pitch from
|
||||
///
|
||||
/// \return Pitch value
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundStream_GetPitch(sfSoundStream* SoundStream);
|
||||
CSFML_API float sfSoundStream_GetPitch(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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])
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundStream_GetVolume(sfSoundStream* SoundStream);
|
||||
CSFML_API float sfSoundStream_GetVolume(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the position of a sound stream
|
||||
///
|
||||
/// \param SoundStream : Sound stream to get the position from
|
||||
/// \param X : X 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 soundStream : Sound stream to get the position from
|
||||
/// \param x : X 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSoundStream_IsRelativeToListener(sfSoundStream* SoundStream);
|
||||
CSFML_API sfBool sfSoundStream_IsRelativeToListener(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundStream_GetMinDistance(sfSoundStream* SoundStream);
|
||||
CSFML_API float sfSoundStream_GetMinDistance(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundStream_GetAttenuation(sfSoundStream* SoundStream);
|
||||
CSFML_API float sfSoundStream_GetAttenuation(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSoundStream_GetLoop(sfSoundStream* SoundStream);
|
||||
CSFML_API sfBool sfSoundStream_GetLoop(sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSoundStream_GetPlayingOffset(sfSoundStream* SoundStream);
|
||||
CSFML_API float sfSoundStream_GetPlayingOffset(sfSoundStream* soundStream);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDSTREAM_H
|
||||
|
|
|
@ -59,49 +59,49 @@ CSFML_API sfColor sfCyan;
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct a color from its 3 RGB components
|
||||
///
|
||||
/// \param R : Red component (0 .. 255)
|
||||
/// \param G : Green component (0 .. 255)
|
||||
/// \param B : Blue component (0 .. 255)
|
||||
/// \param red : Red component (0 .. 255)
|
||||
/// \param green : Green component (0 .. 255)
|
||||
/// \param blue : Blue component (0 .. 255)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param R : Red component (0 .. 255)
|
||||
/// \param G : Green component (0 .. 255)
|
||||
/// \param B : Blue component (0 .. 255)
|
||||
/// \param A : Alpha component (0 .. 255)
|
||||
/// \param red : Red component (0 .. 255)
|
||||
/// \param green : Green component (0 .. 255)
|
||||
/// \param blue : Blue component (0 .. 255)
|
||||
/// \param alpha : Alpha component (0 .. 255)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Color1 : First color
|
||||
/// \param Color2 : Second color
|
||||
/// \param color1 : First color
|
||||
/// \param color2 : Second color
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Color1 : First color
|
||||
/// \param Color2 : Second color
|
||||
/// \param color1 : First color
|
||||
/// \param color2 : Second color
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -43,46 +43,46 @@ CSFML_API sfFont* sfFont_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Create a new font from a file
|
||||
///
|
||||
/// \param Filename : Path of the font file to load
|
||||
/// \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 filename : Path of the font file to load
|
||||
/// \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)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Data : Pointer to the file data in memory
|
||||
/// \param SizeInBytes : Size of the data to load, in bytes
|
||||
/// \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 data : Pointer to the file data in memory
|
||||
/// \param sizeInBytes : Size of the data to load, in bytes
|
||||
/// \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)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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;
|
||||
/// All glyphs dimensions are based on this value
|
||||
///
|
||||
/// \param Font : Font object
|
||||
/// \param font : Font object
|
||||
///
|
||||
/// \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)
|
||||
|
|
|
@ -45,186 +45,186 @@ CSFML_API sfImage* sfImage_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Create a new image filled with a color
|
||||
///
|
||||
/// \param Width : Image width
|
||||
/// \param Height : Image height
|
||||
/// \param Col : Image color
|
||||
/// \param width : Image width
|
||||
/// \param height : Image height
|
||||
/// \param color : Image color
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Width : Image width
|
||||
/// \param Height : Image height
|
||||
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA)
|
||||
/// \param width : Image width
|
||||
/// \param height : Image height
|
||||
/// \param data : Pointer to the pixels in memory (assumed format is RGBA)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
/// \param Data : Pointer to the file data in memory
|
||||
/// \param SizeInBytes : Size of the data to load, in bytes
|
||||
/// \param data : Pointer to the file data in memory
|
||||
/// \param sizeInBytes : Size of the data to load, in bytes
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Image : Image to save
|
||||
/// \param Filename : Path of the file to save (overwritten if already exist)
|
||||
/// \param image : Image to save
|
||||
/// \param filename : Path of the file to save (overwritten if already exist)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Image : Image to modify
|
||||
/// \param ColorKey : Color to become transparent
|
||||
/// \param Alpha : Alpha value to use for transparent pixels
|
||||
/// \param image : Image to modify
|
||||
/// \param colorKey : Color to become transparent
|
||||
/// \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.
|
||||
/// This function does a slow pixel copy and should only
|
||||
/// be used at initialization time
|
||||
///
|
||||
/// \param Image : Destination image
|
||||
/// \param Source : Source image to copy
|
||||
/// \param DestX : X coordinate of the destination position
|
||||
/// \param DestY : Y coordinate of the destination position
|
||||
/// \param SourceRect : Sub-rectangle of the source image to copy
|
||||
/// \param image : Destination image
|
||||
/// \param source : Source image to copy
|
||||
/// \param destX : X coordinate of the destination position
|
||||
/// \param destY : Y coordinate of the destination position
|
||||
/// \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
|
||||
/// given window
|
||||
///
|
||||
/// \param Image : Destination image
|
||||
/// \param Window : Window to capture
|
||||
/// \param SourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
|
||||
/// \param image : Destination image
|
||||
/// \param window : Window to capture
|
||||
/// \param sourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
|
||||
///
|
||||
/// \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
|
||||
/// Don't forget to call Update when you end modifying pixels
|
||||
///
|
||||
/// \param Image : Image to modify
|
||||
/// \param X : X coordinate of pixel in the image
|
||||
/// \param Y : Y coordinate of pixel in the image
|
||||
/// \param Col : New color for pixel (X, Y)
|
||||
/// \param image : Image to modify
|
||||
/// \param x : X coordinate of pixel in the image
|
||||
/// \param y : Y coordinate of pixel in the image
|
||||
/// \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
|
||||
///
|
||||
/// \param Image : Image to read
|
||||
/// \param X : X coordinate of pixel in the image
|
||||
/// \param Y : Y coordinate of pixel in the image
|
||||
/// \param image : Image to read
|
||||
/// \param x : X coordinate of pixel in the image
|
||||
/// \param y : Y coordinate of pixel in the image
|
||||
///
|
||||
/// \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)
|
||||
/// Array size is sfImage_GetWidth() x sfImage_GetHeight() x 4
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API const sfUint8* sfImage_GetPixelsPtr(sfImage* Image);
|
||||
CSFML_API const sfUint8* sfImage_GetPixelsPtr(sfImage* image);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param Image : Image to modify
|
||||
/// \param Smooth : sfTrue to enable smoothing filter, false to disable it
|
||||
/// \param image : Image to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Image : Image to read
|
||||
/// \param image : Image to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Image : Image to read
|
||||
/// \param image : Image to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Image : Image to read
|
||||
/// \param image : Image to read
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
|
@ -45,70 +45,70 @@ CSFML_API sfPostFX* sfPostFX_CreateFromFile(const char* Filename);
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfPostFX* sfPostFX_CreateFromMemory(const char* Effect);
|
||||
CSFML_API sfPostFX* sfPostFX_CreateFromMemory(const char* effect);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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)
|
||||
///
|
||||
/// \param PostFX : Post-effect to modify
|
||||
/// \param Name : Parameter name in the effect
|
||||
/// \param X : Value to assign
|
||||
/// \param postFX : Post-effect to modify
|
||||
/// \param name : Parameter name in the effect
|
||||
/// \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)
|
||||
///
|
||||
/// \param PostFX : Post-effect to modify
|
||||
/// \param Name : Parameter name in the effect
|
||||
/// \param X, Y : Values to assign
|
||||
/// \param postFX : Post-effect to modify
|
||||
/// \param name : Parameter name in the effect
|
||||
/// \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)
|
||||
///
|
||||
/// \param PostFX : Post-effect to modify
|
||||
/// \param Name : Parameter name in the effect
|
||||
/// \param X, Y, Z : Values to assign
|
||||
/// \param postFX : Post-effect to modify
|
||||
/// \param name : Parameter name in the effect
|
||||
/// \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)
|
||||
///
|
||||
/// \param PostFX : Post-effect to modify
|
||||
/// \param Name : Parameter name in the effect
|
||||
/// \param X, Y, Z, W : Values to assign
|
||||
/// \param postFX : Post-effect to modify
|
||||
/// \param name : Parameter name in the effect
|
||||
/// \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
|
||||
///
|
||||
/// \param PostFX : Post-effect to modify
|
||||
/// \param Name : Texture name in the effect
|
||||
/// \param Texture : Image to set (pass NULL to use content of current framebuffer)
|
||||
/// \param postFX : Post-effect to modify
|
||||
/// \param name : Texture name in the effect
|
||||
/// \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
|
||||
|
|
|
@ -55,39 +55,39 @@ typedef struct
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Move a rectangle by the given offset
|
||||
///
|
||||
/// \param Rect : Rectangle to move
|
||||
/// \param OffsetX : Horizontal offset
|
||||
/// \param OffsetY : Vertical offset
|
||||
/// \param rect : Rectangle to move
|
||||
/// \param offsetX : Horizontal offset
|
||||
/// \param offsetY : Vertical offset
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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 sfFloatRect_Offset(sfFloatRect* rect, float offsetX, float offsetY);
|
||||
CSFML_API void sfIntRect_Offset(sfIntRect* rect, int offsetX, int offsetY);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Check if a point is inside a rectangle's area
|
||||
///
|
||||
/// \param Rect : Rectangle to test
|
||||
/// \param X : X coordinate of the point to test
|
||||
/// \param Y : Y coordinate of the point to test
|
||||
/// \param rect : Rectangle to test
|
||||
/// \param x : X coordinate of the point to test
|
||||
/// \param y : Y coordinate of the point to test
|
||||
///
|
||||
/// \return sfTrue if the point is inside
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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 sfFloatRect_Contains(sfFloatRect* rect, float x, float y);
|
||||
CSFML_API sfBool sfIntRect_Contains(sfIntRect* rect, int x, int y);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Check intersection between two rectangles
|
||||
///
|
||||
/// \param Rect1 : First rectangle to test
|
||||
/// \param Rect2 : Second rectangle to test
|
||||
/// \param OverlappingRect : Rectangle to be filled with overlapping rect (can be NULL)
|
||||
/// \param rect1 : First rectangle to test
|
||||
/// \param rect2 : Second rectangle to test
|
||||
/// \param intersection : Rectangle to be filled with overlapping rect (can be NULL)
|
||||
///
|
||||
/// \return sfTrue if rectangles overlap
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfFloatRect_Intersects(sfFloatRect* Rect1, sfFloatRect* Rect2, sfFloatRect* OverlappingRect);
|
||||
CSFML_API sfBool sfIntRect_Intersects(sfIntRect* Rect1, sfIntRect* Rect2, sfIntRect* OverlappingRect);
|
||||
CSFML_API sfBool sfFloatRect_Intersects(sfFloatRect* rect1, sfFloatRect* rect2, sfFloatRect* intersection);
|
||||
CSFML_API sfBool sfIntRect_Intersects(sfIntRect* rect1, sfIntRect* rect2, sfIntRect* intersection);
|
||||
|
||||
|
||||
#endif // SFML_RECT_H
|
||||
|
|
|
@ -37,101 +37,101 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new renderimage
|
||||
///
|
||||
/// \param Width : Width 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 width : Width 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage object
|
||||
/// \param renderImage : Renderimage object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage object
|
||||
/// \param renderImage : Renderimage object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage object
|
||||
/// \param Active : sfTrue to activate, sfFalse to deactivate
|
||||
/// \param renderImage : Renderimage object
|
||||
/// \param active : sfTrue to activate, sfFalse to deactivate
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage to draw in
|
||||
/// \param PostFX / Sprite / String / shape : Object to draw
|
||||
/// \param renderImage : Renderimage to draw in
|
||||
/// \param postFX / sprite / string / shape : Object to draw
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfRenderImage_DrawPostFX(sfRenderImage* RenderImage, sfPostFX* PostFX);
|
||||
CSFML_API void sfRenderImage_DrawSprite(sfRenderImage* RenderImage, sfSprite* Sprite);
|
||||
CSFML_API void sfRenderImage_DrawShape (sfRenderImage* RenderImage, sfShape* Shape);
|
||||
CSFML_API void sfRenderImage_DrawString(sfRenderImage* RenderImage, sfString* String);
|
||||
CSFML_API void sfRenderImage_DrawPostFX(sfRenderImage* renderImage, sfPostFX* postFX);
|
||||
CSFML_API void sfRenderImage_DrawSprite(sfRenderImage* renderImage, sfSprite* sprite);
|
||||
CSFML_API void sfRenderImage_DrawShape (sfRenderImage* renderImage, sfShape* shape);
|
||||
CSFML_API void sfRenderImage_DrawString(sfRenderImage* renderImage, sfString* string);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Clear the renderimage with the given color
|
||||
///
|
||||
/// \param RenderImage : Renderimage to modify
|
||||
/// \param Color : Fill color
|
||||
/// \param renderImage : Renderimage to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage to modify
|
||||
/// \param NewView : Pointer to the new view
|
||||
/// \param renderImage : Renderimage to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage
|
||||
/// \param renderImage : Renderimage
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage
|
||||
/// \param renderImage : 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
|
||||
|
@ -141,21 +141,21 @@ CSFML_API sfView* sfRenderImage_GetDefaultView(sfRenderImage* RenderImage);
|
|||
/// SFML to do internal optimizations and improve performances.
|
||||
/// This parameter is false by default
|
||||
///
|
||||
/// \param RenderImage : Target renderimage
|
||||
/// \param Preserve : True to preserve OpenGL states, false to let SFML optimize
|
||||
/// \param renderImage : Target renderimage
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderImage : Renderimage object
|
||||
/// \param renderImage : Renderimage object
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -41,298 +41,297 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new renderwindow
|
||||
///
|
||||
/// \param Mode : Video mode to use
|
||||
/// \param Title : Title of the window
|
||||
/// \param Style : Window style
|
||||
/// \param Params : Creation settings
|
||||
/// \param mode : Video mode to use
|
||||
/// \param title : Title of the window
|
||||
/// \param style : Window style
|
||||
/// \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
|
||||
///
|
||||
/// \param Handle : Platform-specific handle of the control
|
||||
/// \param Params : Creation settings
|
||||
/// \param handle : Platform-specific handle of the control
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param renderWindow : Renderwindow object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param renderWindow : Renderwindow object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param renderWindow : Renderwindow object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Event : Event to fill, if any
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \param event : Event to fill, if any
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Enabled : sfTrue to enable v-sync, sfFalse to deactivate
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : RenderWindow object
|
||||
/// \param Show : sfTrue to show, sfFalse to hide
|
||||
/// \param renderWindow : RenderWindow object
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Left : Left coordinate of the cursor, relative to the window
|
||||
/// \param Top : Top coordinate of the cursor, relative to the window
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \param left : Left 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.
|
||||
/// Only works for top-level windows
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Left : Left position
|
||||
/// \param Top : Top position
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \param left : Left 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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Width : New Width
|
||||
/// \param Height : New Height
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \param width : New Width
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param State : sfTrue to show, sfFalse to hide
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \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.
|
||||
/// Automatic key-repeat is enabled by default
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Enabled : sfTrue to enable, sfFalse to disable
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Width : Icon's width, in pixels
|
||||
/// \param Height : Icon's height, in pixels
|
||||
/// \param Pixels : Pointer to the pixels in memory, format must be RGBA 32 bits
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \param width : Icon's width, in pixels
|
||||
/// \param height : Icon's height, in pixels
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Active : sfTrue to activate, sfFalse to deactivate
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \param active : sfTrue to activate, sfFalse to deactivate
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param renderWindow : Renderwindow object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
///
|
||||
/// \param Limit : Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param renderWindow : Renderwindow object
|
||||
///
|
||||
/// \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
|
||||
/// no move event will be generated
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow object
|
||||
/// \param Threshold : New threshold, in range [0, 100]
|
||||
/// \param renderWindow : Renderwindow object
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow to draw in
|
||||
/// \param PostFX / Sprite / String / shape : Object to draw
|
||||
/// \param renderWindow : Renderwindow to draw in
|
||||
/// \param postFX / sprite / string / shape : Object to draw
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfRenderWindow_DrawPostFX(sfRenderWindow* RenderWindow, sfPostFX* PostFX);
|
||||
CSFML_API void sfRenderWindow_DrawSprite(sfRenderWindow* RenderWindow, sfSprite* Sprite);
|
||||
CSFML_API void sfRenderWindow_DrawShape (sfRenderWindow* RenderWindow, sfShape* Shape);
|
||||
CSFML_API void sfRenderWindow_DrawString(sfRenderWindow* RenderWindow, sfString* String);
|
||||
CSFML_API void sfRenderWindow_DrawPostFX(sfRenderWindow* renderWindow, sfPostFX* postFX);
|
||||
CSFML_API void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, sfSprite* sprite);
|
||||
CSFML_API void sfRenderWindow_DrawShape (sfRenderWindow* renderWindow, sfShape* shape);
|
||||
CSFML_API void sfRenderWindow_DrawString(sfRenderWindow* renderWindow, sfString* string);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfImage* sfRenderWindow_Capture(sfRenderWindow* RenderWindow);
|
||||
CSFML_API sfImage* sfRenderWindow_Capture(sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Clear the screen with the given color
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow to modify
|
||||
/// \param Color : Fill color
|
||||
/// \param renderWindow : Renderwindow to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow to modify
|
||||
/// \param NewView : Pointer to the new view
|
||||
/// \param renderWindow : Renderwindow to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow
|
||||
/// \param renderWindow : Renderwindow
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Renderwindow
|
||||
/// \param renderWindow : Renderwindow
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param RenderWindow : Target Renderwindow
|
||||
/// \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 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 TargetView : Target view to convert the point to (pass NULL to use the current view)
|
||||
/// \param renderWindow : Target Renderwindow
|
||||
/// \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 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 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
|
||||
|
@ -342,11 +341,11 @@ CSFML_API void sfRenderWindow_ConvertCoords(sfRenderWindow* RenderWindow, unsign
|
|||
/// SFML to do internal optimizations and improve performances.
|
||||
/// This parameter is false by default
|
||||
///
|
||||
/// \param RenderWindow : Target Renderwindow
|
||||
/// \param Preserve : True to preserve OpenGL states, false to let SFML optimize
|
||||
/// \param renderWindow : Target Renderwindow
|
||||
/// \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
|
||||
|
|
|
@ -45,39 +45,39 @@ CSFML_API sfShape* sfShape_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Create a new shape made of a single line
|
||||
///
|
||||
/// \param P1X, P1Y : Position of the first point
|
||||
/// \param P2X, P2Y : Position second point
|
||||
/// \param Thickness : Line thickness
|
||||
/// \param Col : Color used to draw the line
|
||||
/// \param Outline : Outline width
|
||||
/// \param OutlineCol : Color used to draw the outline
|
||||
/// \param p1x, p1y : Position of the first point
|
||||
/// \param p2x, p2y : Position second point
|
||||
/// \param thickness : Line thickness
|
||||
/// \param color : Color used to draw the line
|
||||
/// \param outline : Outline width
|
||||
/// \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
|
||||
///
|
||||
/// \param P1X, P1Y : Position of the first point
|
||||
/// \param P2X, P2Y : Position second point
|
||||
/// \param Col : Color used to fill the rectangle
|
||||
/// \param Outline : Outline width
|
||||
/// \param OutlineCol : Color used to draw the outline
|
||||
/// \param p1x, p1y : Position of the first point
|
||||
/// \param p2x, p2y : Position second point
|
||||
/// \param color : Color used to fill the rectangle
|
||||
/// \param outline : Outline width
|
||||
/// \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
|
||||
///
|
||||
/// \param X, Y : Position of the center
|
||||
/// \param Radius : Radius
|
||||
/// \param Col : Color used to fill the circle
|
||||
/// \param Outline : Outline width
|
||||
/// \param OutlineCol : Color used to draw the outline
|
||||
/// \param x, y : Position of the center
|
||||
/// \param radius : Radius
|
||||
/// \param color : Color used to fill the circle
|
||||
/// \param outline : Outline width
|
||||
/// \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
|
||||
|
@ -85,369 +85,370 @@ CSFML_API sfShape* sfShape_CreateCircle(float X, float Y, float Radius, sfColor
|
|||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param X : New X coordinate
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Y : New Y coordinate
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param X : New X coordinate
|
||||
/// \param Y : New Y coordinate
|
||||
/// \param shape : Shape to modify
|
||||
/// \param x : New X 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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Scale : New scale (must be strictly positive)
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Scale : New scale (must be strictly positive)
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param ScaleX : New horizontal scale (must be strictly positive)
|
||||
/// \param ScaleY : New vertical scale (must be strictly positive)
|
||||
/// \param shape : Shape to modify
|
||||
/// \param scaleX : New horizontal 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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Rotation : Angle of rotation, in degrees
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
/// its left-top corner
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param X : X coordinate of the origin
|
||||
/// \param Y : Y coordinate of the origin
|
||||
/// \param shape : Shape to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Color : New color
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Mode : New blending mode
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \return Current Y origin
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfShape_GetOriginY(sfShape* Shape);
|
||||
CSFML_API float sfShape_GetOriginY(sfShape* shape);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the color of a shape
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \return Current blending mode
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBlendMode sfShape_GetBlendMode(sfShape* Shape);
|
||||
CSFML_API sfBlendMode sfShape_GetBlendMode(sfShape* shape);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Move a shape
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param OffsetX : Offset on the X axis
|
||||
/// \param OffsetY : Offset on the Y axis
|
||||
/// \param shape : Shape to modify
|
||||
/// \param offsetX : Offset on the X 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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param FactorX : Horizontal scaling factor (must be strictly positive)
|
||||
/// \param FactorY : Vertical scaling factor (must be strictly positive)
|
||||
/// \param shape : Shape to modify
|
||||
/// \param factorX : Horizontal 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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Angle : Angle of rotation, in degrees
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
|
||||
///
|
||||
/// \param Shape : Shape object
|
||||
/// \param PointX : X 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 Y : Value to fill with the y coordinate of the converted point
|
||||
/// \param shape : Shape object
|
||||
/// \param pointX : X 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 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
|
||||
/// (ie it applies the object's origin, translation, rotation and scale to the point)
|
||||
///
|
||||
/// \param Shape : Shape object
|
||||
/// \param PointX : X 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 Y : Value to fill with the y coordinate of the converted point
|
||||
/// \param shape : Shape object
|
||||
/// \param pointX : X 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 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
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param X, Y : Position of the point
|
||||
/// \param Col : Color of the point
|
||||
/// \param OutlineCol : Outline color of the point
|
||||
/// \param shape : Shape to modify
|
||||
/// \param x, y : Position of the point
|
||||
/// \param color : 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.
|
||||
/// 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.
|
||||
/// Outline is enabled by default
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \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_EnableOutline(sfShape* Shape, sfBool Enable);
|
||||
CSFML_API void sfShape_EnableOutline(sfShape* shape, sfBool enable);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Change the width of a shape outline
|
||||
///
|
||||
/// \param Shape : Shape to modify
|
||||
/// \param Width : New width
|
||||
/// \param shape : Shape to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param shape : Shape to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param Index : Index of the point to get
|
||||
/// \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 shape : Shape to read
|
||||
/// \param index : Index of the point to get
|
||||
/// \param x : Variable to fill with the X 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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param Index : Index of the point to get
|
||||
/// \param shape : Shape to read
|
||||
/// \param index : Index of the point to get
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param Index : Index of the point to get
|
||||
/// \param shape : Shape to read
|
||||
/// \param index : Index of the point to get
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param Index : Index of the point to get
|
||||
/// \param X : X coordinate of the point
|
||||
/// \param Y : Y coordinate of the point
|
||||
/// \param shape : Shape to read
|
||||
/// \param index : Index of the point to get
|
||||
/// \param x : X 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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param Index : Index of the point to get
|
||||
/// \param Color : Color of the point
|
||||
/// \param shape : Shape to read
|
||||
/// \param index : Index of the point to get
|
||||
/// \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
|
||||
///
|
||||
/// \param Shape : Shape to read
|
||||
/// \param Index : Index of the point to get
|
||||
/// \param Color : Outline color of the point
|
||||
/// \param shape : Shape to read
|
||||
/// \param index : Index of the point to get
|
||||
/// \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
|
||||
|
|
|
@ -46,347 +46,347 @@ CSFML_API sfSprite* sfSprite_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param X : New X coordinate
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Y : New Y coordinate
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param X : New X coordinate
|
||||
/// \param Y : New Y coordinate
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param x : New X 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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Scale : New scale (must be strictly positive)
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Scale : New scale (must be strictly positive)
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param ScaleX : New horizontal scale (must be strictly positive)
|
||||
/// \param ScaleY : New vertical scale (must be strictly positive)
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param scaleX : New horizontal 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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Rotation : Angle of rotation, in degrees
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
/// its left-top corner
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param X : X coordinate of the origin
|
||||
/// \param Y : Y coordinate of the origin
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Color : New color
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Mode : New blending mode
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \return Current Y origin
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSprite_GetOriginY(sfSprite* Sprite);
|
||||
CSFML_API float sfSprite_GetOriginY(sfSprite* sprite);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the color of a sprite
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \return Current blending mode
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBlendMode sfSprite_GetBlendMode(sfSprite* Sprite);
|
||||
CSFML_API sfBlendMode sfSprite_GetBlendMode(sfSprite* sprite);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Move a sprite
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param OffsetX : Offset on the X axis
|
||||
/// \param OffsetY : Offset on the Y axis
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param offsetX : Offset on the X 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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param FactorX : Horizontal scaling factor (must be strictly positive)
|
||||
/// \param FactorY : Vertical scaling factor (must be strictly positive)
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param factorX : Horizontal 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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Angle : Angle of rotation, in degrees
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
|
||||
///
|
||||
/// \param Sprite : Sprite object
|
||||
/// \param PointX : X 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 Y : Value to fill with the y coordinate of the converted point
|
||||
/// \param sprite : Sprite object
|
||||
/// \param pointX : X 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 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
|
||||
/// (ie it applies the object's origin, translation, rotation and scale to the point)
|
||||
///
|
||||
/// \param Sprite : Sprite object
|
||||
/// \param PointX : X 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 Y : Value to fill with the y coordinate of the converted point
|
||||
/// \param sprite : Sprite object
|
||||
/// \param pointX : X 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 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param SubRect : New sub-rectangle
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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)
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Width : New width (must be strictly positive)
|
||||
/// \param Height : New height (must be strictly positive)
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \param width : New width (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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Flipped : sfTrue to flip the sprite
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to modify
|
||||
/// \param Flipped : sfTrue to flip the sprite
|
||||
/// \param sprite : Sprite to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \return Sub-rectangle
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfIntRect sfSprite_GetSubRect(sfSprite* Sprite);
|
||||
CSFML_API sfIntRect sfSprite_GetSubRect(sfSprite* sprite);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get a sprite width
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \return Width of the sprite
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API float sfSprite_GetWidth(sfSprite* Sprite);
|
||||
CSFML_API float sfSprite_GetWidth(sfSprite* sprite);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get a sprite height
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param sprite : Sprite to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Sprite : Sprite to read
|
||||
/// \param X : X coordinate of the pixel to get
|
||||
/// \param Y : Y coordinate of the pixel to get
|
||||
/// \param sprite : Sprite to read
|
||||
/// \param x : X coordinate of the pixel to get
|
||||
/// \param y : Y coordinate of the pixel to get
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -58,367 +58,367 @@ CSFML_API sfString* sfString_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param X : New X coordinate
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Y : New Y coordinate
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Left : New left coordinate
|
||||
/// \param Top : New top coordinate
|
||||
/// \param string : String to modify
|
||||
/// \param x : New X 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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Scale : New scale (must be strictly positive)
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Scale : New scale (must be strictly positive)
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param ScaleX : New horizontal scale (must be strictly positive)
|
||||
/// \param ScaleY : New vertical scale (must be strictly positive)
|
||||
/// \param string : String to modify
|
||||
/// \param scaleX : New horizontal 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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Rotation : Angle of rotation, in degrees
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
/// relative to its left-top corner
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param X : X coordinate of the origin
|
||||
/// \param Y : Y coordinate of the origin
|
||||
/// \param string : String to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Color : New color
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Mode : New blending mode
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \return Current blending mode
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBlendMode sfString_GetBlendMode(sfString* String);
|
||||
CSFML_API sfBlendMode sfString_GetBlendMode(sfString* string);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Move a string
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param OffsetX : Offset on the X axis
|
||||
/// \param OffsetY : Offset on the Y axis
|
||||
/// \param string : String to modify
|
||||
/// \param offsetX : Offset on the X 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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param FactorX : Horizontal scaling factor (must be strictly positive)
|
||||
/// \param FactorY : Vertical scaling factor (must be strictly positive)
|
||||
/// \param string : String to modify
|
||||
/// \param factorX : Horizontal 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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Angle : Angle of rotation, in degrees
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point)
|
||||
///
|
||||
/// \param String : String object
|
||||
/// \param PointX : X 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 Y : Value to fill with the y coordinate of the converted point
|
||||
/// \param string : String object
|
||||
/// \param pointX : X 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 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
|
||||
/// (ie it applies the object's origin, translation, rotation and scale to the point)
|
||||
///
|
||||
/// \param String : String object
|
||||
/// \param PointX : X 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 Y : Value to fill with the y coordinate of the converted point
|
||||
/// \param string : String object
|
||||
/// \param pointX : X 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 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)
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Text : New text
|
||||
/// \param string : String to modify
|
||||
/// \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)
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Text : New text
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Font : Font to use
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Size : New size, in pixels
|
||||
/// \param string : String to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to modify
|
||||
/// \param Size : New style (see sfStringStyle enum)
|
||||
/// \param string : String to modify
|
||||
/// \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)
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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,
|
||||
/// in coordinates relative to the string
|
||||
/// (note : translation, origin, rotation and scale are not applied)
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param Index : Index of the character
|
||||
/// \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 string : String to read
|
||||
/// \param index : Index of the character
|
||||
/// \param x : Value to fill with the X 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
|
||||
///
|
||||
/// \param String : String to read
|
||||
/// \param string : String to read
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -42,47 +42,47 @@ CSFML_API sfView* sfView_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to modify
|
||||
/// \param X : X coordinate of the new center
|
||||
/// \param Y : Y coordinate of the new center
|
||||
/// \param view : View to modify
|
||||
/// \param x : X 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
|
||||
///
|
||||
/// \param View : View to modify
|
||||
/// \param Width : New width
|
||||
/// \param Height : New height
|
||||
/// \param view : View to modify
|
||||
/// \param width : New width
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to modify
|
||||
/// \param Angle : New angle, in degrees
|
||||
/// \param view : View to modify
|
||||
/// \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
|
||||
|
@ -91,109 +91,109 @@ CSFML_API void sfView_SetRotation(sfView* View, float Angle);
|
|||
/// view are displayed, expressed as a factor (between 0 and 1)
|
||||
/// of the size of the RenderTarget to which the view is applied.
|
||||
///
|
||||
/// \param View : View to modify
|
||||
/// \param Viewport : New viewport
|
||||
/// \param view : View to modify
|
||||
/// \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.
|
||||
/// Note: this function resets the rotation angle to 0.
|
||||
///
|
||||
/// \param View : View to modify
|
||||
/// \param Rectangle : Rectangle defining the position and size of the view
|
||||
/// \param view : View to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to read
|
||||
/// \param view : View to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to read
|
||||
/// \param view : View to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to read
|
||||
/// \param view : View to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to read
|
||||
/// \param view : View to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to read
|
||||
/// \param view : View to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to read
|
||||
/// \param view : View to read
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to move
|
||||
/// \param OffsetX : Offset to move the view, on X axis
|
||||
/// \param OffsetY : Offset to move the view, on Y axis
|
||||
/// \param view : View to move
|
||||
/// \param offsetX : Offset to move the view, on X 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
|
||||
///
|
||||
/// \param View : View to rotate
|
||||
/// \param Angle : Angle in degrees
|
||||
/// \param view : View to rotate
|
||||
/// \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
|
||||
///
|
||||
/// \param View : View to zoom
|
||||
/// \param Factor : Zoom factor to apply, relative to the current zoom
|
||||
/// \param view : View to 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
|
||||
|
|
|
@ -114,151 +114,151 @@ enum sfFtpStatus
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
/// means a success
|
||||
///
|
||||
/// \param FtpListingResponse : Ftp listing response
|
||||
/// \param ftpListingResponse : Ftp listing response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpListingResponse : Ftp listing response
|
||||
/// \param ftpListingResponse : Ftp listing response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpListingResponse : Ftp listing response
|
||||
/// \param ftpListingResponse : Ftp listing response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpListingResponse : Ftp listing response
|
||||
/// \param ftpListingResponse : Ftp listing response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpListingResponse : Ftp listing response
|
||||
/// \param Index : Index of the filename to get
|
||||
/// \param ftpListingResponse : Ftp listing response
|
||||
/// \param index : Index of the filename to get
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
/// means a success
|
||||
///
|
||||
/// \param FtpDirectoryResponse : Ftp directory response
|
||||
/// \param ftpDirectoryResponse : Ftp directory response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpDirectoryResponse : Ftp directory response
|
||||
/// \param ftpDirectoryResponse : Ftp directory response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpDirectoryResponse : Ftp directory response
|
||||
/// \param ftpDirectoryResponse : Ftp directory response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpDirectoryResponse : Ftp directory response
|
||||
/// \param ftpDirectoryResponse : Ftp directory response
|
||||
///
|
||||
/// \return Directory name
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* FtpDirectoryResponse);
|
||||
CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* ftpDirectoryResponse);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
/// means a success
|
||||
///
|
||||
/// \param FtpResponse : Ftp response
|
||||
/// \param ftpResponse : Ftp response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpResponse : Ftp response
|
||||
/// \param ftpResponse : Ftp response
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param FtpResponse : Ftp response
|
||||
/// \param ftpResponse : Ftp response
|
||||
///
|
||||
/// \return The response message
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* FtpResponse);
|
||||
CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* ftpResponse);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new Ftp
|
||||
|
@ -271,179 +271,179 @@ CSFML_API sfFtp* sfFtp_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param Server : FTP server to connect to
|
||||
/// \param Port : Port used for connection (21 by default, standard FTP port)
|
||||
/// \param Timeout : Maximum time to wait (0 to use no timeout)
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param server : FTP server to connect to
|
||||
/// \param port : Port used for connection (21 by default, standard FTP port)
|
||||
/// \param timeout : Maximum time to wait (0 to use no timeout)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param ftp : Ftp instance
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param UserName : User name
|
||||
/// \param Password : Password
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param userName : User name
|
||||
/// \param password : Password
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param ftp : Ftp instance
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param ftp : Ftp instance
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param ftp : Ftp instance
|
||||
///
|
||||
/// \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
|
||||
/// (subdirectories and files)
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param Directory : Directory to list ("" by default, the current one)
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param directory : Directory to list ("" by default, the current one)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param Directory : New directory, relative to the current one
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param directory : New directory, relative to the current one
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param ftp : Ftp instance
|
||||
///
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* Ftp);
|
||||
CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a new directory
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param Name : Name of the directory to create
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param name : Name of the directory to create
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param Name : Name of the directory to remove
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param name : Name of the directory to remove
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param File : File to rename
|
||||
/// \param NewName : New name
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param file : File to rename
|
||||
/// \param newName : New name
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param Name : File to remove
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param name : File to remove
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param DistantFile : Path of the distant file to download
|
||||
/// \param DestPath : Where to put to file on the local computer
|
||||
/// \param Mode : Transfer mode (binary by default)
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param distantFile : Path of the distant file to download
|
||||
/// \param destPath : Where to put to file on the local computer
|
||||
/// \param mode : Transfer mode (binary by default)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Ftp : Ftp instance
|
||||
/// \param LocalFile : Path of the local file to upload
|
||||
/// \param DestPath : Where to put to file on the server
|
||||
/// \param Mode : Transfer mode (binary by default)
|
||||
/// \param ftp : Ftp instance
|
||||
/// \param localFile : Path of the local file to upload
|
||||
/// \param destPath : Where to put to file on the server
|
||||
/// \param mode : Transfer mode (binary by default)
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -90,111 +90,111 @@ CSFML_API sfHttpRequest* sfHttpRequest_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param HttpRequest : Http request to modify
|
||||
/// \param Field : Name of the field to set (case-insensitive)
|
||||
/// \param Value : Value of the field
|
||||
/// \param httpRequest : Http request to modify
|
||||
/// \param field : Name of the field to set (case-insensitive)
|
||||
/// \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.
|
||||
/// This parameter is sfHttpGet by default
|
||||
///
|
||||
/// \param HttpRequest : Http request to modify
|
||||
/// \param RequestMethod : Method to use for the request
|
||||
/// \param httpRequest : Http request to modify
|
||||
/// \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.
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
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.
|
||||
/// This parameter is 1.0 by default
|
||||
///
|
||||
/// \param HttpRequest : Http request to modify
|
||||
/// \param Major : Major version number
|
||||
/// \param Minor : Minor version number
|
||||
/// \param httpRequest : Http request to modify
|
||||
/// \param major : Major 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
|
||||
/// makes sense only for POST requests.
|
||||
/// This parameter is empty by default
|
||||
///
|
||||
/// \param HttpRequest : Http request to modify
|
||||
/// \param Body : Content of the request body
|
||||
/// \param httpRequest : Http request to modify
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param HttpResponse : Http response
|
||||
/// \param Field : Field to get
|
||||
/// \param httpResponse : Http response
|
||||
/// \param field : Field to get
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param HttpResponse : Http response
|
||||
/// \param httpResponse : Http 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
|
||||
///
|
||||
/// \param HttpResponse : Http response
|
||||
/// \param httpResponse : Http 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
|
||||
///
|
||||
/// \param HttpResponse : Http response
|
||||
/// \param httpResponse : Http 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 :
|
||||
|
@ -203,12 +203,12 @@ CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* HttpRespon
|
|||
/// - nothing (for HEAD requests)
|
||||
/// - 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API const char* sfHttpResponse_GetBody(sfHttpResponse* HttpResponse);
|
||||
CSFML_API const char* sfHttpResponse_GetBody(sfHttpResponse* httpResponse);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new Http object
|
||||
|
@ -224,17 +224,17 @@ CSFML_API sfHttp* sfHttp_Create();
|
|||
/// \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
|
||||
///
|
||||
/// \param Http : Http object
|
||||
/// \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 http : Http object
|
||||
/// \param host : Web server to connect to
|
||||
/// \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.
|
||||
|
@ -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
|
||||
/// application.
|
||||
///
|
||||
/// \param Http : Http object
|
||||
/// \param Request : Request to send
|
||||
/// \param Timeout : Maximum time to wait (0 to use no timeout)
|
||||
/// \param http : Http object
|
||||
/// \param request : Request to send
|
||||
/// \param timeout : Maximum time to wait (0 to use no timeout)
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -43,62 +43,62 @@ typedef struct
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfIPAddress sfIPAddress_FromString(const char* String);
|
||||
CSFML_API sfIPAddress sfIPAddress_FromString(const char* string);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct an address from 4 bytes
|
||||
///
|
||||
/// \param Byte0 : First byte of the address
|
||||
/// \param Byte1 : Second byte of the address
|
||||
/// \param Byte2 : Third byte of the address
|
||||
/// \param Byte3 : Fourth byte of the address
|
||||
/// \param byte0 : First byte of the address
|
||||
/// \param byte1 : Second byte of the address
|
||||
/// \param byte2 : Third byte of the address
|
||||
/// \param byte3 : Fourth byte of the 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Address : Address to check
|
||||
/// \param address : Address to check
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Address : Address to convert
|
||||
/// \param String : Char array to fill (size must be >= 16)
|
||||
/// \param address : Address to convert
|
||||
/// \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
|
||||
///
|
||||
/// \param Address : Address to convert
|
||||
/// \param address : Address to convert
|
||||
///
|
||||
/// \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)
|
||||
|
@ -114,12 +114,12 @@ CSFML_API sfIPAddress sfIPAddress_GetLocalAddress();
|
|||
/// distant website ; as a consequence, this function may be
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfIPAddress sfIPAddress_GetPublicAddress(float Timeout);
|
||||
CSFML_API sfIPAddress sfIPAddress_GetPublicAddress(float timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get the computer's loopback address
|
||||
|
|
|
@ -43,106 +43,106 @@ CSFML_API sfPacket* sfPacket_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param Packet : Packet to fill
|
||||
/// \param Data : Pointer to the bytes to append
|
||||
/// \param SizeInBytes : Number of bytes to append
|
||||
/// \param packet : Packet to fill
|
||||
/// \param data : Pointer to the 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
|
||||
///
|
||||
/// \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
|
||||
/// Warning : the returned pointer may be invalid after you
|
||||
/// append data to the packet
|
||||
///
|
||||
/// \param Packet : Packet to get data from
|
||||
/// \param packet : Packet to get data from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Packet : Packet to get data size from
|
||||
/// \param packet : Packet to get data size from
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Packet : Packet to check
|
||||
/// \param packet : Packet to check
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Packet : Packet to check
|
||||
/// \param packet : Packet to check
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Packet : Packet to read
|
||||
/// \param packet : Packet to read
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfPacket_ReadBool(sfPacket* Packet);
|
||||
CSFML_API sfInt8 sfPacket_ReadInt8(sfPacket* Packet);
|
||||
CSFML_API sfUint8 sfPacket_ReadUint8(sfPacket* Packet);
|
||||
CSFML_API sfInt16 sfPacket_ReadInt16(sfPacket* Packet);
|
||||
CSFML_API sfUint16 sfPacket_ReadUint16(sfPacket* Packet);
|
||||
CSFML_API sfInt32 sfPacket_ReadInt32(sfPacket* Packet);
|
||||
CSFML_API sfUint32 sfPacket_ReadUint32(sfPacket* Packet);
|
||||
CSFML_API float sfPacket_ReadFloat(sfPacket* Packet);
|
||||
CSFML_API double sfPacket_ReadDouble(sfPacket* Packet);
|
||||
CSFML_API void sfPacket_ReadString(sfPacket* Packet, char* String);
|
||||
CSFML_API void sfPacket_ReadWideString(sfPacket* Packet, wchar_t* String);
|
||||
CSFML_API sfBool sfPacket_ReadBool(sfPacket* packet);
|
||||
CSFML_API sfInt8 sfPacket_ReadInt8(sfPacket* packet);
|
||||
CSFML_API sfUint8 sfPacket_ReadUint8(sfPacket* packet);
|
||||
CSFML_API sfInt16 sfPacket_ReadInt16(sfPacket* packet);
|
||||
CSFML_API sfUint16 sfPacket_ReadUint16(sfPacket* packet);
|
||||
CSFML_API sfInt32 sfPacket_ReadInt32(sfPacket* packet);
|
||||
CSFML_API sfUint32 sfPacket_ReadUint32(sfPacket* packet);
|
||||
CSFML_API float sfPacket_ReadFloat(sfPacket* packet);
|
||||
CSFML_API double sfPacket_ReadDouble(sfPacket* packet);
|
||||
CSFML_API void sfPacket_ReadString(sfPacket* packet, char* string);
|
||||
CSFML_API void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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_WriteInt8(sfPacket* Packet, sfInt8);
|
||||
CSFML_API void sfPacket_WriteUint8(sfPacket* Packet, sfUint8);
|
||||
CSFML_API void sfPacket_WriteInt16(sfPacket* Packet, sfInt16);
|
||||
CSFML_API void sfPacket_WriteUint16(sfPacket* Packet, sfUint16);
|
||||
CSFML_API void sfPacket_WriteInt32(sfPacket* Packet, sfInt32);
|
||||
CSFML_API void sfPacket_WriteUint32(sfPacket* Packet, sfUint32);
|
||||
CSFML_API void sfPacket_WriteFloat(sfPacket* Packet, float);
|
||||
CSFML_API void sfPacket_WriteDouble(sfPacket* Packet, double);
|
||||
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_WriteBool(sfPacket* packet, sfBool);
|
||||
CSFML_API void sfPacket_WriteInt8(sfPacket* packet, sfInt8);
|
||||
CSFML_API void sfPacket_WriteUint8(sfPacket* packet, sfUint8);
|
||||
CSFML_API void sfPacket_WriteInt16(sfPacket* packet, sfInt16);
|
||||
CSFML_API void sfPacket_WriteUint16(sfPacket* packet, sfUint16);
|
||||
CSFML_API void sfPacket_WriteInt32(sfPacket* packet, sfInt32);
|
||||
CSFML_API void sfPacket_WriteUint32(sfPacket* packet, sfUint32);
|
||||
CSFML_API void sfPacket_WriteFloat(sfPacket* packet, float);
|
||||
CSFML_API void sfPacket_WriteDouble(sfPacket* packet, double);
|
||||
CSFML_API void sfPacket_WriteString(sfPacket* packet, const char* string);
|
||||
CSFML_API void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string);
|
||||
|
||||
|
||||
#endif // SFML_PACKET_H
|
||||
|
|
|
@ -44,68 +44,68 @@ CSFML_API sfSelectorUDP* sfSelectorUDP_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Destroy an existing selector
|
||||
///
|
||||
/// \param Selector : Selector to delete
|
||||
/// \param selector : Selector to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSelectorTCP_Destroy(sfSelectorTCP* Selector);
|
||||
CSFML_API void sfSelectorUDP_Destroy(sfSelectorUDP* Selector);
|
||||
CSFML_API void sfSelectorTCP_Destroy(sfSelectorTCP* selector);
|
||||
CSFML_API void sfSelectorUDP_Destroy(sfSelectorUDP* selector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Add a socket to watch to a selector
|
||||
///
|
||||
/// \param Selector : Selector to add the socket to
|
||||
/// \param Socket : Socket to add
|
||||
/// \param selector : Selector to add the socket to
|
||||
/// \param socket : Socket to add
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSelectorTCP_Add(sfSelectorTCP* Selector, sfSocketTCP* Socket);
|
||||
CSFML_API void sfSelectorUDP_Add(sfSelectorUDP* Selector, sfSocketUDP* Socket);
|
||||
CSFML_API void sfSelectorTCP_Add(sfSelectorTCP* selector, sfSocketTCP* socket);
|
||||
CSFML_API void sfSelectorUDP_Add(sfSelectorUDP* selector, sfSocketUDP* socket);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Remove a socket from a selector
|
||||
///
|
||||
/// \param Selector : Selector to remove the socket from
|
||||
/// \param Socket : Socket to remove
|
||||
/// \param selector : Selector to remove the socket from
|
||||
/// \param socket : Socket to remove
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API void sfSelectorTCP_Remove(sfSelectorTCP* Selector, sfSocketTCP* Socket);
|
||||
CSFML_API void sfSelectorUDP_Remove(sfSelectorUDP* Selector, sfSocketUDP* Socket);
|
||||
CSFML_API void sfSelectorTCP_Remove(sfSelectorTCP* selector, sfSocketTCP* socket);
|
||||
CSFML_API void sfSelectorUDP_Remove(sfSelectorUDP* selector, sfSocketUDP* socket);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 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 sfSelectorUDP_Clear(sfSelectorUDP* Selector);
|
||||
CSFML_API void sfSelectorTCP_Clear(sfSelectorTCP* selector);
|
||||
CSFML_API void sfSelectorUDP_Clear(sfSelectorUDP* selector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Wait and collect sockets which are ready for reading.
|
||||
/// This functions will return either when at least one socket
|
||||
/// is ready, or when the given time is out
|
||||
///
|
||||
/// \param Selector : Selector to check
|
||||
/// \param Timeout : Maximum time to wait, in seconds (0 to disable timeout)
|
||||
/// \param selector : Selector to check
|
||||
/// \param timeout : Maximum time to wait, in seconds (0 to disable timeout)
|
||||
///
|
||||
/// \return Number of sockets ready
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API unsigned int sfSelectorTCP_Wait(sfSelectorTCP* Selector, float Timeout);
|
||||
CSFML_API unsigned int sfSelectorUDP_Wait(sfSelectorUDP* Selector, float Timeout);
|
||||
CSFML_API unsigned int sfSelectorTCP_Wait(sfSelectorTCP* 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
|
||||
/// ready for reading. The total number of sockets ready
|
||||
/// is the integer returned by the previous call to Wait()
|
||||
///
|
||||
/// \param Selector : Selector to check
|
||||
/// \param Index : Index of the socket to get
|
||||
/// \param selector : Selector to check
|
||||
/// \param index : Index of the socket to get
|
||||
///
|
||||
/// \return The Index-th socket
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfSocketTCP* sfSelectorTCP_GetSocketReady(sfSelectorTCP* Selector, unsigned int Index);
|
||||
CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* Selector, unsigned int Index);
|
||||
CSFML_API sfSocketTCP* sfSelectorTCP_GetSocketReady(sfSelectorTCP* selector, unsigned int index);
|
||||
CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* selector, unsigned int index);
|
||||
|
||||
|
||||
#endif // SFML_SELECTOR_H
|
||||
|
|
|
@ -45,116 +45,116 @@ CSFML_API sfSocketTCP* sfSocketTCP_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
/// The default behaviour of a socket is blocking
|
||||
///
|
||||
/// \param Socket : Socket to modify
|
||||
/// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
|
||||
/// \param socket : Socket to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Socket : Socket to use for connecting
|
||||
/// \param Port : Port to use for transfers (warning : ports < 1024 are reserved)
|
||||
/// \param HostAddress : IP Address of the host to connect to
|
||||
/// \param Timeout : Maximum time to wait (0 to use no timeout)
|
||||
/// \param socket : Socket to use for connecting
|
||||
/// \param port : Port to use for transfers (warning : ports < 1024 are reserved)
|
||||
/// \param host : IP Address of the host to connect to
|
||||
/// \param timeout : Maximum time to wait (0 to use no timeout)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Socket : Socket to use for listening
|
||||
/// \param Port : Port to listen to
|
||||
/// \param socket : Socket to use for listening
|
||||
/// \param port : Port to listen to
|
||||
///
|
||||
/// \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).
|
||||
/// This function is blocking, ie. it won't return before
|
||||
/// a connection has been accepted
|
||||
///
|
||||
/// \param Socket : Socket to use for accepting
|
||||
/// \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 socket : Socket to use for accepting
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \param Socket : Socket to use for sending
|
||||
/// \param Data : Pointer to the bytes to send
|
||||
/// \param Size : Number of bytes to send
|
||||
/// \param socket : Socket to use for sending
|
||||
/// \param data : Pointer to the bytes to send
|
||||
/// \param size : Number of bytes to send
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \param Socket : Socket to use for receiving
|
||||
/// \param Data : Pointer to a byte array to fill (make sure it is big enough)
|
||||
/// \param MaxSize : Maximum number of bytes to read
|
||||
/// \param SizeReceived : Number of bytes received
|
||||
/// \param socket : Socket to use for receiving
|
||||
/// \param data : Pointer to a byte array to fill (make sure it is big enough)
|
||||
/// \param maxSize : Maximum number of bytes to read
|
||||
/// \param sizeReceived : Number of bytes received
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \param Socket : Socket to use for sending
|
||||
/// \param Packet : Packet to send
|
||||
/// \param socket : Socket to use for sending
|
||||
/// \param packet : Packet to send
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \param Socket : Socket to use for receiving
|
||||
/// \param Packet : Packet to fill with received data
|
||||
/// \param socket : Socket to use for receiving
|
||||
/// \param packet : Packet to fill with received data
|
||||
///
|
||||
/// \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
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSocketTCP_IsValid(sfSocketTCP* Socket);
|
||||
CSFML_API sfBool sfSocketTCP_IsValid(sfSocketTCP* socket);
|
||||
|
||||
|
||||
#endif // SFML_SOCKETTCP_H
|
||||
|
|
|
@ -45,111 +45,111 @@ CSFML_API sfSocketUDP* sfSocketUDP_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
/// The default behaviour of a socket is blocking
|
||||
///
|
||||
/// \param Socket : Socket to modify
|
||||
/// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
|
||||
/// \param socket : Socket to modify
|
||||
/// \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
|
||||
///
|
||||
/// \param Socket : Socket to bind
|
||||
/// \param Port : Port to bind the socket to
|
||||
/// \param socket : Socket to bind
|
||||
/// \param port : Port to bind the socket to
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Socket : Socket to unbind
|
||||
/// \param socket : Socket to unbind
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Socket : Socket to use for sending
|
||||
/// \param Data : Pointer to the bytes to send
|
||||
/// \param Size : Number of bytes to send
|
||||
/// \param Address : Address of the computer to send the packet to
|
||||
/// \param Port : Port to use for communication
|
||||
/// \param socket : Socket to use for sending
|
||||
/// \param data : Pointer to the bytes to send
|
||||
/// \param size : Number of bytes to send
|
||||
/// \param address : Address of the computer to send the packet to
|
||||
/// \param port : Port to use for communication
|
||||
///
|
||||
/// \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.
|
||||
/// This function is blocking, ie. it won't return before some
|
||||
/// bytes have been received
|
||||
///
|
||||
/// \param Socket : Socket to use for receiving
|
||||
/// \param Data : Pointer to a byte array to fill (make sure it is big enough)
|
||||
/// \param MaxSize : Maximum number of bytes to read
|
||||
/// \param SizeReceived : Number of bytes received
|
||||
/// \param Address : Address of the computer which sent the data
|
||||
/// \param Port : Port on which the remote computer sent the data
|
||||
/// \param socket : Socket to use for receiving
|
||||
/// \param data : Pointer to a byte array to fill (make sure it is big enough)
|
||||
/// \param maxSize : Maximum number of bytes to read
|
||||
/// \param sizeReceived : Number of bytes received
|
||||
/// \param address : Address of the computer which sent the data
|
||||
/// \param port : Port on which the remote computer sent the data
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Socket : Socket to use for sending
|
||||
/// \param Packet : Packet to send
|
||||
/// \param Address : Address of the computer to send the packet to
|
||||
/// \param Port : Port to use for communication
|
||||
/// \param socket : Socket to use for sending
|
||||
/// \param packet : Packet to send
|
||||
/// \param address : Address of the computer to send the packet to
|
||||
/// \param port : Port to use for communication
|
||||
///
|
||||
/// \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.
|
||||
/// This function is blocking, ie. it won't return before a
|
||||
/// packet is received
|
||||
///
|
||||
/// \param Socket : Socket to use for receiving
|
||||
/// \param Packet : Packet to fill with received data
|
||||
/// \param Address : Address of the computer which sent the packet
|
||||
/// \param Port : Port on which the remote computer sent the data
|
||||
/// \param socket : Socket to use for receiving
|
||||
/// \param packet : Packet to fill with received data
|
||||
/// \param address : Address of the computer which sent the packet
|
||||
/// \param port : Port on which the remote computer sent the data
|
||||
///
|
||||
/// \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
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfSocketUDP_IsValid(sfSocketUDP* Socket);
|
||||
CSFML_API sfBool sfSocketUDP_IsValid(sfSocketUDP* socket);
|
||||
|
||||
|
||||
#endif // SFML_SOCKETUDP_H
|
||||
|
|
|
@ -43,26 +43,26 @@ CSFML_API sfClock* sfClock_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -43,26 +43,26 @@ CSFML_API sfMutex* sfMutex_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -35,10 +35,10 @@
|
|||
/// Set the seed for the random numbers generator. Using a known seed
|
||||
/// 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
|
||||
|
@ -51,24 +51,24 @@ CSFML_API unsigned int sfRandom_GetSeed();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Get a random float number in a given range
|
||||
///
|
||||
/// \return Start : Start of the range
|
||||
/// \return End : End of the range
|
||||
/// \return begin : Start 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
|
||||
///
|
||||
/// \return Start : Start of the range
|
||||
/// \return End : End of the range
|
||||
/// \return begin : Start 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
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
|
|
|
@ -35,35 +35,35 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new thread from a function pointer
|
||||
///
|
||||
/// \param Function : Entry point of the thread
|
||||
/// \param UserData : Data to pass to the thread function
|
||||
/// \param function : Entry point of the thread
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
|
@ -71,10 +71,10 @@ CSFML_API void sfThread_Wait(sfThread* Thread);
|
|||
/// you should rather try to make the thread function
|
||||
/// 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
|
||||
|
|
|
@ -43,19 +43,19 @@ CSFML_API sfContext* sfContext_Create();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
/// \param Context : Context to activate or deactivate
|
||||
/// \param Active : sfTrue to activate, sfFalse to deactivate
|
||||
/// \param context : Context to activate or 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
|
||||
|
|
|
@ -35,68 +35,68 @@
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Get the state of a key
|
||||
///
|
||||
/// \param Input : Input object
|
||||
/// \param KeyCode : Key to check
|
||||
/// \param input : Input object
|
||||
/// \param code : Key to check
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Input : Input object
|
||||
/// \param Button : Button to check
|
||||
/// \param input : Input object
|
||||
/// \param button : Button to check
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Input : Input object
|
||||
/// \param JoyId : Identifier of the joystick to check (0 or 1)
|
||||
/// \param Button : Button to check
|
||||
/// \param input : Input object
|
||||
/// \param joyId : Identifier of the joystick to check (0 or 1)
|
||||
/// \param button : Button to check
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Input : Input object
|
||||
/// \param input : Input object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Input : Input object
|
||||
/// \param input : Input object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Input : Input object
|
||||
/// \param JoyId : Identifier of the joystick to check (0 or 1)
|
||||
/// \param Axis : Identifier of the axis to read
|
||||
/// \param input : Input object
|
||||
/// \param joyId : Identifier of the joystick to check (0 or 1)
|
||||
/// \param axis : Identifier of the axis to read
|
||||
///
|
||||
/// \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
|
||||
|
|
|
@ -56,12 +56,12 @@ CSFML_API sfVideoMode sfVideoMode_GetDesktopMode();
|
|||
/// Index must be in range [0, GetModesCount()[
|
||||
/// 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)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfVideoMode sfVideoMode_GetMode(size_t Index);
|
||||
CSFML_API sfVideoMode sfVideoMode_GetMode(size_t index);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get valid video modes count
|
||||
|
@ -74,13 +74,13 @@ CSFML_API size_t sfVideoMode_GetModesCount();
|
|||
////////////////////////////////////////////////////////////
|
||||
/// 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
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_API sfBool sfVideoMode_IsValid(sfVideoMode Mode);
|
||||
CSFML_API sfBool sfVideoMode_IsValid(sfVideoMode mode);
|
||||
|
||||
|
||||
#endif // SFML_VIDEOMODE_H
|
||||
|
|
|
@ -63,225 +63,224 @@ typedef struct
|
|||
////////////////////////////////////////////////////////////
|
||||
/// Construct a new window
|
||||
///
|
||||
/// \param Mode : Video mode to use
|
||||
/// \param Title : Title of the window
|
||||
/// \param Style : Window style
|
||||
/// \param Params : Creation settings
|
||||
/// \param mode : Video mode to use
|
||||
/// \param title : Title of the window
|
||||
/// \param style : Window style
|
||||
/// \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
|
||||
///
|
||||
/// \param Handle : Platform-specific handle of the control
|
||||
/// \param Params : Creation settings
|
||||
/// \param handle : Platform-specific handle of the control
|
||||
/// \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
|
||||
///
|
||||
/// \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)
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param window : Window object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param window : Window object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param window : Window object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Event : Event to fill, if any
|
||||
/// \param window : Window object
|
||||
/// \param event : Event to fill, if any
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Enabled : sfTrue to enable v-sync, sfFalse to deactivate
|
||||
/// \param window : Window object
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Show : sfTrue to show, sfFalse to hide
|
||||
/// \param window : Window object
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Left : Left coordinate of the cursor, relative to the window
|
||||
/// \param Top : Top coordinate of the cursor, relative to the window
|
||||
/// \param window : Window object
|
||||
/// \param left : Left 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.
|
||||
/// Only works for top-level windows
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Left : Left position
|
||||
/// \param Top : Top position
|
||||
/// \param window : Window object
|
||||
/// \param left : Left 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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Width : New Width
|
||||
/// \param Height : New Height
|
||||
/// \param window : Window object
|
||||
/// \param width : New Width
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param State : sfTrue to show, sfFalse to hide
|
||||
/// \param window : Window object
|
||||
/// \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.
|
||||
/// Automatic key-repeat is enabled by default
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Enabled : sfTrue to enable, sfFalse to disable
|
||||
/// \param window : Window object
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Width : Icon's width, in pixels
|
||||
/// \param Height : Icon's height, in pixels
|
||||
/// \param Pixels : Pointer to the pixels in memory, format must be RGBA 32 bits
|
||||
/// \param window : Window object
|
||||
/// \param width : Icon's width, in pixels
|
||||
/// \param height : Icon's height, in pixels
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Active : sfTrue to activate, sfFalse to deactivate
|
||||
/// \param window : Window object
|
||||
/// \param active : sfTrue to activate, sfFalse to deactivate
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param window : Window object
|
||||
///
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
///
|
||||
/// \param Limit : Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
/// \param window : Window object
|
||||
/// \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
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param window : Window object
|
||||
///
|
||||
/// \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
|
||||
/// no move event will be generated
|
||||
///
|
||||
/// \param Window : Window object
|
||||
/// \param Threshold : New threshold, in range [0, 100]
|
||||
/// \param window : Window object
|
||||
/// \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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue