Updated to the new naming convention

This commit is contained in:
Laurent Gomila committed 2012-03-18 10:45:20 +01:00
1 parent 9d0d0588b2
commit 36904a45d9
99 files changed
+2409 -2369

No files matched your search

+6 -6
View File
@@ -42,7 +42,7 @@
/// \param volume New global volume, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfListener_SetGlobalVolume(float volume);
CSFML_AUDIO_API void sfListener_setGlobalVolume(float volume);
////////////////////////////////////////////////////////////
/// \brief Get the current value of the global volume
@@ -50,7 +50,7 @@ CSFML_AUDIO_API void sfListener_SetGlobalVolume(float volume);
/// \return Current global volume, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfListener_GetGlobalVolume(void);
CSFML_AUDIO_API float sfListener_getGlobalVolume(void);
////////////////////////////////////////////////////////////
/// \brief Set the position of the listener in the scene
@@ -60,7 +60,7 @@ CSFML_AUDIO_API float sfListener_GetGlobalVolume(void);
/// \param position New position of the listener
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfListener_SetPosition(sfVector3f position);
CSFML_AUDIO_API void sfListener_setPosition(sfVector3f position);
////////////////////////////////////////////////////////////
/// \brief Get the current position of the listener in the scene
@@ -68,7 +68,7 @@ CSFML_AUDIO_API void sfListener_SetPosition(sfVector3f position);
/// \return The listener's position
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfListener_GetPosition();
CSFML_AUDIO_API sfVector3f sfListener_getPosition();
////////////////////////////////////////////////////////////
/// \brief Set the orientation of the listener in the scene
@@ -81,7 +81,7 @@ CSFML_AUDIO_API sfVector3f sfListener_GetPosition();
/// \param position New direction of the listener
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfListener_SetDirection(sfVector3f orientation);
CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation);
////////////////////////////////////////////////////////////
/// \brief Get the current orientation of the listener in the scene
@@ -89,7 +89,7 @@ CSFML_AUDIO_API void sfListener_SetDirection(sfVector3f orientation);
/// \return The listener's direction
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfListener_GetDirection();
CSFML_AUDIO_API sfVector3f sfListener_getDirection();
#endif // SFML_LISTENER_H
+31 -31
View File
@@ -41,7 +41,7 @@
/// \brief Create a new music and load it from a file
///
/// This function doesn't start playing the music (call
/// sfMusic_Play to do so).
/// sfMusic_play to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
@@ -51,13 +51,13 @@
/// \return A new sfMusic object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfMusic* sfMusic_CreateFromFile(const char* filename);
CSFML_AUDIO_API sfMusic* sfMusic_createFromFile(const char* filename);
////////////////////////////////////////////////////////////
/// \brief Create a new music and load it from a file in memory
///
/// This function doesn't start playing the music (call
/// sfMusic_Play to do so).
/// sfMusic_play to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
@@ -68,13 +68,13 @@ CSFML_AUDIO_API sfMusic* sfMusic_CreateFromFile(const char* filename);
/// \return A new sfMusic object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes);
CSFML_AUDIO_API sfMusic* sfMusic_createFromMemory(const void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Create a new music and load it from a custom stream
///
/// This function doesn't start playing the music (call
/// sfMusic_Play to do so).
/// sfMusic_play to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
@@ -84,7 +84,7 @@ CSFML_AUDIO_API sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeI
/// \return A new sfMusic object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfMusic* sfMusic_CreateFromStream(sfInputStream* stream);
CSFML_AUDIO_API sfMusic* sfMusic_createFromStream(sfInputStream* stream);
////////////////////////////////////////////////////////////
/// \brief Destroy a music
@@ -92,21 +92,21 @@ CSFML_AUDIO_API sfMusic* sfMusic_CreateFromStream(sfInputStream* stream);
/// \param music Music to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_Destroy(sfMusic* music);
CSFML_AUDIO_API void sfMusic_destroy(sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Set whether or not a music should loop after reaching the end
///
/// If set, the music will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfMusic_SetLoop(music, sfFalse) is called.
/// sfMusic_setLoop(music, sfFalse) is called.
/// The default looping state for musics is false.
///
/// \param music Music object
/// \param loop sfTrue to play in loop, sfFalse to play once
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetLoop(sfMusic* music, sfBool loop);
CSFML_AUDIO_API void sfMusic_setLoop(sfMusic* music, sfBool loop);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a music is in loop mode
@@ -116,7 +116,7 @@ CSFML_AUDIO_API void sfMusic_SetLoop(sfMusic* music, sfBool loop);
/// \return sfTrue if the music is looping, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfMusic_GetLoop(const sfMusic* music);
CSFML_AUDIO_API sfBool sfMusic_getLoop(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the total duration of a music
@@ -126,7 +126,7 @@ CSFML_AUDIO_API sfBool sfMusic_GetLoop(const sfMusic* music);
/// \return Music duration
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfTime sfMusic_GetDuration(const sfMusic* music);
CSFML_AUDIO_API sfTime sfMusic_getDuration(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Start or resume playing a music
@@ -140,7 +140,7 @@ CSFML_AUDIO_API sfTime sfMusic_GetDuration(const sfMusic* music);
/// \param music Music object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_Play(sfMusic* music);
CSFML_AUDIO_API void sfMusic_play(sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Pause a music
@@ -151,7 +151,7 @@ CSFML_AUDIO_API void sfMusic_Play(sfMusic* music);
/// \param music Music object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_Pause(sfMusic* music);
CSFML_AUDIO_API void sfMusic_pause(sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Stop playing a music
@@ -163,7 +163,7 @@ CSFML_AUDIO_API void sfMusic_Pause(sfMusic* music);
/// \param music Music object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_Stop(sfMusic* music);
CSFML_AUDIO_API void sfMusic_stop(sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Return the number of channels of a music
@@ -175,7 +175,7 @@ CSFML_AUDIO_API void sfMusic_Stop(sfMusic* music);
/// \return Number of channels
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API unsigned int sfMusic_GetChannelCount(const sfMusic* music);
CSFML_AUDIO_API unsigned int sfMusic_getChannelCount(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of a music
@@ -188,7 +188,7 @@ CSFML_AUDIO_API unsigned int sfMusic_GetChannelCount(const sfMusic* music);
/// \return Sample rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API unsigned int sfMusic_GetSampleRate(const sfMusic* music);
CSFML_AUDIO_API unsigned int sfMusic_getSampleRate(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the current status of a music (stopped, paused, playing)
@@ -198,7 +198,7 @@ CSFML_AUDIO_API unsigned int sfMusic_GetSampleRate(const sfMusic* music);
/// \return Current status
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
CSFML_AUDIO_API sfSoundStatus sfMusic_getStatus(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the current playing position of a music
@@ -208,7 +208,7 @@ CSFML_AUDIO_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
/// \return Current playing position
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfTime sfMusic_GetPlayingOffset(const sfMusic* music);
CSFML_AUDIO_API sfTime sfMusic_getPlayingOffset(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Set the pitch of a music
@@ -223,7 +223,7 @@ CSFML_AUDIO_API sfTime sfMusic_GetPlayingOffset(const sfMusic* music);
/// \param pitch New pitch to apply to the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetPitch(sfMusic* music, float pitch);
CSFML_AUDIO_API void sfMusic_setPitch(sfMusic* music, float pitch);
////////////////////////////////////////////////////////////
/// \brief Set the volume of a music
@@ -235,7 +235,7 @@ CSFML_AUDIO_API void sfMusic_SetPitch(sfMusic* music, float pitch);
/// \param volume Volume of the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetVolume(sfMusic* music, float volume);
CSFML_AUDIO_API void sfMusic_setVolume(sfMusic* music, float volume);
////////////////////////////////////////////////////////////
/// \brief Set the 3D position of a music in the audio scene
@@ -248,7 +248,7 @@ CSFML_AUDIO_API void sfMusic_SetVolume(sfMusic* music, float volume);
/// \param position Position of the music in the scene
//
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetPosition(sfMusic* music, sfVector3f position);
CSFML_AUDIO_API void sfMusic_setPosition(sfMusic* music, sfVector3f position);
////////////////////////////////////////////////////////////
/// \brief Make a musics's position relative to the listener or absolute
@@ -263,7 +263,7 @@ CSFML_AUDIO_API void sfMusic_SetPosition(sfMusic* music, sfVector3f position);
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relative);
CSFML_AUDIO_API void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative);
////////////////////////////////////////////////////////////
/// \brief Set the minimum distance of a music
@@ -279,7 +279,7 @@ CSFML_AUDIO_API void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relati
/// \param distance New minimum distance of the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetMinDistance(sfMusic* music, float distance);
CSFML_AUDIO_API void sfMusic_setMinDistance(sfMusic* music, float distance);
////////////////////////////////////////////////////////////
/// \brief Set the attenuation factor of a music
@@ -297,7 +297,7 @@ CSFML_AUDIO_API void sfMusic_SetMinDistance(sfMusic* music, float distance);
/// \param attenuation New attenuation factor of the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetAttenuation(sfMusic* music, float attenuation);
CSFML_AUDIO_API void sfMusic_setAttenuation(sfMusic* music, float attenuation);
////////////////////////////////////////////////////////////
/// \brief Change the current playing position of a music
@@ -309,7 +309,7 @@ CSFML_AUDIO_API void sfMusic_SetAttenuation(sfMusic* music, float attenuation);
/// \param timeOffset New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_SetPlayingOffset(sfMusic* music, sfUint32 timeOffset);
CSFML_AUDIO_API void sfMusic_setPlayingOffset(sfMusic* music, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// \brief Get the pitch of a music
@@ -319,7 +319,7 @@ CSFML_AUDIO_API void sfMusic_SetPlayingOffset(sfMusic* music, sfUint32 timeOffse
/// \return Pitch of the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfMusic_GetPitch(const sfMusic* music);
CSFML_AUDIO_API float sfMusic_getPitch(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the volume of a music
@@ -329,7 +329,7 @@ CSFML_AUDIO_API float sfMusic_GetPitch(const sfMusic* music);
/// \return Volume of the music, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfMusic_GetVolume(const sfMusic* music);
CSFML_AUDIO_API float sfMusic_getVolume(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the 3D position of a music in the audio scene
@@ -339,7 +339,7 @@ CSFML_AUDIO_API float sfMusic_GetVolume(const sfMusic* music);
/// \return Position of the music in the world
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfMusic_GetPosition(const sfMusic* music);
CSFML_AUDIO_API sfVector3f sfMusic_getPosition(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Tell whether a music's position is relative to the
@@ -350,7 +350,7 @@ CSFML_AUDIO_API sfVector3f sfMusic_GetPosition(const sfMusic* music);
/// \return sfTrue if the position is relative, sfFalse if it's absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music);
CSFML_AUDIO_API sfBool sfMusic_isRelativeToListener(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the minimum distance of a music
@@ -360,7 +360,7 @@ CSFML_AUDIO_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music);
/// \return Minimum distance of the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfMusic_GetMinDistance(const sfMusic* music);
CSFML_AUDIO_API float sfMusic_getMinDistance(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Get the attenuation factor of a music
@@ -370,7 +370,7 @@ CSFML_AUDIO_API float sfMusic_GetMinDistance(const sfMusic* music);
/// \return Attenuation factor of the music
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfMusic_GetAttenuation(const sfMusic* music);
CSFML_AUDIO_API float sfMusic_getAttenuation(const sfMusic* music);
#endif // SFML_MUSIC_H
+27 -27
View File
@@ -41,7 +41,7 @@
/// \return A new sfSound object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSound* sfSound_Create(void);
CSFML_AUDIO_API sfSound* sfSound_create(void);
////////////////////////////////////////////////////////////
/// \brief Create a new sound by copying an existing one
@@ -51,7 +51,7 @@ CSFML_AUDIO_API sfSound* sfSound_Create(void);
/// \return A new sfSound object which is a copy of \a sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSound* sfSound_Copy(sfSound* sound);
CSFML_AUDIO_API sfSound* sfSound_copy(sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Destroy a sound
@@ -59,7 +59,7 @@ CSFML_AUDIO_API sfSound* sfSound_Copy(sfSound* sound);
/// \param sound Sound to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_Destroy(sfSound* sound);
CSFML_AUDIO_API void sfSound_destroy(sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Start or resume playing a sound
@@ -73,7 +73,7 @@ CSFML_AUDIO_API void sfSound_Destroy(sfSound* sound);
/// \param sound Sound object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_Play(sfSound* sound);
CSFML_AUDIO_API void sfSound_play(sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Pause a sound
@@ -84,19 +84,19 @@ CSFML_AUDIO_API void sfSound_Play(sfSound* sound);
/// \param sound Sound object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_Pause(sfSound* sound);
CSFML_AUDIO_API void sfSound_pause(sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Stop playing a sound
///
/// This function stops the sound if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike sfSound_Pause).
/// It also resets the playing position (unlike sfSound_pause).
///
/// \param sound Sound object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_Stop(sfSound* sound);
CSFML_AUDIO_API void sfSound_stop(sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Set the source buffer containing the audio data to play
@@ -109,7 +109,7 @@ CSFML_AUDIO_API void sfSound_Stop(sfSound* sound);
/// \param buffer Sound buffer to attach to the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buffer);
CSFML_AUDIO_API void sfSound_setBuffer(sfSound* sound, const sfSoundBuffer* buffer);
////////////////////////////////////////////////////////////
/// \brief Get the audio buffer attached to a sound
@@ -119,21 +119,21 @@ CSFML_AUDIO_API void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buff
/// \return Sound buffer attached to the sound (can be NULL)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound);
CSFML_AUDIO_API const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Set whether or not a sound should loop after reaching the end
///
/// If set, the sound will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfSound_SetLoop(sound, sfFalse) is called.
/// sfSound_setLoop(sound, sfFalse) is called.
/// The default looping state for sounds is false.
///
/// \param sound Sound object
/// \param loop sfTrue to play in loop, sfFalse to play once
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetLoop(sfSound* sound, sfBool loop);
CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, sfBool loop);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a soud is in loop mode
@@ -143,7 +143,7 @@ CSFML_AUDIO_API void sfSound_SetLoop(sfSound* sound, sfBool loop);
/// \return sfTrue if the sound is looping, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSound_GetLoop(const sfSound* sound);
CSFML_AUDIO_API sfBool sfSound_getLoop(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the current status of a sound (stopped, paused, playing)
@@ -153,7 +153,7 @@ CSFML_AUDIO_API sfBool sfSound_GetLoop(const sfSound* sound);
/// \return Current status
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundStatus sfSound_GetStatus(const sfSound* sound);
CSFML_AUDIO_API sfSoundStatus sfSound_getStatus(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Set the pitch of a sound
@@ -168,7 +168,7 @@ CSFML_AUDIO_API sfSoundStatus sfSound_GetStatus(const sfSound* sound);
/// \param pitch New pitch to apply to the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetPitch(sfSound* sound, float pitch);
CSFML_AUDIO_API void sfSound_setPitch(sfSound* sound, float pitch);
////////////////////////////////////////////////////////////
/// \brief Set the volume of a sound
@@ -180,7 +180,7 @@ CSFML_AUDIO_API void sfSound_SetPitch(sfSound* sound, float pitch);
/// \param volume Volume of the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetVolume(sfSound* sound, float volume);
CSFML_AUDIO_API void sfSound_setVolume(sfSound* sound, float volume);
////////////////////////////////////////////////////////////
/// \brief Set the 3D position of a sound in the audio scene
@@ -193,7 +193,7 @@ CSFML_AUDIO_API void sfSound_SetVolume(sfSound* sound, float volume);
/// \param position Position of the sound in the scene
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetPosition(sfSound* sound, sfVector3f position);
CSFML_AUDIO_API void sfSound_setPosition(sfSound* sound, sfVector3f position);
////////////////////////////////////////////////////////////
/// \brief Make the sound's position relative to the listener or absolute
@@ -208,7 +208,7 @@ CSFML_AUDIO_API void sfSound_SetPosition(sfSound* sound, sfVector3f position);
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetRelativeToListener(sfSound* sound, sfBool relative);
CSFML_AUDIO_API void sfSound_setRelativeToListener(sfSound* sound, sfBool relative);
////////////////////////////////////////////////////////////
/// \brief Set the minimum distance of a sound
@@ -224,7 +224,7 @@ CSFML_AUDIO_API void sfSound_SetRelativeToListener(sfSound* sound, sfBool relati
/// \param distance New minimum distance of the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetMinDistance(sfSound* sound, float distance);
CSFML_AUDIO_API void sfSound_setMinDistance(sfSound* sound, float distance);
////////////////////////////////////////////////////////////
/// \brief Set the attenuation factor of a sound
@@ -242,7 +242,7 @@ CSFML_AUDIO_API void sfSound_SetMinDistance(sfSound* sound, float distance);
/// \param attenuation New attenuation factor of the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetAttenuation(sfSound* sound, float attenuation);
CSFML_AUDIO_API void sfSound_setAttenuation(sfSound* sound, float attenuation);
////////////////////////////////////////////////////////////
/// \brief Change the current playing position of a sound
@@ -254,7 +254,7 @@ CSFML_AUDIO_API void sfSound_SetAttenuation(sfSound* sound, float attenuation);
/// \param timeOffset New playing position
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_SetPlayingOffset(sfSound* sound, sfTime timeOffset);
CSFML_AUDIO_API void sfSound_setPlayingOffset(sfSound* sound, sfTime timeOffset);
////////////////////////////////////////////////////////////
/// \brief Get the pitch of a sound
@@ -264,7 +264,7 @@ CSFML_AUDIO_API void sfSound_SetPlayingOffset(sfSound* sound, sfTime timeOffset)
/// \return Pitch of the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfSound_GetPitch(const sfSound* sound);
CSFML_AUDIO_API float sfSound_getPitch(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the volume of a sound
@@ -274,7 +274,7 @@ CSFML_AUDIO_API float sfSound_GetPitch(const sfSound* sound);
/// \return Volume of the sound, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfSound_GetVolume(const sfSound* sound);
CSFML_AUDIO_API float sfSound_getVolume(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the 3D position of a sound in the audio scene
@@ -284,7 +284,7 @@ CSFML_AUDIO_API float sfSound_GetVolume(const sfSound* sound);
/// \return Position of the sound in the world
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfSound_GetPosition(const sfSound* sound);
CSFML_AUDIO_API sfVector3f sfSound_getPosition(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Tell whether a sound's position is relative to the
@@ -295,7 +295,7 @@ CSFML_AUDIO_API sfVector3f sfSound_GetPosition(const sfSound* sound);
/// \return sfTrue if the position is relative, sfFalse if it's absolute
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSound_IsRelativeToListener(const sfSound* sound);
CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the minimum distance of a sound
@@ -305,7 +305,7 @@ CSFML_AUDIO_API sfBool sfSound_IsRelativeToListener(const sfSound* sound);
/// \return Minimum distance of the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfSound_GetMinDistance(const sfSound* sound);
CSFML_AUDIO_API float sfSound_getMinDistance(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the attenuation factor of a sound
@@ -315,7 +315,7 @@ CSFML_AUDIO_API float sfSound_GetMinDistance(const sfSound* sound);
/// \return Attenuation factor of the sound
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API float sfSound_GetAttenuation(const sfSound* sound);
CSFML_AUDIO_API float sfSound_getAttenuation(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Get the current playing position of a sound
@@ -325,7 +325,7 @@ CSFML_AUDIO_API float sfSound_GetAttenuation(const sfSound* sound);
/// \return Current playing position
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfTime sfSound_GetPlayingOffset(const sfSound* sound);
CSFML_AUDIO_API sfTime sfSound_getPlayingOffset(const sfSound* sound);
#endif // SFML_SOUND_H
+13 -13
View File
@@ -47,7 +47,7 @@
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer and load it from a file in memory
@@ -62,7 +62,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInBytes);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer and load it from a custom stream
@@ -76,7 +76,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data,
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* stream);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer and load it from an array of samples in memory
@@ -92,7 +92,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* str
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelsCount, unsigned int sampleRate);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer by copying an existing one
@@ -102,7 +102,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* sa
/// \return A new sfSoundBuffer object which is a copy of \a soundBuffer
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Destroy a sound buffer
@@ -110,7 +110,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer);
/// \param soundBuffer Sound buffer to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Save a sound buffer to an audio file
@@ -125,7 +125,7 @@ CSFML_AUDIO_API void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer);
/// \return sfTrue if saving succeeded, sfFalse if it failed
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
////////////////////////////////////////////////////////////
/// \brief Get the array of audio samples stored in a sound buffer
@@ -139,20 +139,20 @@ CSFML_AUDIO_API sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer
/// \return Read-only pointer to the array of sound samples
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Get the number of samples stored in a sound buffer
///
/// The array of samples can be accessed with the
/// sfSoundBuffer_GetSamples function.
/// sfSoundBuffer_getSamples function.
///
/// \param soundBuffer Sound buffer object
///
/// \return Number of samples
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API size_t sfSoundBuffer_GetSampleCount(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of a sound buffer
@@ -166,7 +166,7 @@ CSFML_AUDIO_API size_t sfSoundBuffer_GetSampleCount(const sfSoundBuffer* soundBu
/// \return Sample rate (number of samples per second)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Get the number of channels used by a sound buffer
@@ -179,7 +179,7 @@ CSFML_AUDIO_API unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* so
/// \return Number of channels
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API unsigned int sfSoundBuffer_GetChannelCount(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Get the total duration of a sound buffer
@@ -189,7 +189,7 @@ CSFML_AUDIO_API unsigned int sfSoundBuffer_GetChannelCount(const sfSoundBuffer*
/// \return Sound duration
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfTime sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer);
#endif // SFML_SOUNDBUFFER_H
+6 -6
View File
@@ -38,7 +38,7 @@
/// \return A new sfSoundBufferRecorder object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_Create(void);
CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a sound buffer recorder
@@ -46,7 +46,7 @@ CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_Create(void);
/// \param soundBufferRecorder Sound buffer recorder to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundBufferRecorder);
CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// \brief Start the capture of a sound recorder recorder
@@ -62,7 +62,7 @@ CSFML_AUDIO_API void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundB
/// \param sampleRate Desired capture rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
CSFML_AUDIO_API void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Stop the capture of a sound recorder
@@ -70,7 +70,7 @@ CSFML_AUDIO_API void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBuf
/// \param soundBufferRecorder Sound buffer recorder object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder);
CSFML_AUDIO_API void sfSoundBufferRecorder_stop(sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of a sound buffer recorder
@@ -84,7 +84,7 @@ CSFML_AUDIO_API void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBuff
/// \return Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBufferRecorder* soundBufferRecorder);
CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// \brief Get the sound buffer containing the captured audio data
@@ -99,7 +99,7 @@ CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBu
/// \return Read-only access to the sound buffer
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
#endif // SFML_SOUNDBUFFERRECORDER_H
+9 -9
View File
@@ -49,10 +49,10 @@ typedef void (*sfSoundRecorderStopCallback)(void*);
/// \return A new sfSoundRecorder object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart,
sfSoundRecorderProcessCallback onProcess,
sfSoundRecorderStopCallback onStop,
void* userData);
CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_create(sfSoundRecorderStartCallback onStart,
sfSoundRecorderProcessCallback onProcess,
sfSoundRecorderStopCallback onStop,
void* userData);
////////////////////////////////////////////////////////////
/// \brief Destroy a sound recorder
@@ -60,7 +60,7 @@ CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCall
/// \param soundRecorder Sound recorder to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder);
CSFML_AUDIO_API void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// \brief Start the capture of a sound recorder
@@ -76,7 +76,7 @@ CSFML_AUDIO_API void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder);
/// \param sampleRate Desired capture rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
CSFML_AUDIO_API void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Stop the capture of a sound recorder
@@ -84,7 +84,7 @@ CSFML_AUDIO_API void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsig
/// \param soundRecorder Sound recorder object
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder);
CSFML_AUDIO_API void sfSoundRecorder_stop(sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of a sound recorder
@@ -98,7 +98,7 @@ CSFML_AUDIO_API void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder);
/// \return Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder* soundRecorder);
CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// \brief Check if the system supports audio capture
@@ -110,7 +110,7 @@ CSFML_AUDIO_API unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder
/// \return sfTrue if audio capture is supported, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfBool sfSoundRecorder_IsAvailable(void);
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
#endif // SFML_SOUNDRECORDER_H
+2 -2
View File
@@ -41,8 +41,8 @@
////////////////////////////////////////////////////////////
typedef struct
{
sfInt16* Samples; ///< Pointer to the audio samples
unsigned int SampleCount; ///< Number of samples pointed by Samples
sfInt16* samples; ///< Pointer to the audio samples
unsigned int sampleCount; ///< Number of samples pointed by Samples
} sfSoundStreamChunk;
typedef sfBool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*); ///< Type of the callback used to get a sound stream data
+40 -40
View File
@@ -41,7 +41,7 @@
/// \return A new sfCircleShape object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_Create(void);
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_create(void);
////////////////////////////////////////////////////////////
/// \brief Copy an existing circle shape
@@ -51,7 +51,7 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_Create(void);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_Copy(sfCircleShape* shape);
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing circle Shape
@@ -59,46 +59,46 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_Copy(sfCircleShape* shape);
/// \param Shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_Destroy(sfCircleShape* shape);
CSFML_GRAPHICS_API void sfCircleShape_destroy(sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a circle shape
///
/// This function completely overwrites the previous position.
/// See sfCircleShape_Move to apply an offset based on the previous position instead.
/// See sfCircleShape_move to apply an offset based on the previous position instead.
/// The default position of a circle Shape object is (0, 0).
///
/// \param shape Shape object
/// \param position New position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetPosition(sfCircleShape* shape, sfVector2f position);
CSFML_GRAPHICS_API void sfCircleShape_setPosition(sfCircleShape* shape, sfVector2f position);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a circle shape
///
/// This function completely overwrites the previous rotation.
/// See sfCircleShape_Rotate to add an angle based on the previous rotation instead.
/// See sfCircleShape_rotate to add an angle based on the previous rotation instead.
/// The default rotation of a circle Shape object is 0.
///
/// \param shape Shape object
/// \param angle New rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetRotation(sfCircleShape* shape, float angle);
CSFML_GRAPHICS_API void sfCircleShape_setRotation(sfCircleShape* shape, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the scale factors of a circle shape
///
/// This function completely overwrites the previous scale.
/// See sfCircleShape_Scale to add a factor based on the previous scale instead.
/// See sfCircleShape_scale to add a factor based on the previous scale instead.
/// The default scale of a circle Shape object is (1, 1).
///
/// \param shape Shape object
/// \param scale New scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetScale(sfCircleShape* shape, sfVector2f scale);
CSFML_GRAPHICS_API void sfCircleShape_setScale(sfCircleShape* shape, sfVector2f scale);
////////////////////////////////////////////////////////////
/// \brief Set the local origin of a circle shape
@@ -114,7 +114,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetScale(sfCircleShape* shape, sfVector2f
/// \param origin New origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetOrigin(sfCircleShape* shape, sfVector2f origin);
CSFML_GRAPHICS_API void sfCircleShape_setOrigin(sfCircleShape* shape, sfVector2f origin);
////////////////////////////////////////////////////////////
/// \brief Get the position of a circle shape
@@ -124,7 +124,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetOrigin(sfCircleShape* shape, sfVector2f
/// \return Current position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetPosition(const sfCircleShape* shape);
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPosition(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the orientation of a circle shape
@@ -136,7 +136,7 @@ CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetPosition(const sfCircleShape* sha
/// \return Current rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfCircleShape_GetRotation(const sfCircleShape* shape);
CSFML_GRAPHICS_API float sfCircleShape_getRotation(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the current scale of a circle shape
@@ -162,37 +162,37 @@ CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape
/// \brief Move a circle shape by a given offset
///
/// This function adds to the current position of the object,
/// unlike sfCircleShape_SetPosition which overwrites it.
/// unlike sfCircleShape_setPosition which overwrites it.
///
/// \param shape Shape object
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_Move(sfCircleShape* shape, sfVector2f offset);
CSFML_GRAPHICS_API void sfCircleShape_move(sfCircleShape* shape, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a circle shape
///
/// This function adds to the current rotation of the object,
/// unlike sfCircleShape_SetRotation which overwrites it.
/// unlike sfCircleShape_setRotation which overwrites it.
///
/// \param shape Shape object
/// \param angle Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_Rotate(sfCircleShape* shape, float angle);
CSFML_GRAPHICS_API void sfCircleShape_rotate(sfCircleShape* shape, float angle);
////////////////////////////////////////////////////////////
/// \brief Scale a circle shape
///
/// This function multiplies the current scale of the object,
/// unlike sfCircleShape_SetScale which overwrites it.
/// unlike sfCircleShape_setScale which overwrites it.
///
/// \param shape Shape object
/// \param factors Scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_Scale(sfCircleShape* shape, sfVector2f factors);
CSFML_GRAPHICS_API void sfCircleShape_scale(sfCircleShape* shape, sfVector2f factors);
////////////////////////////////////////////////////////////
/// \brief Get the combined transform of a circle shape
@@ -202,7 +202,7 @@ CSFML_GRAPHICS_API void sfCircleShape_Scale(sfCircleShape* shape, sfVector2f fac
/// \return Transform combining the position/rotation/scale/origin of the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfCircleShape_GetTransform(const sfCircleShape* shape);
CSFML_GRAPHICS_API const sfTransform* sfCircleShape_getTransform(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the inverse of the combined transform of a circle shape
@@ -212,7 +212,7 @@ CSFML_GRAPHICS_API const sfTransform* sfCircleShape_GetTransform(const sfCircleS
/// \return Inverse of the combined transformations applied to the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfCircleShape_GetInverseTransform(const sfCircleShape* shape);
CSFML_GRAPHICS_API const sfTransform* sfCircleShape_getInverseTransform(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Change the source texture of a circle shape
@@ -233,7 +233,7 @@ CSFML_GRAPHICS_API const sfTransform* sfCircleShape_GetInverseTransform(const sf
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a circle shape will display
@@ -246,7 +246,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetTexture(sfCircleShape* shape, const sfT
/// \param rect Rectangle defining the region of the texture to display
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetTextureRect(sfCircleShape* shape, sfIntRect rect);
CSFML_GRAPHICS_API void sfCircleShape_setTextureRect(sfCircleShape* shape, sfIntRect rect);
////////////////////////////////////////////////////////////
/// \brief Set the fill color of a circle shape
@@ -254,7 +254,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetTextureRect(sfCircleShape* shape, sfInt
/// This color is modulated (multiplied) with the shape's
/// texture if any. It can be used to colorize the shape,
/// or change its global opacity.
/// You can use sf::Color::Transparent to make the inside of
/// You can use sfTransparent to make the inside of
/// the shape transparent, and have the outline alone.
/// By default, the shape's fill color is opaque white.
///
@@ -262,19 +262,19 @@ CSFML_GRAPHICS_API void sfCircleShape_SetTextureRect(sfCircleShape* shape, sfInt
/// \param color New color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetFillColor(sfCircleShape* shape, sfColor color);
CSFML_GRAPHICS_API void sfCircleShape_setFillColor(sfCircleShape* shape, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Set the outline color of a circle shape
///
/// You can use sf::Color::Transparent to disable the outline.
/// You can use sfTransparent to disable the outline.
/// By default, the shape's outline color is opaque white.
///
/// \param shape Shape object
/// \param color New outline color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetOutlineColor(sfCircleShape* shape, sfColor color);
CSFML_GRAPHICS_API void sfCircleShape_setOutlineColor(sfCircleShape* shape, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Set the thickness of a circle shape's outline
@@ -287,7 +287,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetOutlineColor(sfCircleShape* shape, sfCo
/// \param thickness New outline thickness
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetOutlineThickness(sfCircleShape* shape, float thickness);
CSFML_GRAPHICS_API void sfCircleShape_setOutlineThickness(sfCircleShape* shape, float thickness);
////////////////////////////////////////////////////////////
/// \brief Get the source texture of a circle shape
@@ -301,7 +301,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetOutlineThickness(sfCircleShape* shape,
/// \return Pointer to the shape's texture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTexture* sfCircleShape_GetTexture(const sfCircleShape* shape);
CSFML_GRAPHICS_API const sfTexture* sfCircleShape_getTexture(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the sub-rectangle of the texture displayed by a circle shape
@@ -311,7 +311,7 @@ CSFML_GRAPHICS_API const sfTexture* sfCircleShape_GetTexture(const sfCircleShape
/// \return Texture rectangle of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfIntRect sfCircleShape_GetTextureRect(const sfCircleShape* shape);
CSFML_GRAPHICS_API sfIntRect sfCircleShape_getTextureRect(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the fill color of a circle shape
@@ -321,7 +321,7 @@ CSFML_GRAPHICS_API sfIntRect sfCircleShape_GetTextureRect(const sfCircleShape* s
/// \return Fill color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfCircleShape_GetFillColor(const sfCircleShape* shape);
CSFML_GRAPHICS_API sfColor sfCircleShape_getFillColor(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the outline color of a circle shape
@@ -331,7 +331,7 @@ CSFML_GRAPHICS_API sfColor sfCircleShape_GetFillColor(const sfCircleShape* shape
/// \return Outline color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfCircleShape_GetOutlineColor(const sfCircleShape* shape);
CSFML_GRAPHICS_API sfColor sfCircleShape_getOutlineColor(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the outline thickness of a circle shape
@@ -341,7 +341,7 @@ CSFML_GRAPHICS_API sfColor sfCircleShape_GetOutlineColor(const sfCircleShape* sh
/// \return Outline thickness of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfCircleShape_GetOutlineThickness(const sfCircleShape* shape);
CSFML_GRAPHICS_API float sfCircleShape_getOutlineThickness(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the total number of points of a circle shape
@@ -351,7 +351,7 @@ CSFML_GRAPHICS_API float sfCircleShape_GetOutlineThickness(const sfCircleShape*
/// \return Number of points of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfCircleShape_GetPointCount(const sfCircleShape* shape);
CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get a point of a circle shape
@@ -359,12 +359,12 @@ CSFML_GRAPHICS_API unsigned int sfCircleShape_GetPointCount(const sfCircleShape*
/// The result is undefined if \a index is out of the valid range.
///
/// \param shape Shape object
/// \param index Index of the point to get, in range [0 .. GetPointCount() - 1]
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
///
/// \return Index-th point of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetPoint(const sfCircleShape* shape, unsigned int index);
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index);
////////////////////////////////////////////////////////////
/// \brief Set the radius of a circle
@@ -373,7 +373,7 @@ CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetPoint(const sfCircleShape* shape,
/// \param radius New radius of the circle
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetRadius(sfCircleShape* shape, float radius);
CSFML_GRAPHICS_API void sfCircleShape_setRadius(sfCircleShape* shape, float radius);
////////////////////////////////////////////////////////////
/// \brief Get the radius of a circle
@@ -383,7 +383,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetRadius(sfCircleShape* shape, float radi
/// \return Radius of the circle
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfCircleShape_GetRadius(const sfCircleShape* shape);
CSFML_GRAPHICS_API float sfCircleShape_getRadius(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the number of points of a circle
@@ -392,7 +392,7 @@ CSFML_GRAPHICS_API float sfCircleShape_GetRadius(const sfCircleShape* shape);
/// \param count New number of points of the circle
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_SetPointCount(sfCircleShape* shape, unsigned int count);
CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count);
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a circle shape
@@ -408,7 +408,7 @@ CSFML_GRAPHICS_API void sfCircleShape_SetPointCount(sfCircleShape* shape, unsign
/// \return Local bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfCircleShape_GetLocalBounds(const sfCircleShape* shape);
CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getLocalBounds(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of a circle shape
@@ -424,7 +424,7 @@ CSFML_GRAPHICS_API sfFloatRect sfCircleShape_GetLocalBounds(const sfCircleShape*
/// \return Global bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfCircleShape_GetGlobalBounds(const sfCircleShape* shape);
CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getGlobalBounds(const sfCircleShape* shape);
#endif // SFML_CIRCLESHAPE_H
+4 -4
View File
@@ -65,7 +65,7 @@ CSFML_GRAPHICS_API sfColor sfTransparent; ///< Transparent (black) predefined co
/// \return sfColor constructed from the components
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_FromRGB(sfUint8 red, sfUint8 green, sfUint8 blue);
CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue);
////////////////////////////////////////////////////////////
/// \brief Construct a color from its 4 RGBA components
@@ -78,7 +78,7 @@ CSFML_GRAPHICS_API sfColor sfColor_FromRGB(sfUint8 red, sfUint8 green, sfUint8 b
/// \return sfColor constructed from the components
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
////////////////////////////////////////////////////////////
/// \brief Add two colors
@@ -89,7 +89,7 @@ CSFML_GRAPHICS_API sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8
/// \return Component-wise saturated addition of the two colors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_Add(sfColor color1, sfColor color2);
CSFML_GRAPHICS_API sfColor sfColor_add(sfColor color1, sfColor color2);
////////////////////////////////////////////////////////////
/// \brief Modulate two colors
@@ -100,7 +100,7 @@ CSFML_GRAPHICS_API sfColor sfColor_Add(sfColor color1, sfColor color2);
/// \return Component-wise multiplication of the two colors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_Modulate(sfColor color1, sfColor color2);
CSFML_GRAPHICS_API sfColor sfColor_modulate(sfColor color1, sfColor color2);
#endif // SFML_COLOR_H
+42 -42
View File
@@ -41,7 +41,7 @@
/// \return A new sfConvexShape object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_Create(void);
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_create(void);
////////////////////////////////////////////////////////////
/// \brief Copy an existing convex shape
@@ -51,7 +51,7 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_Create(void);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_Copy(sfConvexShape* shape);
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing convex Shape
@@ -59,46 +59,46 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_Copy(sfConvexShape* shape);
/// \param Shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_Destroy(sfConvexShape* shape);
CSFML_GRAPHICS_API void sfConvexShape_destroy(sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a convex shape
///
/// This function completely overwrites the previous position.
/// See sfConvexShape_Move to apply an offset based on the previous position instead.
/// See sfConvexShape_move to apply an offset based on the previous position instead.
/// The default position of a circle Shape object is (0, 0).
///
/// \param shape Shape object
/// \param position New position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetPosition(sfConvexShape* shape, sfVector2f position);
CSFML_GRAPHICS_API void sfConvexShape_setPosition(sfConvexShape* shape, sfVector2f position);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a convex shape
///
/// This function completely overwrites the previous rotation.
/// See sfConvexShape_Rotate to add an angle based on the previous rotation instead.
/// See sfConvexShape_rotate to add an angle based on the previous rotation instead.
/// The default rotation of a circle Shape object is 0.
///
/// \param shape Shape object
/// \param angle New rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetRotation(sfConvexShape* shape, float angle);
CSFML_GRAPHICS_API void sfConvexShape_setRotation(sfConvexShape* shape, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the scale factors of a convex shape
///
/// This function completely overwrites the previous scale.
/// See sfConvexShape_Scale to add a factor based on the previous scale instead.
/// See sfConvexShape_scale to add a factor based on the previous scale instead.
/// The default scale of a circle Shape object is (1, 1).
///
/// \param shape Shape object
/// \param scale New scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetScale(sfConvexShape* shape, sfVector2f scale);
CSFML_GRAPHICS_API void sfConvexShape_setScale(sfConvexShape* shape, sfVector2f scale);
////////////////////////////////////////////////////////////
/// \brief Set the local origin of a convex shape
@@ -114,7 +114,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetScale(sfConvexShape* shape, sfVector2f
/// \param origin New origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetOrigin(sfConvexShape* shape, sfVector2f origin);
CSFML_GRAPHICS_API void sfConvexShape_setOrigin(sfConvexShape* shape, sfVector2f origin);
////////////////////////////////////////////////////////////
/// \brief Get the position of a convex shape
@@ -124,7 +124,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetOrigin(sfConvexShape* shape, sfVector2f
/// \return Current position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetPosition(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPosition(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the orientation of a convex shape
@@ -136,7 +136,7 @@ CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetPosition(const sfConvexShape* sha
/// \return Current rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfConvexShape_GetRotation(const sfConvexShape* shape);
CSFML_GRAPHICS_API float sfConvexShape_getRotation(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the current scale of a convex shape
@@ -146,7 +146,7 @@ CSFML_GRAPHICS_API float sfConvexShape_GetRotation(const sfConvexShape* shape);
/// \return Current scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetScale(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getScale(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the local origin of a convex shape
@@ -156,43 +156,43 @@ CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetScale(const sfConvexShape* shape)
/// \return Current origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetOrigin(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getOrigin(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Move a convex shape by a given offset
///
/// This function adds to the current position of the object,
/// unlike sfConvexShape_SetPosition which overwrites it.
/// unlike sfConvexShape_setPosition which overwrites it.
///
/// \param shape Shape object
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_Move(sfConvexShape* shape, sfVector2f offset);
CSFML_GRAPHICS_API void sfConvexShape_move(sfConvexShape* shape, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a convex shape
///
/// This function adds to the current rotation of the object,
/// unlike sfConvexShape_SetRotation which overwrites it.
/// unlike sfConvexShape_setRotation which overwrites it.
///
/// \param shape Shape object
/// \param angle Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_Rotate(sfConvexShape* shape, float angle);
CSFML_GRAPHICS_API void sfConvexShape_rotate(sfConvexShape* shape, float angle);
////////////////////////////////////////////////////////////
/// \brief Scale a convex shape
///
/// This function multiplies the current scale of the object,
/// unlike sfConvexShape_SetScale which overwrites it.
/// unlike sfConvexShape_setScale which overwrites it.
///
/// \param shape Shape object
/// \param factors Scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_Scale(sfConvexShape* shape, sfVector2f factors);
CSFML_GRAPHICS_API void sfConvexShape_scale(sfConvexShape* shape, sfVector2f factors);
////////////////////////////////////////////////////////////
/// \brief Get the combined transform of a convex shape
@@ -202,7 +202,7 @@ CSFML_GRAPHICS_API void sfConvexShape_Scale(sfConvexShape* shape, sfVector2f fac
/// \return Transform combining the position/rotation/scale/origin of the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfConvexShape_GetTransform(const sfConvexShape* shape);
CSFML_GRAPHICS_API const sfTransform* sfConvexShape_getTransform(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the inverse of the combined transform of a convex shape
@@ -212,7 +212,7 @@ CSFML_GRAPHICS_API const sfTransform* sfConvexShape_GetTransform(const sfConvexS
/// \return Inverse of the combined transformations applied to the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfConvexShape_GetInverseTransform(const sfConvexShape* shape);
CSFML_GRAPHICS_API const sfTransform* sfConvexShape_getInverseTransform(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Change the source texture of a convex shape
@@ -233,7 +233,7 @@ CSFML_GRAPHICS_API const sfTransform* sfConvexShape_GetInverseTransform(const sf
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a convex shape will display
@@ -246,7 +246,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetTexture(sfConvexShape* shape, const sfT
/// \param rect Rectangle defining the region of the texture to display
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetTextureRect(sfConvexShape* shape, sfIntRect rect);
CSFML_GRAPHICS_API void sfConvexShape_setTextureRect(sfConvexShape* shape, sfIntRect rect);
////////////////////////////////////////////////////////////
/// \brief Set the fill color of a convex shape
@@ -254,7 +254,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetTextureRect(sfConvexShape* shape, sfInt
/// This color is modulated (multiplied) with the shape's
/// texture if any. It can be used to colorize the shape,
/// or change its global opacity.
/// You can use sf::Color::Transparent to make the inside of
/// You can use sfTransparent to make the inside of
/// the shape transparent, and have the outline alone.
/// By default, the shape's fill color is opaque white.
///
@@ -262,19 +262,19 @@ CSFML_GRAPHICS_API void sfConvexShape_SetTextureRect(sfConvexShape* shape, sfInt
/// \param color New color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetFillColor(sfConvexShape* shape, sfColor color);
CSFML_GRAPHICS_API void sfConvexShape_setFillColor(sfConvexShape* shape, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Set the outline color of a convex shape
///
/// You can use sf::Color::Transparent to disable the outline.
/// You can use sfTransparent to disable the outline.
/// By default, the shape's outline color is opaque white.
///
/// \param shape Shape object
/// \param color New outline color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetOutlineColor(sfConvexShape* shape, sfColor color);
CSFML_GRAPHICS_API void sfConvexShape_setOutlineColor(sfConvexShape* shape, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Set the thickness of a convex shape's outline
@@ -287,7 +287,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetOutlineColor(sfConvexShape* shape, sfCo
/// \param thickness New outline thickness
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetOutlineThickness(sfConvexShape* shape, float thickness);
CSFML_GRAPHICS_API void sfConvexShape_setOutlineThickness(sfConvexShape* shape, float thickness);
////////////////////////////////////////////////////////////
/// \brief Get the source texture of a convex shape
@@ -301,7 +301,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetOutlineThickness(sfConvexShape* shape,
/// \return Pointer to the shape's texture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTexture* sfConvexShape_GetTexture(const sfConvexShape* shape);
CSFML_GRAPHICS_API const sfTexture* sfConvexShape_getTexture(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the sub-rectangle of the texture displayed by a convex shape
@@ -311,7 +311,7 @@ CSFML_GRAPHICS_API const sfTexture* sfConvexShape_GetTexture(const sfConvexShape
/// \return Texture rectangle of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfIntRect sfConvexShape_GetTextureRect(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfIntRect sfConvexShape_getTextureRect(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the fill color of a convex shape
@@ -321,7 +321,7 @@ CSFML_GRAPHICS_API sfIntRect sfConvexShape_GetTextureRect(const sfConvexShape* s
/// \return Fill color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfConvexShape_GetFillColor(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfColor sfConvexShape_getFillColor(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the outline color of a convex shape
@@ -331,7 +331,7 @@ CSFML_GRAPHICS_API sfColor sfConvexShape_GetFillColor(const sfConvexShape* shape
/// \return Outline color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfConvexShape_GetOutlineColor(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfColor sfConvexShape_getOutlineColor(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the outline thickness of a convex shape
@@ -341,7 +341,7 @@ CSFML_GRAPHICS_API sfColor sfConvexShape_GetOutlineColor(const sfConvexShape* sh
/// \return Outline thickness of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfConvexShape_GetOutlineThickness(const sfConvexShape* shape);
CSFML_GRAPHICS_API float sfConvexShape_getOutlineThickness(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the total number of points of a convex shape
@@ -351,7 +351,7 @@ CSFML_GRAPHICS_API float sfConvexShape_GetOutlineThickness(const sfConvexShape*
/// \return Number of points of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfConvexShape_GetPointCount(const sfConvexShape* shape);
CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get a point of a convex shape
@@ -359,12 +359,12 @@ CSFML_GRAPHICS_API unsigned int sfConvexShape_GetPointCount(const sfConvexShape*
/// The result is undefined if \a index is out of the valid range.
///
/// \param shape Shape object
/// \param index Index of the point to get, in range [0 .. GetPointCount() - 1]
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
///
/// \return Index-th point of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetPoint(const sfConvexShape* shape, unsigned int index);
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index);
////////////////////////////////////////////////////////////
/// \brief Set the number of points of a convex shap
@@ -375,14 +375,14 @@ CSFML_GRAPHICS_API sfVector2f sfConvexShape_GetPoint(const sfConvexShape* shape,
/// \param count New number of points of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetPointCount(sfConvexShape* shape, unsigned int count);
CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count);
////////////////////////////////////////////////////////////
/// \brief Set the position of a point in a convex shape
///
/// Don't forget that the polygon must remain convex, and
/// the points need to stay ordered!
/// SetPointCount must be called first in order to set the total
/// setPointCount must be called first in order to set the total
/// number of points. The result is undefined if \a index is out
/// of the valid range.
///
@@ -391,7 +391,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetPointCount(sfConvexShape* shape, unsign
/// \param point New point
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_SetPoint(sfConvexShape* shape, unsigned int index, sfVector2f point);
CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point);
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a convex shape
@@ -407,7 +407,7 @@ CSFML_GRAPHICS_API void sfConvexShape_SetPoint(sfConvexShape* shape, unsigned in
/// \return Local bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfConvexShape_GetLocalBounds(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getLocalBounds(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of a convex shape
@@ -423,7 +423,7 @@ CSFML_GRAPHICS_API sfFloatRect sfConvexShape_GetLocalBounds(const sfConvexShape*
/// \return Global bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfConvexShape_GetGlobalBounds(const sfConvexShape* shape);
CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getGlobalBounds(const sfConvexShape* shape);
#endif // SFML_CONVEXSHAPE_H
+10 -10
View File
@@ -43,7 +43,7 @@
/// \return A new sfFont object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFont* sfFont_CreateFromFile(const char* filename);
CSFML_GRAPHICS_API sfFont* sfFont_createFromFile(const char* filename);
////////////////////////////////////////////////////////////
/// \brief Create a new image font a file in memory
@@ -54,7 +54,7 @@ CSFML_GRAPHICS_API sfFont* sfFont_CreateFromFile(const char* filename);
/// \return A new sfFont object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFont* sfFont_CreateFromMemory(const void* data, size_t sizeInBytes);
CSFML_GRAPHICS_API sfFont* sfFont_createFromMemory(const void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Create a new image font a custom stream
@@ -64,7 +64,7 @@ CSFML_GRAPHICS_API sfFont* sfFont_CreateFromMemory(const void* data, size_t size
/// \return A new sfFont object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFont* sfFont_CreateFromStream(sfInputStream* stream);
CSFML_GRAPHICS_API sfFont* sfFont_createFromStream(sfInputStream* stream);
////////////////////////////////////////////////////////////
/// \brief Copy an existing font
@@ -74,7 +74,7 @@ CSFML_GRAPHICS_API sfFont* sfFont_CreateFromStream(sfInputStream* stream);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFont* sfFont_Copy(sfFont* font);
CSFML_GRAPHICS_API sfFont* sfFont_copy(sfFont* font);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing font
@@ -82,7 +82,7 @@ CSFML_GRAPHICS_API sfFont* sfFont_Copy(sfFont* font);
/// \param font Font to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfFont_Destroy(sfFont* font);
CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
////////////////////////////////////////////////////////////
/// \brief Get a glyph in a font
@@ -95,7 +95,7 @@ CSFML_GRAPHICS_API void sfFont_Destroy(sfFont* font);
/// \return The corresponding glyph
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
////////////////////////////////////////////////////////////
/// \brief Get the kerning value corresponding to a given pair of characters in a font
@@ -108,7 +108,7 @@ CSFML_GRAPHICS_API sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, uns
/// \return Kerning offset, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API int sfFont_GetKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
CSFML_GRAPHICS_API int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
////////////////////////////////////////////////////////////
/// \brief Get the line spacing value
@@ -120,7 +120,7 @@ CSFML_GRAPHICS_API int sfFont_GetKerning(sfFont* font, sfUint32 first, sfUint32
/// \return Line spacing, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API int sfFont_GetLineSpacing(sfFont* font, unsigned int characterSize);
CSFML_GRAPHICS_API int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
////////////////////////////////////////////////////////////
/// \brief Get the texture containing the glyphs of a given size in a font
@@ -131,7 +131,7 @@ CSFML_GRAPHICS_API int sfFont_GetLineSpacing(sfFont* font, unsigned int characte
/// \return Read-only pointer to the texture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTexture* sfFont_GetTexture(sfFont* font, unsigned int characterSize);
CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize);
////////////////////////////////////////////////////////////
/// \brief Get the built-in default font (Arial)
@@ -139,7 +139,7 @@ CSFML_GRAPHICS_API const sfTexture* sfFont_GetTexture(sfFont* font, unsigned int
/// \return Pointer to the default font
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfFont* sfFont_GetDefaultFont(void);
CSFML_GRAPHICS_API const sfFont* sfFont_getDefaultFont(void);
#endif // SFML_IMAGE_H
+3 -3
View File
@@ -37,9 +37,9 @@
////////////////////////////////////////////////////////////
typedef struct
{
int Advance; ///< Offset to move horizontically to the next character
sfIntRect Bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
sfIntRect TextureRect; ///< Texture coordinates of the glyph inside the font's image
int advance; ///< Offset to move horizontically to the next character
sfIntRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
sfIntRect textureRect; ///< Texture coordinates of the glyph inside the font's image
} sfGlyph;
+19 -19
View File
@@ -47,7 +47,7 @@
/// \return A new sfImage object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_Create(unsigned int width, unsigned int height);
CSFML_GRAPHICS_API sfImage* sfImage_create(unsigned int width, unsigned int height);
////////////////////////////////////////////////////////////
/// \brief Create an image and fill it with a unique color
@@ -59,7 +59,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_Create(unsigned int width, unsigned int heig
/// \return A new sfImage object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_CreateFromColor(unsigned int width, unsigned int height, sfColor color);
CSFML_GRAPHICS_API sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Create an image from an array of pixels
@@ -76,7 +76,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_CreateFromColor(unsigned int width, unsigned
/// \return A new sfImage object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_CreateFromPixels(unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_GRAPHICS_API sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* pixels);
////////////////////////////////////////////////////////////
/// \brief Create an image from a file on disk
@@ -91,7 +91,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_CreateFromPixels(unsigned int width, unsigne
/// \return A new sfImage object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_CreateFromFile(const char* filename);
CSFML_GRAPHICS_API sfImage* sfImage_createFromFile(const char* filename);
////////////////////////////////////////////////////////////
/// \brief Create an image from a file in memory
@@ -107,7 +107,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_CreateFromFile(const char* filename);
/// \return A new sfImage object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_CreateFromMemory(const void* data, size_t size);
CSFML_GRAPHICS_API sfImage* sfImage_createFromMemory(const void* data, size_t size);
////////////////////////////////////////////////////////////
/// \brief Create an image from a custom stream
@@ -122,7 +122,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_CreateFromMemory(const void* data, size_t si
/// \return A new sfImage object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_CreateFromStream(sfInputStream* stream);
CSFML_GRAPHICS_API sfImage* sfImage_createFromStream(sfInputStream* stream);
////////////////////////////////////////////////////////////
/// \brief Copy an existing image
@@ -132,7 +132,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_CreateFromStream(sfInputStream* stream);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfImage_Copy(sfImage* image);
CSFML_GRAPHICS_API sfImage* sfImage_copy(sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing image
@@ -140,7 +140,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_Copy(sfImage* image);
/// \param image Image to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_Destroy(sfImage* image);
CSFML_GRAPHICS_API void sfImage_destroy(sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Save an image to a file on disk
@@ -156,7 +156,7 @@ CSFML_GRAPHICS_API void sfImage_Destroy(sfImage* image);
/// \return sfTrue if saving was successful
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfImage_SaveToFile(const sfImage* image, const char* filename);
CSFML_GRAPHICS_API sfBool sfImage_saveToFile(const sfImage* image, const char* filename);
////////////////////////////////////////////////////////////
/// \brief Return the width of an image
@@ -166,7 +166,7 @@ CSFML_GRAPHICS_API sfBool sfImage_SaveToFile(const sfImage* image, const char* f
/// \return Width in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfImage_GetWidth(const sfImage* image);
CSFML_GRAPHICS_API unsigned int sfImage_getWidth(const sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Return the height of an image
@@ -176,7 +176,7 @@ CSFML_GRAPHICS_API unsigned int sfImage_GetWidth(const sfImage* image);
/// \return Height in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfImage_GetHeight(const sfImage* image);
CSFML_GRAPHICS_API unsigned int sfImage_getHeight(const sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Create a transparency mask from a specified color-key
@@ -190,7 +190,7 @@ CSFML_GRAPHICS_API unsigned int sfImage_GetHeight(const sfImage* image);
/// \param alpha Alpha value to assign to transparent pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_CreateMaskFromColor(sfColor color, sfUint8 alpha);
CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfColor color, sfUint8 alpha);
////////////////////////////////////////////////////////////
/// \brief Copy pixels from an image onto another
@@ -213,7 +213,7 @@ CSFML_GRAPHICS_API void sfImage_CreateMaskFromColor(sfColor color, sfUint8 alpha
/// \param applyAlpha Should the copy take in account the source transparency?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_CopyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha);
CSFML_GRAPHICS_API void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha);
////////////////////////////////////////////////////////////
/// \brief Change the color of a pixel in an image
@@ -228,7 +228,7 @@ CSFML_GRAPHICS_API void sfImage_CopyImage(sfImage* image, const sfImage* source,
/// \param color New color of the pixel
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color);
CSFML_GRAPHICS_API void sfImage_setPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Get the color of a pixel in an image
@@ -244,14 +244,14 @@ CSFML_GRAPHICS_API void sfImage_SetPixel(sfImage* image, unsigned int x, unsigne
/// \return Color of the pixel at coordinates (x, y)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfImage_GetPixel(const sfImage* image, unsigned int x, unsigned int y);
CSFML_GRAPHICS_API sfColor sfImage_getPixel(const sfImage* image, unsigned int x, unsigned int y);
////////////////////////////////////////////////////////////
/// \brief Get a read-only pointer to the array of pixels of an image
///
/// The returned value points to an array of RGBA pixels made of
/// 8 bits integers components. The size of the array is
/// GetWidth() * GetHeight() * 4.
/// getWidth() * getHeight() * 4.
/// Warning: the returned pointer may become invalid if you
/// modify the image, so you should never store it for too long.
/// If the image is empty, a null pointer is returned.
@@ -261,7 +261,7 @@ CSFML_GRAPHICS_API sfColor sfImage_GetPixel(const sfImage* image, unsigned int x
/// \return Read-only pointer to the array of pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfUint8* sfImage_GetPixelsPtr(const sfImage* image);
CSFML_GRAPHICS_API const sfUint8* sfImage_getPixelsPtr(const sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Flip an image horizontally (left <-> right)
@@ -269,7 +269,7 @@ CSFML_GRAPHICS_API const sfUint8* sfImage_GetPixelsPtr(const sfImage* image);
/// \param image Image object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_FlipHorizontally(sfImage* image);
CSFML_GRAPHICS_API void sfImage_flipHorizontally(sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Flip an image vertically (top <-> bottom)
@@ -277,7 +277,7 @@ CSFML_GRAPHICS_API void sfImage_FlipHorizontally(sfImage* image);
/// \param image Image object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_FlipVertically(sfImage* image);
CSFML_GRAPHICS_API void sfImage_flipVertically(sfImage* image);
#endif // SFML_IMAGE_H
+12 -12
View File
@@ -37,18 +37,18 @@
////////////////////////////////////////////////////////////
typedef struct
{
float Left;
float Top;
float Width;
float Height;
float left;
float top;
float width;
float height;
} sfFloatRect;
typedef struct
{
int Left;
int Top;
int Width;
int Height;
int left;
int top;
int width;
int height;
} sfIntRect;
////////////////////////////////////////////////////////////
@@ -61,8 +61,8 @@ typedef struct
/// \return sfTrue if the point is inside
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfFloatRect_Contains(const sfFloatRect* rect, float x, float y);
CSFML_GRAPHICS_API sfBool sfIntRect_Contains(const sfIntRect* rect, int x, int y);
CSFML_GRAPHICS_API sfBool sfFloatRect_contains(const sfFloatRect* rect, float x, float y);
CSFML_GRAPHICS_API sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y);
////////////////////////////////////////////////////////////
/// \brief Check intersection between two rectangles
@@ -74,8 +74,8 @@ CSFML_GRAPHICS_API sfBool sfIntRect_Contains(const sfIntRect* rect, int x, int y
/// \return sfTrue if rectangles overlap
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfFloatRect_Intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
CSFML_GRAPHICS_API sfBool sfIntRect_Intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
CSFML_GRAPHICS_API sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
CSFML_GRAPHICS_API sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
#endif // SFML_RECT_H
+2 -2
View File
@@ -254,7 +254,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetTextureRect(sfRectangleShape* shape,
/// This color is modulated (multiplied) with the shape's
/// texture if any. It can be used to colorize the shape,
/// or change its global opacity.
/// You can use sf::Color::Transparent to make the inside of
/// You can use sfTransparent to make the inside of
/// the shape transparent, and have the outline alone.
/// By default, the shape's fill color is opaque white.
///
@@ -267,7 +267,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetFillColor(sfRectangleShape* shape, s
////////////////////////////////////////////////////////////
/// \brief Set the outline color of a rectangle shape
///
/// You can use sf::Color::Transparent to disable the outline.
/// You can use sfTransparent to disable the outline.
/// By default, the shape's outline color is opaque white.
///
/// \param shape Shape object
+4 -4
View File
@@ -39,10 +39,10 @@
////////////////////////////////////////////////////////////
typedef struct
{
sfBlendMode BlendMode; ///< Blending mode
sfTransform* Transform; ///< Transform
const sfTexture* Texture; ///< Texture
const sfShader* Shader; ///< Shader
sfBlendMode blendMode; ///< Blending mode
sfTransform* transform; ///< Transform
const sfTexture* texture; ///< Texture
const sfShader* shader; ///< Shader
} sfRenderStates;
+32 -32
View File
@@ -48,7 +48,7 @@
/// \return A new sfRenderTexture object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_Create(unsigned int width, unsigned int height, sfBool depthBuffer);
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing render texture
@@ -56,7 +56,7 @@ CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_Create(unsigned int width, u
/// \param renderTexture Render texture to destroy
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_Destroy(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API void sfRenderTexture_destroy(sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Get the size of the rendering region of a render texture
@@ -66,7 +66,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_Destroy(sfRenderTexture* renderTexture);
/// \return Size in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2u sfRenderTexture_GetSize(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Activate or deactivate a render texture as the current target for rendering
@@ -77,7 +77,7 @@ CSFML_GRAPHICS_API sfVector2u sfRenderTexture_GetSize(const sfRenderTexture* ren
/// \return True if operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_SetActive(sfRenderTexture* renderTexture, sfBool active);
CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active);
////////////////////////////////////////////////////////////
/// \brief Update the contents of the target texture
@@ -85,7 +85,7 @@ CSFML_GRAPHICS_API sfBool sfRenderTexture_SetActive(sfRenderTexture* renderTextu
/// \param renderTexture Render texture object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_Display(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API void sfRenderTexture_display(sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Clear the rendertexture with the given color
@@ -94,7 +94,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_Display(sfRenderTexture* renderTexture);
/// \param color Fill color
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_Clear(sfRenderTexture* renderTexture, sfColor color);
CSFML_GRAPHICS_API void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Change the current active view of a render texture
@@ -103,7 +103,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_Clear(sfRenderTexture* renderTexture, sf
/// \param view Pointer to the new view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_SetView(sfRenderTexture* renderTexture, const sfView* view);
CSFML_GRAPHICS_API void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Get the current active view of a render texture
@@ -113,7 +113,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_SetView(sfRenderTexture* renderTexture,
/// \return Current active view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfView* sfRenderTexture_GetView(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Get the default view of a render texture
@@ -123,7 +123,7 @@ CSFML_GRAPHICS_API const sfView* sfRenderTexture_GetView(const sfRenderTexture*
/// \return Default view of the rendertexture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfView* sfRenderTexture_GetDefaultView(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Get the viewport of a view applied to this target
@@ -134,7 +134,7 @@ CSFML_GRAPHICS_API const sfView* sfRenderTexture_GetDefaultView(const sfRenderTe
/// \return Viewport rectangle, expressed in pixels in the current target
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfIntRect sfRenderTexture_GetViewport(const sfRenderTexture* renderTexture, const sfView* view);
CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Convert a point in texture coordinates into view coordinates
@@ -147,7 +147,7 @@ CSFML_GRAPHICS_API sfIntRect sfRenderTexture_GetViewport(const sfRenderTexture*
/// \param targetView Target view to convert the point to (pass NULL to use the current view)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_ConvertCoords(const sfRenderTexture* renderTexture, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView);
CSFML_GRAPHICS_API void sfRenderTexture_convertCoords(const sfRenderTexture* renderTexture, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView);
////////////////////////////////////////////////////////////
/// \brief Draw a drawable object to the render-target
@@ -157,13 +157,13 @@ CSFML_GRAPHICS_API void sfRenderTexture_ConvertCoords(const sfRenderTexture* ren
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_DrawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_DrawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_DrawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_DrawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_DrawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_DrawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_DrawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Draw primitives defined by an array of vertices to a render texture
@@ -175,15 +175,15 @@ CSFML_GRAPHICS_API void sfRenderTexture_DrawVertexArray(sfRenderTexture* renderT
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_DrawPrimitives(sfRenderTexture* renderTexture,
const sfVertex* vertices, unsigned int vertexCount,
sfPrimitiveType type, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
const sfVertex* vertices, unsigned int vertexCount,
sfPrimitiveType type, const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Save the current OpenGL render states and matrices
///
/// This function can be used when you mix SFML drawing
/// and direct OpenGL rendering. Combined with PopGLStates,
/// and direct OpenGL rendering. Combined with popGLStates,
/// it ensures that:
/// \li SFML's internal states are not messed up by your OpenGL code
/// \li your OpenGL states are not modified by a call to a SFML function
@@ -194,38 +194,38 @@ CSFML_GRAPHICS_API void sfRenderTexture_DrawPrimitives(sfRenderTexture* renderTe
/// It is provided for convenience, but the best results will
/// be achieved if you handle OpenGL states yourself (because
/// you know which states have really changed, and need to be
/// saved and restored). Take a look at the ResetGLStates
/// saved and restored). Take a look at the resetGLStates
/// function if you do so.
///
/// \param renderTexture Render texture object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_PushGLStates(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Restore the previously saved OpenGL render states and matrices
///
/// See the description of PushGLStates to get a detailed
/// See the description of pushGLStates to get a detailed
/// description of these functions.
///
/// \param renderTexture Render texture object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_PopGLStates(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Reset the internal OpenGL states so that the target is ready for drawing
///
/// This function can be used when you mix SFML drawing
/// and direct OpenGL rendering, if you choose not to use
/// PushGLStates/PopGLStates. It makes sure that all OpenGL
/// states needed by SFML are set, so that subsequent sfRenderTexture_Draw*()
/// pushGLStates/popGLStates. It makes sure that all OpenGL
/// states needed by SFML are set, so that subsequent sfRenderTexture_draw*()
/// calls will work as expected.
///
/// \param renderTexture Render texture object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_ResetGLStates(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Get the target texture of a render texture
@@ -235,7 +235,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_ResetGLStates(sfRenderTexture* renderTex
/// \return Pointer to the target texture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_GetTexture(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Enable or disable the smooth filter on a render texture
@@ -244,7 +244,7 @@ CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_GetTexture(const sfRenderTex
/// \param smooth sfTrue to enable smoothing, sfFalse to disable it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_SetSmooth(sfRenderTexture* renderTexture, sfBool smooth);
CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth);
////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not for a render texture
@@ -254,7 +254,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_SetSmooth(sfRenderTexture* renderTexture
/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderTexture_IsSmooth(const sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
#endif // SFML_RENDERTEXTURE_H
+49 -49
View File
@@ -51,7 +51,7 @@
/// \param settings Creation settings (pass NULL to use default values)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a render window from an existing control
@@ -60,7 +60,7 @@ CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const
/// \param settings Creation settings (pass NULL to use default values)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing render window
@@ -68,7 +68,7 @@ CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandl
/// \param renderWindow Render window to destroy
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_Destroy(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Close a render window (but doesn't destroy the internal data)
@@ -76,7 +76,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_Destroy(sfRenderWindow* renderWindow);
/// \param renderWindow Render window to close
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_Close(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a render window is opened
@@ -84,7 +84,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_Close(sfRenderWindow* renderWindow);
/// \param renderWindow Render window object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_IsOpen(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Get the creation settings of a render window
@@ -94,7 +94,7 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_IsOpen(const sfRenderWindow* renderWind
/// \return Settings used to create the window
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_GetSettings(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Get the event on top of events stack of a render window, if any, and pop it
@@ -105,7 +105,7 @@ CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_GetSettings(const sfRenderWi
/// \return sfTrue if an event was returned, sfFalse if events stack was empty
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_PollEvent(sfRenderWindow* renderWindow, sfEvent* event);
CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Wait for an event and return it
@@ -116,7 +116,7 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_PollEvent(sfRenderWindow* renderWindow,
/// \return sfFalse if an error occured
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_WaitEvent(sfRenderWindow* renderWindow, sfEvent* event);
CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Get the position of a render window
@@ -126,7 +126,7 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_WaitEvent(sfRenderWindow* renderWindow,
/// \return Position in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_GetPosition(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Change the position of a render window on screen
@@ -137,7 +137,7 @@ CSFML_GRAPHICS_API sfVector2i sfRenderWindow_GetPosition(const sfRenderWindow* r
/// \param position New position, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetPosition(sfRenderWindow* renderWindow, sfVector2i position);
CSFML_GRAPHICS_API void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position);
////////////////////////////////////////////////////////////
/// \brief Get the size of the rendering region of a render window
@@ -147,7 +147,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetPosition(sfRenderWindow* renderWindow,
/// \return Size in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2u sfRenderWindow_GetSize(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Change the size of the rendering region of a render window
@@ -156,7 +156,7 @@ CSFML_GRAPHICS_API sfVector2u sfRenderWindow_GetSize(const sfRenderWindow* rende
/// \param size New size, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetSize(sfRenderWindow* renderWindow, sfVector2u size);
CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size);
////////////////////////////////////////////////////////////
/// \brief Change the title of a render window
@@ -165,7 +165,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetSize(sfRenderWindow* renderWindow, sfV
/// \param title New title
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetTitle(sfRenderWindow* renderWindow, const char* title);
CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
////////////////////////////////////////////////////////////
/// \brief Change a render window's icon
@@ -176,7 +176,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetTitle(sfRenderWindow* renderWindow, co
/// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
////////////////////////////////////////////////////////////
/// \brief Show or hide a render window
@@ -185,7 +185,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, uns
/// \param visible sfTrue to show the window, sfFalse to hide it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetVisible(sfRenderWindow* renderWindow, sfBool visible);
CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
////////////////////////////////////////////////////////////
/// \brief Show or hide the mouse cursor on a render window
@@ -194,7 +194,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetVisible(sfRenderWindow* renderWindow,
/// \param show sfTrue to show, sfFalse to hide
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
////////////////////////////////////////////////////////////
/// \brief Enable / disable vertical synchronization on a render window
@@ -203,7 +203,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetMouseCursorVisible(sfRenderWindow* ren
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
////////////////////////////////////////////////////////////
/// \brief Enable or disable automatic key-repeat for keydown events
@@ -214,7 +214,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetVerticalSyncEnabled(sfRenderWindow* re
/// \param enabled sfTrue to enable, sfFalse to disable
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
////////////////////////////////////////////////////////////
/// \brief Activate or deactivate a render window as the current target for rendering
@@ -225,7 +225,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetKeyRepeatEnabled(sfRenderWindow* rende
/// \return True if operation was successful, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfRenderWindow_SetActive(sfRenderWindow* renderWindow, sfBool active);
CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
////////////////////////////////////////////////////////////
/// \brief Display a render window on screen
@@ -233,7 +233,7 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_SetActive(sfRenderWindow* renderWindow,
/// \param renderWindow Render window object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_Display(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Limit the framerate to a maximum fixed frequency for a render window
@@ -242,7 +242,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_Display(sfRenderWindow* renderWindow);
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
////////////////////////////////////////////////////////////
/// \brief Change the joystick threshold, ie. the value below which no move event will be generated
@@ -251,7 +251,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderW
/// \param threshold New threshold, in range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
////////////////////////////////////////////////////////////
/// \brief Retrieve the OS-specific handle of a render window
@@ -261,7 +261,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* rend
/// \return Window handle
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_GetSystemHandle(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Clear a render window with the given color
@@ -270,7 +270,7 @@ CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_GetSystemHandle(const sfRenderW
/// \param color Fill color
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfColor color);
CSFML_GRAPHICS_API void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Change the current active view of a render window
@@ -279,7 +279,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfCol
/// \param view Pointer to the new view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_SetView(sfRenderWindow* renderWindow, const sfView* view);
CSFML_GRAPHICS_API void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Get the current active view of a render window
@@ -289,7 +289,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_SetView(sfRenderWindow* renderWindow, con
/// \return Current active view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Get the default view of a render window
@@ -299,7 +299,7 @@ CSFML_GRAPHICS_API const sfView* sfRenderWindow_GetView(const sfRenderWindow* re
/// \return Default view of the render window
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfView* sfRenderWindow_GetDefaultView(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Get the viewport of a view applied to this target
@@ -310,7 +310,7 @@ CSFML_GRAPHICS_API const sfView* sfRenderWindow_GetDefaultView(const sfRenderWin
/// \return Viewport rectangle, expressed in pixels in the current target
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfIntRect sfRenderWindow_GetViewport(const sfRenderWindow* renderWindow, const sfView* view);
CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Convert a point in window coordinates into view coordinates
@@ -323,7 +323,7 @@ CSFML_GRAPHICS_API sfIntRect sfRenderWindow_GetViewport(const sfRenderWindow* re
/// \param targetView Target view to convert the point to (pass NULL to use the current view)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView);
CSFML_GRAPHICS_API void sfRenderWindow_convertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView);
////////////////////////////////////////////////////////////
/// \brief Draw a drawable object to the render-target
@@ -333,13 +333,13 @@ CSFML_GRAPHICS_API void sfRenderWindow_ConvertCoords(const sfRenderWindow* rende
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_DrawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_DrawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_DrawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_DrawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_DrawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_DrawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Draw primitives defined by an array of vertices to a render window
@@ -351,15 +351,15 @@ CSFML_GRAPHICS_API void sfRenderWindow_DrawVertexArray(sfRenderWindow* renderWin
/// \param states Render states to use for drawing (NULL to use the default states)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_DrawPrimitives(sfRenderWindow* renderWindow,
const sfVertex* vertices, unsigned int vertexCount,
sfPrimitiveType type, const sfRenderStates* states);
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
const sfVertex* vertices, unsigned int vertexCount,
sfPrimitiveType type, const sfRenderStates* states);
////////////////////////////////////////////////////////////
/// \brief Save the current OpenGL render states and matrices
///
/// This function can be used when you mix SFML drawing
/// and direct OpenGL rendering. Combined with PopGLStates,
/// and direct OpenGL rendering. Combined with popGLStates,
/// it ensures that:
/// \li SFML's internal states are not messed up by your OpenGL code
/// \li your OpenGL states are not modified by a call to a SFML function
@@ -370,38 +370,38 @@ CSFML_GRAPHICS_API void sfRenderWindow_DrawPrimitives(sfRenderWindow* renderWind
/// It is provided for convenience, but the best results will
/// be achieved if you handle OpenGL states yourself (because
/// you know which states have really changed, and need to be
/// saved and restored). Take a look at the ResetGLStates
/// saved and restored). Take a look at the resetGLStates
/// function if you do so.
///
/// \param renderWindow render window object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_PushGLStates(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Restore the previously saved OpenGL render states and matrices
///
/// See the description of PushGLStates to get a detailed
/// See the description of pushGLStates to get a detailed
/// description of these functions.
///
/// \param renderWindow render window object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_PopGLStates(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Reset the internal OpenGL states so that the target is ready for drawing
///
/// This function can be used when you mix SFML drawing
/// and direct OpenGL rendering, if you choose not to use
/// PushGLStates/PopGLStates. It makes sure that all OpenGL
/// states needed by SFML are set, so that subsequent sfRenderWindow_Draw*()
/// pushGLStates/popGLStates. It makes sure that all OpenGL
/// states needed by SFML are set, so that subsequent sfRenderWindow_draw*()
/// calls will work as expected.
///
/// \param renderWindow render window object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_ResetGLStates(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Copy the current contents of a render window to an image
@@ -410,7 +410,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_ResetGLStates(sfRenderWindow* renderWindo
/// screenshots of the application. If you want to update an
/// image with the contents of the window and then use it for
/// drawing, you should rather use a sfTexture and its
/// Update(sfWindow*) function.
/// update(sfWindow*) function.
/// You can also draw things directly to a texture with the
/// sfRenderWindow class.
///
@@ -419,7 +419,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_ResetGLStates(sfRenderWindow* renderWindo
/// \return New image containing the captured contents
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfRenderWindow_Capture(const sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
#endif // SFML_RENDERWINDOW_H
+76 -28
View File
@@ -32,6 +32,8 @@
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Vector2.h>
#include <SFML/System/Vector3.h>
////////////////////////////////////////////////////////////
@@ -51,7 +53,7 @@
/// \return A new sfShader object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
////////////////////////////////////////////////////////////
/// \brief Load both the vertex and fragment shaders from source codes in memory
@@ -70,7 +72,7 @@ CSFML_GRAPHICS_API sfShader* sfShader_CreateFromFile(const char* vertexShaderFil
/// \return A new sfShader object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragmentShader);
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader);
////////////////////////////////////////////////////////////
/// \brief Load both the vertex and fragment shaders from custom streams
@@ -89,7 +91,7 @@ CSFML_GRAPHICS_API sfShader* sfShader_CreateFromMemory(const char* vertexShader,
/// \return A new sfShader object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing shader
@@ -97,7 +99,7 @@ CSFML_GRAPHICS_API sfShader* sfShader_CreateFromStream(sfInputStream* vertexShad
/// \param shader Shader to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_Destroy(sfShader* shader);
CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
////////////////////////////////////////////////////////////
/// \brief Change a float parameter of a shader
@@ -111,7 +113,7 @@ CSFML_GRAPHICS_API void sfShader_Destroy(sfShader* shader);
/// uniform float myparam; // this is the variable in the shader
/// \endcode
/// \code
/// sfShader_SetFloatParameter(shader, "myparam", 5.2f);
/// sfShader_setFloatParameter(shader, "myparam", 5.2f);
/// \endcode
///
/// \param shader Shader object
@@ -119,7 +121,7 @@ CSFML_GRAPHICS_API void sfShader_Destroy(sfShader* shader);
/// \param x Value to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetFloatParameter(sfShader* shader, const char* name, float x);
CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
////////////////////////////////////////////////////////////
/// \brief Change a 2-components vector parameter of a shader
@@ -133,7 +135,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloatParameter(sfShader* shader, const char*
/// uniform vec2 myparam; // this is the variable in the shader
/// \endcode
/// \code
/// sfShader_SetFloat2Parameter(shader, "myparam", 5.2f, 6.0f);
/// sfShader_setFloat2Parameter(shader, "myparam", 5.2f, 6.0f);
/// \endcode
///
/// \param shader Shader object
@@ -142,7 +144,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloatParameter(sfShader* shader, const char*
/// \param y Second component of the value to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetFloat2Parameter(sfShader* shader, const char* name, float x, float y);
CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
////////////////////////////////////////////////////////////
/// \brief Change a 3-components vector parameter of a shader
@@ -156,7 +158,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloat2Parameter(sfShader* shader, const char
/// uniform vec3 myparam; // this is the variable in the shader
/// \endcode
/// \code
/// sfShader_SetFloat3Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f);
/// sfShader_setFloat3Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f);
/// \endcode
///
/// \param shader Shader object
@@ -166,7 +168,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloat2Parameter(sfShader* shader, const char
/// \param z Third component of the value to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
////////////////////////////////////////////////////////////
/// \brief Change a 4-components vector parameter of a shader
@@ -180,7 +182,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloat3Parameter(sfShader* shader, const char
/// uniform vec4 myparam; // this is the variable in the shader
/// \endcode
/// \code
/// sfShader_SetFloat4Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f, 0.4f);
/// sfShader_setFloat4Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f, 0.4f);
/// \endcode
///
/// \param shader Shader object
@@ -191,7 +193,53 @@ CSFML_GRAPHICS_API void sfShader_SetFloat3Parameter(sfShader* shader, const char
/// \param w Fourth component of the value to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
////////////////////////////////////////////////////////////
/// \brief Change a 2-components vector parameter of a shader
///
/// \a name is the name of the variable to change in the shader.
/// The corresponding parameter in the shader must be a 2x1 vector
/// (vec2 GLSL type).
///
/// Example:
/// \code
/// uniform vec2 myparam; // this is the variable in the shader
/// \endcode
/// \code
/// sfVector2f vec = {5.2f, 6.0f};
/// sfShader_setVector2Parameter(shader, "myparam", vec);
/// \endcode
///
/// \param shader Shader object
/// \param name Name of the parameter in the shader
/// \param vector Vector to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
////////////////////////////////////////////////////////////
/// \brief Change a 3-components vector parameter of a shader
///
/// \a name is the name of the variable to change in the shader.
/// The corresponding parameter in the shader must be a 3x1 vector
/// (vec3 GLSL type).
///
/// Example:
/// \code
/// uniform vec3 myparam; // this is the variable in the shader
/// \endcode
/// \code
/// sfVector3f vec = {5.2f, 6.0f, -8.1f};
/// sfShader_setVector3Parameter(shader, "myparam", vec);
/// \endcode
///
/// \param shader Shader object
/// \param name Name of the parameter in the shader
/// \param vector Vector to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
////////////////////////////////////////////////////////////
/// \brief Change a color parameter of a shader
@@ -211,7 +259,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloat4Parameter(sfShader* shader, const char
/// uniform vec4 color; // this is the variable in the shader
/// \endcode
/// \code
/// sfShader_SetColorParameter(shader, "color", sfColor_FromRGB(255, 128, 0));
/// sfShader_setColorParameter(shader, "color", sfColor_FromRGB(255, 128, 0));
/// \endcode
///
/// \param shader Shader object
@@ -219,7 +267,7 @@ CSFML_GRAPHICS_API void sfShader_SetFloat4Parameter(sfShader* shader, const char
/// \param color Color to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetColorParameter(sfShader* shader, const char* name, sfColor color);
CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Change a matrix parameter of a shader
@@ -234,7 +282,7 @@ CSFML_GRAPHICS_API void sfShader_SetColorParameter(sfShader* shader, const char*
/// \endcode
/// \code
/// @todo
/// sfShader_SetTransformParameter(shader, "matrix", transform);
/// sfShader_setTransformParameter(shader, "matrix", transform);
/// \endcode
///
/// \param shader Shader object
@@ -242,7 +290,7 @@ CSFML_GRAPHICS_API void sfShader_SetColorParameter(sfShader* shader, const char*
/// \param transform Transform to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetTransformParameter(sfShader* shader, const char* name, const sfTransform* transform);
CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, const sfTransform* transform);
////////////////////////////////////////////////////////////
/// \brief Change a texture parameter of a shader
@@ -258,16 +306,16 @@ CSFML_GRAPHICS_API void sfShader_SetTransformParameter(sfShader* shader, const c
/// \code
/// sf::Texture texture;
/// ...
/// sfShader_SetTextureParameter(shader, "the_texture", texture);
/// sfShader_setTextureParameter(shader, "the_texture", texture);
/// \endcode
/// It is important to note that \a texture must remain alive as long
/// as the shader uses it, no copy is made internally.
///
/// To use the texture of the object being draw, which cannot be
/// known in advance, you can use the special function
/// sfShader_SetCurrentTextureParameter:
/// sfShader_setCurrentTextureParameter:
/// \code
/// sfShader_SetCurrentTextureParameter(shader, "the_texture").
/// sfShader_setCurrentTextureParameter(shader, "the_texture").
/// \endcode
///
/// \param shader Shader object
@@ -275,7 +323,7 @@ CSFML_GRAPHICS_API void sfShader_SetTransformParameter(sfShader* shader, const c
/// \param texture Texture to assign
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Change a texture parameter of a shader
@@ -291,14 +339,14 @@ CSFML_GRAPHICS_API void sfShader_SetTextureParameter(sfShader* shader, const cha
/// uniform sampler2D current; // this is the variable in the shader
/// \endcode
/// \code
/// sfShader_SetCurrentTextureParameter(shader, "current");
/// sfShader_setCurrentTextureParameter(shader, "current");
/// \endcode
///
/// \param shader Shader object
/// \param name Name of the texture in the shader
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_SetCurrentTextureParameter(sfShader* shader, const char* name);
CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
////////////////////////////////////////////////////////////
/// \brief Bind a shader for rendering (activate it)
@@ -307,16 +355,16 @@ CSFML_GRAPHICS_API void sfShader_SetCurrentTextureParameter(sfShader* shader, co
/// you want to use the shader with a custom OpenGL rendering
/// instead of a SFML drawable.
/// \code
/// sfWindow_SetActive(window, sfTrue);
/// sfShader_Bind(shader);
/// sfWindow_setActive(window, sfTrue);
/// sfShader_bind(shader);
/// ... render OpenGL geometry ...
/// sfShader_Unbind(shader);
/// sfShader_unbind(shader);
/// \endcode
///
/// \param shader Shader to bind
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_Bind(const sfShader* shader);
CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
////////////////////////////////////////////////////////////
/// \brief Unbind a shader (deactivate it)
@@ -328,7 +376,7 @@ CSFML_GRAPHICS_API void sfShader_Bind(const sfShader* shader);
/// \param shader Shader to unbind
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_Unbind(const sfShader* shader);
CSFML_GRAPHICS_API void sfShader_unbind(const sfShader* shader);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not the system supports shaders
@@ -340,7 +388,7 @@ CSFML_GRAPHICS_API void sfShader_Unbind(const sfShader* shader);
/// \return sfTrue if the system can use shaders, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfShader_IsAvailable(void);
CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
#endif // SFML_SHADER_H
+40 -40
View File
@@ -48,7 +48,7 @@ typedef sfVector2f (*sfShapeGetPointCallback)(unsigned int, void*); ///< Type of
/// \return A new sfShape object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfShape* sfShape_Create(sfShapeGetPointCountCallback getPointCount,
CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount,
sfShapeGetPointCallback getPoint,
void* userData);
@@ -58,46 +58,46 @@ CSFML_GRAPHICS_API sfShape* sfShape_Create(sfShapeGetPointCountCallback getPoint
/// \param Shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_Destroy(sfShape* shape);
CSFML_GRAPHICS_API void sfShape_destroy(sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a shape
///
/// This function completely overwrites the previous position.
/// See sfShape_Move to apply an offset based on the previous position instead.
/// See sfShape_move to apply an offset based on the previous position instead.
/// The default position of a circle Shape object is (0, 0).
///
/// \param shape Shape object
/// \param position New position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetPosition(sfShape* shape, sfVector2f position);
CSFML_GRAPHICS_API void sfShape_setPosition(sfShape* shape, sfVector2f position);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a shape
///
/// This function completely overwrites the previous rotation.
/// See sfShape_Rotate to add an angle based on the previous rotation instead.
/// See sfShape_rotate to add an angle based on the previous rotation instead.
/// The default rotation of a circle Shape object is 0.
///
/// \param shape Shape object
/// \param angle New rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetRotation(sfShape* shape, float angle);
CSFML_GRAPHICS_API void sfShape_setRotation(sfShape* shape, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the scale factors of a shape
///
/// This function completely overwrites the previous scale.
/// See sfShape_Scale to add a factor based on the previous scale instead.
/// See sfShape_scale to add a factor based on the previous scale instead.
/// The default scale of a circle Shape object is (1, 1).
///
/// \param shape Shape object
/// \param scale New scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetScale(sfShape* shape, sfVector2f scale);
CSFML_GRAPHICS_API void sfShape_setScale(sfShape* shape, sfVector2f scale);
////////////////////////////////////////////////////////////
/// \brief Set the local origin of a shape
@@ -113,7 +113,7 @@ CSFML_GRAPHICS_API void sfShape_SetScale(sfShape* shape, sfVector2f scale);
/// \param origin New origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetOrigin(sfShape* shape, sfVector2f origin);
CSFML_GRAPHICS_API void sfShape_setOrigin(sfShape* shape, sfVector2f origin);
////////////////////////////////////////////////////////////
/// \brief Get the position of a shape
@@ -123,7 +123,7 @@ CSFML_GRAPHICS_API void sfShape_SetOrigin(sfShape* shape, sfVector2f origin);
/// \return Current position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfShape_GetPosition(const sfShape* shape);
CSFML_GRAPHICS_API sfVector2f sfShape_getPosition(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the orientation of a shape
@@ -135,7 +135,7 @@ CSFML_GRAPHICS_API sfVector2f sfShape_GetPosition(const sfShape* shape);
/// \return Current rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfShape_GetRotation(const sfShape* shape);
CSFML_GRAPHICS_API float sfShape_getRotation(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the current scale of a shape
@@ -145,7 +145,7 @@ CSFML_GRAPHICS_API float sfShape_GetRotation(const sfShape* shape);
/// \return Current scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfShape_GetScale(const sfShape* shape);
CSFML_GRAPHICS_API sfVector2f sfShape_getScale(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the local origin of a shape
@@ -155,43 +155,43 @@ CSFML_GRAPHICS_API sfVector2f sfShape_GetScale(const sfShape* shape);
/// \return Current origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfShape_GetOrigin(const sfShape* shape);
CSFML_GRAPHICS_API sfVector2f sfShape_getOrigin(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Move a shape by a given offset
///
/// This function adds to the current position of the object,
/// unlike sfShape_SetPosition which overwrites it.
/// unlike sfShape_setPosition which overwrites it.
///
/// \param shape Shape object
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_Move(sfShape* shape, sfVector2f offset);
CSFML_GRAPHICS_API void sfShape_move(sfShape* shape, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a shape
///
/// This function adds to the current rotation of the object,
/// unlike sfShape_SetRotation which overwrites it.
/// unlike sfShape_setRotation which overwrites it.
///
/// \param shape Shape object
/// \param angle Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_Rotate(sfShape* shape, float angle);
CSFML_GRAPHICS_API void sfShape_rotate(sfShape* shape, float angle);
////////////////////////////////////////////////////////////
/// \brief Scale a shape
///
/// This function multiplies the current scale of the object,
/// unlike sfShape_SetScale which overwrites it.
/// unlike sfShape_setScale which overwrites it.
///
/// \param shape Shape object
/// \param factors Scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_Scale(sfShape* shape, sfVector2f factors);
CSFML_GRAPHICS_API void sfShape_scale(sfShape* shape, sfVector2f factors);
////////////////////////////////////////////////////////////
/// \brief Get the combined transform of a shape
@@ -201,7 +201,7 @@ CSFML_GRAPHICS_API void sfShape_Scale(sfShape* shape, sfVector2f factors);
/// \return Transform combining the position/rotation/scale/origin of the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfShape_GetTransform(const sfShape* shape);
CSFML_GRAPHICS_API const sfTransform* sfShape_getTransform(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the inverse of the combined transform of a shape
@@ -211,7 +211,7 @@ CSFML_GRAPHICS_API const sfTransform* sfShape_GetTransform(const sfShape* shape)
/// \return Inverse of the combined transformations applied to the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfShape_GetInverseTransform(const sfShape* shape);
CSFML_GRAPHICS_API const sfTransform* sfShape_getInverseTransform(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Change the source texture of a shape
@@ -232,7 +232,7 @@ CSFML_GRAPHICS_API const sfTransform* sfShape_GetInverseTransform(const sfShape*
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfShape_setTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a shape will display
@@ -245,7 +245,7 @@ CSFML_GRAPHICS_API void sfShape_SetTexture(sfShape* shape, const sfTexture* text
/// \param rect Rectangle defining the region of the texture to display
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetTextureRect(sfShape* shape, sfIntRect rect);
CSFML_GRAPHICS_API void sfShape_setTextureRect(sfShape* shape, sfIntRect rect);
////////////////////////////////////////////////////////////
/// \brief Set the fill color of a shape
@@ -253,7 +253,7 @@ CSFML_GRAPHICS_API void sfShape_SetTextureRect(sfShape* shape, sfIntRect rect);
/// This color is modulated (multiplied) with the shape's
/// texture if any. It can be used to colorize the shape,
/// or change its global opacity.
/// You can use sf::Color::Transparent to make the inside of
/// You can use sfTransparent to make the inside of
/// the shape transparent, and have the outline alone.
/// By default, the shape's fill color is opaque white.
///
@@ -261,19 +261,19 @@ CSFML_GRAPHICS_API void sfShape_SetTextureRect(sfShape* shape, sfIntRect rect);
/// \param color New color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetFillColor(sfShape* shape, sfColor color);
CSFML_GRAPHICS_API void sfShape_setFillColor(sfShape* shape, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Set the outline color of a shape
///
/// You can use sf::Color::Transparent to disable the outline.
/// You can use sfTransparent to disable the outline.
/// By default, the shape's outline color is opaque white.
///
/// \param shape Shape object
/// \param color New outline color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetOutlineColor(sfShape* shape, sfColor color);
CSFML_GRAPHICS_API void sfShape_setOutlineColor(sfShape* shape, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Set the thickness of a shape's outline
@@ -286,7 +286,7 @@ CSFML_GRAPHICS_API void sfShape_SetOutlineColor(sfShape* shape, sfColor color);
/// \param thickness New outline thickness
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_SetOutlineThickness(sfShape* shape, float thickness);
CSFML_GRAPHICS_API void sfShape_setOutlineThickness(sfShape* shape, float thickness);
////////////////////////////////////////////////////////////
/// \brief Get the source texture of a shape
@@ -300,7 +300,7 @@ CSFML_GRAPHICS_API void sfShape_SetOutlineThickness(sfShape* shape, float thickn
/// \return Pointer to the shape's texture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTexture* sfShape_GetTexture(const sfShape* shape);
CSFML_GRAPHICS_API const sfTexture* sfShape_getTexture(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the sub-rectangle of the texture displayed by a shape
@@ -310,7 +310,7 @@ CSFML_GRAPHICS_API const sfTexture* sfShape_GetTexture(const sfShape* shape);
/// \return Texture rectangle of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfIntRect sfShape_GetTextureRect(const sfShape* shape);
CSFML_GRAPHICS_API sfIntRect sfShape_getTextureRect(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the fill color of a shape
@@ -320,7 +320,7 @@ CSFML_GRAPHICS_API sfIntRect sfShape_GetTextureRect(const sfShape* shape);
/// \return Fill color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfShape_GetFillColor(const sfShape* shape);
CSFML_GRAPHICS_API sfColor sfShape_getFillColor(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the outline color of a shape
@@ -330,7 +330,7 @@ CSFML_GRAPHICS_API sfColor sfShape_GetFillColor(const sfShape* shape);
/// \return Outline color of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfShape_GetOutlineColor(const sfShape* shape);
CSFML_GRAPHICS_API sfColor sfShape_getOutlineColor(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the outline thickness of a shape
@@ -340,7 +340,7 @@ CSFML_GRAPHICS_API sfColor sfShape_GetOutlineColor(const sfShape* shape);
/// \return Outline thickness of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfShape_GetOutlineThickness(const sfShape* shape);
CSFML_GRAPHICS_API float sfShape_getOutlineThickness(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the total number of points of a shape
@@ -350,7 +350,7 @@ CSFML_GRAPHICS_API float sfShape_GetOutlineThickness(const sfShape* shape);
/// \return Number of points of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfShape_GetPointCount(const sfShape* shape);
CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get a point of a shape
@@ -358,12 +358,12 @@ CSFML_GRAPHICS_API unsigned int sfShape_GetPointCount(const sfShape* shape);
/// The result is undefined if \a index is out of the valid range.
///
/// \param shape Shape object
/// \param index Index of the point to get, in range [0 .. GetPointCount() - 1]
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
///
/// \return Index-th point of the shape
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfShape_GetPoint(const sfShape* shape, unsigned int index);
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index);
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a shape
@@ -379,7 +379,7 @@ CSFML_GRAPHICS_API sfVector2f sfShape_GetPoint(const sfShape* shape, unsigned in
/// \return Local bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfShape_GetLocalBounds(const sfShape* shape);
CSFML_GRAPHICS_API sfFloatRect sfShape_getLocalBounds(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of a shape
@@ -395,17 +395,17 @@ CSFML_GRAPHICS_API sfFloatRect sfShape_GetLocalBounds(const sfShape* shape);
/// \return Global bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfShape_GetGlobalBounds(const sfShape* shape);
CSFML_GRAPHICS_API sfFloatRect sfShape_getGlobalBounds(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Recompute the internal geometry of a shape
///
/// This function must be called by specialized shape objects
/// everytime their points change (ie. the result of either
/// the GetPointCount or GetPoint callbacks is different).
/// the getPointCount or getPoint callbacks is different).
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_Update(sfShape* shape);
CSFML_GRAPHICS_API void sfShape_update(sfShape* shape);
#endif // SFML_SHAPE_H
+30 -30
View File
@@ -42,7 +42,7 @@
/// \return A new sfSprite object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfSprite* sfSprite_Create(void);
CSFML_GRAPHICS_API sfSprite* sfSprite_create(void);
////////////////////////////////////////////////////////////
/// \brief Copy an existing sprite
@@ -52,7 +52,7 @@ CSFML_GRAPHICS_API sfSprite* sfSprite_Create(void);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfSprite* sfSprite_Copy(sfSprite* sprite);
CSFML_GRAPHICS_API sfSprite* sfSprite_copy(sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing sprite
@@ -60,46 +60,46 @@ CSFML_GRAPHICS_API sfSprite* sfSprite_Copy(sfSprite* sprite);
/// \param sprite Sprite to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_Destroy(sfSprite* sprite);
CSFML_GRAPHICS_API void sfSprite_destroy(sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Set the position of a sprite
///
/// This function completely overwrites the previous position.
/// See sfSprite_Move to apply an offset based on the previous position instead.
/// See sfSprite_move to apply an offset based on the previous position instead.
/// The default position of a sprite Sprite object is (0, 0).
///
/// \param sprite Sprite object
/// \param position New position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetPosition(sfSprite* sprite, sfVector2f position);
CSFML_GRAPHICS_API void sfSprite_setPosition(sfSprite* sprite, sfVector2f position);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a sprite
///
/// This function completely overwrites the previous rotation.
/// See sfSprite_Rotate to add an angle based on the previous rotation instead.
/// See sfSprite_rotate to add an angle based on the previous rotation instead.
/// The default rotation of a sprite Sprite object is 0.
///
/// \param sprite Sprite object
/// \param angle New rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetRotation(sfSprite* sprite, float angle);
CSFML_GRAPHICS_API void sfSprite_setRotation(sfSprite* sprite, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the scale factors of a sprite
///
/// This function completely overwrites the previous scale.
/// See sfSprite_Scale to add a factor based on the previous scale instead.
/// See sfSprite_scale to add a factor based on the previous scale instead.
/// The default scale of a sprite Sprite object is (1, 1).
///
/// \param sprite Sprite object
/// \param scale New scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetScale(sfSprite* sprite, sfVector2f scale);
CSFML_GRAPHICS_API void sfSprite_setScale(sfSprite* sprite, sfVector2f scale);
////////////////////////////////////////////////////////////
/// \brief Set the local origin of a sprite
@@ -115,7 +115,7 @@ CSFML_GRAPHICS_API void sfSprite_SetScale(sfSprite* sprite, sfVector2f scale);
/// \param origin New origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetOrigin(sfSprite* sprite, sfVector2f origin);
CSFML_GRAPHICS_API void sfSprite_setOrigin(sfSprite* sprite, sfVector2f origin);
////////////////////////////////////////////////////////////
/// \brief Get the position of a sprite
@@ -125,7 +125,7 @@ CSFML_GRAPHICS_API void sfSprite_SetOrigin(sfSprite* sprite, sfVector2f origin);
/// \return Current position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfSprite_GetPosition(const sfSprite* sprite);
CSFML_GRAPHICS_API sfVector2f sfSprite_getPosition(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the orientation of a sprite
@@ -137,7 +137,7 @@ CSFML_GRAPHICS_API sfVector2f sfSprite_GetPosition(const sfSprite* sprite);
/// \return Current rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfSprite_GetRotation(const sfSprite* sprite);
CSFML_GRAPHICS_API float sfSprite_getRotation(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the current scale of a sprite
@@ -147,7 +147,7 @@ CSFML_GRAPHICS_API float sfSprite_GetRotation(const sfSprite* sprite);
/// \return Current scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfSprite_GetScale(const sfSprite* sprite);
CSFML_GRAPHICS_API sfVector2f sfSprite_getScale(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the local origin of a sprite
@@ -157,43 +157,43 @@ CSFML_GRAPHICS_API sfVector2f sfSprite_GetScale(const sfSprite* sprite);
/// \return Current origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfSprite_GetOrigin(const sfSprite* sprite);
CSFML_GRAPHICS_API sfVector2f sfSprite_getOrigin(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Move a sprite by a given offset
///
/// This function adds to the current position of the object,
/// unlike sfSprite_SetPosition which overwrites it.
/// unlike sfSprite_setPosition which overwrites it.
///
/// \param sprite Sprite object
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_Move(sfSprite* sprite, sfVector2f offset);
CSFML_GRAPHICS_API void sfSprite_move(sfSprite* sprite, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a sprite
///
/// This function adds to the current rotation of the object,
/// unlike sfSprite_SetRotation which overwrites it.
/// unlike sfSprite_setRotation which overwrites it.
///
/// \param sprite Sprite object
/// \param angle Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_Rotate(sfSprite* sprite, float angle);
CSFML_GRAPHICS_API void sfSprite_rotate(sfSprite* sprite, float angle);
////////////////////////////////////////////////////////////
/// \brief Scale a sprite
///
/// This function multiplies the current scale of the object,
/// unlike sfSprite_SetScale which overwrites it.
/// unlike sfSprite_setScale which overwrites it.
///
/// \param sprite Sprite object
/// \param factors Scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_Scale(sfSprite* sprite, sfVector2f factors);
CSFML_GRAPHICS_API void sfSprite_scale(sfSprite* sprite, sfVector2f factors);
////////////////////////////////////////////////////////////
/// \brief Get the combined transform of a sprite
@@ -203,7 +203,7 @@ CSFML_GRAPHICS_API void sfSprite_Scale(sfSprite* sprite, sfVector2f factors);
/// \return Transform combining the position/rotation/scale/origin of the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfSprite_GetTransform(const sfSprite* sprite);
CSFML_GRAPHICS_API const sfTransform* sfSprite_getTransform(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the inverse of the combined transform of a sprite
@@ -213,7 +213,7 @@ CSFML_GRAPHICS_API const sfTransform* sfSprite_GetTransform(const sfSprite* spri
/// \return Inverse of the combined transformations applied to the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfSprite_GetInverseTransform(const sfSprite* sprite);
CSFML_GRAPHICS_API const sfTransform* sfSprite_getInverseTransform(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Change the source texture of a sprite
@@ -233,7 +233,7 @@ CSFML_GRAPHICS_API const sfTransform* sfSprite_GetInverseTransform(const sfSprit
/// \param resetRect Should the texture rect be reset to the size of the new texture?
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect);
CSFML_GRAPHICS_API void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect);
////////////////////////////////////////////////////////////
/// \brief Set the sub-rectangle of the texture that a sprite will display
@@ -246,7 +246,7 @@ CSFML_GRAPHICS_API void sfSprite_SetTexture(sfSprite* sprite, const sfTexture* t
/// \param rectangle Rectangle defining the region of the texture to display
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetTextureRect(sfSprite* sprite, sfIntRect rectangle);
CSFML_GRAPHICS_API void sfSprite_setTextureRect(sfSprite* sprite, sfIntRect rectangle);
////////////////////////////////////////////////////////////
/// \brief Set the global color of a sprite
@@ -260,7 +260,7 @@ CSFML_GRAPHICS_API void sfSprite_SetTextureRect(sfSprite* sprite, sfIntRect rect
/// \param color New color of the sprite
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_SetColor(sfSprite* sprite, sfColor color);
CSFML_GRAPHICS_API void sfSprite_setColor(sfSprite* sprite, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Get the source texture of a sprite
@@ -274,7 +274,7 @@ CSFML_GRAPHICS_API void sfSprite_SetColor(sfSprite* sprite, sfColor color);
/// \return Pointer to the sprite's texture
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTexture* sfSprite_GetTexture(const sfSprite* sprite);
CSFML_GRAPHICS_API const sfTexture* sfSprite_getTexture(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the sub-rectangle of the texture displayed by a sprite
@@ -284,7 +284,7 @@ CSFML_GRAPHICS_API const sfTexture* sfSprite_GetTexture(const sfSprite* sprite);
/// \return Texture rectangle of the sprite
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfIntRect sfSprite_GetTextureRect(const sfSprite* sprite);
CSFML_GRAPHICS_API sfIntRect sfSprite_getTextureRect(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the global color of a sprite
@@ -294,7 +294,7 @@ CSFML_GRAPHICS_API sfIntRect sfSprite_GetTextureRect(const sfSprite* sprite);
/// \return Global color of the sprite
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfSprite_GetColor(const sfSprite* sprite);
CSFML_GRAPHICS_API sfColor sfSprite_getColor(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a sprite
@@ -310,7 +310,7 @@ CSFML_GRAPHICS_API sfColor sfSprite_GetColor(const sfSprite* sprite);
/// \return Local bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfSprite_GetLocalBounds(const sfSprite* sprite);
CSFML_GRAPHICS_API sfFloatRect sfSprite_getLocalBounds(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of a sprite
@@ -326,7 +326,7 @@ CSFML_GRAPHICS_API sfFloatRect sfSprite_GetLocalBounds(const sfSprite* sprite);
/// \return Global bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfSprite_GetGlobalBounds(const sfSprite* sprite);
CSFML_GRAPHICS_API sfFloatRect sfSprite_getGlobalBounds(const sfSprite* sprite);
#endif // SFML_SPRITE_H
+39 -39
View File
@@ -54,7 +54,7 @@ typedef enum
/// \return A new sfText object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfText* sfText_Create(void);
CSFML_GRAPHICS_API sfText* sfText_create(void);
////////////////////////////////////////////////////////////
/// \brief Copy an existing text
@@ -64,7 +64,7 @@ CSFML_GRAPHICS_API sfText* sfText_Create(void);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfText* sfText_Copy(sfText* text);
CSFML_GRAPHICS_API sfText* sfText_copy(sfText* text);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing text
@@ -72,46 +72,46 @@ CSFML_GRAPHICS_API sfText* sfText_Copy(sfText* text);
/// \param text Text to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_Destroy(sfText* text);
CSFML_GRAPHICS_API void sfText_destroy(sfText* text);
////////////////////////////////////////////////////////////
/// \brief Set the position of a text
///
/// This function completely overwrites the previous position.
/// See sfText_Move to apply an offset based on the previous position instead.
/// See sfText_move to apply an offset based on the previous position instead.
/// The default position of a text Text object is (0, 0).
///
/// \param text Text object
/// \param position New position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetPosition(sfText* text, sfVector2f position);
CSFML_GRAPHICS_API void sfText_setPosition(sfText* text, sfVector2f position);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a text
///
/// This function completely overwrites the previous rotation.
/// See sfText_Rotate to add an angle based on the previous rotation instead.
/// See sfText_rotate to add an angle based on the previous rotation instead.
/// The default rotation of a text Text object is 0.
///
/// \param text Text object
/// \param angle New rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetRotation(sfText* text, float angle);
CSFML_GRAPHICS_API void sfText_setRotation(sfText* text, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the scale factors of a text
///
/// This function completely overwrites the previous scale.
/// See sfText_Scale to add a factor based on the previous scale instead.
/// See sfText_scale to add a factor based on the previous scale instead.
/// The default scale of a text Text object is (1, 1).
///
/// \param text Text object
/// \param scale New scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetScale(sfText* text, sfVector2f scale);
CSFML_GRAPHICS_API void sfText_setScale(sfText* text, sfVector2f scale);
////////////////////////////////////////////////////////////
/// \brief Set the local origin of a text
@@ -121,13 +121,13 @@ CSFML_GRAPHICS_API void sfText_SetScale(sfText* text, sfVector2f scale);
/// The coordinates of this point must be relative to the
/// top-left corner of the object, and ignore all
/// transformations (position, scale, rotation).
/// The default origin of a text Text object is (0, 0).
/// The default origin of a text object is (0, 0).
///
/// \param text Text object
/// \param origin New origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetOrigin(sfText* text, sfVector2f origin);
CSFML_GRAPHICS_API void sfText_setOrigin(sfText* text, sfVector2f origin);
////////////////////////////////////////////////////////////
/// \brief Get the position of a text
@@ -137,7 +137,7 @@ CSFML_GRAPHICS_API void sfText_SetOrigin(sfText* text, sfVector2f origin);
/// \return Current position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfText_GetPosition(const sfText* text);
CSFML_GRAPHICS_API sfVector2f sfText_getPosition(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the orientation of a text
@@ -149,7 +149,7 @@ CSFML_GRAPHICS_API sfVector2f sfText_GetPosition(const sfText* text);
/// \return Current rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfText_GetRotation(const sfText* text);
CSFML_GRAPHICS_API float sfText_getRotation(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the current scale of a text
@@ -159,7 +159,7 @@ CSFML_GRAPHICS_API float sfText_GetRotation(const sfText* text);
/// \return Current scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfText_GetScale(const sfText* text);
CSFML_GRAPHICS_API sfVector2f sfText_getScale(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the local origin of a text
@@ -169,43 +169,43 @@ CSFML_GRAPHICS_API sfVector2f sfText_GetScale(const sfText* text);
/// \return Current origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfText_GetOrigin(const sfText* text);
CSFML_GRAPHICS_API sfVector2f sfText_getOrigin(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Move a text by a given offset
///
/// This function adds to the current position of the object,
/// unlike sfText_SetPosition which overwrites it.
/// unlike sfText_setPosition which overwrites it.
///
/// \param text Text object
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_Move(sfText* text, sfVector2f offset);
CSFML_GRAPHICS_API void sfText_move(sfText* text, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a text
///
/// This function adds to the current rotation of the object,
/// unlike sfText_SetRotation which overwrites it.
/// unlike sfText_setRotation which overwrites it.
///
/// \param text Text object
/// \param angle Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_Rotate(sfText* text, float angle);
CSFML_GRAPHICS_API void sfText_rotate(sfText* text, float angle);
////////////////////////////////////////////////////////////
/// \brief Scale a text
///
/// This function multiplies the current scale of the object,
/// unlike sfText_SetScale which overwrites it.
/// unlike sfText_setScale which overwrites it.
///
/// \param text Text object
/// \param factors Scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_Scale(sfText* text, sfVector2f factors);
CSFML_GRAPHICS_API void sfText_scale(sfText* text, sfVector2f factors);
////////////////////////////////////////////////////////////
/// \brief Get the combined transform of a text
@@ -215,7 +215,7 @@ CSFML_GRAPHICS_API void sfText_Scale(sfText* text, sfVector2f factors);
/// \return Transform combining the position/rotation/scale/origin of the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfText_GetTransform(const sfText* text);
CSFML_GRAPHICS_API const sfTransform* sfText_getTransform(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the inverse of the combined transform of a text
@@ -225,7 +225,7 @@ CSFML_GRAPHICS_API const sfTransform* sfText_GetTransform(const sfText* text);
/// \return Inverse of the combined transformations applied to the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfText_GetInverseTransform(const sfText* text);
CSFML_GRAPHICS_API const sfTransform* sfText_getInverseTransform(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Set the string of a text (from an ANSI string)
@@ -236,7 +236,7 @@ CSFML_GRAPHICS_API const sfTransform* sfText_GetInverseTransform(const sfText* t
/// \param string New string
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetString(sfText* text, const char* string);
CSFML_GRAPHICS_API void sfText_setString(sfText* text, const char* string);
////////////////////////////////////////////////////////////
/// \brief Set the string of a text (from a unicode string)
@@ -245,7 +245,7 @@ CSFML_GRAPHICS_API void sfText_SetString(sfText* text, const char* string);
/// \param string New string
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetUnicodeString(sfText* text, const sfUint32* string);
CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const sfUint32* string);
////////////////////////////////////////////////////////////
/// \brief Set the font of a text
@@ -257,13 +257,13 @@ CSFML_GRAPHICS_API void sfText_SetUnicodeString(sfText* text, const sfUint32* st
/// If the font is destroyed and the text tries to
/// use it, the behaviour is undefined.
/// Texts have a valid font by default, which the built-in
/// sfFont_GetDefaultFont().
/// sfFont_getDefaultFont().
///
/// \param text Text object
/// \param font New font
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetFont(sfText* text, const sfFont* font);
CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font);
////////////////////////////////////////////////////////////
/// \brief Set the character size of a text
@@ -274,7 +274,7 @@ CSFML_GRAPHICS_API void sfText_SetFont(sfText* text, const sfFont* font);
/// \param size New character size, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetCharacterSize(sfText* text, unsigned int size);
CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size);
////////////////////////////////////////////////////////////
/// \brief Set the style of a text
@@ -287,7 +287,7 @@ CSFML_GRAPHICS_API void sfText_SetCharacterSize(sfText* text, unsigned int size)
/// \param style New style
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetStyle(sfText* text, sfUint32 style);
CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
////////////////////////////////////////////////////////////
/// \brief Set the global color of a text
@@ -298,7 +298,7 @@ CSFML_GRAPHICS_API void sfText_SetStyle(sfText* text, sfUint32 style);
/// \param color New color of the text
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_SetColor(sfText* text, sfColor color);
CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
////////////////////////////////////////////////////////////
/// \brief Get the text of a text (returns an ANSI string)
@@ -308,7 +308,7 @@ CSFML_GRAPHICS_API void sfText_SetColor(sfText* text, sfColor color);
/// \return String an a locale-dependant ANSI string
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const char* sfText_GetString(const sfText* text);
CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the string of a text (returns a unicode string)
@@ -318,7 +318,7 @@ CSFML_GRAPHICS_API const char* sfText_GetString(const sfText* text);
/// \return String as UTF-32
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfUint32* sfText_GetUnicodeString(const sfText* text);
CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the font used by a text
@@ -328,7 +328,7 @@ CSFML_GRAPHICS_API const sfUint32* sfText_GetUnicodeString(const sfText* text);
/// \return Pointer to the font
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfFont* sfText_GetFont(const sfText* text);
CSFML_GRAPHICS_API const sfFont* sfText_getFont(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the size of the characters of a text
@@ -338,7 +338,7 @@ CSFML_GRAPHICS_API const sfFont* sfText_GetFont(const sfText* text);
/// \return Size of the characters
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfText_GetCharacterSize(const sfText* text);
CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the style of a text
@@ -348,7 +348,7 @@ CSFML_GRAPHICS_API unsigned int sfText_GetCharacterSize(const sfText* text);
/// \return Current string style (see sfTextStyle enum)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfUint32 sfText_GetStyle(const sfText* text);
CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the global color of a text
@@ -358,7 +358,7 @@ CSFML_GRAPHICS_API sfUint32 sfText_GetStyle(const sfText* text);
/// \return Global color of the text
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfText_GetColor(const sfText* text);
CSFML_GRAPHICS_API sfColor sfText_getColor(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Return the position of the \a index-th character in a text
@@ -376,7 +376,7 @@ CSFML_GRAPHICS_API sfColor sfText_GetColor(const sfText* text);
/// \return Position of the character
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfText_FindCharacterPos(const sfText* text, size_t index);
CSFML_GRAPHICS_API sfVector2f sfText_findCharacterPos(const sfText* text, size_t index);
////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a text
@@ -392,7 +392,7 @@ CSFML_GRAPHICS_API sfVector2f sfText_FindCharacterPos(const sfText* text, size_t
/// \return Local bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfText_GetLocalBounds(const sfText* text);
CSFML_GRAPHICS_API sfFloatRect sfText_getLocalBounds(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Get the global bounding rectangle of a text
@@ -408,7 +408,7 @@ CSFML_GRAPHICS_API sfFloatRect sfText_GetLocalBounds(const sfText* text);
/// \return Global bounding rectangle of the entity
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfText_GetGlobalBounds(const sfText* text);
CSFML_GRAPHICS_API sfFloatRect sfText_getGlobalBounds(const sfText* text);
#endif // SFML_TEXT_H
+20 -20
View File
@@ -45,7 +45,7 @@
/// \return A new sfTexture object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTexture* sfTexture_Create(unsigned int width, unsigned int height);
CSFML_GRAPHICS_API sfTexture* sfTexture_create(unsigned int width, unsigned int height);
////////////////////////////////////////////////////////////
/// \brief Create a new texture from a file
@@ -56,7 +56,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_Create(unsigned int width, unsigned int
/// \return A new sfTexture object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromFile(const char* filename, const sfIntRect* area);
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area);
////////////////////////////////////////////////////////////
/// \brief Create a new texture from a file in memory
@@ -68,7 +68,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromFile(const char* filename, con
/// \return A new sfTexture object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area);
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area);
////////////////////////////////////////////////////////////
/// \brief Create a new texture from a custom stream
@@ -79,7 +79,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromMemory(const void* data, size_
/// \return A new sfTexture object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* area);
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area);
////////////////////////////////////////////////////////////
/// \brief Create a new texture from an image
@@ -90,7 +90,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromStream(sfInputStream* stream,
/// \return A new sfTexture object, or NULL if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area);
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area);
////////////////////////////////////////////////////////////
/// \brief Copy an existing texture
@@ -100,7 +100,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_CreateFromImage(const sfImage* image, co
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTexture* sfTexture_Copy(sfTexture* texture);
CSFML_GRAPHICS_API sfTexture* sfTexture_copy(sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing texture
@@ -108,7 +108,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_Copy(sfTexture* texture);
/// \param texture Texture to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_Destroy(sfTexture* texture);
CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Return the width of the texture
@@ -118,7 +118,7 @@ CSFML_GRAPHICS_API void sfTexture_Destroy(sfTexture* texture);
/// \return Width in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfTexture_GetWidth(const sfTexture* texture);
CSFML_GRAPHICS_API unsigned int sfTexture_getWidth(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Return the height of the texture
@@ -128,7 +128,7 @@ CSFML_GRAPHICS_API unsigned int sfTexture_GetWidth(const sfTexture* texture);
/// \return Height in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfTexture_GetHeight(const sfTexture* texture);
CSFML_GRAPHICS_API unsigned int sfTexture_getHeight(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Copy a texture's pixels to an image
@@ -138,7 +138,7 @@ CSFML_GRAPHICS_API unsigned int sfTexture_GetHeight(const sfTexture* texture);
/// \return Image containing the texture's pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfImage* sfTexture_CopyToImage(const sfTexture* texture);
CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Update a texture from an array of pixels
@@ -151,7 +151,7 @@ CSFML_GRAPHICS_API sfImage* sfTexture_CopyToImage(const sfTexture* texture);
/// \param y Y offset in the texture where to copy the source pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_UpdateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
////////////////////////////////////////////////////////////
/// \brief Update a texture from an image
@@ -162,7 +162,7 @@ CSFML_GRAPHICS_API void sfTexture_UpdateFromPixels(sfTexture* texture, const sfU
/// \param y Y offset in the texture where to copy the source pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_UpdateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y);
CSFML_GRAPHICS_API void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y);
////////////////////////////////////////////////////////////
/// \brief Update a texture from the contents of a window
@@ -173,7 +173,7 @@ CSFML_GRAPHICS_API void sfTexture_UpdateFromImage(sfTexture* texture, const sfIm
/// \param y Y offset in the texture where to copy the source pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_UpdateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y);
CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y);
////////////////////////////////////////////////////////////
/// \brief Update a texture from the contents of a render-window
@@ -184,7 +184,7 @@ CSFML_GRAPHICS_API void sfTexture_UpdateFromWindow(sfTexture* texture, const sfW
/// \param y Y offset in the texture where to copy the source pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_UpdateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
////////////////////////////////////////////////////////////
/// \brief Activate a texture for rendering
@@ -192,7 +192,7 @@ CSFML_GRAPHICS_API void sfTexture_UpdateFromRenderWindow(sfTexture* texture, con
/// \param texture Texture to bind
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_Bind(const sfTexture* texture);
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Enable or disable the smooth filter on a texture
@@ -201,7 +201,7 @@ CSFML_GRAPHICS_API void sfTexture_Bind(const sfTexture* texture);
/// \param smooth sfTrue to enable smoothing, sfFalse to disable it
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_SetSmooth(sfTexture* texture, sfBool smooth);
CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not for a texture
@@ -211,7 +211,7 @@ CSFML_GRAPHICS_API void sfTexture_SetSmooth(sfTexture* texture, sfBool smooth);
/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTexture_IsSmooth(const sfTexture* texture);
CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Enable or disable repeating for a texture
@@ -234,7 +234,7 @@ CSFML_GRAPHICS_API sfBool sfTexture_IsSmooth(const sfTexture* texture);
/// \param repeated True to repeat the texture, false to disable repeating
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_SetRepeated(sfTexture* texture, sfBool repeated);
CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeated);
////////////////////////////////////////////////////////////
/// \brief Tell whether a texture is repeated or not
@@ -244,7 +244,7 @@ CSFML_GRAPHICS_API void sfTexture_SetRepeated(sfTexture* texture, sfBool repeate
/// \return sfTrue if repeat mode is enabled, sfFalse if it is disabled
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfTexture_IsRepeated(const sfTexture* texture);
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Get the maximum texture size allowed
@@ -252,7 +252,7 @@ CSFML_GRAPHICS_API sfBool sfTexture_IsRepeated(const sfTexture* texture);
/// \return Maximum size allowed for textures, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfTexture_GetMaximumSize();
CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize();
#endif // SFML_TEXTURE_H
+26 -25
View File
@@ -31,6 +31,7 @@
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>
////////////////////////////////////////////////////////////
@@ -41,7 +42,7 @@
/// \return A new sfTransform object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTransform* sfTransform_Create(void);
CSFML_GRAPHICS_API sfTransform* sfTransform_create(void);
////////////////////////////////////////////////////////////
/// \brief Create a new transform from a matrix
@@ -59,7 +60,7 @@ CSFML_GRAPHICS_API sfTransform* sfTransform_Create(void);
/// \return A new sfTransform object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTransform* sfTransform_CreateFromMatrix(float a00, float a01, float a02,
CSFML_GRAPHICS_API sfTransform* sfTransform_createFromMatrix(float a00, float a01, float a02,
float a10, float a11, float a12,
float a20, float a21, float a22);
@@ -71,7 +72,7 @@ CSFML_GRAPHICS_API sfTransform* sfTransform_CreateFromMatrix(float a00, float a0
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTransform* sfTransform_Copy(sfTransform* transform);
CSFML_GRAPHICS_API sfTransform* sfTransform_copy(sfTransform* transform);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing transform
@@ -79,7 +80,7 @@ CSFML_GRAPHICS_API sfTransform* sfTransform_Copy(sfTransform* transform);
/// \param transform Transform to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_Destroy(sfTransform* transform);
CSFML_GRAPHICS_API void sfTransform_destroy(sfTransform* transform);
////////////////////////////////////////////////////////////
/// \brief Return the 4x4 matrix of a transform
@@ -90,7 +91,7 @@ CSFML_GRAPHICS_API void sfTransform_Destroy(sfTransform* transform);
///
/// \code
/// sfTransform* transform = ...;
/// glLoadMatrixf(sfTransform_GetMatrix(transform));
/// glLoadMatrixf(sfTransform_getMatrix(transform));
/// \endcode
///
/// \param transform Transform object
@@ -98,7 +99,7 @@ CSFML_GRAPHICS_API void sfTransform_Destroy(sfTransform* transform);
/// \return Pointer to a 4x4 matrix
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const float* sfTransform_GetMatrix(const sfTransform* transform);
CSFML_GRAPHICS_API const float* sfTransform_getMatrix(const sfTransform* transform);
////////////////////////////////////////////////////////////
/// \brief Return the inverse of a transform
@@ -110,19 +111,18 @@ CSFML_GRAPHICS_API const float* sfTransform_GetMatrix(const sfTransform* transfo
/// \param result Returned inverse matrix
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_GetInverse(const sfTransform* transform, sfTransform* result);
CSFML_GRAPHICS_API void sfTransform_getInverse(const sfTransform* transform, sfTransform* result);
////////////////////////////////////////////////////////////
/// \brief Apply a transform to a 2D point
///
/// \param transform Transform object
/// \param x X coordinate of the point to transform
/// \param y Y coordinate of the point to transform
/// \param transformedX X coordinate of the transformed point
/// \param transformedY Y coordinate of the transformed point
/// \param transform Transform object
/// \param point Point to transform
///
/// \return Transformed point
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_TransformPoint(const sfTransform* transform, float x, float y, float* transformedX, float* transformedY);
CSFML_GRAPHICS_API sfVector2f sfTransform_transformPoint(const sfTransform* transform, sfVector2f point);
////////////////////////////////////////////////////////////
/// \brief Apply a transform to a rectangle
@@ -133,12 +133,13 @@ CSFML_GRAPHICS_API void sfTransform_TransformPoint(const sfTransform* transform,
/// rotation, the bounding rectangle of the transformed rectangle
/// is returned.
///
/// \param transform Transform object
/// \param rectangle Rectangle to transform
/// \param transformedRectangle Transformed rectangle
/// \param transform Transform object
/// \param rectangle Rectangle to transform
///
/// \return Transformed rectangle
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_TransformRect(const sfTransform* transform, sfFloatRect rectangle, sfFloatRect* transformedRectangle);
CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect(const sfTransform* transform, sfFloatRect rectangle);
////////////////////////////////////////////////////////////
/// \brief Combine two transforms
@@ -151,7 +152,7 @@ CSFML_GRAPHICS_API void sfTransform_TransformRect(const sfTransform* transform,
/// \param right Transform to combine to \a transform
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_Combine(sfTransform* transform, const sfTransform* other);
CSFML_GRAPHICS_API void sfTransform_combine(sfTransform* transform, const sfTransform* other);
////////////////////////////////////////////////////////////
/// \brief Combine a transform with a translation
@@ -161,7 +162,7 @@ CSFML_GRAPHICS_API void sfTransform_Combine(sfTransform* transform, const sfTran
/// \param y Offset to apply on Y axis
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_Translate(sfTransform* transform, float x, float y);
CSFML_GRAPHICS_API void sfTransform_translate(sfTransform* transform, float x, float y);
////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a rotation
@@ -170,7 +171,7 @@ CSFML_GRAPHICS_API void sfTransform_Translate(sfTransform* transform, float x, f
/// \param angle Rotation angle, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_Rotate(sfTransform* transform, float angle);
CSFML_GRAPHICS_API void sfTransform_rotate(sfTransform* transform, float angle);
////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a rotation
@@ -178,7 +179,7 @@ CSFML_GRAPHICS_API void sfTransform_Rotate(sfTransform* transform, float angle);
/// The center of rotation is provided for convenience as a second
/// argument, so that you can build rotations around arbitrary points
/// more easily (and efficiently) than the usual
/// [Translate(-center), Rotate(angle), Translate(center)].
/// [translate(-center), rotate(angle), translate(center)].
///
/// \param transform Transform object
/// \param angle Rotation angle, in degrees
@@ -186,7 +187,7 @@ CSFML_GRAPHICS_API void sfTransform_Rotate(sfTransform* transform, float angle);
/// \param centerY Y coordinate of the center of rotation
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_RotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY);
CSFML_GRAPHICS_API void sfTransform_rotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY);
////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a scaling
@@ -196,7 +197,7 @@ CSFML_GRAPHICS_API void sfTransform_RotateWithCenter(sfTransform* transform, flo
/// \param scaleY Scaling factor on the Y axis
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_Scale(sfTransform* transform, float scaleX, float scaleY);
CSFML_GRAPHICS_API void sfTransform_scale(sfTransform* transform, float scaleX, float scaleY);
////////////////////////////////////////////////////////////
/// \brief Combine the current transform with a scaling
@@ -204,7 +205,7 @@ CSFML_GRAPHICS_API void sfTransform_Scale(sfTransform* transform, float scaleX,
/// The center of scaling is provided for convenience as a second
/// argument, so that you can build scaling around arbitrary points
/// more easily (and efficiently) than the usual
/// [Translate(-center), Scale(factors), Translate(center)]
/// [translate(-center), scale(factors), translate(center)]
///
/// \param transform Transform object
/// \param scaleX Scaling factor on X axis
@@ -213,7 +214,7 @@ CSFML_GRAPHICS_API void sfTransform_Scale(sfTransform* transform, float scaleX,
/// \param centerY Y coordinate of the center of scaling
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransform_ScaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY);
CSFML_GRAPHICS_API void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY);
#endif // SFML_TRANSFORM_H
+22 -22
View File
@@ -39,7 +39,7 @@
/// \return A new sfTransformable object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTransformable* sfTransformable_Create(void);
CSFML_GRAPHICS_API sfTransformable* sfTransformable_create(void);
////////////////////////////////////////////////////////////
/// \brief Copy an existing transformable
@@ -49,7 +49,7 @@ CSFML_GRAPHICS_API sfTransformable* sfTransformable_Create(void);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfTransformable* sfTransformable_Copy(sfTransformable* transformable);
CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy(sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing transformable
@@ -57,46 +57,46 @@ CSFML_GRAPHICS_API sfTransformable* sfTransformable_Copy(sfTransformable* transf
/// \param transformable Transformable to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_Destroy(sfTransformable* transformable);
CSFML_GRAPHICS_API void sfTransformable_destroy(sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Set the position of a transformable
///
/// This function completely overwrites the previous position.
/// See sfTransformable_Move to apply an offset based on the previous position instead.
/// See sfTransformable_move to apply an offset based on the previous position instead.
/// The default position of a transformable Transformable object is (0, 0).
///
/// \param transformable Transformable object
/// \param position New position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_SetPosition(sfTransformable* transformable, sfVector2f position);
CSFML_GRAPHICS_API void sfTransformable_setPosition(sfTransformable* transformable, sfVector2f position);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a transformable
///
/// This function completely overwrites the previous rotation.
/// See sfTransformable_Rotate to add an angle based on the previous rotation instead.
/// See sfTransformable_rotate to add an angle based on the previous rotation instead.
/// The default rotation of a transformable Transformable object is 0.
///
/// \param transformable Transformable object
/// \param angle New rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_SetRotation(sfTransformable* transformable, float angle);
CSFML_GRAPHICS_API void sfTransformable_setRotation(sfTransformable* transformable, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the scale factors of a transformable
///
/// This function completely overwrites the previous scale.
/// See sfTransformable_Scale to add a factor based on the previous scale instead.
/// See sfTransformable_scale to add a factor based on the previous scale instead.
/// The default scale of a transformable Transformable object is (1, 1).
///
/// \param transformable Transformable object
/// \param scale New scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_SetScale(sfTransformable* transformable, sfVector2f scale);
CSFML_GRAPHICS_API void sfTransformable_setScale(sfTransformable* transformable, sfVector2f scale);
////////////////////////////////////////////////////////////
/// \brief Set the local origin of a transformable
@@ -112,7 +112,7 @@ CSFML_GRAPHICS_API void sfTransformable_SetScale(sfTransformable* transformable,
/// \param origin New origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_SetOrigin(sfTransformable* transformable, sfVector2f origin);
CSFML_GRAPHICS_API void sfTransformable_setOrigin(sfTransformable* transformable, sfVector2f origin);
////////////////////////////////////////////////////////////
/// \brief Get the position of a transformable
@@ -122,7 +122,7 @@ CSFML_GRAPHICS_API void sfTransformable_SetOrigin(sfTransformable* transformable
/// \return Current position
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfTransformable_GetPosition(const sfTransformable* transformable);
CSFML_GRAPHICS_API sfVector2f sfTransformable_getPosition(const sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Get the orientation of a transformable
@@ -134,7 +134,7 @@ CSFML_GRAPHICS_API sfVector2f sfTransformable_GetPosition(const sfTransformable*
/// \return Current rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfTransformable_GetRotation(const sfTransformable* transformable);
CSFML_GRAPHICS_API float sfTransformable_getRotation(const sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Get the current scale of a transformable
@@ -144,7 +144,7 @@ CSFML_GRAPHICS_API float sfTransformable_GetRotation(const sfTransformable* tran
/// \return Current scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfTransformable_GetScale(const sfTransformable* transformable);
CSFML_GRAPHICS_API sfVector2f sfTransformable_getScale(const sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Get the local origin of a transformable
@@ -154,43 +154,43 @@ CSFML_GRAPHICS_API sfVector2f sfTransformable_GetScale(const sfTransformable* tr
/// \return Current origin
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfTransformable_GetOrigin(const sfTransformable* transformable);
CSFML_GRAPHICS_API sfVector2f sfTransformable_getOrigin(const sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Move a transformable by a given offset
///
/// This function adds to the current position of the object,
/// unlike sfTransformable_SetPosition which overwrites it.
/// unlike sfTransformable_setPosition which overwrites it.
///
/// \param transformable Transformable object
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_Move(sfTransformable* transformable, sfVector2f offset);
CSFML_GRAPHICS_API void sfTransformable_move(sfTransformable* transformable, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a transformable
///
/// This function adds to the current rotation of the object,
/// unlike sfTransformable_SetRotation which overwrites it.
/// unlike sfTransformable_setRotation which overwrites it.
///
/// \param transformable Transformable object
/// \param angle Angle of rotation, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_Rotate(sfTransformable* transformable, float angle);
CSFML_GRAPHICS_API void sfTransformable_rotate(sfTransformable* transformable, float angle);
////////////////////////////////////////////////////////////
/// \brief Scale a transformable
///
/// This function multiplies the current scale of the object,
/// unlike sfTransformable_SetScale which overwrites it.
/// unlike sfTransformable_setScale which overwrites it.
///
/// \param transformable Transformable object
/// \param factors Scale factors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_Scale(sfTransformable* transformable, sfVector2f factors);
CSFML_GRAPHICS_API void sfTransformable_scale(sfTransformable* transformable, sfVector2f factors);
////////////////////////////////////////////////////////////
/// \brief Get the combined transform of a transformable
@@ -200,7 +200,7 @@ CSFML_GRAPHICS_API void sfTransformable_Scale(sfTransformable* transformable, sf
/// \return Transform combining the position/rotation/scale/origin of the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfTransformable_GetTransform(const sfTransformable* transformable);
CSFML_GRAPHICS_API const sfTransform* sfTransformable_getTransform(const sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Get the inverse of the combined transform of a transformable
@@ -210,7 +210,7 @@ CSFML_GRAPHICS_API const sfTransform* sfTransformable_GetTransform(const sfTrans
/// \return Inverse of the combined transformations applied to the object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API const sfTransform* sfTransformable_GetInverseTransform(const sfTransformable* transformable);
CSFML_GRAPHICS_API const sfTransform* sfTransformable_getInverseTransform(const sfTransformable* transformable);
#endif // SFML_TRANSFORMABLE_H
+4 -5
View File
@@ -30,6 +30,7 @@
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/System/Vector2.h>
////////////////////////////////////////////////////////////
@@ -37,11 +38,9 @@
////////////////////////////////////////////////////////////
typedef struct
{
float X; ///< X coordinate of the position of the vertex
float Y; ///< Y coordinate of the position of the vertex
sfColor Color; ///< Color of the vertex
float TexCoordX; ///< X coordinate of the texture's pixel to map to the vertex
float TexCoordY; ///< Y coordinate of the texture's pixel to map to the vertex
sfVector2f position; ///< Position of the vertex
sfColor color; ///< Color of the vertex
sfVector2f texCoords; ///< Coordinates of the texture's pixel to map to the vertex
} sfVertex;
+11 -11
View File
@@ -41,7 +41,7 @@
/// \return A new sfVertexArray object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_Create(void);
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_create(void);
////////////////////////////////////////////////////////////
/// \brief Copy an existing vertex array
@@ -51,7 +51,7 @@ CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_Create(void);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVertexArray* sfTransform_Copy(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy(sfVertexArray* vertexArray);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing vertex array
@@ -59,7 +59,7 @@ CSFML_GRAPHICS_API sfVertexArray* sfTransform_Copy(sfVertexArray* vertexArray);
/// \param vertexArray Vertex array to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_Destroy(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API void sfVertexArray_destroy(sfVertexArray* vertexArray);
////////////////////////////////////////////////////////////
/// \brief Return the vertex count of a vertex array
@@ -69,7 +69,7 @@ CSFML_GRAPHICS_API void sfVertexArray_Destroy(sfVertexArray* vertexArray);
/// \return Number of vertices in the array
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfVertexArray_GetVertexCount(const sfVertexArray* vertexArray);
CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray);
////////////////////////////////////////////////////////////
/// \brief Get access to a vertex by its index
@@ -84,7 +84,7 @@ CSFML_GRAPHICS_API unsigned int sfVertexArray_GetVertexCount(const sfVertexArray
/// \return Pointer to the index-th vertex
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVertex* sfVertexArray_GetVertex(sfVertexArray* vertexArray, unsigned int index);
CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index);
////////////////////////////////////////////////////////////
/// \brief Clear a vertex array
@@ -97,7 +97,7 @@ CSFML_GRAPHICS_API sfVertex* sfVertexArray_GetVertex(sfVertexArray* vertexArray,
/// \param vertexArray Vertex array object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_Clear(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API void sfVertexArray_clear(sfVertexArray* vertexArray);
////////////////////////////////////////////////////////////
/// \brief Resize the vertex array
@@ -112,7 +112,7 @@ CSFML_GRAPHICS_API void sfVertexArray_Clear(sfVertexArray* vertexArray);
/// \param vertexCount New size of the array (number of vertices)
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_Resize(sfVertexArray* vertexArray, unsigned int vertexCount);
CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount);
////////////////////////////////////////////////////////////
/// \brief Add a vertex to a vertex array array
@@ -121,7 +121,7 @@ CSFML_GRAPHICS_API void sfVertexArray_Resize(sfVertexArray* vertexArray, unsigne
/// \param vertex Vertex to add
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_Append(sfVertexArray* vertexArray, sfVertex vertex);
CSFML_GRAPHICS_API void sfVertexArray_append(sfVertexArray* vertexArray, sfVertex vertex);
////////////////////////////////////////////////////////////
/// \brief Set the type of primitives of a vertex array
@@ -138,7 +138,7 @@ CSFML_GRAPHICS_API void sfVertexArray_Append(sfVertexArray* vertexArray, sfVerte
/// \param type Type of primitive
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_SetPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type);
CSFML_GRAPHICS_API void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type);
////////////////////////////////////////////////////////////
/// \brief Get the type of primitives drawn by a vertex array
@@ -148,7 +148,7 @@ CSFML_GRAPHICS_API void sfVertexArray_SetPrimitiveType(sfVertexArray* vertexArra
/// \return Primitive type
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_GetPrimitiveType(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray);
////////////////////////////////////////////////////////////
/// \brief Compute the bounding rectangle of a vertex array
@@ -161,7 +161,7 @@ CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_GetPrimitiveType(sfVertexArray*
/// \return Bounding rectangle of the vertex array
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfVertexArray_GetBounds(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray);
#endif // SFML_VERTEXARRAY_H
+17 -17
View File
@@ -42,7 +42,7 @@
/// \return A new sfView object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfView* sfView_Create(void);
CSFML_GRAPHICS_API sfView* sfView_create(void);
////////////////////////////////////////////////////////////
/// \brief Construct a view from a rectangle
@@ -52,7 +52,7 @@ CSFML_GRAPHICS_API sfView* sfView_Create(void);
/// \return A new sfView object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfView* sfView_CreateFromRect(sfFloatRect rectangle);
CSFML_GRAPHICS_API sfView* sfView_createFromRect(sfFloatRect rectangle);
////////////////////////////////////////////////////////////
/// \brief Copy an existing view
@@ -62,7 +62,7 @@ CSFML_GRAPHICS_API sfView* sfView_CreateFromRect(sfFloatRect rectangle);
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfView* sfView_Copy(sfView* view);
CSFML_GRAPHICS_API sfView* sfView_copy(sfView* view);
////////////////////////////////////////////////////////////
/// \brief Destroy an existing view
@@ -70,7 +70,7 @@ CSFML_GRAPHICS_API sfView* sfView_Copy(sfView* view);
/// \param view View to destroy
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_Destroy(sfView* view);
CSFML_GRAPHICS_API void sfView_destroy(sfView* view);
////////////////////////////////////////////////////////////
/// \brief Set the center of a view
@@ -79,7 +79,7 @@ CSFML_GRAPHICS_API void sfView_Destroy(sfView* view);
/// \param center New center
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_SetCenter(sfView* view, sfVector2f center);
CSFML_GRAPHICS_API void sfView_setCenter(sfView* view, sfVector2f center);
////////////////////////////////////////////////////////////
/// \brief Set the size of a view
@@ -88,7 +88,7 @@ CSFML_GRAPHICS_API void sfView_SetCenter(sfView* view, sfVector2f center);
/// \param size New size of the view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_SetSize(sfView* view, sfVector2f size);
CSFML_GRAPHICS_API void sfView_setSize(sfView* view, sfVector2f size);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of a view
@@ -99,14 +99,14 @@ CSFML_GRAPHICS_API void sfView_SetSize(sfView* view, sfVector2f size);
/// \param angle New angle, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_SetRotation(sfView* view, float angle);
CSFML_GRAPHICS_API void sfView_setRotation(sfView* view, float angle);
////////////////////////////////////////////////////////////
/// \brief Set the target viewport of a view
///
/// The viewport is the rectangle into which the contents of the
/// view are displayed, expressed as a factor (between 0 and 1)
/// of the size of the RenderTarget to which the view is applied.
/// of the size of the render target to which the view is applied.
/// For example, a view which takes the left side of the target would
/// be defined by a rect of (0, 0, 0.5, 1).
/// By default, a view has a viewport which covers the entire target.
@@ -115,7 +115,7 @@ CSFML_GRAPHICS_API void sfView_SetRotation(sfView* view, float angle);
/// \param viewport New viewport rectangle
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_SetViewport(sfView* view, sfFloatRect viewport);
CSFML_GRAPHICS_API void sfView_setViewport(sfView* view, sfFloatRect viewport);
////////////////////////////////////////////////////////////
/// \brief Reset a view to the given rectangle
@@ -126,7 +126,7 @@ CSFML_GRAPHICS_API void sfView_SetViewport(sfView* view, sfFloatRect viewport);
/// \param rectangle Rectangle defining the zone to display
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_Reset(sfView* view, sfFloatRect rectangle);
CSFML_GRAPHICS_API void sfView_reset(sfView* view, sfFloatRect rectangle);
////////////////////////////////////////////////////////////
/// \brief Get the center of a view
@@ -136,7 +136,7 @@ CSFML_GRAPHICS_API void sfView_Reset(sfView* view, sfFloatRect rectangle);
/// \return Center of the view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfView_GetCenter(const sfView* view);
CSFML_GRAPHICS_API sfVector2f sfView_getCenter(const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Get the size of a view
@@ -146,7 +146,7 @@ CSFML_GRAPHICS_API sfVector2f sfView_GetCenter(const sfView* view);
/// \return Size of the view
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfView_GetSize(const sfView* view);
CSFML_GRAPHICS_API sfVector2f sfView_getSize(const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Get the current orientation of a view
@@ -156,7 +156,7 @@ CSFML_GRAPHICS_API sfVector2f sfView_GetSize(const sfView* view);
/// \return Rotation angle of the view, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API float sfView_GetRotation(const sfView* view);
CSFML_GRAPHICS_API float sfView_getRotation(const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Get the target viewport rectangle of a view
@@ -166,7 +166,7 @@ CSFML_GRAPHICS_API float sfView_GetRotation(const sfView* view);
/// \return Viewport rectangle, expressed as a factor of the target size
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfFloatRect sfView_GetViewport(const sfView* view);
CSFML_GRAPHICS_API sfFloatRect sfView_getViewport(const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Move a view relatively to its current position
@@ -175,7 +175,7 @@ CSFML_GRAPHICS_API sfFloatRect sfView_GetViewport(const sfView* view);
/// \param offset Offset
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_Move(sfView* view, sfVector2f offset);
CSFML_GRAPHICS_API void sfView_move(sfView* view, sfVector2f offset);
////////////////////////////////////////////////////////////
/// \brief Rotate a view relatively to its current orientation
@@ -184,7 +184,7 @@ CSFML_GRAPHICS_API void sfView_Move(sfView* view, sfVector2f offset);
/// \param angle Angle to rotate, in degrees
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_Rotate(sfView* view, float angle);
CSFML_GRAPHICS_API void sfView_rotate(sfView* view, float angle);
////////////////////////////////////////////////////////////
/// \brief Resize a view rectangle relatively to its current size
@@ -200,7 +200,7 @@ CSFML_GRAPHICS_API void sfView_Rotate(sfView* view, float angle);
/// \param factor Zoom factor to apply
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_Zoom(sfView* view, float factor);
CSFML_GRAPHICS_API void sfView_zoom(sfView* view, float factor);
#endif // SFML_VIEW_H
+32 -32
View File
@@ -119,7 +119,7 @@ enum sfFtpStatus
/// \param ftpListingResponse Ftp listing response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Check if a FTP listing response status code means a success
@@ -132,7 +132,7 @@ CSFML_NETWORK_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpLis
/// \return sfTrue if the status is a success, sfFalse if it is a failure
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfFtpListingResponse_IsOk(const sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a FTP listing response
@@ -142,7 +142,7 @@ CSFML_NETWORK_API sfBool sfFtpListingResponse_IsOk(const sfFtpListingResponse* f
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_GetStatus(const sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_getStatus(const sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Get the full message contained in a FTP listing response
@@ -152,7 +152,7 @@ CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_GetStatus(const sfFtpListingR
/// \return The response message
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfFtpListingResponse_GetMessage(const sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Return the number of filenames contained in a FTP listing response
@@ -162,7 +162,7 @@ CSFML_NETWORK_API const char* sfFtpListingResponse_GetMessage(const sfFtpListing
/// \return Total number of filenames available
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API size_t sfFtpListingResponse_GetCount(const sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Return a filename contained in a FTP listing response
@@ -173,7 +173,7 @@ CSFML_NETWORK_API size_t sfFtpListingResponse_GetCount(const sfFtpListingRespons
/// \return Array containing the requested filenames
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfFtpListingResponse_GetFilename(const sfFtpListingResponse* ftpListingResponse, size_t index);
CSFML_NETWORK_API const char* sfFtpListingResponse_getFilename(const sfFtpListingResponse* ftpListingResponse, size_t index);
////////////////////////////////////////////////////////////
/// \brief Destroy a FTP directory response
@@ -181,7 +181,7 @@ CSFML_NETWORK_API const char* sfFtpListingResponse_GetFilename(const sfFtpListin
/// \param ftpDirectoryResponse Ftp directory response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// \brief Check if a FTP directory response status code means a success
@@ -194,7 +194,7 @@ CSFML_NETWORK_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ft
/// \return sfTrue if the status is a success, sfFalse if it is a failure
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_IsOk(const sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a FTP directory response
@@ -204,7 +204,7 @@ CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_IsOk(const sfFtpDirectoryRespons
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API sfFtpStatus sfFtpDirectoryResponse_getStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// \brief Get the full message contained in a FTP directory response
@@ -214,7 +214,7 @@ CSFML_NETWORK_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(const sfFtpDirect
/// \return The response message
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_GetMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// \brief Get the directory returned in a FTP directory response
@@ -224,7 +224,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_GetMessage(const sfFtpDirec
/// \return Directory name
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_GetDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
@@ -233,7 +233,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_GetDirectory(const sfFtpDir
/// \param ftpResponse Ftp response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse);
CSFML_NETWORK_API void sfFtpResponse_destroy(sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// \brief Check if a FTP response status code means a success
@@ -246,7 +246,7 @@ CSFML_NETWORK_API void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse);
/// \return sfTrue if the status is a success, sfFalse if it is a failure
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfFtpResponse_IsOk(const sfFtpResponse* ftpResponse);
CSFML_NETWORK_API sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a FTP response
@@ -256,7 +256,7 @@ CSFML_NETWORK_API sfBool sfFtpResponse_IsOk(const sfFtpResponse* ftpResponse);
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpStatus sfFtpResponse_GetStatus(const sfFtpResponse* ftpResponse);
CSFML_NETWORK_API sfFtpStatus sfFtpResponse_getStatus(const sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the full message contained in a FTP response
@@ -266,7 +266,7 @@ CSFML_NETWORK_API sfFtpStatus sfFtpResponse_GetStatus(const sfFtpResponse* ftpRe
/// \return The response message
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfFtpResponse_GetMessage(const sfFtpResponse* ftpResponse);
CSFML_NETWORK_API const char* sfFtpResponse_getMessage(const sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// \brief Create a new Ftp object
@@ -274,7 +274,7 @@ CSFML_NETWORK_API const char* sfFtpResponse_GetMessage(const sfFtpResponse* ftpR
/// \return A new sfFtp object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtp* sfFtp_Create(void);
CSFML_NETWORK_API sfFtp* sfFtp_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a Ftp object
@@ -282,7 +282,7 @@ CSFML_NETWORK_API sfFtp* sfFtp_Create(void);
/// \param ftp Ftp object to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtp_Destroy(sfFtp* ftp);
CSFML_NETWORK_API void sfFtp_destroy(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Connect to the specified FTP server
@@ -304,7 +304,7 @@ CSFML_NETWORK_API void sfFtp_Destroy(sfFtp* ftp);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfUint32 timeout);
CSFML_NETWORK_API sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfUint32 timeout);
////////////////////////////////////////////////////////////
/// \brief Log in using an anonymous account
@@ -317,7 +317,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, u
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp);
CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Log in using a username and a password
@@ -332,7 +332,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, const char* password);
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password);
////////////////////////////////////////////////////////////
/// \brief Close the connection with the server
@@ -342,7 +342,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, c
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp);
CSFML_NETWORK_API sfFtpResponse* sfFtp_disconnect(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Send a null command to keep the connection alive
@@ -355,7 +355,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp);
CSFML_NETWORK_API sfFtpResponse* sfFtp_keepAlive(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Get the current working directory
@@ -368,7 +368,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp);
CSFML_NETWORK_API sfFtpDirectoryResponse* sfFtp_getWorkingDirectory(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Get the contents of the given directory
@@ -384,7 +384,7 @@ CSFML_NETWORK_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, const char* directory);
CSFML_NETWORK_API sfFtpListingResponse* sfFtp_getDirectoryListing(sfFtp* ftp, const char* directory);
////////////////////////////////////////////////////////////
/// \brief Change the current working directory
@@ -397,7 +397,7 @@ CSFML_NETWORK_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, co
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* directory);
CSFML_NETWORK_API sfFtpResponse* sfFtp_changeDirectory(sfFtp* ftp, const char* directory);
////////////////////////////////////////////////////////////
/// \brief Go to the parent directory of the current one
@@ -407,7 +407,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* d
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp);
CSFML_NETWORK_API sfFtpResponse* sfFtp_parentDirectory(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Create a new directory
@@ -421,7 +421,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_CreateDirectory(sfFtp* ftp, const char* name);
CSFML_NETWORK_API sfFtpResponse* sfFtp_createDirectory(sfFtp* ftp, const char* name);
////////////////////////////////////////////////////////////
/// \brief Remove an existing directory
@@ -437,7 +437,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_CreateDirectory(sfFtp* ftp, const char* n
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* name);
CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteDirectory(sfFtp* ftp, const char* name);
////////////////////////////////////////////////////////////
/// \brief Rename an existing file
@@ -452,7 +452,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* n
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file, const char* newName);
CSFML_NETWORK_API sfFtpResponse* sfFtp_renameFile(sfFtp* ftp, const char* file, const char* newName);
////////////////////////////////////////////////////////////
/// \brief Remove an existing file
@@ -468,7 +468,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file,
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name);
CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name);
////////////////////////////////////////////////////////////
/// \brief Download a file from a FTP server
@@ -486,7 +486,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name);
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
////////////////////////////////////////////////////////////
/// \brief Upload a file to a FTP server
@@ -504,7 +504,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantF
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfFtpResponse* sfFtp_Upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
#endif // SFML_FTP_H
+17 -17
View File
@@ -87,7 +87,7 @@ enum sfHttpStatus
/// \return A new sfHttpRequest object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_Create(void);
CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a HTTP request
@@ -95,7 +95,7 @@ CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_Create(void);
/// \param httpRequest HTTP request to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_Destroy(sfHttpRequest* httpRequest);
CSFML_NETWORK_API void sfHttpRequest_destroy(sfHttpRequest* httpRequest);
////////////////////////////////////////////////////////////
/// \brief Set the value of a header field of a HTTP request
@@ -111,7 +111,7 @@ CSFML_NETWORK_API void sfHttpRequest_Destroy(sfHttpRequest* httpRequest);
/// \param value Value of the field
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const char* field, const char* value);
CSFML_NETWORK_API void sfHttpRequest_setField(sfHttpRequest* httpRequest, const char* field, const char* value);
////////////////////////////////////////////////////////////
/// \brief Set a HTTP request method
@@ -124,7 +124,7 @@ CSFML_NETWORK_API void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const
/// \param method Method to use for the request
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHttpMethod method);
CSFML_NETWORK_API void sfHttpRequest_setMethod(sfHttpRequest* httpRequest, sfHttpMethod method);
////////////////////////////////////////////////////////////
/// \brief Set a HTTP request URI
@@ -137,7 +137,7 @@ CSFML_NETWORK_API void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHtt
/// \param uri URI to request, relative to the host
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_SetUri(sfHttpRequest* httpRequest, const char* uri);
CSFML_NETWORK_API void sfHttpRequest_setUri(sfHttpRequest* httpRequest, const char* uri);
////////////////////////////////////////////////////////////
/// \brief Set the HTTP version of a HTTP request
@@ -149,7 +149,7 @@ CSFML_NETWORK_API void sfHttpRequest_SetUri(sfHttpRequest* httpRequest, const ch
/// \param minor Minor HTTP version number
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor);
CSFML_NETWORK_API void sfHttpRequest_setHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor);
////////////////////////////////////////////////////////////
/// \brief Set the body of a HTTP request
@@ -162,7 +162,7 @@ CSFML_NETWORK_API void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest,
/// \param body Content of the body
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const char* body);
CSFML_NETWORK_API void sfHttpRequest_setBody(sfHttpRequest* httpRequest, const char* body);
////////////////////////////////////////////////////////////
/// \brief Destroy a HTTP response
@@ -170,7 +170,7 @@ CSFML_NETWORK_API void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const c
/// \param httpResponse HTTP response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpResponse_Destroy(sfHttpResponse* httpResponse);
CSFML_NETWORK_API void sfHttpResponse_destroy(sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the value of a field of a HTTP response
@@ -185,7 +185,7 @@ CSFML_NETWORK_API void sfHttpResponse_Destroy(sfHttpResponse* httpResponse);
/// \return Value of the field, or empty string if not found
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfHttpResponse_GetField(const sfHttpResponse* httpResponse, const char* field);
CSFML_NETWORK_API const char* sfHttpResponse_getField(const sfHttpResponse* httpResponse, const char* field);
////////////////////////////////////////////////////////////
/// \brief Get the status code of a HTTP reponse
@@ -200,7 +200,7 @@ CSFML_NETWORK_API const char* sfHttpResponse_GetField(const sfHttpResponse* http
/// \return Status code of the response
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfHttpStatus sfHttpResponse_GetStatus(const sfHttpResponse* httpResponse);
CSFML_NETWORK_API sfHttpStatus sfHttpResponse_getStatus(const sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the major HTTP version number of a HTTP response
@@ -210,7 +210,7 @@ CSFML_NETWORK_API sfHttpStatus sfHttpResponse_GetStatus(const sfHttpResponse* ht
/// \return Major HTTP version number
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned int sfHttpResponse_GetMajorVersion(const sfHttpResponse* httpResponse);
CSFML_NETWORK_API unsigned int sfHttpResponse_getMajorVersion(const sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the minor HTTP version number of a HTTP response
@@ -220,7 +220,7 @@ CSFML_NETWORK_API unsigned int sfHttpResponse_GetMajorVersion(const sfHttpRespon
/// \return Minor HTTP version number
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned int sfHttpResponse_GetMinorVersion(const sfHttpResponse* httpResponse);
CSFML_NETWORK_API unsigned int sfHttpResponse_getMinorVersion(const sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the body of a HTTP response
@@ -236,7 +236,7 @@ CSFML_NETWORK_API unsigned int sfHttpResponse_GetMinorVersion(const sfHttpRespon
/// \return The response body
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfHttpResponse_GetBody(const sfHttpResponse* httpResponse);
CSFML_NETWORK_API const char* sfHttpResponse_getBody(const sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// \brief Create a new Http object
@@ -244,7 +244,7 @@ CSFML_NETWORK_API const char* sfHttpResponse_GetBody(const sfHttpResponse* httpR
/// \return A new sfHttp object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfHttp* sfHttp_Create(void);
CSFML_NETWORK_API sfHttp* sfHttp_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a Http object
@@ -252,7 +252,7 @@ CSFML_NETWORK_API sfHttp* sfHttp_Create(void);
/// \param http Http object to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttp_Destroy(sfHttp* http);
CSFML_NETWORK_API void sfHttp_destroy(sfHttp* http);
////////////////////////////////////////////////////////////
/// \brief Set the target host of a HTTP object
@@ -270,7 +270,7 @@ CSFML_NETWORK_API void sfHttp_Destroy(sfHttp* http);
/// \param port Port to use for connection
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port);
CSFML_NETWORK_API void sfHttp_setHost(sfHttp* http, const char* host, unsigned short port);
////////////////////////////////////////////////////////////
/// \brief Send a HTTP request and return the server's response.
@@ -291,7 +291,7 @@ CSFML_NETWORK_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned s
/// \return Server's response
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout);
CSFML_NETWORK_API sfHttpResponse* sfHttp_sendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout);
#endif // SFML_HTTP_H
+29 -35
View File
@@ -38,10 +38,28 @@
////////////////////////////////////////////////////////////
typedef struct
{
char Address[16];
char address[16];
} sfIpAddress;
////////////////////////////////////////////////////////////
/// \brief Empty object that represents invalid addresses
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_None;
////////////////////////////////////////////////////////////
/// \brief Local host IP address (127.0.0.1, or "localhost")
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_LocalHost;
////////////////////////////////////////////////////////////
/// \brief UDP broadcast address (255.255.255.255)
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_Broadcast;
////////////////////////////////////////////////////////////
/// \brief Create an address from a string
///
@@ -53,13 +71,13 @@ typedef struct
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_FromString(const char* address);
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromString(const char* address);
////////////////////////////////////////////////////////////
/// \brief Create an address from 4 bytes
///
/// Calling sfIpAddress_FromBytes(a, b, c, d) is equivalent
/// to calling sfIpAddress_FromString("a.b.c.d"), but safer
/// Calling sfIpAddress_fromBytes(a, b, c, d) is equivalent
/// to calling sfIpAddress_fromString("a.b.c.d"), but safer
/// as it doesn't have to parse a string to get the address
/// components.
///
@@ -71,7 +89,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_FromString(const char* address);
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3);
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3);
////////////////////////////////////////////////////////////
/// \brief Construct an address from a 32-bits integer
@@ -86,7 +104,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_FromBytes(sfUint8 byte0, sfUint8 byte1
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_FromInteger(sfUint32 address);
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address);
////////////////////////////////////////////////////////////
/// \brief Get a string representation of an address
@@ -100,7 +118,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_FromInteger(sfUint32 address);
/// \return String representation of the address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfIpAddress_ToString(sfIpAddress address, char* string);
CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string);
////////////////////////////////////////////////////////////
/// \brief Get an integer representation of the address
@@ -116,7 +134,7 @@ CSFML_NETWORK_API void sfIpAddress_ToString(sfIpAddress address, char* string);
/// \return 32-bits unsigned integer representation of the address
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfUint32 sfIpAddress_ToInteger(sfIpAddress address);
CSFML_NETWORK_API sfUint32 sfIpAddress_toInteger(sfIpAddress address);
////////////////////////////////////////////////////////////
/// \brief Get the computer's local address
@@ -124,13 +142,13 @@ CSFML_NETWORK_API sfUint32 sfIpAddress_ToInteger(sfIpAddress address);
/// The local address is the address of the computer from the
/// LAN point of view, i.e. something like 192.168.1.56. It is
/// meaningful only for communications over the local network.
/// Unlike sfIpAddress_GetPublicAddress, this function is fast
/// Unlike sfIpAddress_getPublicAddress, this function is fast
/// and may be used safely anywhere.
///
/// \return Local IP address of the computer
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_GetLocalAddress(void);
CSFML_NETWORK_API sfIpAddress sfIpAddress_getLocalAddress(void);
////////////////////////////////////////////////////////////
/// \brief Get the computer's public address
@@ -152,31 +170,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_GetLocalAddress(void);
/// \return Public IP address of the computer
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_GetPublicAddress(sfTime timeout);
////////////////////////////////////////////////////////////
/// \brief Get the empty/invalid address
///
/// \return Empty object that represents invalid addresses
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_None(void);
////////////////////////////////////////////////////////////
/// \brief Get the computer's loopback address
///
/// \return Local host IP address (127.0.0.1, or "localhost")
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_LocalHost(void);
////////////////////////////////////////////////////////////
/// \brief Get the UDP broadcast address
///
/// \return Broadcast IP address (255.255.255.255)
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfIpAddress_Broadcast(void);
CSFML_NETWORK_API sfIpAddress sfIpAddress_getPublicAddress(sfTime timeout);
#endif // SFML_IPADDRESS_H
+32 -32
View File
@@ -39,7 +39,7 @@
/// \return A new sfPacket object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfPacket* sfPacket_Create(void);
CSFML_NETWORK_API sfPacket* sfPacket_create(void);
////////////////////////////////////////////////////////////
/// \brief Create a new packet by copying an existing one
@@ -49,7 +49,7 @@ CSFML_NETWORK_API sfPacket* sfPacket_Create(void);
/// \return A new sfPacket object which is a copy of \a packet
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfPacket* sfPacket_Copy(sfPacket* packet);
CSFML_NETWORK_API sfPacket* sfPacket_copy(sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Destroy a packet
@@ -57,7 +57,7 @@ CSFML_NETWORK_API sfPacket* sfPacket_Copy(sfPacket* packet);
/// \param packet Packet to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfPacket_Destroy(sfPacket* packet);
CSFML_NETWORK_API void sfPacket_destroy(sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Append data to the end of a packet
@@ -67,7 +67,7 @@ CSFML_NETWORK_API void sfPacket_Destroy(sfPacket* packet);
/// \param sizeInBytes Number of bytes to append
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfPacket_Append(sfPacket* packet, const void* data, size_t sizeInBytes);
CSFML_NETWORK_API void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Clear a packet
@@ -77,7 +77,7 @@ CSFML_NETWORK_API void sfPacket_Append(sfPacket* packet, const void* data, size_
/// \param packet Packet object
///
///////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfPacket_Clear(sfPacket* packet);
CSFML_NETWORK_API void sfPacket_clear(sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Get a pointer to the data contained in a packet
@@ -92,20 +92,20 @@ CSFML_NETWORK_API void sfPacket_Clear(sfPacket* packet);
/// \return Pointer to the data
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfPacket_GetData(const sfPacket* packet);
CSFML_NETWORK_API const char* sfPacket_getData(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Get the size of the data contained in a packet
///
/// This function returns the number of bytes pointed to by
/// what sfPacket_GetData returns.
/// what sfPacket_getData returns.
///
/// \param packet Packet object
///
/// \return Data size, in bytes
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API size_t sfPacket_GetDataSize(const sfPacket* packet);
CSFML_NETWORK_API size_t sfPacket_getDataSize(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Tell if the reading position has reached the
@@ -119,7 +119,7 @@ CSFML_NETWORK_API size_t sfPacket_GetDataSize(const sfPacket* packet);
/// \return sfTrue if all data was read, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfPacket_EndOfPacket(const sfPacket* packet);
CSFML_NETWORK_API sfBool sfPacket_endOfPacket(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Test the validity of a packet, for reading
@@ -135,7 +135,7 @@ CSFML_NETWORK_API sfBool sfPacket_EndOfPacket(const sfPacket* packet);
/// \return sfTrue if last data extraction from packet was successful
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfPacket_CanRead(const sfPacket* packet);
CSFML_NETWORK_API sfBool sfPacket_canRead(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Functions to extract data from a packet
@@ -143,17 +143,17 @@ CSFML_NETWORK_API sfBool sfPacket_CanRead(const sfPacket* packet);
/// \param packet Packet object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfPacket_ReadBool(sfPacket* packet);
CSFML_NETWORK_API sfInt8 sfPacket_ReadInt8(sfPacket* packet);
CSFML_NETWORK_API sfUint8 sfPacket_ReadUint8(sfPacket* packet);
CSFML_NETWORK_API sfInt16 sfPacket_ReadInt16(sfPacket* packet);
CSFML_NETWORK_API sfUint16 sfPacket_ReadUint16(sfPacket* packet);
CSFML_NETWORK_API sfInt32 sfPacket_ReadInt32(sfPacket* packet);
CSFML_NETWORK_API sfUint32 sfPacket_ReadUint32(sfPacket* packet);
CSFML_NETWORK_API float sfPacket_ReadFloat(sfPacket* packet);
CSFML_NETWORK_API double sfPacket_ReadDouble(sfPacket* packet);
CSFML_NETWORK_API void sfPacket_ReadString(sfPacket* packet, char* string);
CSFML_NETWORK_API void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string);
CSFML_NETWORK_API sfBool sfPacket_readBool(sfPacket* packet);
CSFML_NETWORK_API sfInt8 sfPacket_readInt8(sfPacket* packet);
CSFML_NETWORK_API sfUint8 sfPacket_readUint8(sfPacket* packet);
CSFML_NETWORK_API sfInt16 sfPacket_readInt16(sfPacket* packet);
CSFML_NETWORK_API sfUint16 sfPacket_readUint16(sfPacket* packet);
CSFML_NETWORK_API sfInt32 sfPacket_readInt32(sfPacket* packet);
CSFML_NETWORK_API sfUint32 sfPacket_readUint32(sfPacket* packet);
CSFML_NETWORK_API float sfPacket_readFloat(sfPacket* packet);
CSFML_NETWORK_API double sfPacket_readDouble(sfPacket* packet);
CSFML_NETWORK_API void sfPacket_readString(sfPacket* packet, char* string);
CSFML_NETWORK_API void sfPacket_readWideString(sfPacket* packet, wchar_t* string);
////////////////////////////////////////////////////////////
/// \brief Functions to insert data into a packet
@@ -161,17 +161,17 @@ CSFML_NETWORK_API void sfPacket_ReadWideString(sfPacket* packet, wchar_t* st
/// \param packet Packet object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfPacket_WriteBool(sfPacket* packet, sfBool);
CSFML_NETWORK_API void sfPacket_WriteInt8(sfPacket* packet, sfInt8);
CSFML_NETWORK_API void sfPacket_WriteUint8(sfPacket* packet, sfUint8);
CSFML_NETWORK_API void sfPacket_WriteInt16(sfPacket* packet, sfInt16);
CSFML_NETWORK_API void sfPacket_WriteUint16(sfPacket* packet, sfUint16);
CSFML_NETWORK_API void sfPacket_WriteInt32(sfPacket* packet, sfInt32);
CSFML_NETWORK_API void sfPacket_WriteUint32(sfPacket* packet, sfUint32);
CSFML_NETWORK_API void sfPacket_WriteFloat(sfPacket* packet, float);
CSFML_NETWORK_API void sfPacket_WriteDouble(sfPacket* packet, double);
CSFML_NETWORK_API void sfPacket_WriteString(sfPacket* packet, const char* string);
CSFML_NETWORK_API void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string);
CSFML_NETWORK_API void sfPacket_writeBool(sfPacket* packet, sfBool);
CSFML_NETWORK_API void sfPacket_writeInt8(sfPacket* packet, sfInt8);
CSFML_NETWORK_API void sfPacket_writeUint8(sfPacket* packet, sfUint8);
CSFML_NETWORK_API void sfPacket_writeInt16(sfPacket* packet, sfInt16);
CSFML_NETWORK_API void sfPacket_writeUint16(sfPacket* packet, sfUint16);
CSFML_NETWORK_API void sfPacket_writeInt32(sfPacket* packet, sfInt32);
CSFML_NETWORK_API void sfPacket_writeUint32(sfPacket* packet, sfUint32);
CSFML_NETWORK_API void sfPacket_writeFloat(sfPacket* packet, float);
CSFML_NETWORK_API void sfPacket_writeDouble(sfPacket* packet, double);
CSFML_NETWORK_API void sfPacket_writeString(sfPacket* packet, const char* string);
CSFML_NETWORK_API void sfPacket_writeWideString(sfPacket* packet, const wchar_t* string);
#endif // SFML_PACKET_H
+15 -15
View File
@@ -39,7 +39,7 @@
/// \return A new sfSocketSelector object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_Create(void);
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_create(void);
////////////////////////////////////////////////////////////
/// \brief Create a new socket selector by copying an existing one
@@ -49,7 +49,7 @@ CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_Create(void);
/// \return A new sfSocketSelector object which is a copy of \a selector
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_Copy(sfSocketSelector* selector);
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy(sfSocketSelector* selector);
////////////////////////////////////////////////////////////
/// \brief Destroy a socket selector
@@ -57,7 +57,7 @@ CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_Copy(sfSocketSelector* sele
/// \param selector Socket selector to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfSocketSelector_Destroy(sfSocketSelector* selector);
CSFML_NETWORK_API void sfSocketSelector_destroy(sfSocketSelector* selector);
////////////////////////////////////////////////////////////
/// \brief Add a new socket to a socket selector
@@ -70,9 +70,9 @@ CSFML_NETWORK_API void sfSocketSelector_Destroy(sfSocketSelector* selector);
/// \param socket Pointer to the socket to add
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfSocketSelector_AddTcpListener(sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API void sfSocketSelector_AddTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API void sfSocketSelector_AddUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket);
CSFML_NETWORK_API void sfSocketSelector_addTcpListener(sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API void sfSocketSelector_addTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API void sfSocketSelector_addUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Remove a socket from a socket selector
@@ -84,9 +84,9 @@ CSFML_NETWORK_API void sfSocketSelector_AddUdpSocket(sfSocketSelector* selector,
/// \param socket POointer to the socket to remove
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfSocketSelector_RemoveTcpListener(sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API void sfSocketSelector_RemoveTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API void sfSocketSelector_RemoveUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket);
CSFML_NETWORK_API void sfSocketSelector_removeTcpListener(sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API void sfSocketSelector_removeTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API void sfSocketSelector_removeUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Remove all the sockets stored in a selector
@@ -98,14 +98,14 @@ CSFML_NETWORK_API void sfSocketSelector_RemoveUdpSocket(sfSocketSelector* select
/// \param selector Socket selector object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfSocketSelector_Clear(sfSocketSelector* selector);
CSFML_NETWORK_API void sfSocketSelector_clear(sfSocketSelector* selector);
////////////////////////////////////////////////////////////
/// \brief Wait until one or more sockets are ready to receive
///
/// This function returns as soon as at least one socket has
/// some data available to be received. To know which sockets are
/// ready, use the sfSocketSelector_IsXxxReady functions.
/// ready, use the sfSocketSelector_isXxxReady functions.
/// If you use a timeout and no socket is ready before the timeout
/// is over, the function returns sfFalse.
///
@@ -115,7 +115,7 @@ CSFML_NETWORK_API void sfSocketSelector_Clear(sfSocketSelector* selector);
/// \return sfTrue if there are sockets ready, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfTime timeout);
CSFML_NETWORK_API sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout);
////////////////////////////////////////////////////////////
/// \brief Test a socket to know if it is ready to receive data
@@ -133,9 +133,9 @@ CSFML_NETWORK_API sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfTim
/// \return sfTrue if the socket is ready to read, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfSocketSelector_IsTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_IsTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_IsUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket);
CSFML_NETWORK_API sfBool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket);
#endif // SFML_SOCKETSELECTOR_H
+7 -7
View File
@@ -39,7 +39,7 @@
/// \return A new sfTcpListener object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfTcpListener* sfTcpListener_Create(void);
CSFML_NETWORK_API sfTcpListener* sfTcpListener_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a TCP listener
@@ -47,7 +47,7 @@ CSFML_NETWORK_API sfTcpListener* sfTcpListener_Create(void);
/// \param listener TCP listener to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpListener_Destroy(sfTcpListener* listener);
CSFML_NETWORK_API void sfTcpListener_destroy(sfTcpListener* listener);
////////////////////////////////////////////////////////////
/// \brief Set the blocking state of a TCP listener
@@ -65,7 +65,7 @@ CSFML_NETWORK_API void sfTcpListener_Destroy(sfTcpListener* listener);
/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpListener_SetBlocking(sfTcpListener* listener, sfBool blocking);
CSFML_NETWORK_API void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking);
////////////////////////////////////////////////////////////
/// \brief Tell whether a TCP listener is in blocking or non-blocking mode
@@ -75,7 +75,7 @@ CSFML_NETWORK_API void sfTcpListener_SetBlocking(sfTcpListener* listener, sfBool
/// \return sfTrue if the socket is blocking, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfTcpListener_IsBlocking(const sfTcpListener* listener);
CSFML_NETWORK_API sfBool sfTcpListener_isBlocking(const sfTcpListener* listener);
////////////////////////////////////////////////////////////
/// \brief Get the port to which a TCP listener is bound locally
@@ -88,7 +88,7 @@ CSFML_NETWORK_API sfBool sfTcpListener_IsBlocking(const sfTcpListener* listener)
/// \return Port to which the TCP listener is bound
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned short sfTcpListener_GetLocalPort(const sfTcpListener* listener);
CSFML_NETWORK_API unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener);
////////////////////////////////////////////////////////////
/// \brief Start listening for connections
@@ -104,7 +104,7 @@ CSFML_NETWORK_API unsigned short sfTcpListener_GetLocalPort(const sfTcpListener*
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpListener_Listen(sfTcpListener* listener, unsigned short port);
CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port);
////////////////////////////////////////////////////////////
/// \brief Accept a new connection
@@ -118,7 +118,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpListener_Listen(sfTcpListener* listener, u
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpListener_Accept(sfTcpListener* listener, sfTcpSocket** connected);
CSFML_NETWORK_API sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** connected);
#endif // SFML_TCPLISTENER_H
+15 -15
View File
@@ -42,7 +42,7 @@
/// \return A new sfTcpSocket object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_Create(void);
CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a TCP socket
@@ -50,14 +50,14 @@ CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_Create(void);
/// \param socket TCP socket to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpSocket_Destroy(sfTcpSocket* socket);
CSFML_NETWORK_API void sfTcpSocket_destroy(sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Set the blocking state of a TCP listener
///
/// In blocking mode, calls will not return until they have
/// completed their task. For example, a call to
/// sfTcpSocket_Receive in blocking mode won't return until
/// sfTcpSocket_receive in blocking mode won't return until
/// new data was actually received.
/// In non-blocking mode, calls will always return immediately,
/// using the return code to signal whether there was data
@@ -68,7 +68,7 @@ CSFML_NETWORK_API void sfTcpSocket_Destroy(sfTcpSocket* socket);
/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpSocket_SetBlocking(sfTcpSocket* socket, sfBool blocking);
CSFML_NETWORK_API void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking);
////////////////////////////////////////////////////////////
/// \brief Tell whether a TCP socket is in blocking or non-blocking mode
@@ -78,7 +78,7 @@ CSFML_NETWORK_API void sfTcpSocket_SetBlocking(sfTcpSocket* socket, sfBool block
/// \return sfTrue if the socket is blocking, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfTcpSocket_IsBlocking(const sfTcpSocket* socket);
CSFML_NETWORK_API sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Get the port to which a TCP socket is bound locally
@@ -90,20 +90,20 @@ CSFML_NETWORK_API sfBool sfTcpSocket_IsBlocking(const sfTcpSocket* socket);
/// \return Port to which the socket is bound
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned short sfTcpSocket_GetLocalPort(const sfTcpSocket* socket);
CSFML_NETWORK_API unsigned short sfTcpSocket_getLocalPort(const sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Get the address of the connected peer of a TCP socket
///
/// It the socket is not connected, this function returns
/// sfIpAddress_None().
/// sfIpAddress_None.
///
/// \param socket TCP socket object
///
/// \return Address of the remote peer
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfIpAddress sfTcpSocket_GetRemoteAddress(const sfTcpSocket* socket);
CSFML_NETWORK_API sfIpAddress sfTcpSocket_getRemoteAddress(const sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Get the port of the connected peer to which
@@ -116,7 +116,7 @@ CSFML_NETWORK_API sfIpAddress sfTcpSocket_GetRemoteAddress(const sfTcpSocket* so
/// \return Remote port to which the socket is connected
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* socket);
CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Connect a TCP socket to a remote peer
@@ -134,7 +134,7 @@ CSFML_NETWORK_API unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* so
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout);
////////////////////////////////////////////////////////////
/// \brief Disconnect a TCP socket from its remote peer
@@ -145,7 +145,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAd
/// \param socket TCP socket object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpSocket_Disconnect(sfTcpSocket* socket);
CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Send raw data to the remote peer of a TCP socket
@@ -159,7 +159,7 @@ CSFML_NETWORK_API void sfTcpSocket_Disconnect(sfTcpSocket* socket);
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_Send(sfTcpSocket* socket, const char* data, size_t size);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const char* data, size_t size);
////////////////////////////////////////////////////////////
/// \brief Receive raw data from the remote peer of a TCP socket
@@ -176,7 +176,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_Send(sfTcpSocket* socket, const cha
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_Receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived);
////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to the remote peer of a TCP socket
@@ -189,7 +189,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_Receive(sfTcpSocket* socket, char*
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_SendPacket(sfTcpSocket* socket, sfPacket* packet);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPacket(sfTcpSocket* socket, sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Receive a formatted packet of data from the remote peer
@@ -204,7 +204,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_SendPacket(sfTcpSocket* socket, sfP
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_ReceivePacket(sfTcpSocket* socket, sfPacket* packet);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receivePacket(sfTcpSocket* socket, sfPacket* packet);
#endif // SFML_TCPSOCKET_H
+15 -17
View File
@@ -41,7 +41,7 @@
/// \return A new sfUdpSocket object
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_Create(void);
CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a UDP socket
@@ -49,14 +49,14 @@ CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_Create(void);
/// \param socket UDP socket to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfUdpSocket_Destroy(sfUdpSocket* socket);
CSFML_NETWORK_API void sfUdpSocket_destroy(sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Set the blocking state of a UDP listener
///
/// In blocking mode, calls will not return until they have
/// completed their task. For example, a call to
/// sfUDPSocket_Receive in blocking mode won't return until
/// sfUDPSocket_receive in blocking mode won't return until
/// new data was actually received.
/// In non-blocking mode, calls will always return immediately,
/// using the return code to signal whether there was data
@@ -67,7 +67,7 @@ CSFML_NETWORK_API void sfUdpSocket_Destroy(sfUdpSocket* socket);
/// \param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfUdpSocket_SetBlocking(sfUdpSocket* socket, sfBool blocking);
CSFML_NETWORK_API void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking);
////////////////////////////////////////////////////////////
/// \brief Tell whether a UDP socket is in blocking or non-blocking mode
@@ -77,7 +77,7 @@ CSFML_NETWORK_API void sfUdpSocket_SetBlocking(sfUdpSocket* socket, sfBool block
/// \return sfTrue if the socket is blocking, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfBool sfUdpSocket_IsBlocking(const sfUdpSocket* socket);
CSFML_NETWORK_API sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Get the port to which a UDP socket is bound locally
@@ -90,7 +90,7 @@ CSFML_NETWORK_API sfBool sfUdpSocket_IsBlocking(const sfUdpSocket* socket);
/// \return Port to which the socket is bound
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned short sfUdpSocket_GetLocalPort(const sfUdpSocket* socket);
CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Bind a UDP socket to a specific port
@@ -99,7 +99,7 @@ CSFML_NETWORK_API unsigned short sfUdpSocket_GetLocalPort(const sfUdpSocket* soc
/// able to receive data on that port.
/// You can use the special value 0 to tell the
/// system to automatically pick an available port, and then
/// call sfUdpSocket_GetLocalPort to retrieve the chosen port.
/// call sfUdpSocket_getLocalPort to retrieve the chosen port.
///
/// \param socket UDP socket object
/// \param port Port to bind the socket to
@@ -107,7 +107,7 @@ CSFML_NETWORK_API unsigned short sfUdpSocket_GetLocalPort(const sfUdpSocket* soc
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_Bind(sfUdpSocket* socket, unsigned short port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port);
////////////////////////////////////////////////////////////
/// \brief Unbind a UDP socket from the local port to which it is bound
@@ -125,7 +125,7 @@ CSFML_NETWORK_API void sfUdpSocket_Unbind(sfUdpSocket* socket);
/// \brief Send raw data to a remote peer with a UDP socket
///
/// Make sure that \a size is not greater than
/// sfUdpSocket_MaxDatagramSize(), otherwise this function will
/// sfUdpSocket_maxDatagramSize(), otherwise this function will
/// fail and no data will be sent.
///
/// \param socket UDP socket object
@@ -137,7 +137,7 @@ CSFML_NETWORK_API void sfUdpSocket_Unbind(sfUdpSocket* socket);
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_Send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port);
////////////////////////////////////////////////////////////
/// \brief Receive raw data from a remote peer with a UDP socket
@@ -159,13 +159,13 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_Send(sfUdpSocket* socket, const cha
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to a remote peer with a UDP socket
///
/// Make sure that the packet size is not greater than
/// sfUdpSocket_MaxDatagramSize(), otherwise this function will
/// sfUdpSocket_maxDatagramSize(), otherwise this function will
/// fail and no data will be sent.
///
/// \param socket UDP socket object
@@ -176,15 +176,13 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char*
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_SendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port);
////////////////////////////////////////////////////////////
/// \brief Receive a formatted packet of data from a remote peer with a UDP socket
///
/// In blocking mode, this function will wait until the whole packet
/// has been received.
/// Warning: this functon doesn't properly handle mixed data
/// received from multiple peers.
///
/// \param packet Packet to fill with the received data
/// \param remoteAddress Address of the peer that sent the data
@@ -193,7 +191,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_SendPacket(sfUdpSocket* socket, sfP
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_ReceivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port);
////////////////////////////////////////////////////////////
/// \brief Return the maximum number of bytes that can be
@@ -202,7 +200,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_ReceivePacket(sfUdpSocket* socket,
/// \return The maximum size of a UDP datagram (message)
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned int sfUdpSocket_MaxDatagramSize();
CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize();
#endif // SFML_UDPSOCKET_H
+7 -7
View File
@@ -39,7 +39,7 @@
/// \return A new sfClock object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfClock* sfClock_Create(void);
CSFML_SYSTEM_API sfClock* sfClock_create(void);
////////////////////////////////////////////////////////////
/// \brief Create a new clock by copying an existing one
@@ -49,7 +49,7 @@ CSFML_SYSTEM_API sfClock* sfClock_Create(void);
/// \return A new sfClock object which is a copy of \a clock
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfClock* sfClock_Copy(sfClock* clock);
CSFML_SYSTEM_API sfClock* sfClock_copy(sfClock* clock);
////////////////////////////////////////////////////////////
/// \brief Destroy a clock
@@ -57,21 +57,21 @@ CSFML_SYSTEM_API sfClock* sfClock_Copy(sfClock* clock);
/// \param clock Clock to destroy
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfClock_Destroy(sfClock* clock);
CSFML_SYSTEM_API void sfClock_destroy(sfClock* clock);
////////////////////////////////////////////////////////////
/// \brief Get the time elapsed in a clock
///
/// This function returns the time elapsed since the last call
/// to sfClock_Restart (or the construction of the object if
/// sfClock_Restart has not been called).
/// to sfClock_restart (or the construction of the object if
/// sfClock_restart has not been called).
///
/// \param clock Clock object
///
/// \return Time elapsed
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfTime sfClock_GetElapsedTime(const sfClock* clock);
CSFML_SYSTEM_API sfTime sfClock_getElapsedTime(const sfClock* clock);
////////////////////////////////////////////////////////////
/// \brief Restart a clock
@@ -84,7 +84,7 @@ CSFML_SYSTEM_API sfTime sfClock_GetElapsedTime(const sfClock* clock);
/// \return Time elapsed
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfTime sfClock_Restart(sfClock* clock);
CSFML_SYSTEM_API sfTime sfClock_restart(sfClock* clock);
#endif // SFML_CLOCK_H
+5 -5
View File
@@ -43,11 +43,11 @@ typedef sfInt64 (*sfInputStreamGetSizeFunc)(void* userData);
////////////////////////////////////////////////////////////
typedef struct sfInputStream
{
sfInputStreamReadFunc Read; ///< Function to read data from the stream
sfInputStreamSeekFunc Seek; ///< Function to set the current read position
sfInputStreamTellFunc Tell; ///< Function to get the current read position
sfInputStreamGetSizeFunc GetSize; ///< Function to get the total number of bytes in the stream
void* UserData; ///< User data that will be passed to the callbacks
sfInputStreamReadFunc read; ///< Function to read data from the stream
sfInputStreamSeekFunc seek; ///< Function to set the current read position
sfInputStreamTellFunc tell; ///< Function to get the current read position
sfInputStreamGetSizeFunc getSize; ///< Function to get the total number of bytes in the stream
void* userData; ///< User data that will be passed to the callbacks
} sfInputStream;
+4 -4
View File
@@ -38,7 +38,7 @@
/// \return A new sfMutex object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfMutex* sfMutex_Create(void);
CSFML_SYSTEM_API sfMutex* sfMutex_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a mutex
@@ -46,7 +46,7 @@ CSFML_SYSTEM_API sfMutex* sfMutex_Create(void);
/// \param mutex Mutex to destroy
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfMutex_Destroy(sfMutex* mutex);
CSFML_SYSTEM_API void sfMutex_destroy(sfMutex* mutex);
////////////////////////////////////////////////////////////
/// \brief Lock a mutex
@@ -54,7 +54,7 @@ CSFML_SYSTEM_API void sfMutex_Destroy(sfMutex* mutex);
/// \param mutex Mutex object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfMutex_Lock(sfMutex* mutex);
CSFML_SYSTEM_API void sfMutex_lock(sfMutex* mutex);
////////////////////////////////////////////////////////////
/// \brief Unlock a mutex
@@ -62,7 +62,7 @@ CSFML_SYSTEM_API void sfMutex_Lock(sfMutex* mutex);
/// \param mutex Mutex object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfMutex_Unlock(sfMutex* mutex);
CSFML_SYSTEM_API void sfMutex_unlock(sfMutex* mutex);
#endif // SFML_MUTEX_H
+7 -7
View File
@@ -35,7 +35,7 @@
////////////////////////////////////////////////////////////
/// \brief Create a new thread from a function pointer
///
/// Note: this does *not* run the thread, use sfThread_Launch.
/// Note: this does *not* run the thread, use sfThread_launch.
///
/// \param function Entry point of the thread
/// \param userData Custom data to pass to the thread function
@@ -43,18 +43,18 @@
/// \return A new sfThread object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfThread* sfThread_Create(void (*function)(void*), void* userData);
CSFML_SYSTEM_API sfThread* sfThread_create(void (*function)(void*), void* userData);
////////////////////////////////////////////////////////////
/// \brief Destroy a thread
///
/// This function calls sfThread_Wait, so that the internal thread
/// This function calls sfThread_wait, so that the internal thread
/// cannot survive after the sfThread object is destroyed.
///
/// \param thread Thread to destroy
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfThread_Destroy(sfThread* thread);
CSFML_SYSTEM_API void sfThread_destroy(sfThread* thread);
////////////////////////////////////////////////////////////
/// \brief Run a thread
@@ -67,7 +67,7 @@ CSFML_SYSTEM_API void sfThread_Destroy(sfThread* thread);
/// \param thread Thread object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfThread_Launch(sfThread* thread);
CSFML_SYSTEM_API void sfThread_launch(sfThread* thread);
////////////////////////////////////////////////////////////
/// \brief Wait until a thread finishes
@@ -82,7 +82,7 @@ CSFML_SYSTEM_API void sfThread_Launch(sfThread* thread);
/// \param thread Thread object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfThread_Wait(sfThread* thread);
CSFML_SYSTEM_API void sfThread_wait(sfThread* thread);
////////////////////////////////////////////////////////////
/// \brief Terminate a thread
@@ -97,7 +97,7 @@ CSFML_SYSTEM_API void sfThread_Wait(sfThread* thread);
/// \param thread Thread object
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfThread_Terminate(sfThread* thread);
CSFML_SYSTEM_API void sfThread_terminate(sfThread* thread);
#endif // SFML_THREAD_H
+5 -5
View File
@@ -37,14 +37,14 @@
////////////////////////////////////////////////////////////
typedef struct
{
sfInt64 Microseconds;
sfInt64 microseconds;
} sfTime;
////////////////////////////////////////////////////////////
/// \brief Predefined "zero" time value
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfTime sfTimeZero;
CSFML_SYSTEM_API sfTime sfTime_Zero;
////////////////////////////////////////////////////////////
/// \brief Return a time value as a number of seconds
@@ -54,7 +54,7 @@ CSFML_SYSTEM_API sfTime sfTimeZero;
/// \return Time in seconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API float sfTime_AsSeconds(sfTime time);
CSFML_SYSTEM_API float sfTime_asSeconds(sfTime time);
////////////////////////////////////////////////////////////
/// \brief Return a time value as a number of milliseconds
@@ -64,7 +64,7 @@ CSFML_SYSTEM_API float sfTime_AsSeconds(sfTime time);
/// \return Time in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfInt32 sfTime_AsMilliseconds(sfTime time);
CSFML_SYSTEM_API sfInt32 sfTime_asMilliseconds(sfTime time);
////////////////////////////////////////////////////////////
/// \brief Return a time value as a number of microseconds
@@ -74,7 +74,7 @@ CSFML_SYSTEM_API sfInt32 sfTime_AsMilliseconds(sfTime time);
/// \return Time in microseconds
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API sfInt64 sfTime_AsMicroseconds(sfTime time);
CSFML_SYSTEM_API sfInt64 sfTime_asMicroseconds(sfTime time);
////////////////////////////////////////////////////////////
/// \brief Construct a time value from a number of seconds
+3 -3
View File
@@ -40,7 +40,7 @@
/// \return New sfContext object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfContext* sfContext_Create(void);
CSFML_WINDOW_API sfContext* sfContext_create(void);
////////////////////////////////////////////////////////////
/// \brief Destroy a context
@@ -48,7 +48,7 @@ CSFML_WINDOW_API sfContext* sfContext_Create(void);
/// \param context Context to destroy
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfContext_Destroy(sfContext* context);
CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
////////////////////////////////////////////////////////////
/// \brief Activate or deactivate explicitely a context
@@ -57,7 +57,7 @@ CSFML_WINDOW_API void sfContext_Destroy(sfContext* context);
/// \param active sfTrue to activate, sfFalse to deactivate
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfContext_SetActive(sfContext* context, sfBool active);
CSFML_WINDOW_API void sfContext_setActive(sfContext* context, sfBool active);
#endif // SFML_CONTEXT_H
+41 -41
View File
@@ -66,12 +66,12 @@ typedef enum
////////////////////////////////////////////////////////////
struct sfKeyEvent
{
sfEventType Type;
sfKeyCode Code;
sfBool Alt;
sfBool Control;
sfBool Shift;
sfBool System;
sfEventType type;
sfKeyCode code;
sfBool alt;
sfBool control;
sfBool shift;
sfBool system;
};
////////////////////////////////////////////////////////////
@@ -80,8 +80,8 @@ struct sfKeyEvent
////////////////////////////////////////////////////////////
struct sfTextEvent
{
sfEventType Type;
sfUint32 Unicode;
sfEventType type;
sfUint32 unicode;
};
////////////////////////////////////////////////////////////
@@ -90,9 +90,9 @@ struct sfTextEvent
////////////////////////////////////////////////////////////
struct sfMouseMoveEvent
{
sfEventType Type;
int X;
int Y;
sfEventType type;
int x;
int y;
};
////////////////////////////////////////////////////////////
@@ -101,10 +101,10 @@ struct sfMouseMoveEvent
////////////////////////////////////////////////////////////
struct sfMouseButtonEvent
{
sfEventType Type;
sfMouseButton Button;
int X;
int Y;
sfEventType type;
sfMouseButton button;
int x;
int y;
};
////////////////////////////////////////////////////////////
@@ -113,10 +113,10 @@ struct sfMouseButtonEvent
////////////////////////////////////////////////////////////
struct sfMouseWheelEvent
{
sfEventType Type;
int Delta;
int X;
int Y;
sfEventType type;
int delta;
int x;
int y;
};
////////////////////////////////////////////////////////////
@@ -125,10 +125,10 @@ struct sfMouseWheelEvent
////////////////////////////////////////////////////////////
struct sfJoystickMoveEvent
{
sfEventType Type;
unsigned int JoystickId;
sfJoystickAxis Axis;
float Position;
sfEventType type;
unsigned int joystickId;
sfJoystickAxis axis;
float position;
};
////////////////////////////////////////////////////////////
@@ -137,9 +137,9 @@ struct sfJoystickMoveEvent
////////////////////////////////////////////////////////////
struct sfJoystickButtonEvent
{
sfEventType Type;
unsigned int JoystickId;
unsigned int Button;
sfEventType type;
unsigned int joystickId;
unsigned int button;
};
////////////////////////////////////////////////////////////
@@ -148,8 +148,8 @@ struct sfJoystickButtonEvent
////////////////////////////////////////////////////////////
struct sfJoystickConnectEvent
{
sfEventType Type;
unsigned int JoystickId;
sfEventType type;
unsigned int joystickId;
};
////////////////////////////////////////////////////////////
@@ -158,9 +158,9 @@ struct sfJoystickConnectEvent
////////////////////////////////////////////////////////////
struct sfSizeEvent
{
sfEventType Type;
unsigned int Width;
unsigned int Height;
sfEventType type;
unsigned int width;
unsigned int height;
};
@@ -173,16 +173,16 @@ typedef union
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
sfEventType Type; ///< Type of the event
struct sfSizeEvent Size;
struct sfKeyEvent Key;
struct sfTextEvent Text;
struct sfMouseMoveEvent MouseMove;
struct sfMouseButtonEvent MouseButton;
struct sfMouseWheelEvent MouseWheel;
struct sfJoystickMoveEvent JoystickMove;
struct sfJoystickButtonEvent JoystickButton;
struct sfJoystickConnectEvent JoystickConnect;
sfEventType type; ///< Type of the event
struct sfSizeEvent size;
struct sfKeyEvent key;
struct sfTextEvent text;
struct sfMouseMoveEvent mouseMove;
struct sfMouseButtonEvent mouseButton;
struct sfMouseWheelEvent mouseWheel;
struct sfJoystickMoveEvent joystickMove;
struct sfJoystickButtonEvent joystickButton;
struct sfJoystickConnectEvent joystickConnect;
} sfEvent;
+6 -6
View File
@@ -67,7 +67,7 @@ typedef enum
/// \return sfTrue if the joystick is connected, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfJoystick_IsConnected(unsigned int joystick);
CSFML_WINDOW_API sfBool sfJoystick_isConnected(unsigned int joystick);
////////////////////////////////////////////////////////////
/// \brief Return the number of buttons supported by a joystick
@@ -79,7 +79,7 @@ CSFML_WINDOW_API sfBool sfJoystick_IsConnected(unsigned int joystick);
/// \return Number of buttons supported by the joystick
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API unsigned int sfJoystick_GetButtonCount(unsigned int joystick);
CSFML_WINDOW_API unsigned int sfJoystick_getButtonCount(unsigned int joystick);
////////////////////////////////////////////////////////////
/// \brief Check if a joystick supports a given axis
@@ -92,7 +92,7 @@ CSFML_WINDOW_API unsigned int sfJoystick_GetButtonCount(unsigned int joystick);
/// \return sfTrue if the joystick supports the axis, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfJoystick_HasAxis(unsigned int joystick, sfJoystickAxis axis);
CSFML_WINDOW_API sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis);
////////////////////////////////////////////////////////////
/// \brief Check if a joystick button is pressed
@@ -105,7 +105,7 @@ CSFML_WINDOW_API sfBool sfJoystick_HasAxis(unsigned int joystick, sfJoystickAxis
/// \return sfTrue if the button is pressed, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfJoystick_IsButtonPressed(unsigned int joystick, unsigned int button);
CSFML_WINDOW_API sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button);
////////////////////////////////////////////////////////////
/// \brief Get the current position of a joystick axis
@@ -118,7 +118,7 @@ CSFML_WINDOW_API sfBool sfJoystick_IsButtonPressed(unsigned int joystick, unsign
/// \return Current position of the axis, in range [-100 .. 100]
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API float sfJoystick_GetAxisPosition(unsigned int joystick, sfJoystickAxis axis);
CSFML_WINDOW_API float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis);
////////////////////////////////////////////////////////////
/// \brief Update the states of all joysticks
@@ -129,7 +129,7 @@ CSFML_WINDOW_API float sfJoystick_GetAxisPosition(unsigned int joystick, sfJoyst
/// in this case the joysticks states are not updated automatically.
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfJoystick_Update(void);
CSFML_WINDOW_API void sfJoystick_update(void);
#endif // SFML_JOYSTICK_H
+1 -1
View File
@@ -150,7 +150,7 @@ typedef enum
/// \return sfTrue if the key is pressed, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfKeyboard_IsKeyPressed(sfKeyCode key);
CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
#endif // SFML_KEYBOARD_H
+3 -3
View File
@@ -56,7 +56,7 @@ typedef enum
/// \return sfTrue if the button is pressed, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfMouse_IsButtonPressed(sfMouseButton button);
CSFML_WINDOW_API sfBool sfMouse_isButtonPressed(sfMouseButton button);
////////////////////////////////////////////////////////////
/// \brief Get the current position of the mouse
@@ -69,7 +69,7 @@ CSFML_WINDOW_API sfBool sfMouse_IsButtonPressed(sfMouseButton button);
/// \return Position of the mouse cursor, relative to the given window
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfVector2i sfMouse_GetPosition(const sfWindow* relativeTo);
CSFML_WINDOW_API sfVector2i sfMouse_getPosition(const sfWindow* relativeTo);
////////////////////////////////////////////////////////////
/// \brief Set the current position of the mouse
@@ -81,7 +81,7 @@ CSFML_WINDOW_API sfVector2i sfMouse_GetPosition(const sfWindow* relativeTo);
/// \param relativeTo Reference window
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfMouse_SetPosition(sfVector2i position, const sfWindow* relativeTo);
CSFML_WINDOW_API void sfMouse_setPosition(sfVector2i position, const sfWindow* relativeTo);
#endif // SFML_MOUSE_H
+6 -6
View File
@@ -39,9 +39,9 @@
////////////////////////////////////////////////////////////
typedef struct
{
unsigned int Width; ///< Video mode width, in pixels
unsigned int Height; ///< Video mode height, in pixels
unsigned int BitsPerPixel; ///< Video mode pixel depth, in bits per pixels
unsigned int width; ///< Video mode width, in pixels
unsigned int height; ///< Video mode height, in pixels
unsigned int bitsPerPixel; ///< Video mode pixel depth, in bits per pixels
} sfVideoMode;
@@ -51,7 +51,7 @@ typedef struct
/// \return Current desktop video mode
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfVideoMode sfVideoMode_GetDesktopMode(void);
CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode(void);
////////////////////////////////////////////////////////////
/// \brief Retrieve all the video modes supported in fullscreen mode
@@ -69,7 +69,7 @@ CSFML_WINDOW_API sfVideoMode sfVideoMode_GetDesktopMode(void);
/// \return Pointer to an array containing all the supported fullscreen modes
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_GetFullscreenModes(size_t* Count);
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a video mode is valid
@@ -83,7 +83,7 @@ CSFML_WINDOW_API const sfVideoMode* sfVideoMode_GetFullscreenModes(size_t* Count
/// \return sfTrue if the video mode is valid for fullscreen mode
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfVideoMode_IsValid(sfVideoMode mode);
CSFML_WINDOW_API sfBool sfVideoMode_isValid(sfVideoMode mode);
#endif // SFML_VIDEOMODE_H
+33 -33
View File
@@ -57,11 +57,11 @@ enum
////////////////////////////////////////////////////////////
typedef struct
{
unsigned int DepthBits; ///< Bits of the depth buffer
unsigned int StencilBits; ///< Bits of the stencil buffer
unsigned int AntialiasingLevel; ///< Level of antialiasing
unsigned int MajorVersion; ///< Major number of the context version to create
unsigned int MinorVersion; ///< Minor number of the context version to create
unsigned int depthBits; ///< Bits of the depth buffer
unsigned int stencilBits; ///< Bits of the stencil buffer
unsigned int antialiasingLevel; ///< Level of antialiasing
unsigned int majorVersion; ///< Major number of the context version to create
unsigned int minorVersion; ///< Minor number of the context version to create
} sfContextSettings;
@@ -86,7 +86,7 @@ typedef struct
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Construct a window from an existing control
@@ -104,7 +104,7 @@ CSFML_WINDOW_API sfWindow* sfWindow_Create(sfVideoMode mode, const char* title,
/// \return A new sfWindow object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
CSFML_WINDOW_API sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
////////////////////////////////////////////////////////////
/// \brief Destroy a window
@@ -112,27 +112,27 @@ CSFML_WINDOW_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, cons
/// \param window Window to destroy
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_Destroy(sfWindow* window);
CSFML_WINDOW_API void sfWindow_destroy(sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Close a window and destroy all the attached resources
///
/// After calling this function, the sfWindow object remains
/// valid, you must call sfWindow_Destroy to actually delete it.
/// All other functions such as sfWindow_PollEvent or sfWindow_Display
/// will still work (i.e. you don't have to test sfWindow_IsOpen
/// valid, you must call sfWindow_destroy to actually delete it.
/// All other functions such as sfWindow_pollEvent or sfWindow_display
/// will still work (i.e. you don't have to test sfWindow_isOpen
/// every time), and will have no effect on closed windows.
///
/// \param window Window object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_Close(sfWindow* window);
CSFML_WINDOW_API void sfWindow_close(sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not a window is opened
///
/// This function returns whether or not the window exists.
/// Note that a hidden window (sfWindow_Show(sfFalse)) will return
/// Note that a hidden window (sfWindow_SetVisible(sfFalse)) will return
/// sfTrue.
///
/// \param window Window object
@@ -140,13 +140,13 @@ CSFML_WINDOW_API void sfWindow_Close(sfWindow* window);
/// \return sfTrue if the window is opened, sfFalse if it has been closed
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_IsOpen(const sfWindow* window);
CSFML_WINDOW_API sfBool sfWindow_isOpen(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Get the settings of the OpenGL context of a window
///
/// Note that these settings may be different from what was
/// passed to the sfWindow_Create function,
/// passed to the sfWindow_create function,
/// if one or more settings were not supported. In this case,
/// SFML chose the closest match.
///
@@ -155,7 +155,7 @@ CSFML_WINDOW_API sfBool sfWindow_IsOpen(const sfWindow* window);
/// \return Structure containing the OpenGL context settings
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfContextSettings sfWindow_GetSettings(const sfWindow* window);
CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Pop the event on top of events stack, if any, and return it
@@ -172,7 +172,7 @@ CSFML_WINDOW_API sfContextSettings sfWindow_GetSettings(const sfWindow* window);
/// \return sfTrue if an event was returned, or sfFalse if the events stack was empty
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_PollEvent(sfWindow* window, sfEvent* event);
CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Wait for an event and return it
@@ -191,7 +191,7 @@ CSFML_WINDOW_API sfBool sfWindow_PollEvent(sfWindow* window, sfEvent* event);
/// \return sfFalse if any error occured
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_WaitEvent(sfWindow* window, sfEvent* event);
CSFML_WINDOW_API sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event);
////////////////////////////////////////////////////////////
/// \brief Get the position of a window
@@ -201,7 +201,7 @@ CSFML_WINDOW_API sfBool sfWindow_WaitEvent(sfWindow* window, sfEvent* event);
/// \return Position in pixels
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfVector2i sfWindow_GetPosition(const sfWindow* window);
CSFML_WINDOW_API sfVector2i sfWindow_getPosition(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Change the position of a window on screen
@@ -214,7 +214,7 @@ CSFML_WINDOW_API sfVector2i sfWindow_GetPosition(const sfWindow* window);
/// \param position New position of the window, in pixels
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetPosition(sfWindow* window, sfVector2i position);
CSFML_WINDOW_API void sfWindow_setPosition(sfWindow* window, sfVector2i position);
////////////////////////////////////////////////////////////
/// \brief Get the size of the rendering region of a window
@@ -227,7 +227,7 @@ CSFML_WINDOW_API void sfWindow_SetPosition(sfWindow* window, sfVector2i position
/// \return Size in pixels
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfVector2u sfWindow_GetSize(const sfWindow* window);
CSFML_WINDOW_API sfVector2u sfWindow_getSize(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Change the size of the rendering region of a window
@@ -236,7 +236,7 @@ CSFML_WINDOW_API sfVector2u sfWindow_GetSize(const sfWindow* window);
/// \param size New size, in pixels
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetSize(sfWindow* window, sfVector2u size);
CSFML_WINDOW_API void sfWindow_setSize(sfWindow* window, sfVector2u size);
////////////////////////////////////////////////////////////
/// \brief Change the title of a window
@@ -245,7 +245,7 @@ CSFML_WINDOW_API void sfWindow_SetSize(sfWindow* window, sfVector2u size);
/// \param title New title
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetTitle(sfWindow* window, const char* title);
CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title);
////////////////////////////////////////////////////////////
/// \brief Change a window's icon
@@ -259,7 +259,7 @@ CSFML_WINDOW_API void sfWindow_SetTitle(sfWindow* window, const char* title);
/// \param pixels Pointer to the array of pixels in memory
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
////////////////////////////////////////////////////////////
/// \brief Show or hide a window
@@ -268,7 +268,7 @@ CSFML_WINDOW_API void sfWindow_SetIcon(sfWindow* window, unsigned int width, uns
/// \param visible sfTrue to show the window, sfFalse to hide it
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetVisible(sfWindow* window, sfBool visible);
CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
////////////////////////////////////////////////////////////
/// \brief Show or hide the mouse cursor
@@ -277,7 +277,7 @@ CSFML_WINDOW_API void sfWindow_SetVisible(sfWindow* window, sfBool visible);
/// \param visible sfTrue to show, sfFalse to hide
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetMouseCursorVisible(sfWindow* window, sfBool visible);
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
////////////////////////////////////////////////////////////
/// \brief Enable or disable vertical synchronization
@@ -291,7 +291,7 @@ CSFML_WINDOW_API void sfWindow_SetMouseCursorVisible(sfWindow* window, sfBool vi
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetVerticalSyncEnabled(sfWindow* window, sfBool enabled);
CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
////////////////////////////////////////////////////////////
/// \brief Enable or disable automatic key-repeat
@@ -306,7 +306,7 @@ CSFML_WINDOW_API void sfWindow_SetVerticalSyncEnabled(sfWindow* window, sfBool e
/// \param enabled sfTrue to enable, sfFalse to disable
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetKeyRepeatEnabled(sfWindow* window, sfBool enabled);
CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
////////////////////////////////////////////////////////////
/// \brief Activate or deactivate a window as the current target
@@ -324,7 +324,7 @@ CSFML_WINDOW_API void sfWindow_SetKeyRepeatEnabled(sfWindow* window, sfBool enab
/// \return sfTrue if operation was successful, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfWindow_SetActive(sfWindow* window, sfBool active);
CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
////////////////////////////////////////////////////////////
/// \brief Display on screen what has been rendered to the
@@ -337,7 +337,7 @@ CSFML_WINDOW_API sfBool sfWindow_SetActive(sfWindow* window, sfBool active);
/// \param window Window object
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_Display(sfWindow* window);
CSFML_WINDOW_API void sfWindow_display(sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Limit the framerate to a maximum fixed frequency
@@ -350,7 +350,7 @@ CSFML_WINDOW_API void sfWindow_Display(sfWindow* window);
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit);
CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
////////////////////////////////////////////////////////////
/// \brief Change the joystick threshold
@@ -362,7 +362,7 @@ CSFML_WINDOW_API void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int
/// \param threshold New threshold, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_SetJoystickThreshold(sfWindow* window, float threshold);
CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
////////////////////////////////////////////////////////////
/// \brief Get the OS-specific handle of the window
@@ -378,7 +378,7 @@ CSFML_WINDOW_API void sfWindow_SetJoystickThreshold(sfWindow* window, float thre
/// \return System handle of the window
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfWindowHandle sfWindow_GetSystemHandle(const sfWindow* window);
CSFML_WINDOW_API sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window);
#endif // SFML_WINDOW_H