diff --git a/include/SFML/Audio/Listener.h b/include/SFML/Audio/Listener.h index b291d45..fa03cc1 100644 --- a/include/SFML/Audio/Listener.h +++ b/include/SFML/Audio/Listener.h @@ -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 diff --git a/include/SFML/Audio/Music.h b/include/SFML/Audio/Music.h index 38b3128..c3761d9 100644 --- a/include/SFML/Audio/Music.h +++ b/include/SFML/Audio/Music.h @@ -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 diff --git a/include/SFML/Audio/Sound.h b/include/SFML/Audio/Sound.h index e9f17c9..5ea2176 100644 --- a/include/SFML/Audio/Sound.h +++ b/include/SFML/Audio/Sound.h @@ -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 diff --git a/include/SFML/Audio/SoundBuffer.h b/include/SFML/Audio/SoundBuffer.h index b462961..499e952 100644 --- a/include/SFML/Audio/SoundBuffer.h +++ b/include/SFML/Audio/SoundBuffer.h @@ -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 diff --git a/include/SFML/Audio/SoundBufferRecorder.h b/include/SFML/Audio/SoundBufferRecorder.h index 62b6d40..28c9b91 100644 --- a/include/SFML/Audio/SoundBufferRecorder.h +++ b/include/SFML/Audio/SoundBufferRecorder.h @@ -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 diff --git a/include/SFML/Audio/SoundRecorder.h b/include/SFML/Audio/SoundRecorder.h index 42b2317..eb9d5ec 100644 --- a/include/SFML/Audio/SoundRecorder.h +++ b/include/SFML/Audio/SoundRecorder.h @@ -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 diff --git a/include/SFML/Audio/SoundStream.h b/include/SFML/Audio/SoundStream.h index ee08889..70065f9 100644 --- a/include/SFML/Audio/SoundStream.h +++ b/include/SFML/Audio/SoundStream.h @@ -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 diff --git a/include/SFML/Graphics/CircleShape.h b/include/SFML/Graphics/CircleShape.h index 76bd2a4..588622b 100644 --- a/include/SFML/Graphics/CircleShape.h +++ b/include/SFML/Graphics/CircleShape.h @@ -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 diff --git a/include/SFML/Graphics/Color.h b/include/SFML/Graphics/Color.h index fbbddd3..7e21360 100644 --- a/include/SFML/Graphics/Color.h +++ b/include/SFML/Graphics/Color.h @@ -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 diff --git a/include/SFML/Graphics/ConvexShape.h b/include/SFML/Graphics/ConvexShape.h index e80fb48..dd19d5b 100644 --- a/include/SFML/Graphics/ConvexShape.h +++ b/include/SFML/Graphics/ConvexShape.h @@ -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 diff --git a/include/SFML/Graphics/Font.h b/include/SFML/Graphics/Font.h index 55f617c..c38dd2e 100644 --- a/include/SFML/Graphics/Font.h +++ b/include/SFML/Graphics/Font.h @@ -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 diff --git a/include/SFML/Graphics/Glyph.h b/include/SFML/Graphics/Glyph.h index e873c56..1766895 100644 --- a/include/SFML/Graphics/Glyph.h +++ b/include/SFML/Graphics/Glyph.h @@ -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; diff --git a/include/SFML/Graphics/Image.h b/include/SFML/Graphics/Image.h index 0e92a8b..49b94d4 100644 --- a/include/SFML/Graphics/Image.h +++ b/include/SFML/Graphics/Image.h @@ -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 diff --git a/include/SFML/Graphics/Rect.h b/include/SFML/Graphics/Rect.h index 4e61cc2..104fde4 100644 --- a/include/SFML/Graphics/Rect.h +++ b/include/SFML/Graphics/Rect.h @@ -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 diff --git a/include/SFML/Graphics/RectangleShape.h b/include/SFML/Graphics/RectangleShape.h index 5eb7e4e..be705c7 100644 --- a/include/SFML/Graphics/RectangleShape.h +++ b/include/SFML/Graphics/RectangleShape.h @@ -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 diff --git a/include/SFML/Graphics/RenderStates.h b/include/SFML/Graphics/RenderStates.h index 6abc536..039eba6 100644 --- a/include/SFML/Graphics/RenderStates.h +++ b/include/SFML/Graphics/RenderStates.h @@ -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; diff --git a/include/SFML/Graphics/RenderTexture.h b/include/SFML/Graphics/RenderTexture.h index 9416f6b..3277e45 100644 --- a/include/SFML/Graphics/RenderTexture.h +++ b/include/SFML/Graphics/RenderTexture.h @@ -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 diff --git a/include/SFML/Graphics/RenderWindow.h b/include/SFML/Graphics/RenderWindow.h index fd421f5..ace24e4 100644 --- a/include/SFML/Graphics/RenderWindow.h +++ b/include/SFML/Graphics/RenderWindow.h @@ -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 diff --git a/include/SFML/Graphics/Shader.h b/include/SFML/Graphics/Shader.h index 3011983..013c98f 100644 --- a/include/SFML/Graphics/Shader.h +++ b/include/SFML/Graphics/Shader.h @@ -32,6 +32,8 @@ #include #include #include +#include +#include //////////////////////////////////////////////////////////// @@ -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 diff --git a/include/SFML/Graphics/Shape.h b/include/SFML/Graphics/Shape.h index 0a6705b..925b664 100644 --- a/include/SFML/Graphics/Shape.h +++ b/include/SFML/Graphics/Shape.h @@ -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 diff --git a/include/SFML/Graphics/Sprite.h b/include/SFML/Graphics/Sprite.h index eaae526..6d71f4f 100644 --- a/include/SFML/Graphics/Sprite.h +++ b/include/SFML/Graphics/Sprite.h @@ -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 diff --git a/include/SFML/Graphics/Text.h b/include/SFML/Graphics/Text.h index a806473..bf930ce 100644 --- a/include/SFML/Graphics/Text.h +++ b/include/SFML/Graphics/Text.h @@ -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 diff --git a/include/SFML/Graphics/Texture.h b/include/SFML/Graphics/Texture.h index f2792cc..4d679c3 100644 --- a/include/SFML/Graphics/Texture.h +++ b/include/SFML/Graphics/Texture.h @@ -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 diff --git a/include/SFML/Graphics/Transform.h b/include/SFML/Graphics/Transform.h index aa42ca8..320c117 100644 --- a/include/SFML/Graphics/Transform.h +++ b/include/SFML/Graphics/Transform.h @@ -31,6 +31,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////// @@ -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 diff --git a/include/SFML/Graphics/Transformable.h b/include/SFML/Graphics/Transformable.h index a520f09..042736f 100644 --- a/include/SFML/Graphics/Transformable.h +++ b/include/SFML/Graphics/Transformable.h @@ -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 diff --git a/include/SFML/Graphics/Vertex.h b/include/SFML/Graphics/Vertex.h index 5095578..8b13368 100644 --- a/include/SFML/Graphics/Vertex.h +++ b/include/SFML/Graphics/Vertex.h @@ -30,6 +30,7 @@ //////////////////////////////////////////////////////////// #include #include +#include //////////////////////////////////////////////////////////// @@ -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; diff --git a/include/SFML/Graphics/VertexArray.h b/include/SFML/Graphics/VertexArray.h index 9253ac4..66fc220 100644 --- a/include/SFML/Graphics/VertexArray.h +++ b/include/SFML/Graphics/VertexArray.h @@ -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 diff --git a/include/SFML/Graphics/View.h b/include/SFML/Graphics/View.h index 2cea3eb..1791e94 100644 --- a/include/SFML/Graphics/View.h +++ b/include/SFML/Graphics/View.h @@ -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 diff --git a/include/SFML/Network/Ftp.h b/include/SFML/Network/Ftp.h index 15a4836..d077d28 100644 --- a/include/SFML/Network/Ftp.h +++ b/include/SFML/Network/Ftp.h @@ -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 diff --git a/include/SFML/Network/Http.h b/include/SFML/Network/Http.h index 0eca898..e9a215d 100644 --- a/include/SFML/Network/Http.h +++ b/include/SFML/Network/Http.h @@ -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 diff --git a/include/SFML/Network/IpAddress.h b/include/SFML/Network/IpAddress.h index 17fbac5..4035546 100644 --- a/include/SFML/Network/IpAddress.h +++ b/include/SFML/Network/IpAddress.h @@ -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 diff --git a/include/SFML/Network/Packet.h b/include/SFML/Network/Packet.h index 7f1f083..5601501 100644 --- a/include/SFML/Network/Packet.h +++ b/include/SFML/Network/Packet.h @@ -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 diff --git a/include/SFML/Network/SocketSelector.h b/include/SFML/Network/SocketSelector.h index d4d0871..1946c90 100644 --- a/include/SFML/Network/SocketSelector.h +++ b/include/SFML/Network/SocketSelector.h @@ -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 diff --git a/include/SFML/Network/TcpListener.h b/include/SFML/Network/TcpListener.h index 77933ac..5fb1e91 100644 --- a/include/SFML/Network/TcpListener.h +++ b/include/SFML/Network/TcpListener.h @@ -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 diff --git a/include/SFML/Network/TcpSocket.h b/include/SFML/Network/TcpSocket.h index 71cb94c..d7dc2ea 100644 --- a/include/SFML/Network/TcpSocket.h +++ b/include/SFML/Network/TcpSocket.h @@ -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 diff --git a/include/SFML/Network/UdpSocket.h b/include/SFML/Network/UdpSocket.h index 84f792b..e76f5a8 100644 --- a/include/SFML/Network/UdpSocket.h +++ b/include/SFML/Network/UdpSocket.h @@ -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 diff --git a/include/SFML/System/Clock.h b/include/SFML/System/Clock.h index 78c17b0..27a0c40 100644 --- a/include/SFML/System/Clock.h +++ b/include/SFML/System/Clock.h @@ -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 diff --git a/include/SFML/System/InputStream.h b/include/SFML/System/InputStream.h index 93c6db3..fb44464 100644 --- a/include/SFML/System/InputStream.h +++ b/include/SFML/System/InputStream.h @@ -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; diff --git a/include/SFML/System/Mutex.h b/include/SFML/System/Mutex.h index eb2c8cf..4db18df 100644 --- a/include/SFML/System/Mutex.h +++ b/include/SFML/System/Mutex.h @@ -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 diff --git a/include/SFML/System/Thread.h b/include/SFML/System/Thread.h index 350be51..8706d89 100644 --- a/include/SFML/System/Thread.h +++ b/include/SFML/System/Thread.h @@ -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 diff --git a/include/SFML/System/Time.h b/include/SFML/System/Time.h index 55cff25..bfb6e91 100644 --- a/include/SFML/System/Time.h +++ b/include/SFML/System/Time.h @@ -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 diff --git a/include/SFML/Window/Context.h b/include/SFML/Window/Context.h index b30c09d..b026909 100644 --- a/include/SFML/Window/Context.h +++ b/include/SFML/Window/Context.h @@ -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 diff --git a/include/SFML/Window/Event.h b/include/SFML/Window/Event.h index c71ec53..32771a9 100644 --- a/include/SFML/Window/Event.h +++ b/include/SFML/Window/Event.h @@ -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; diff --git a/include/SFML/Window/Joystick.h b/include/SFML/Window/Joystick.h index b8ce800..ce7d3bf 100644 --- a/include/SFML/Window/Joystick.h +++ b/include/SFML/Window/Joystick.h @@ -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 diff --git a/include/SFML/Window/Keyboard.h b/include/SFML/Window/Keyboard.h index dab421e..42142e4 100644 --- a/include/SFML/Window/Keyboard.h +++ b/include/SFML/Window/Keyboard.h @@ -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 diff --git a/include/SFML/Window/Mouse.h b/include/SFML/Window/Mouse.h index fd23ba7..767efd6 100644 --- a/include/SFML/Window/Mouse.h +++ b/include/SFML/Window/Mouse.h @@ -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 diff --git a/include/SFML/Window/VideoMode.h b/include/SFML/Window/VideoMode.h index c94e67a..74d43a0 100644 --- a/include/SFML/Window/VideoMode.h +++ b/include/SFML/Window/VideoMode.h @@ -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 diff --git a/include/SFML/Window/Window.h b/include/SFML/Window/Window.h index 286e17d..22905f9 100644 --- a/include/SFML/Window/Window.h +++ b/include/SFML/Window/Window.h @@ -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 diff --git a/src/SFML/Audio/Listener.cpp b/src/SFML/Audio/Listener.cpp index 89a500b..7aa3cab 100644 --- a/src/SFML/Audio/Listener.cpp +++ b/src/SFML/Audio/Listener.cpp @@ -31,46 +31,46 @@ //////////////////////////////////////////////////////////// -void sfListener_SetGlobalVolume(float volume) +void sfListener_setGlobalVolume(float volume) { - sf::Listener::SetGlobalVolume(volume); + sf::Listener::setGlobalVolume(volume); } //////////////////////////////////////////////////////////// -float sfListener_GetGlobalVolume(void) +float sfListener_getGlobalVolume(void) { - return sf::Listener::GetGlobalVolume(); + return sf::Listener::getGlobalVolume(); } //////////////////////////////////////////////////////////// -void sfListener_SetPosition(sfVector3f position) +void sfListener_setPosition(sfVector3f position) { - sf::Listener::SetPosition(position.x, position.y, position.z); + sf::Listener::setPosition(position.x, position.y, position.z); } //////////////////////////////////////////////////////////// -sfVector3f sfListener_GetPosition() +sfVector3f sfListener_getPosition() { - sf::Vector3f sfmlPos = sf::Listener::GetPosition(); + sf::Vector3f sfmlPos = sf::Listener::getPosition(); sfVector3f position = {sfmlPos.x, sfmlPos.y, sfmlPos.z}; return position; } //////////////////////////////////////////////////////////// -void sfListener_SetDirection(sfVector3f direction) +void sfListener_setDirection(sfVector3f direction) { - sf::Listener::SetDirection(direction.x, direction.y, direction.z); + sf::Listener::setDirection(direction.x, direction.y, direction.z); } //////////////////////////////////////////////////////////// -sfVector3f sfListener_GetDirection() +sfVector3f sfListener_getDirection() { - sf::Vector3f sfmlDirection = sf::Listener::GetDirection(); + sf::Vector3f sfmlDirection = sf::Listener::getDirection(); sfVector3f direction = {sfmlDirection.x, sfmlDirection.y, sfmlDirection.z}; return direction; } diff --git a/src/SFML/Audio/Music.cpp b/src/SFML/Audio/Music.cpp index afb4c86..9085623 100644 --- a/src/SFML/Audio/Music.cpp +++ b/src/SFML/Audio/Music.cpp @@ -31,10 +31,10 @@ //////////////////////////////////////////////////////////// -sfMusic* sfMusic_CreateFromFile(const char* filename) +sfMusic* sfMusic_createFromFile(const char* filename) { sfMusic* music = new sfMusic; - if (!music->This.OpenFromFile(filename)) + if (!music->This.openFromFile(filename)) { delete music; music = NULL; @@ -45,10 +45,10 @@ sfMusic* sfMusic_CreateFromFile(const char* filename) //////////////////////////////////////////////////////////// -sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes) +sfMusic* sfMusic_createFromMemory(const void* data, size_t sizeInBytes) { sfMusic* music = new sfMusic; - if (!music->This.OpenFromMemory(data, sizeInBytes)) + if (!music->This.openFromMemory(data, sizeInBytes)) { delete music; music = NULL; @@ -59,13 +59,13 @@ sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes) //////////////////////////////////////////////////////////// -sfMusic* sfMusic_CreateFromStream(sfInputStream* stream) +sfMusic* sfMusic_createFromStream(sfInputStream* stream) { CSFML_CHECK_RETURN(stream, NULL); sfMusic* music = new sfMusic; music->Stream = CallbackStream(stream); - if (!music->This.OpenFromStream(music->Stream)) + if (!music->This.openFromStream(music->Stream)) { delete music; music = NULL; @@ -76,162 +76,162 @@ sfMusic* sfMusic_CreateFromStream(sfInputStream* stream) //////////////////////////////////////////////////////////// -void sfMusic_Destroy(sfMusic* music) +void sfMusic_destroy(sfMusic* music) { delete music; } //////////////////////////////////////////////////////////// -void sfMusic_SetLoop(sfMusic* music, sfBool loop) +void sfMusic_setLoop(sfMusic* music, sfBool loop) { - CSFML_CALL(music, SetLoop(loop != 0)); + CSFML_CALL(music, setLoop(loop != 0)); } //////////////////////////////////////////////////////////// -sfBool sfMusic_GetLoop(const sfMusic* music) +sfBool sfMusic_getLoop(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetLoop(), sfFalse); + CSFML_CALL_RETURN(music, getLoop(), sfFalse); } //////////////////////////////////////////////////////////// -sfTime sfMusic_GetDuration(const sfMusic* music) +sfTime sfMusic_getDuration(const sfMusic* music) { sfTime time = {0}; CSFML_CHECK_RETURN(music, time); - time.Microseconds = music->This.GetDuration().AsMicroseconds(); + time.microseconds = music->This.getDuration().asMicroseconds(); return time; } //////////////////////////////////////////////////////////// -void sfMusic_Play(sfMusic* music) +void sfMusic_play(sfMusic* music) { - CSFML_CALL(music, Play()); + CSFML_CALL(music, play()); } //////////////////////////////////////////////////////////// -void sfMusic_Pause(sfMusic* music) +void sfMusic_pause(sfMusic* music) { - CSFML_CALL(music, Pause()); + CSFML_CALL(music, pause()); } //////////////////////////////////////////////////////////// -void sfMusic_Stop(sfMusic* music) +void sfMusic_stop(sfMusic* music) { - CSFML_CALL(music, Stop()); + CSFML_CALL(music, stop()); } //////////////////////////////////////////////////////////// -unsigned int sfMusic_GetChannelCount(const sfMusic* music) +unsigned int sfMusic_getChannelCount(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetChannelCount(), 0); + CSFML_CALL_RETURN(music, getChannelCount(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfMusic_GetSampleRate(const sfMusic* music) +unsigned int sfMusic_getSampleRate(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetSampleRate(), 0); + CSFML_CALL_RETURN(music, getSampleRate(), 0); } //////////////////////////////////////////////////////////// -sfSoundStatus sfMusic_GetStatus(const sfMusic* music) +sfSoundStatus sfMusic_getStatus(const sfMusic* music) { CSFML_CHECK_RETURN(music, sfStopped); - return static_cast(music->This.GetStatus()); + return static_cast(music->This.getStatus()); } //////////////////////////////////////////////////////////// -sfTime sfMusic_GetPlayingOffset(const sfMusic* music) +sfTime sfMusic_getPlayingOffset(const sfMusic* music) { sfTime time = {0}; CSFML_CHECK_RETURN(music, time); - time.Microseconds = music->This.GetPlayingOffset().AsMicroseconds(); + time.microseconds = music->This.getPlayingOffset().asMicroseconds(); return time; } //////////////////////////////////////////////////////////// -void sfMusic_SetPitch(sfMusic* music, float pitch) +void sfMusic_setPitch(sfMusic* music, float pitch) { - CSFML_CALL(music, SetPitch(pitch)); + CSFML_CALL(music, setPitch(pitch)); } //////////////////////////////////////////////////////////// -void sfMusic_SetVolume(sfMusic* music, float volume) +void sfMusic_setVolume(sfMusic* music, float volume) { - CSFML_CALL(music, SetVolume(volume)); + CSFML_CALL(music, setVolume(volume)); } //////////////////////////////////////////////////////////// -void sfMusic_SetPosition(sfMusic* music, sfVector3f position) +void sfMusic_setPosition(sfMusic* music, sfVector3f position) { - CSFML_CALL(music, SetPosition(sf::Vector3f(position.x, position.y, position.z))); + CSFML_CALL(music, setPosition(sf::Vector3f(position.x, position.y, position.z))); } //////////////////////////////////////////////////////////// -void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relative) +void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative) { - CSFML_CALL(music, SetRelativeToListener(relative == sfTrue)); + CSFML_CALL(music, setRelativeToListener(relative == sfTrue)); } //////////////////////////////////////////////////////////// -void sfMusic_SetMinDistance(sfMusic* music, float distance) +void sfMusic_setMinDistance(sfMusic* music, float distance) { - CSFML_CALL(music, SetMinDistance(distance)); + CSFML_CALL(music, setMinDistance(distance)); } //////////////////////////////////////////////////////////// -void sfMusic_SetAttenuation(sfMusic* music, float attenuation) +void sfMusic_setAttenuation(sfMusic* music, float attenuation) { - CSFML_CALL(music, SetAttenuation(attenuation)); + CSFML_CALL(music, setAttenuation(attenuation)); } //////////////////////////////////////////////////////////// -void sfMusic_SetPlayingOffset(sfMusic* music, sfTime timeOffset) +void sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset) { - CSFML_CALL(music, SetPlayingOffset(sf::Microseconds(timeOffset.Microseconds))); + CSFML_CALL(music, setPlayingOffset(sf::microseconds(timeOffset.microseconds))); } //////////////////////////////////////////////////////////// -float sfMusic_GetPitch(const sfMusic* music) +float sfMusic_getPitch(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetPitch(), 0.f); + CSFML_CALL_RETURN(music, getPitch(), 0.f); } //////////////////////////////////////////////////////////// -float sfMusic_GetVolume(const sfMusic* music) +float sfMusic_getVolume(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetVolume(), 0.f); + CSFML_CALL_RETURN(music, getVolume(), 0.f); } //////////////////////////////////////////////////////////// -sfVector3f sfMusic_GetPosition(const sfMusic* music) +sfVector3f sfMusic_getPosition(const sfMusic* music) { sfVector3f position = {0, 0, 0}; CSFML_CHECK_RETURN(music, position); - sf::Vector3f sfmlPos = music->This.GetPosition(); + sf::Vector3f sfmlPos = music->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; position.z = sfmlPos.z; @@ -241,21 +241,21 @@ sfVector3f sfMusic_GetPosition(const sfMusic* music) //////////////////////////////////////////////////////////// -CSFML_AUDIO_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music) +sfBool sfMusic_isRelativeToListener(const sfMusic* music) { - CSFML_CALL_RETURN(music, IsRelativeToListener(), sfFalse); + CSFML_CALL_RETURN(music, isRelativeToListener(), sfFalse); } //////////////////////////////////////////////////////////// -float sfMusic_GetMinDistance(const sfMusic* music) +float sfMusic_getMinDistance(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetMinDistance(), 0.f); + CSFML_CALL_RETURN(music, getMinDistance(), 0.f); } //////////////////////////////////////////////////////////// -float sfMusic_GetAttenuation(const sfMusic* music) +float sfMusic_getAttenuation(const sfMusic* music) { - CSFML_CALL_RETURN(music, GetAttenuation(), 0.f); + CSFML_CALL_RETURN(music, getAttenuation(), 0.f); } diff --git a/src/SFML/Audio/Sound.cpp b/src/SFML/Audio/Sound.cpp index 8a142d6..1811114 100644 --- a/src/SFML/Audio/Sound.cpp +++ b/src/SFML/Audio/Sound.cpp @@ -31,14 +31,14 @@ //////////////////////////////////////////////////////////// -sfSound* sfSound_Create(void) +sfSound* sfSound_create(void) { return new sfSound; } //////////////////////////////////////////////////////////// -sfSound* sfSound_Copy(sfSound* sound) +sfSound* sfSound_copy(sfSound* sound) { CSFML_CHECK_RETURN(sound, NULL); @@ -47,46 +47,46 @@ sfSound* sfSound_Copy(sfSound* sound) //////////////////////////////////////////////////////////// -void sfSound_Destroy(sfSound* sound) +void sfSound_destroy(sfSound* sound) { delete sound; } //////////////////////////////////////////////////////////// -void sfSound_Play(sfSound* sound) +void sfSound_play(sfSound* sound) { - CSFML_CALL(sound, Play()); + CSFML_CALL(sound, play()); } //////////////////////////////////////////////////////////// -void sfSound_Pause(sfSound* sound) +void sfSound_pause(sfSound* sound) { - CSFML_CALL(sound, Pause()); + CSFML_CALL(sound, pause()); } //////////////////////////////////////////////////////////// -void sfSound_Stop(sfSound* sound) +void sfSound_stop(sfSound* sound) { - CSFML_CALL(sound, Stop()); + CSFML_CALL(sound, stop()); } //////////////////////////////////////////////////////////// -void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buffer) +void sfSound_setBuffer(sfSound* sound, const sfSoundBuffer* buffer) { if (buffer) { - CSFML_CALL(sound, SetBuffer(buffer->This)); + CSFML_CALL(sound, setBuffer(buffer->This)); sound->Buffer = buffer; } } //////////////////////////////////////////////////////////// -const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound) +const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound) { CSFML_CHECK_RETURN(sound, NULL); @@ -95,98 +95,98 @@ const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound) //////////////////////////////////////////////////////////// -void sfSound_SetLoop(sfSound* sound, sfBool loop) +void sfSound_setLoop(sfSound* sound, sfBool loop) { - CSFML_CALL(sound, SetLoop(loop == sfTrue)); + CSFML_CALL(sound, setLoop(loop == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfSound_GetLoop(const sfSound* sound) +sfBool sfSound_getLoop(const sfSound* sound) { - CSFML_CALL_RETURN(sound, GetLoop(), sfFalse); + CSFML_CALL_RETURN(sound, getLoop(), sfFalse); } //////////////////////////////////////////////////////////// -sfSoundStatus sfSound_GetStatus(const sfSound* sound) +sfSoundStatus sfSound_getStatus(const sfSound* sound) { CSFML_CHECK_RETURN(sound, sfStopped); - return static_cast(sound->This.GetStatus()); + return static_cast(sound->This.getStatus()); } //////////////////////////////////////////////////////////// -void sfSound_SetPitch(sfSound* sound, float pitch) +void sfSound_setPitch(sfSound* sound, float pitch) { - CSFML_CALL(sound, SetPitch(pitch)); + CSFML_CALL(sound, setPitch(pitch)); } //////////////////////////////////////////////////////////// -void sfSound_SetVolume(sfSound* sound, float volume) +void sfSound_setVolume(sfSound* sound, float volume) { - CSFML_CALL(sound, SetVolume(volume)); + CSFML_CALL(sound, setVolume(volume)); } //////////////////////////////////////////////////////////// -void sfSound_SetPosition(sfSound* sound, sfVector3f position) +void sfSound_setPosition(sfSound* sound, sfVector3f position) { - CSFML_CALL(sound, SetPosition(sf::Vector3f(position.x, position.y, position.z))); + CSFML_CALL(sound, setPosition(sf::Vector3f(position.x, position.y, position.z))); } //////////////////////////////////////////////////////////// -void sfSound_SetRelativeToListener(sfSound* sound, sfBool relative) +void sfSound_setRelativeToListener(sfSound* sound, sfBool relative) { - CSFML_CALL(sound, SetRelativeToListener(relative == sfTrue)); + CSFML_CALL(sound, setRelativeToListener(relative == sfTrue)); } //////////////////////////////////////////////////////////// -void sfSound_SetMinDistance(sfSound* sound, float distance) +void sfSound_setMinDistance(sfSound* sound, float distance) { - CSFML_CALL(sound, SetMinDistance(distance)); + CSFML_CALL(sound, setMinDistance(distance)); } //////////////////////////////////////////////////////////// -void sfSound_SetAttenuation(sfSound* sound, float attenuation) +void sfSound_setAttenuation(sfSound* sound, float attenuation) { - CSFML_CALL(sound, SetAttenuation(attenuation)); + CSFML_CALL(sound, setAttenuation(attenuation)); } //////////////////////////////////////////////////////////// -void sfSound_SetPlayingOffset(sfSound* sound, sfTime timeOffset) +void sfSound_setPlayingOffset(sfSound* sound, sfTime timeOffset) { - CSFML_CALL(sound, SetPlayingOffset(sf::Microseconds(timeOffset.Microseconds))); + CSFML_CALL(sound, setPlayingOffset(sf::microseconds(timeOffset.microseconds))); } //////////////////////////////////////////////////////////// -float sfSound_GetPitch(const sfSound* sound) +float sfSound_getPitch(const sfSound* sound) { - CSFML_CALL_RETURN(sound, GetPitch(), 0.f); + CSFML_CALL_RETURN(sound, getPitch(), 0.f); } //////////////////////////////////////////////////////////// -float sfSound_GetVolume(const sfSound* sound) +float sfSound_getVolume(const sfSound* sound) { - CSFML_CALL_RETURN(sound, GetVolume(), 0.f); + CSFML_CALL_RETURN(sound, getVolume(), 0.f); } //////////////////////////////////////////////////////////// -sfVector3f sfSound_GetPosition(const sfSound* sound) +sfVector3f sfSound_getPosition(const sfSound* sound) { sfVector3f position = {0, 0, 0}; CSFML_CHECK_RETURN(sound, position); - sf::Vector3f sfmlPos = sound->This.GetPosition(); + sf::Vector3f sfmlPos = sound->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; position.z = sfmlPos.z; @@ -196,32 +196,32 @@ sfVector3f sfSound_GetPosition(const sfSound* sound) //////////////////////////////////////////////////////////// -CSFML_AUDIO_API sfBool sfSound_IsRelativeToListener(const sfSound* sound) +CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound) { - CSFML_CALL_RETURN(sound, IsRelativeToListener(), sfFalse); + CSFML_CALL_RETURN(sound, isRelativeToListener(), sfFalse); } //////////////////////////////////////////////////////////// -float sfSound_GetMinDistance(const sfSound* sound) +float sfSound_getMinDistance(const sfSound* sound) { - CSFML_CALL_RETURN(sound, GetMinDistance(), 0.f); + CSFML_CALL_RETURN(sound, getMinDistance(), 0.f); } //////////////////////////////////////////////////////////// -float sfSound_GetAttenuation(const sfSound* sound) +float sfSound_getAttenuation(const sfSound* sound) { - CSFML_CALL_RETURN(sound, GetAttenuation(), 0.f); + CSFML_CALL_RETURN(sound, getAttenuation(), 0.f); } //////////////////////////////////////////////////////////// -sfTime sfSound_GetPlayingOffset(const sfSound* sound) +sfTime sfSound_getPlayingOffset(const sfSound* sound) { sfTime time = {0}; CSFML_CHECK_RETURN(sound, time); - time.Microseconds = sound->This.GetPlayingOffset().AsMicroseconds(); + time.microseconds = sound->This.getPlayingOffset().asMicroseconds(); return time; } diff --git a/src/SFML/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp index 152cd17..d08d67d 100644 --- a/src/SFML/Audio/SoundBuffer.cpp +++ b/src/SFML/Audio/SoundBuffer.cpp @@ -32,11 +32,11 @@ //////////////////////////////////////////////////////////// -sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename) +sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename) { sfSoundBuffer* buffer = new sfSoundBuffer; - if (!buffer->This.LoadFromFile(filename)) + if (!buffer->This.loadFromFile(filename)) { delete buffer; buffer = NULL; @@ -47,11 +47,11 @@ sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename) //////////////////////////////////////////////////////////// -sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInBytes) +sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInBytes) { sfSoundBuffer* buffer = new sfSoundBuffer; - if (!buffer->This.LoadFromMemory(data, sizeInBytes)) + if (!buffer->This.loadFromMemory(data, sizeInBytes)) { delete buffer; buffer = NULL; @@ -63,13 +63,13 @@ sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInByt //////////////////////////////////////////////////////////// -CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* stream) +CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream) { CSFML_CHECK_RETURN(stream, NULL); sfSoundBuffer* buffer = new sfSoundBuffer; CallbackStream sfmlStream(stream); - if (!buffer->This.LoadFromStream(sfmlStream)) + if (!buffer->This.loadFromStream(sfmlStream)) { delete buffer; buffer = NULL; @@ -80,11 +80,11 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* str //////////////////////////////////////////////////////////// -sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelsCount, unsigned int sampleRate) +sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate) { sfSoundBuffer* buffer = new sfSoundBuffer; - if (!buffer->This.LoadFromSamples(samples, sampleCount, channelsCount, sampleRate)) + if (!buffer->This.loadFromSamples(samples, sampleCount, channelCount, sampleRate)) { delete buffer; buffer = NULL; @@ -95,7 +95,7 @@ sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sa //////////////////////////////////////////////////////////// -sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer) +sfSoundBuffer* sfSoundBuffer_copy(sfSoundBuffer* soundBuffer) { CSFML_CHECK_RETURN(soundBuffer, NULL); @@ -104,53 +104,53 @@ sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer) //////////////////////////////////////////////////////////// -void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer) +void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer) { delete soundBuffer; } //////////////////////////////////////////////////////////// -sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename) +sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename) { - CSFML_CALL_RETURN(soundBuffer, SaveToFile(filename), sfFalse); + CSFML_CALL_RETURN(soundBuffer, saveToFile(filename), sfFalse); } //////////////////////////////////////////////////////////// -const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer) +const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer) { - CSFML_CALL_RETURN(soundBuffer, GetSamples(), NULL); + CSFML_CALL_RETURN(soundBuffer, getSamples(), NULL); } //////////////////////////////////////////////////////////// -size_t sfSoundBuffer_GetSampleCount(const sfSoundBuffer* soundBuffer) +size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer) { - CSFML_CALL_RETURN(soundBuffer, GetSampleCount(), 0); + CSFML_CALL_RETURN(soundBuffer, getSampleCount(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer) +unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer) { - CSFML_CALL_RETURN(soundBuffer, GetSampleRate(), 0); + CSFML_CALL_RETURN(soundBuffer, getSampleRate(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfSoundBuffer_GetChannelCount(const sfSoundBuffer* soundBuffer) +unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer) { - CSFML_CALL_RETURN(soundBuffer, GetChannelCount(), 0); + CSFML_CALL_RETURN(soundBuffer, getChannelCount(), 0); } //////////////////////////////////////////////////////////// -sfTime sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer) +sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer) { sfTime time = {0}; CSFML_CHECK_RETURN(soundBuffer, time); - time.Microseconds = soundBuffer->This.GetDuration().AsMicroseconds(); + time.microseconds = soundBuffer->This.getDuration().asMicroseconds(); return time; } diff --git a/src/SFML/Audio/SoundBufferRecorder.cpp b/src/SFML/Audio/SoundBufferRecorder.cpp index cbd5a01..769057e 100644 --- a/src/SFML/Audio/SoundBufferRecorder.cpp +++ b/src/SFML/Audio/SoundBufferRecorder.cpp @@ -31,46 +31,46 @@ //////////////////////////////////////////////////////////// -sfSoundBufferRecorder* sfSoundBufferRecorder_Create(void) +sfSoundBufferRecorder* sfSoundBufferRecorder_create(void) { return new sfSoundBufferRecorder; } //////////////////////////////////////////////////////////// -void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundBufferRecorder) +void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder) { delete soundBufferRecorder; } //////////////////////////////////////////////////////////// -void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate) +void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate) { - CSFML_CALL(soundBufferRecorder, Start(sampleRate)); + CSFML_CALL(soundBufferRecorder, start(sampleRate)); } //////////////////////////////////////////////////////////// -void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder) +void sfSoundBufferRecorder_stop(sfSoundBufferRecorder* soundBufferRecorder) { - CSFML_CALL(soundBufferRecorder, Stop()); + CSFML_CALL(soundBufferRecorder, stop()); } //////////////////////////////////////////////////////////// -unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBufferRecorder* soundBufferRecorder) +unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBufferRecorder* soundBufferRecorder) { - CSFML_CALL_RETURN(soundBufferRecorder, GetSampleRate(), 0); + CSFML_CALL_RETURN(soundBufferRecorder, getSampleRate(), 0); } //////////////////////////////////////////////////////////// -const sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(const sfSoundBufferRecorder* soundBufferRecorder) +const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder) { CSFML_CHECK_RETURN(soundBufferRecorder, NULL); - soundBufferRecorder->SoundBuffer.This = soundBufferRecorder->This.GetBuffer(); + soundBufferRecorder->SoundBuffer.This = soundBufferRecorder->This.getBuffer(); return &soundBufferRecorder->SoundBuffer; } diff --git a/src/SFML/Audio/SoundRecorder.cpp b/src/SFML/Audio/SoundRecorder.cpp index 337e362..8ef306a 100644 --- a/src/SFML/Audio/SoundRecorder.cpp +++ b/src/SFML/Audio/SoundRecorder.cpp @@ -31,7 +31,7 @@ //////////////////////////////////////////////////////////// -sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart, +sfSoundRecorder* sfSoundRecorder_create(sfSoundRecorderStartCallback onStart, sfSoundRecorderProcessCallback onProcess, sfSoundRecorderStopCallback onStop, void* userData) @@ -41,35 +41,35 @@ sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback onStart, //////////////////////////////////////////////////////////// -void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder) +void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder) { delete soundRecorder; } //////////////////////////////////////////////////////////// -void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsigned int sampleRate) +void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate) { - CSFML_CALL(soundRecorder, Start(sampleRate)); + CSFML_CALL(soundRecorder, start(sampleRate)); } //////////////////////////////////////////////////////////// -void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder) +void sfSoundRecorder_stop(sfSoundRecorder* soundRecorder) { - CSFML_CALL(soundRecorder, Stop()); + CSFML_CALL(soundRecorder, stop()); } //////////////////////////////////////////////////////////// -unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder* soundRecorder) +unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder) { - CSFML_CALL_RETURN(soundRecorder, GetSampleRate(), 0); + CSFML_CALL_RETURN(soundRecorder, getSampleRate(), 0); } //////////////////////////////////////////////////////////// -sfBool sfSoundRecorder_IsAvailable(void) +sfBool sfSoundRecorder_isAvailable(void) { - return sf::SoundRecorder::IsAvailable() ? sfTrue : sfFalse; + return sf::SoundRecorder::isAvailable() ? sfTrue : sfFalse; } diff --git a/src/SFML/Audio/SoundRecorderStruct.h b/src/SFML/Audio/SoundRecorderStruct.h index a596f84..8d9bf56 100644 --- a/src/SFML/Audio/SoundRecorderStruct.h +++ b/src/SFML/Audio/SoundRecorderStruct.h @@ -53,7 +53,7 @@ public : private : - virtual bool OnStart() + virtual bool onStart() { if (myStartCallback) return myStartCallback(myUserData) == sfTrue; @@ -61,7 +61,7 @@ private : return true; } - virtual bool OnProcessSamples(const sf::Int16* samples, std::size_t sampleCount) + virtual bool onProcessSamples(const sf::Int16* samples, std::size_t sampleCount) { if (myProcessCallback) return myProcessCallback(samples, sampleCount, myUserData) == sfTrue; @@ -69,7 +69,7 @@ private : return true; } - virtual void OnStop() + virtual void onStop() { if (myStopCallback) myStopCallback(myUserData); diff --git a/src/SFML/Audio/SoundStream.cpp b/src/SFML/Audio/SoundStream.cpp index 2cd3768..5a341be 100644 --- a/src/SFML/Audio/SoundStream.cpp +++ b/src/SFML/Audio/SoundStream.cpp @@ -31,7 +31,7 @@ //////////////////////////////////////////////////////////// -sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData, +sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData, sfSoundStreamSeekCallback onSeek, unsigned int channelCount, unsigned int sampleRate, @@ -42,133 +42,133 @@ sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData, //////////////////////////////////////////////////////////// -void sfSoundStream_Destroy(sfSoundStream* soundStream) +void sfSoundStream_destroy(sfSoundStream* soundStream) { delete soundStream; } //////////////////////////////////////////////////////////// -void sfSoundStream_Play(sfSoundStream* soundStream) +void sfSoundStream_play(sfSoundStream* soundStream) { - CSFML_CALL(soundStream, Play()); + CSFML_CALL(soundStream, play()); } //////////////////////////////////////////////////////////// -void sfSoundStream_Pause(sfSoundStream* soundStream) +void sfSoundStream_pause(sfSoundStream* soundStream) { - CSFML_CALL(soundStream, Pause()); + CSFML_CALL(soundStream, pause()); } //////////////////////////////////////////////////////////// -void sfSoundStream_Stop(sfSoundStream* soundStream) +void sfSoundStream_stop(sfSoundStream* soundStream) { - CSFML_CALL(soundStream, Stop()); + CSFML_CALL(soundStream, stop()); } //////////////////////////////////////////////////////////// -sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream) +sfSoundStatus sfSoundStream_getStatus(const sfSoundStream* soundStream) { CSFML_CHECK_RETURN(soundStream, sfStopped); - return static_cast(soundStream->This.GetStatus()); + return static_cast(soundStream->This.getStatus()); } //////////////////////////////////////////////////////////// -unsigned int sfSoundStream_GetChannelCount(const sfSoundStream* soundStream) +unsigned int sfSoundStream_getChannelCount(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetChannelCount(), 0); + CSFML_CALL_RETURN(soundStream, getChannelCount(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* soundStream) +unsigned int sfSoundStream_getSampleRate(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetSampleRate(), 0); + CSFML_CALL_RETURN(soundStream, getSampleRate(), 0); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pitch) +void sfSoundStream_setPitch(sfSoundStream* soundStream, float pitch) { - CSFML_CALL(soundStream, SetPitch(pitch)); + CSFML_CALL(soundStream, setPitch(pitch)); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetVolume(sfSoundStream* soundStream, float volume) +void sfSoundStream_setVolume(sfSoundStream* soundStream, float volume) { - CSFML_CALL(soundStream, SetVolume(volume)); + CSFML_CALL(soundStream, setVolume(volume)); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetPosition(sfSoundStream* soundStream, sfVector3f position) +void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVector3f position) { - CSFML_CALL(soundStream, SetPosition(position.x, position.y, position.z)); + CSFML_CALL(soundStream, setPosition(position.x, position.y, position.z)); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStream, sfBool relative) +void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative) { - CSFML_CALL(soundStream, SetRelativeToListener(relative == sfTrue)); + CSFML_CALL(soundStream, setRelativeToListener(relative == sfTrue)); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, float distance) +void sfSoundStream_setMinDistance(sfSoundStream* soundStream, float distance) { - CSFML_CALL(soundStream, SetMinDistance(distance)); + CSFML_CALL(soundStream, setMinDistance(distance)); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation) +void sfSoundStream_setAttenuation(sfSoundStream* soundStream, float attenuation) { - CSFML_CALL(soundStream, SetAttenuation(attenuation)); + CSFML_CALL(soundStream, setAttenuation(attenuation)); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset) +void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset) { - CSFML_CALL(soundStream, SetPlayingOffset(sf::Microseconds(timeOffset.Microseconds))); + CSFML_CALL(soundStream, setPlayingOffset(sf::microseconds(timeOffset.microseconds))); } //////////////////////////////////////////////////////////// -void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop) +void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop) { - CSFML_CALL(soundStream, SetLoop(loop == sfTrue)); + CSFML_CALL(soundStream, setLoop(loop == sfTrue)); } //////////////////////////////////////////////////////////// -float sfSoundStream_GetPitch(const sfSoundStream* soundStream) +float sfSoundStream_getPitch(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetPitch(), 0.f); + CSFML_CALL_RETURN(soundStream, getPitch(), 0.f); } //////////////////////////////////////////////////////////// -float sfSoundStream_GetVolume(const sfSoundStream* soundStream) +float sfSoundStream_getVolume(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetVolume(), 0.f); + CSFML_CALL_RETURN(soundStream, getVolume(), 0.f); } //////////////////////////////////////////////////////////// -sfVector3f sfSoundStream_GetPosition(const sfSoundStream* soundStream) +sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundStream) { sfVector3f position = {0, 0, 0}; CSFML_CHECK_RETURN(soundStream, position); - sf::Vector3f sfmlPos = soundStream->This.GetPosition(); + sf::Vector3f sfmlPos = soundStream->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; position.z = sfmlPos.z; @@ -178,39 +178,39 @@ sfVector3f sfSoundStream_GetPosition(const sfSoundStream* soundStream) //////////////////////////////////////////////////////////// -CSFML_AUDIO_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* soundStream) +CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, IsRelativeToListener(), sfFalse); + CSFML_CALL_RETURN(soundStream, isRelativeToListener(), sfFalse); } //////////////////////////////////////////////////////////// -float sfSoundStream_GetMinDistance(const sfSoundStream* soundStream) +float sfSoundStream_getMinDistance(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetMinDistance(), 0.f); + CSFML_CALL_RETURN(soundStream, getMinDistance(), 0.f); } //////////////////////////////////////////////////////////// -float sfSoundStream_GetAttenuation(const sfSoundStream* soundStream) +float sfSoundStream_getAttenuation(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetAttenuation(), 0.f); + CSFML_CALL_RETURN(soundStream, getAttenuation(), 0.f); } //////////////////////////////////////////////////////////// -sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream) +sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream) { - CSFML_CALL_RETURN(soundStream, GetLoop(), sfFalse); + CSFML_CALL_RETURN(soundStream, getLoop(), sfFalse); } //////////////////////////////////////////////////////////// -sfTime sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream) +sfTime sfSoundStream_getPlayingOffset(const sfSoundStream* soundStream) { sfTime time = {0}; CSFML_CHECK_RETURN(soundStream, time); - time.Microseconds = soundStream->This.GetPlayingOffset().AsMicroseconds(); + time.microseconds = soundStream->This.getPlayingOffset().asMicroseconds(); return time; } diff --git a/src/SFML/Audio/SoundStreamStruct.h b/src/SFML/Audio/SoundStreamStruct.h index defdf92..da9cce1 100644 --- a/src/SFML/Audio/SoundStreamStruct.h +++ b/src/SFML/Audio/SoundStreamStruct.h @@ -48,27 +48,27 @@ public : mySeekCallback (onSeek), myUserData (userData) { - Initialize(channelCount, sampleRate); + initialize(channelCount, sampleRate); } private : - virtual bool OnGetData(Chunk& data) + virtual bool onGetData(Chunk& data) { sfSoundStreamChunk chunk = {NULL, 0}; bool ok = (myGetDataCallback(&chunk, myUserData) == sfTrue); - data.Samples = chunk.Samples; - data.SampleCount = chunk.SampleCount; + data.samples = chunk.samples; + data.sampleCount = chunk.sampleCount; return ok; } - virtual void OnSeek(sf::Time timeOffset) + virtual void onSeek(sf::Time timeOffset) { if (mySeekCallback) { - sfTime time = {timeOffset.AsMicroseconds()}; + sfTime time = {timeOffset.asMicroseconds()}; mySeekCallback(time, myUserData); } } diff --git a/src/SFML/CallbackStream.h b/src/SFML/CallbackStream.h index 115f731..9dd01a2 100644 --- a/src/SFML/CallbackStream.h +++ b/src/SFML/CallbackStream.h @@ -68,9 +68,9 @@ public: /// \return The number of bytes actually read /// //////////////////////////////////////////////////////////// - virtual sf::Int64 Read(char* data, sf::Int64 size) + virtual sf::Int64 read(char* data, sf::Int64 size) { - return myStream.Read ? myStream.Read(data, size, myStream.UserData) : -1; + return myStream.read ? myStream.read(data, size, myStream.userData) : -1; } //////////////////////////////////////////////////////////// @@ -81,9 +81,9 @@ public: /// \return The position actually seeked to, or -1 on error /// //////////////////////////////////////////////////////////// - virtual sf::Int64 Seek(sf::Int64 position) + virtual sf::Int64 seek(sf::Int64 position) { - return myStream.Seek ? myStream.Seek(position, myStream.UserData) : -1; + return myStream.seek ? myStream.seek(position, myStream.userData) : -1; } //////////////////////////////////////////////////////////// @@ -92,9 +92,9 @@ public: /// \return The current position, or -1 on error. /// //////////////////////////////////////////////////////////// - virtual sf::Int64 Tell() + virtual sf::Int64 tell() { - return myStream.Tell ? myStream.Tell(myStream.UserData) : -1; + return myStream.tell ? myStream.tell(myStream.userData) : -1; } //////////////////////////////////////////////////////////// @@ -103,9 +103,9 @@ public: /// \return The total number of bytes available in the stream, or -1 on error /// //////////////////////////////////////////////////////////// - virtual sf::Int64 GetSize() + virtual sf::Int64 getSize() { - return myStream.GetSize ? myStream.GetSize(myStream.UserData) : -1; + return myStream.getSize ? myStream.getSize(myStream.userData) : -1; } private: diff --git a/src/SFML/ConvertEvent.h b/src/SFML/ConvertEvent.h index 31c4dad..f01f307 100644 --- a/src/SFML/ConvertEvent.h +++ b/src/SFML/ConvertEvent.h @@ -35,68 +35,65 @@ //////////////////////////////////////////////////////////// // Define a function to convert a sf::Event ot a sfEvent //////////////////////////////////////////////////////////// -inline void ConvertEvent(const sf::Event& SFMLEvent, sfEvent* event) +inline void convertEvent(const sf::Event& SFMLEvent, sfEvent* event) { // Convert its type - event->Type = static_cast(SFMLEvent.Type); + event->type = static_cast(SFMLEvent.type); // Fill its fields - switch (event->Type) + switch (event->type) { case sfEvtResized : - event->Size.Width = SFMLEvent.Size.Width; - event->Size.Height = SFMLEvent.Size.Height; + event->size.width = SFMLEvent.size.width; + event->size.height = SFMLEvent.size.height; break; case sfEvtTextEntered : - event->Text.Unicode = SFMLEvent.Text.Unicode; + event->text.unicode = SFMLEvent.text.unicode; break; case sfEvtKeyReleased : case sfEvtKeyPressed : - event->Key.Code = static_cast(SFMLEvent.Key.Code); - event->Key.Alt = SFMLEvent.Key.Alt ? sfTrue : sfFalse; - event->Key.Control = SFMLEvent.Key.Control ? sfTrue : sfFalse; - event->Key.Shift = SFMLEvent.Key.Shift ? sfTrue : sfFalse; - event->Key.System = SFMLEvent.Key.System ? sfTrue : sfFalse; + event->key.code = static_cast(SFMLEvent.key.code); + event->key.alt = SFMLEvent.key.alt ? sfTrue : sfFalse; + event->key.control = SFMLEvent.key.control ? sfTrue : sfFalse; + event->key.shift = SFMLEvent.key.shift ? sfTrue : sfFalse; + event->key.system = SFMLEvent.key.system ? sfTrue : sfFalse; break; case sfEvtMouseWheelMoved : - event->MouseWheel.Delta = SFMLEvent.MouseWheel.Delta; - event->MouseWheel.X = SFMLEvent.MouseWheel.X; - event->MouseWheel.Y = SFMLEvent.MouseWheel.Y; + event->mouseWheel.delta = SFMLEvent.mouseWheel.delta; + event->mouseWheel.x = SFMLEvent.mouseWheel.x; + event->mouseWheel.y = SFMLEvent.mouseWheel.y; break; case sfEvtMouseButtonPressed : case sfEvtMouseButtonReleased : - event->MouseButton.Button = static_cast(SFMLEvent.MouseButton.Button); - event->MouseButton.X = SFMLEvent.MouseButton.X; - event->MouseButton.Y = SFMLEvent.MouseButton.Y; + event->mouseButton.button = static_cast(SFMLEvent.mouseButton.button); + event->mouseButton.x = SFMLEvent.mouseButton.x; + event->mouseButton.y = SFMLEvent.mouseButton.y; break; case sfEvtMouseMoved : - event->MouseMove.X = SFMLEvent.MouseMove.X; - event->MouseMove.Y = SFMLEvent.MouseMove.Y; + event->mouseMove.x = SFMLEvent.mouseMove.x; + event->mouseMove.y = SFMLEvent.mouseMove.y; break; case sfEvtJoystickButtonPressed : case sfEvtJoystickButtonReleased : - event->JoystickButton.JoystickId = SFMLEvent.JoystickButton.JoystickId; - event->JoystickButton.Button = SFMLEvent.JoystickButton.Button; + event->joystickButton.joystickId = SFMLEvent.joystickButton.joystickId; + event->joystickButton.button = SFMLEvent.joystickButton.button; break; case sfEvtJoystickMoved : - event->JoystickMove.JoystickId = SFMLEvent.JoystickMove.JoystickId; - event->JoystickMove.Axis = static_cast(SFMLEvent.JoystickMove.Axis); - event->JoystickMove.Position = SFMLEvent.JoystickMove.Position; + event->joystickMove.joystickId = SFMLEvent.joystickMove.joystickId; + event->joystickMove.axis = static_cast(SFMLEvent.joystickMove.axis); + event->joystickMove.position = SFMLEvent.joystickMove.position; break; case sfEvtJoystickConnected : - event->JoystickConnect.JoystickId = SFMLEvent.JoystickConnect.JoystickId; - break; - case sfEvtJoystickDisconnected : - event->JoystickConnect.JoystickId = SFMLEvent.JoystickConnect.JoystickId; + event->joystickConnect.joystickId = SFMLEvent.joystickConnect.joystickId; break; default : diff --git a/src/SFML/Graphics/CircleShape.cpp b/src/SFML/Graphics/CircleShape.cpp index ffada52..130abe7 100644 --- a/src/SFML/Graphics/CircleShape.cpp +++ b/src/SFML/Graphics/CircleShape.cpp @@ -32,7 +32,7 @@ //////////////////////////////////////////////////////////// -sfCircleShape* sfCircleShape_Create(void) +sfCircleShape* sfCircleShape_create(void) { sfCircleShape* shape = new sfCircleShape; shape->Texture = NULL; @@ -42,7 +42,7 @@ sfCircleShape* sfCircleShape_Create(void) //////////////////////////////////////////////////////////// -sfCircleShape* sfCircleShape_Copy(sfCircleShape* shape) +sfCircleShape* sfCircleShape_copy(sfCircleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -51,47 +51,47 @@ sfCircleShape* sfCircleShape_Copy(sfCircleShape* shape) //////////////////////////////////////////////////////////// -void sfCircleShape_Destroy(sfCircleShape* shape) +void sfCircleShape_destroy(sfCircleShape* shape) { delete shape; } //////////////////////////////////////////////////////////// -void sfCircleShape_SetPosition(sfCircleShape* shape, sfVector2f position) +void sfCircleShape_setPosition(sfCircleShape* shape, sfVector2f position) { - CSFML_CALL(shape, SetPosition(position.x, position.y)); + CSFML_CALL(shape, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetRotation(sfCircleShape* shape, float angle) +void sfCircleShape_setRotation(sfCircleShape* shape, float angle) { - CSFML_CALL(shape, SetRotation(angle)); + CSFML_CALL(shape, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetScale(sfCircleShape* shape, sfVector2f scale) +void sfCircleShape_setScale(sfCircleShape* shape, sfVector2f scale) { - CSFML_CALL(shape, SetScale(scale.x, scale.y)); + CSFML_CALL(shape, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetOrigin(sfCircleShape* shape, sfVector2f origin) +void sfCircleShape_setOrigin(sfCircleShape* shape, sfVector2f origin) { - CSFML_CALL(shape, SetOrigin(origin.x, origin.y)); + CSFML_CALL(shape, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfCircleShape_GetPosition(const sfCircleShape* shape) +sfVector2f sfCircleShape_getPosition(const sfCircleShape* shape) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(shape, position); - sf::Vector2f sfmlPos = shape->This.GetPosition(); + sf::Vector2f sfmlPos = shape->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -100,19 +100,19 @@ sfVector2f sfCircleShape_GetPosition(const sfCircleShape* shape) //////////////////////////////////////////////////////////// -float sfCircleShape_GetRotation(const sfCircleShape* shape) +float sfCircleShape_getRotation(const sfCircleShape* shape) { - CSFML_CALL_RETURN(shape, GetRotation(), 0.f); + CSFML_CALL_RETURN(shape, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape) +sfVector2f sfCircleShape_getScale(const sfCircleShape* shape) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(shape, scale); - sf::Vector2f sfmlScale = shape->This.GetScale(); + sf::Vector2f sfmlScale = shape->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -121,12 +121,12 @@ sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape) //////////////////////////////////////////////////////////// -sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape) +sfVector2f sfCircleShape_getOrigin(const sfCircleShape* shape) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(shape, origin); - sf::Vector2f sfmlOrigin = shape->This.GetOrigin(); + sf::Vector2f sfmlOrigin = shape->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -135,84 +135,84 @@ sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape) //////////////////////////////////////////////////////////// -void sfCircleShape_Move(sfCircleShape* shape, sfVector2f offset) +void sfCircleShape_move(sfCircleShape* shape, sfVector2f offset) { - CSFML_CALL(shape, Move(offset.x, offset.y)); + CSFML_CALL(shape, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfCircleShape_Rotate(sfCircleShape* shape, float angle) +void sfCircleShape_rotate(sfCircleShape* shape, float angle) { - CSFML_CALL(shape, Rotate(angle)); + CSFML_CALL(shape, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfCircleShape_Scale(sfCircleShape* shape, sfVector2f factors) +void sfCircleShape_scale(sfCircleShape* shape, sfVector2f factors) { - CSFML_CALL(shape, Scale(factors.x, factors.y)); + CSFML_CALL(shape, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfCircleShape_GetTransform(const sfCircleShape* shape) +const sfTransform* sfCircleShape_getTransform(const sfCircleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->Transform.This = shape->This.GetTransform(); + shape->Transform.This = shape->This.getTransform(); return &shape->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfCircleShape_GetInverseTransform(const sfCircleShape* shape) +const sfTransform* sfCircleShape_getInverseTransform(const sfCircleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->InverseTransform.This = shape->This.GetInverseTransform(); + shape->InverseTransform.This = shape->This.getInverseTransform(); return &shape->InverseTransform; } //////////////////////////////////////////////////////////// -void sfCircleShape_SetTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect) +void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect) { - CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue)); + CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue)); shape->Texture = texture; } //////////////////////////////////////////////////////////// -void sfCircleShape_SetTextureRect(sfCircleShape* shape, sfIntRect rect) +void sfCircleShape_setTextureRect(sfCircleShape* shape, sfIntRect rect) { - CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height))); + CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height))); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetFillColor(sfCircleShape* shape, sfColor color) +void sfCircleShape_setFillColor(sfCircleShape* shape, sfColor color) { - CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetOutlineColor(sfCircleShape* shape, sfColor color) +void sfCircleShape_setOutlineColor(sfCircleShape* shape, sfColor color) { - CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetOutlineThickness(sfCircleShape* shape, float thickness) +void sfCircleShape_setOutlineThickness(sfCircleShape* shape, float thickness) { - CSFML_CALL(shape, SetOutlineThickness(thickness)); + CSFML_CALL(shape, setOutlineThickness(thickness)); } //////////////////////////////////////////////////////////// -const sfTexture* sfCircleShape_GetTexture(const sfCircleShape* shape) +const sfTexture* sfCircleShape_getTexture(const sfCircleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -221,28 +221,28 @@ const sfTexture* sfCircleShape_GetTexture(const sfCircleShape* shape) //////////////////////////////////////////////////////////// -sfIntRect sfCircleShape_GetTextureRect(const sfCircleShape* shape) +sfIntRect sfCircleShape_getTextureRect(const sfCircleShape* shape) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::IntRect sfmlRect = shape->This.GetTextureRect(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::IntRect sfmlRect = shape->This.getTextureRect(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfColor sfCircleShape_GetFillColor(const sfCircleShape* shape) +sfColor sfCircleShape_getFillColor(const sfCircleShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetFillColor(); + sf::Color sfmlColor = shape->This.getFillColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -253,12 +253,12 @@ sfColor sfCircleShape_GetFillColor(const sfCircleShape* shape) //////////////////////////////////////////////////////////// -sfColor sfCircleShape_GetOutlineColor(const sfCircleShape* shape) +sfColor sfCircleShape_getOutlineColor(const sfCircleShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetOutlineColor(); + sf::Color sfmlColor = shape->This.getOutlineColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -269,26 +269,26 @@ sfColor sfCircleShape_GetOutlineColor(const sfCircleShape* shape) //////////////////////////////////////////////////////////// -float sfCircleShape_GetOutlineThickness(const sfCircleShape* shape) +float sfCircleShape_getOutlineThickness(const sfCircleShape* shape) { - CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f); + CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f); } //////////////////////////////////////////////////////////// -unsigned int sfCircleShape_GetPointCount(const sfCircleShape* shape) +unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape) { - CSFML_CALL_RETURN(shape, GetPointCount(), 0); + CSFML_CALL_RETURN(shape, getPointCount(), 0); } //////////////////////////////////////////////////////////// -sfVector2f sfCircleShape_GetPoint(const sfCircleShape* shape, unsigned int index) +sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index) { sfVector2f point = {0, 0}; CSFML_CHECK_RETURN(shape, point); - sf::Vector2f sfmlPoint = shape->This.GetPoint(index); + sf::Vector2f sfmlPoint = shape->This.getPoint(index); point.x = sfmlPoint.x; point.y = sfmlPoint.y; @@ -297,53 +297,53 @@ sfVector2f sfCircleShape_GetPoint(const sfCircleShape* shape, unsigned int index //////////////////////////////////////////////////////////// -void sfCircleShape_SetRadius(sfCircleShape* shape, float radius) +void sfCircleShape_setRadius(sfCircleShape* shape, float radius) { - CSFML_CALL(shape, SetRadius(radius)); + CSFML_CALL(shape, setRadius(radius)); } //////////////////////////////////////////////////////////// -float sfCircleShape_GetRadius(const sfCircleShape* shape) +float sfCircleShape_getRadius(const sfCircleShape* shape) { - CSFML_CALL_RETURN(shape, GetRadius(), 0.f); + CSFML_CALL_RETURN(shape, getRadius(), 0.f); } //////////////////////////////////////////////////////////// -void sfCircleShape_SetPointCount(sfCircleShape* shape, unsigned int count) +void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count) { - CSFML_CALL(shape, SetPointCount(count)); + CSFML_CALL(shape, setPointCount(count)); } //////////////////////////////////////////////////////////// -sfFloatRect sfCircleShape_GetLocalBounds(const sfCircleShape* shape) +sfFloatRect sfCircleShape_getLocalBounds(const sfCircleShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetLocalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getLocalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfFloatRect sfCircleShape_GetGlobalBounds(const sfCircleShape* shape) +sfFloatRect sfCircleShape_getGlobalBounds(const sfCircleShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetGlobalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getGlobalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } diff --git a/src/SFML/Graphics/Color.cpp b/src/SFML/Graphics/Color.cpp index b830198..829b937 100644 --- a/src/SFML/Graphics/Color.cpp +++ b/src/SFML/Graphics/Color.cpp @@ -31,26 +31,26 @@ //////////////////////////////////////////////////////////// -sfColor sfBlack = sfColor_FromRGB( 0, 0, 0); -sfColor sfWhite = sfColor_FromRGB(255, 255, 255); -sfColor sfRed = sfColor_FromRGB(255, 0, 0); -sfColor sfGreen = sfColor_FromRGB( 0, 255, 0); -sfColor sfBlue = sfColor_FromRGB( 0, 0, 255); -sfColor sfYellow = sfColor_FromRGB(255, 255, 0); -sfColor sfMagenta = sfColor_FromRGB(255, 0, 255); -sfColor sfCyan = sfColor_FromRGB( 0, 255, 255); -sfColor sfTransparent = sfColor_FromRGBA( 0, 0, 0, 0); +sfColor sfBlack = sfColor_fromRGB( 0, 0, 0); +sfColor sfWhite = sfColor_fromRGB(255, 255, 255); +sfColor sfRed = sfColor_fromRGB(255, 0, 0); +sfColor sfGreen = sfColor_fromRGB( 0, 255, 0); +sfColor sfBlue = sfColor_fromRGB( 0, 0, 255); +sfColor sfYellow = sfColor_fromRGB(255, 255, 0); +sfColor sfMagenta = sfColor_fromRGB(255, 0, 255); +sfColor sfCyan = sfColor_fromRGB( 0, 255, 255); +sfColor sfTransparent = sfColor_fromRGBA( 0, 0, 0, 0); //////////////////////////////////////////////////////////// -sfColor sfColor_FromRGB(sfUint8 red, sfUint8 green, sfUint8 blue) +sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue) { - return sfColor_FromRGBA(red, green, blue, 255); + return sfColor_fromRGBA(red, green, blue, 255); } //////////////////////////////////////////////////////////// -sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha) +sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha) { sfColor color; @@ -64,14 +64,14 @@ sfColor sfColor_FromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha //////////////////////////////////////////////////////////// -sfColor sfColor_Add(sfColor color1, sfColor color2) +sfColor sfColor_add(sfColor color1, sfColor color2) { int red = std::min(color1.r + color2.r, 255); int green = std::min(color1.g + color2.g, 255); int blue = std::min(color1.b + color2.b, 255); int alpha = std::min(color1.a + color2.a, 255); - return sfColor_FromRGBA(static_cast(red), + return sfColor_fromRGBA(static_cast(red), static_cast(green), static_cast(blue), static_cast(alpha)); @@ -79,14 +79,14 @@ sfColor sfColor_Add(sfColor color1, sfColor color2) //////////////////////////////////////////////////////////// -sfColor sfColor_Modulate(sfColor color1, sfColor color2) +sfColor sfColor_modulate(sfColor color1, sfColor color2) { int red = color1.r * color2.r / 255; int green = color1.g * color2.g / 255; int blue = color1.b * color2.b / 255; int alpha = color1.a * color2.a / 255; - return sfColor_FromRGBA(static_cast(red), + return sfColor_fromRGBA(static_cast(red), static_cast(green), static_cast(blue), static_cast(alpha)); diff --git a/src/SFML/Graphics/ConvertRenderStates.hpp b/src/SFML/Graphics/ConvertRenderStates.hpp index a7cddde..a8af538 100644 --- a/src/SFML/Graphics/ConvertRenderStates.hpp +++ b/src/SFML/Graphics/ConvertRenderStates.hpp @@ -38,22 +38,19 @@ //////////////////////////////////////////////////////////// // Convert sfRenderStates* to sf::RenderStates //////////////////////////////////////////////////////////// -inline sf::RenderStates ConvertRenderStates(const sfRenderStates* states) +inline sf::RenderStates convertRenderStates(const sfRenderStates* states) { - if (!states) - { - return sf::RenderStates::Default; - } - else - { - sf::RenderStates sfmlStates; - sfmlStates.BlendMode = static_cast(states->BlendMode); - sfmlStates.Transform = states->Transform ? states->Transform->This : sf::Transform::Identity; - sfmlStates.Texture = states->Texture ? states->Texture->This : NULL; - sfmlStates.Shader = states->Shader ? &states->Shader->This : NULL; + sf::RenderStates sfmlStates; - return sfmlStates; + if (states) + { + sfmlStates.blendMode = static_cast(states->blendMode); + sfmlStates.transform = states->transform ? states->transform->This : sf::Transform::Identity; + sfmlStates.texture = states->texture ? states->texture->This : NULL; + sfmlStates.shader = states->shader ? &states->shader->This : NULL; } + + return sfmlStates; } diff --git a/src/SFML/Graphics/ConvexShape.cpp b/src/SFML/Graphics/ConvexShape.cpp index 0f56314..d6c6478 100644 --- a/src/SFML/Graphics/ConvexShape.cpp +++ b/src/SFML/Graphics/ConvexShape.cpp @@ -32,14 +32,14 @@ //////////////////////////////////////////////////////////// -sfConvexShape* sfConvexShape_Create(void) +sfConvexShape* sfConvexShape_create(void) { return new sfConvexShape; } //////////////////////////////////////////////////////////// -sfConvexShape* sfConvexShape_Copy(sfConvexShape* shape) +sfConvexShape* sfConvexShape_copy(sfConvexShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -48,47 +48,47 @@ sfConvexShape* sfConvexShape_Copy(sfConvexShape* shape) //////////////////////////////////////////////////////////// -void sfConvexShape_Destroy(sfConvexShape* shape) +void sfConvexShape_destroy(sfConvexShape* shape) { delete shape; } //////////////////////////////////////////////////////////// -void sfConvexShape_SetPosition(sfConvexShape* shape, sfVector2f position) +void sfConvexShape_setPosition(sfConvexShape* shape, sfVector2f position) { - CSFML_CALL(shape, SetPosition(position.x, position.y)); + CSFML_CALL(shape, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetRotation(sfConvexShape* shape, float angle) +void sfConvexShape_setRotation(sfConvexShape* shape, float angle) { - CSFML_CALL(shape, SetRotation(angle)); + CSFML_CALL(shape, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetScale(sfConvexShape* shape, sfVector2f scale) +void sfConvexShape_setScale(sfConvexShape* shape, sfVector2f scale) { - CSFML_CALL(shape, SetScale(scale.x, scale.y)); + CSFML_CALL(shape, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetOrigin(sfConvexShape* shape, sfVector2f origin) +void sfConvexShape_setOrigin(sfConvexShape* shape, sfVector2f origin) { - CSFML_CALL(shape, SetOrigin(origin.x, origin.y)); + CSFML_CALL(shape, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfConvexShape_GetPosition(const sfConvexShape* shape) +sfVector2f sfConvexShape_getPosition(const sfConvexShape* shape) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(shape, position); - sf::Vector2f sfmlPos = shape->This.GetPosition(); + sf::Vector2f sfmlPos = shape->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -97,19 +97,19 @@ sfVector2f sfConvexShape_GetPosition(const sfConvexShape* shape) //////////////////////////////////////////////////////////// -float sfConvexShape_GetRotation(const sfConvexShape* shape) +float sfConvexShape_getRotation(const sfConvexShape* shape) { - CSFML_CALL_RETURN(shape, GetRotation(), 0.f); + CSFML_CALL_RETURN(shape, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfConvexShape_GetScale(const sfConvexShape* shape) +sfVector2f sfConvexShape_getScale(const sfConvexShape* shape) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(shape, scale); - sf::Vector2f sfmlScale = shape->This.GetScale(); + sf::Vector2f sfmlScale = shape->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -118,12 +118,12 @@ sfVector2f sfConvexShape_GetScale(const sfConvexShape* shape) //////////////////////////////////////////////////////////// -sfVector2f sfConvexShape_GetOrigin(const sfConvexShape* shape) +sfVector2f sfConvexShape_getOrigin(const sfConvexShape* shape) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(shape, origin); - sf::Vector2f sfmlOrigin = shape->This.GetOrigin(); + sf::Vector2f sfmlOrigin = shape->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -132,84 +132,84 @@ sfVector2f sfConvexShape_GetOrigin(const sfConvexShape* shape) //////////////////////////////////////////////////////////// -void sfConvexShape_Move(sfConvexShape* shape, sfVector2f offset) +void sfConvexShape_move(sfConvexShape* shape, sfVector2f offset) { - CSFML_CALL(shape, Move(offset.x, offset.y)); + CSFML_CALL(shape, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfConvexShape_Rotate(sfConvexShape* shape, float angle) +void sfConvexShape_rotate(sfConvexShape* shape, float angle) { - CSFML_CALL(shape, Rotate(angle)); + CSFML_CALL(shape, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfConvexShape_Scale(sfConvexShape* shape, sfVector2f factors) +void sfConvexShape_scale(sfConvexShape* shape, sfVector2f factors) { - CSFML_CALL(shape, Scale(factors.x, factors.y)); + CSFML_CALL(shape, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfConvexShape_GetTransform(const sfConvexShape* shape) +const sfTransform* sfConvexShape_getTransform(const sfConvexShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->Transform.This = shape->This.GetTransform(); + shape->Transform.This = shape->This.getTransform(); return &shape->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfConvexShape_GetInverseTransform(const sfConvexShape* shape) +const sfTransform* sfConvexShape_getInverseTransform(const sfConvexShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->InverseTransform.This = shape->This.GetInverseTransform(); + shape->InverseTransform.This = shape->This.getInverseTransform(); return &shape->InverseTransform; } //////////////////////////////////////////////////////////// -void sfConvexShape_SetTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect) +void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect) { - CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue)); + CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue)); shape->Texture = texture; } //////////////////////////////////////////////////////////// -void sfConvexShape_SetTextureRect(sfConvexShape* shape, sfIntRect rect) +void sfConvexShape_setTextureRect(sfConvexShape* shape, sfIntRect rect) { - CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height))); + CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height))); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetFillColor(sfConvexShape* shape, sfColor color) +void sfConvexShape_setFillColor(sfConvexShape* shape, sfColor color) { - CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetOutlineColor(sfConvexShape* shape, sfColor color) +void sfConvexShape_setOutlineColor(sfConvexShape* shape, sfColor color) { - CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetOutlineThickness(sfConvexShape* shape, float thickness) +void sfConvexShape_setOutlineThickness(sfConvexShape* shape, float thickness) { - CSFML_CALL(shape, SetOutlineThickness(thickness)); + CSFML_CALL(shape, setOutlineThickness(thickness)); } //////////////////////////////////////////////////////////// -const sfTexture* sfConvexShape_GetTexture(const sfConvexShape* shape) +const sfTexture* sfConvexShape_getTexture(const sfConvexShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -218,28 +218,28 @@ const sfTexture* sfConvexShape_GetTexture(const sfConvexShape* shape) //////////////////////////////////////////////////////////// -sfIntRect sfConvexShape_GetTextureRect(const sfConvexShape* shape) +sfIntRect sfConvexShape_getTextureRect(const sfConvexShape* shape) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::IntRect sfmlRect = shape->This.GetTextureRect(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::IntRect sfmlRect = shape->This.getTextureRect(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfColor sfConvexShape_GetFillColor(const sfConvexShape* shape) +sfColor sfConvexShape_getFillColor(const sfConvexShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetFillColor(); + sf::Color sfmlColor = shape->This.getFillColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -250,12 +250,12 @@ sfColor sfConvexShape_GetFillColor(const sfConvexShape* shape) //////////////////////////////////////////////////////////// -sfColor sfConvexShape_GetOutlineColor(const sfConvexShape* shape) +sfColor sfConvexShape_getOutlineColor(const sfConvexShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetOutlineColor(); + sf::Color sfmlColor = shape->This.getOutlineColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -266,26 +266,26 @@ sfColor sfConvexShape_GetOutlineColor(const sfConvexShape* shape) //////////////////////////////////////////////////////////// -float sfConvexShape_GetOutlineThickness(const sfConvexShape* shape) +float sfConvexShape_getOutlineThickness(const sfConvexShape* shape) { - CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f); + CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f); } //////////////////////////////////////////////////////////// -unsigned int sfConvexShape_GetPointCount(const sfConvexShape* shape) +unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape) { - CSFML_CALL_RETURN(shape, GetPointCount(), 0); + CSFML_CALL_RETURN(shape, getPointCount(), 0); } //////////////////////////////////////////////////////////// -sfVector2f sfConvexShape_GetPoint(const sfConvexShape* shape, unsigned int index) +sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index) { sfVector2f point = {0, 0}; CSFML_CHECK_RETURN(shape, point); - sf::Vector2f sfmlPoint = shape->This.GetPoint(index); + sf::Vector2f sfmlPoint = shape->This.getPoint(index); point.x = sfmlPoint.x; point.y = sfmlPoint.y; @@ -294,46 +294,46 @@ sfVector2f sfConvexShape_GetPoint(const sfConvexShape* shape, unsigned int index //////////////////////////////////////////////////////////// -void sfConvexShape_SetPointCount(sfConvexShape* shape, unsigned int count) +void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count) { - CSFML_CALL(shape, SetPointCount(count)); + CSFML_CALL(shape, setPointCount(count)); } //////////////////////////////////////////////////////////// -void sfConvexShape_SetPoint(sfConvexShape* shape, unsigned int index, sfVector2f point) +void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point) { - CSFML_CALL(shape, SetPoint(index, sf::Vector2f(point.x, point.y))); + CSFML_CALL(shape, setPoint(index, sf::Vector2f(point.x, point.y))); } //////////////////////////////////////////////////////////// -sfFloatRect sfConvexShape_GetLocalBounds(const sfConvexShape* shape) +sfFloatRect sfConvexShape_getLocalBounds(const sfConvexShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetLocalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getLocalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfFloatRect sfConvexShape_GetGlobalBounds(const sfConvexShape* shape) +sfFloatRect sfConvexShape_getGlobalBounds(const sfConvexShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetGlobalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getGlobalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index a4b4cf9..d5037a4 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -34,10 +34,10 @@ //////////////////////////////////////////////////////////// /// Create a new font from a file //////////////////////////////////////////////////////////// -sfFont* sfFont_CreateFromFile(const char* filename) +sfFont* sfFont_createFromFile(const char* filename) { sfFont* font = new sfFont; - if (!font->This.LoadFromFile(filename)) + if (!font->This.loadFromFile(filename)) { delete font; font = NULL; @@ -50,10 +50,10 @@ sfFont* sfFont_CreateFromFile(const char* filename) //////////////////////////////////////////////////////////// /// Create a new font from a file in memory //////////////////////////////////////////////////////////// -sfFont* sfFont_CreateFromMemory(const void* data, size_t sizeInBytes) +sfFont* sfFont_createFromMemory(const void* data, size_t sizeInBytes) { sfFont* font = new sfFont; - if (!font->This.LoadFromMemory(data, sizeInBytes)) + if (!font->This.loadFromMemory(data, sizeInBytes)) { delete font; font = NULL; @@ -66,13 +66,13 @@ sfFont* sfFont_CreateFromMemory(const void* data, size_t sizeInBytes) //////////////////////////////////////////////////////////// /// Create a new font from a custom stream //////////////////////////////////////////////////////////// -sfFont* sfFont_CreateFromStream(sfInputStream* stream) +sfFont* sfFont_createFromStream(sfInputStream* stream) { CSFML_CHECK_RETURN(stream, NULL); sfFont* font = new sfFont; font->Stream = CallbackStream(stream); - if (!font->This.LoadFromStream(font->Stream)) + if (!font->This.loadFromStream(font->Stream)) { delete font; font = NULL; @@ -85,7 +85,7 @@ sfFont* sfFont_CreateFromStream(sfInputStream* stream) //////////////////////////////////////////////////////////// /// Copy an existing font //////////////////////////////////////////////////////////// -sfFont* sfFont_Copy(sfFont* font) +sfFont* sfFont_copy(sfFont* font) { CSFML_CHECK_RETURN(font, NULL); @@ -96,7 +96,7 @@ sfFont* sfFont_Copy(sfFont* font) //////////////////////////////////////////////////////////// /// Destroy an existing font //////////////////////////////////////////////////////////// -void sfFont_Destroy(sfFont* font) +void sfFont_destroy(sfFont* font) { delete font; } @@ -105,22 +105,22 @@ void sfFont_Destroy(sfFont* font) //////////////////////////////////////////////////////////// /// Get a glyph in a font //////////////////////////////////////////////////////////// -sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold) +sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold) { sfGlyph glyph = {0, {0, 0, 0, 0}, {0, 0, 0, 0}}; CSFML_CHECK_RETURN(font, glyph); - sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize, bold == sfTrue); + sf::Glyph SFMLGlyph = font->This.getGlyph(codePoint, characterSize, bold == sfTrue); - glyph.Advance = SFMLGlyph.Advance; - glyph.Bounds.Left = SFMLGlyph.Bounds.Left; - glyph.Bounds.Top = SFMLGlyph.Bounds.Top; - glyph.Bounds.Width = SFMLGlyph.Bounds.Width; - glyph.Bounds.Height = SFMLGlyph.Bounds.Height; - glyph.TextureRect.Left = SFMLGlyph.TextureRect.Left; - glyph.TextureRect.Top = SFMLGlyph.TextureRect.Top; - glyph.TextureRect.Width = SFMLGlyph.TextureRect.Width; - glyph.TextureRect.Height = SFMLGlyph.TextureRect.Height; + glyph.advance = SFMLGlyph.advance; + glyph.bounds.left = SFMLGlyph.bounds.left; + glyph.bounds.top = SFMLGlyph.bounds.top; + glyph.bounds.width = SFMLGlyph.bounds.width; + glyph.bounds.height = SFMLGlyph.bounds.height; + glyph.textureRect.left = SFMLGlyph.textureRect.left; + glyph.textureRect.top = SFMLGlyph.textureRect.top; + glyph.textureRect.width = SFMLGlyph.textureRect.width; + glyph.textureRect.height = SFMLGlyph.textureRect.height; return glyph; } @@ -129,29 +129,29 @@ sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int character //////////////////////////////////////////////////////////// /// Get the kerning value corresponding to a given pair of characters in a font //////////////////////////////////////////////////////////// -int sfFont_GetKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize) +int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize) { - CSFML_CALL_RETURN(font, GetKerning(first, second, characterSize), 0); + CSFML_CALL_RETURN(font, getKerning(first, second, characterSize), 0); } //////////////////////////////////////////////////////////// /// Get the line spacing value //////////////////////////////////////////////////////////// -int sfFont_GetLineSpacing(sfFont* font, unsigned int characterSize) +int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize) { - CSFML_CALL_RETURN(font, GetLineSpacing(characterSize), 0); + CSFML_CALL_RETURN(font, getLineSpacing(characterSize), 0); } //////////////////////////////////////////////////////////// /// Get the texture containing the glyphs of a given size in a font //////////////////////////////////////////////////////////// -const sfTexture* sfFont_GetTexture(sfFont* font, unsigned int characterSize) +const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize) { CSFML_CHECK_RETURN(font, NULL); - *font->Textures[characterSize].This = font->This.GetTexture(characterSize); + *font->Textures[characterSize].This = font->This.getTexture(characterSize); return &font->Textures[characterSize]; } @@ -160,9 +160,9 @@ const sfTexture* sfFont_GetTexture(sfFont* font, unsigned int characterSize) //////////////////////////////////////////////////////////// /// Get the built-in default font (Arial) //////////////////////////////////////////////////////////// -const sfFont* sfFont_GetDefaultFont(void) +const sfFont* sfFont_getDefaultFont(void) { - static sfFont defaultFont = {sf::Font::GetDefaultFont(), std::map()}; + static sfFont defaultFont = {sf::Font::getDefaultFont(), std::map()}; return &defaultFont; } diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp index 91c9740..11c794f 100644 --- a/src/SFML/Graphics/Image.cpp +++ b/src/SFML/Graphics/Image.cpp @@ -31,41 +31,41 @@ #include //////////////////////////////////////////////////////////// -sfImage* sfImage_Create(unsigned int width, unsigned int height) +sfImage* sfImage_create(unsigned int width, unsigned int height) { sfImage* image = new sfImage; - image->This.Create(width, height); + image->This.create(width, height); return image; } //////////////////////////////////////////////////////////// -sfImage* sfImage_CreateFromColor(unsigned int width, unsigned int height, sfColor color) +sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColor color) { sfImage* image = new sfImage; - image->This.Create(width, height, sf::Color(color.r, color.g, color.b, color.a)); + image->This.create(width, height, sf::Color(color.r, color.g, color.b, color.a)); return image; } //////////////////////////////////////////////////////////// -sfImage* sfImage_CreateFromPixels(unsigned int width, unsigned int height, const sfUint8* data) +sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* data) { sfImage* image = new sfImage; - image->This.Create(width, height, data); + image->This.create(width, height, data); return image; } //////////////////////////////////////////////////////////// -sfImage* sfImage_CreateFromFile(const char* filename) +sfImage* sfImage_createFromFile(const char* filename) { sfImage* image = new sfImage; - if (!image->This.LoadFromFile(filename)) + if (!image->This.loadFromFile(filename)) { delete image; image = NULL; @@ -76,11 +76,11 @@ sfImage* sfImage_CreateFromFile(const char* filename) //////////////////////////////////////////////////////////// -sfImage* sfImage_CreateFromMemory(const void* data, size_t sizeInBytes) +sfImage* sfImage_createFromMemory(const void* data, size_t sizeInBytes) { sfImage* image = new sfImage; - if (!image->This.LoadFromMemory(data, sizeInBytes)) + if (!image->This.loadFromMemory(data, sizeInBytes)) { delete image; image = NULL; @@ -91,14 +91,14 @@ sfImage* sfImage_CreateFromMemory(const void* data, size_t sizeInBytes) //////////////////////////////////////////////////////////// -sfImage* sfImage_CreateFromStream(sfInputStream* stream) +sfImage* sfImage_createFromStream(sfInputStream* stream) { CSFML_CHECK_RETURN(stream, NULL); sfImage* image = new sfImage; CallbackStream sfmlStream(stream); - if (!image->This.LoadFromStream(sfmlStream)) + if (!image->This.loadFromStream(sfmlStream)) { delete image; image = NULL; @@ -109,7 +109,7 @@ sfImage* sfImage_CreateFromStream(sfInputStream* stream) //////////////////////////////////////////////////////////// -sfImage* sfImage_Copy(sfImage* image) +sfImage* sfImage_copy(sfImage* image) { CSFML_CHECK_RETURN(image, NULL); @@ -118,84 +118,84 @@ sfImage* sfImage_Copy(sfImage* image) //////////////////////////////////////////////////////////// -void sfImage_Destroy(sfImage* image) +void sfImage_destroy(sfImage* image) { delete image; } //////////////////////////////////////////////////////////// -sfBool sfImage_SaveToFile(const sfImage* image, const char* filename) +sfBool sfImage_saveToFile(const sfImage* image, const char* filename) { - CSFML_CALL_RETURN(image, SaveToFile(filename), sfFalse); + CSFML_CALL_RETURN(image, saveToFile(filename), sfFalse); } //////////////////////////////////////////////////////////// -void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha) +void sfImage_createMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha) { - CSFML_CALL(image, CreateMaskFromColor(sf::Color(colorKey.r, colorKey.g, colorKey.b, colorKey.a), alpha)); + CSFML_CALL(image, createMaskFromColor(sf::Color(colorKey.r, colorKey.g, colorKey.b, colorKey.a), alpha)); } //////////////////////////////////////////////////////////// -void sfImage_CopyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha) +void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha) { CSFML_CHECK(source); - sf::IntRect sfmlRect(sourceRect.Left, sourceRect.Top, sourceRect.Width, sourceRect.Height); - CSFML_CALL(image, Copy(source->This, destX, destY, sfmlRect, applyAlpha == sfTrue)); + sf::IntRect sfmlRect(sourceRect.left, sourceRect.top, sourceRect.width, sourceRect.height); + CSFML_CALL(image, copy(source->This, destX, destY, sfmlRect, applyAlpha == sfTrue)); } //////////////////////////////////////////////////////////// -void sfImage_SetPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color) +void sfImage_setPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color) { - CSFML_CALL(image, SetPixel(x, y, sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(image, setPixel(x, y, sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -sfColor sfImage_GetPixel(const sfImage* image, unsigned int x, unsigned int y) +sfColor sfImage_getPixel(const sfImage* image, unsigned int x, unsigned int y) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(image, color); - sf::Color sfmlColor = image->This.GetPixel(x, y); + sf::Color sfmlColor = image->This.getPixel(x, y); - return sfColor_FromRGBA(sfmlColor.r, sfmlColor.g, sfmlColor.b, sfmlColor.a); + return sfColor_fromRGBA(sfmlColor.r, sfmlColor.g, sfmlColor.b, sfmlColor.a); } //////////////////////////////////////////////////////////// -const sfUint8* sfImage_GetPixelsPtr(const sfImage* image) +const sfUint8* sfImage_getPixelsPtr(const sfImage* image) { - CSFML_CALL_RETURN(image, GetPixelsPtr(), NULL); + CSFML_CALL_RETURN(image, getPixelsPtr(), NULL); } //////////////////////////////////////////////////////////// -unsigned int sfImage_GetWidth(const sfImage* image) +unsigned int sfImage_getWidth(const sfImage* image) { - CSFML_CALL_RETURN(image, GetWidth(), 0); + CSFML_CALL_RETURN(image, getWidth(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfImage_GetHeight(const sfImage* image) +unsigned int sfImage_getHeight(const sfImage* image) { - CSFML_CALL_RETURN(image, GetHeight(), 0); + CSFML_CALL_RETURN(image, getHeight(), 0); } //////////////////////////////////////////////////////////// -void sfImage_FlipHorizontally(sfImage* image) +void sfImage_flipHorizontally(sfImage* image) { - CSFML_CALL(image, FlipHorizontally()); + CSFML_CALL(image, flipHorizontally()); } //////////////////////////////////////////////////////////// -void sfImage_FlipVertically(sfImage* image) +void sfImage_flipVertically(sfImage* image) { - CSFML_CALL(image, FlipVertically()); + CSFML_CALL(image, flipVertically()); } diff --git a/src/SFML/Graphics/Rect.cpp b/src/SFML/Graphics/Rect.cpp index 83e64fc..0e2c420 100644 --- a/src/SFML/Graphics/Rect.cpp +++ b/src/SFML/Graphics/Rect.cpp @@ -33,68 +33,68 @@ //////////////////////////////////////////////////////////// /// Check if a point is inside a rectangle's area //////////////////////////////////////////////////////////// -sfBool sfFloatRect_Contains(const sfFloatRect* rect, float x, float y) +sfBool sfFloatRect_contains(const sfFloatRect* rect, float x, float y) { CSFML_CHECK_RETURN(rect, sfFalse); - return sf::FloatRect(rect->Left, rect->Top, rect->Width, rect->Height).Contains(x, y); + return sf::FloatRect(rect->left, rect->top, rect->width, rect->height).contains(x, y); } -sfBool sfIntRect_Contains(const sfIntRect* rect, int x, int y) +sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y) { CSFML_CHECK_RETURN(rect, sfFalse); - return sf::IntRect(rect->Left, rect->Top, rect->Width, rect->Height).Contains(x, y); + return sf::IntRect(rect->left, rect->top, rect->width, rect->height).contains(x, y); } //////////////////////////////////////////////////////////// /// Check intersection between two rectangles //////////////////////////////////////////////////////////// -sfBool sfFloatRect_Intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection) +sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection) { CSFML_CHECK_RETURN(rect1, sfFalse); CSFML_CHECK_RETURN(rect2, sfFalse); - sf::FloatRect SFMLRect1(rect1->Left, rect1->Top, rect1->Width, rect1->Height); - sf::FloatRect SFMLRect2(rect2->Left, rect2->Top, rect2->Width, rect2->Height); + sf::FloatRect SFMLRect1(rect1->left, rect1->top, rect1->width, rect1->height); + sf::FloatRect SFMLRect2(rect2->left, rect2->top, rect2->width, rect2->height); if (intersection) { sf::FloatRect overlap; - bool intersects = SFMLRect1.Intersects(SFMLRect2, overlap); + bool intersects = SFMLRect1.intersects(SFMLRect2, overlap); - intersection->Left = overlap.Left; - intersection->Top = overlap.Top; - intersection->Width = overlap.Width; - intersection->Height = overlap.Height; + intersection->left = overlap.left; + intersection->top = overlap.top; + intersection->width = overlap.width; + intersection->height = overlap.height; return intersects; } else { - return SFMLRect1.Intersects(SFMLRect2); + return SFMLRect1.intersects(SFMLRect2); } } -sfBool sfIntRect_Intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection) +sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection) { CSFML_CHECK_RETURN(rect1, sfFalse); CSFML_CHECK_RETURN(rect2, sfFalse); - sf::IntRect SFMLRect1(rect1->Left, rect1->Top, rect1->Width, rect1->Height); - sf::IntRect SFMLRect2(rect2->Left, rect2->Top, rect2->Width, rect2->Height); + sf::IntRect SFMLRect1(rect1->left, rect1->top, rect1->width, rect1->height); + sf::IntRect SFMLRect2(rect2->left, rect2->top, rect2->width, rect2->height); if (intersection) { sf::IntRect overlap; - bool intersects = SFMLRect1.Intersects(SFMLRect2, overlap); + bool intersects = SFMLRect1.intersects(SFMLRect2, overlap); - intersection->Left = overlap.Left; - intersection->Top = overlap.Top; - intersection->Width = overlap.Width; - intersection->Height = overlap.Height; + intersection->left = overlap.left; + intersection->top = overlap.top; + intersection->width = overlap.width; + intersection->height = overlap.height; return intersects; } else { - return SFMLRect1.Intersects(SFMLRect2); + return SFMLRect1.intersects(SFMLRect2); } } diff --git a/src/SFML/Graphics/RectangleShape.cpp b/src/SFML/Graphics/RectangleShape.cpp index 23629c3..006b589 100644 --- a/src/SFML/Graphics/RectangleShape.cpp +++ b/src/SFML/Graphics/RectangleShape.cpp @@ -32,14 +32,14 @@ //////////////////////////////////////////////////////////// -sfRectangleShape* sfRectangleShape_Create(void) +sfRectangleShape* sfRectangleShape_create(void) { return new sfRectangleShape; } //////////////////////////////////////////////////////////// -sfRectangleShape* sfRectangleShape_Copy(sfRectangleShape* shape) +sfRectangleShape* sfRectangleShape_copy(sfRectangleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -48,47 +48,47 @@ sfRectangleShape* sfRectangleShape_Copy(sfRectangleShape* shape) //////////////////////////////////////////////////////////// -void sfRectangleShape_Destroy(sfRectangleShape* shape) +void sfRectangleShape_destroy(sfRectangleShape* shape) { delete shape; } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetPosition(sfRectangleShape* shape, sfVector2f position) +void sfRectangleShape_setPosition(sfRectangleShape* shape, sfVector2f position) { - CSFML_CALL(shape, SetPosition(position.x, position.y)); + CSFML_CALL(shape, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetRotation(sfRectangleShape* shape, float angle) +void sfRectangleShape_setRotation(sfRectangleShape* shape, float angle) { - CSFML_CALL(shape, SetRotation(angle)); + CSFML_CALL(shape, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetScale(sfRectangleShape* shape, sfVector2f scale) +void sfRectangleShape_setScale(sfRectangleShape* shape, sfVector2f scale) { - CSFML_CALL(shape, SetScale(scale.x, scale.y)); + CSFML_CALL(shape, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetOrigin(sfRectangleShape* shape, sfVector2f origin) +void sfRectangleShape_setOrigin(sfRectangleShape* shape, sfVector2f origin) { - CSFML_CALL(shape, SetOrigin(origin.x, origin.y)); + CSFML_CALL(shape, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfRectangleShape_GetPosition(const sfRectangleShape* shape) +sfVector2f sfRectangleShape_getPosition(const sfRectangleShape* shape) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(shape, position); - sf::Vector2f sfmlPos = shape->This.GetPosition(); + sf::Vector2f sfmlPos = shape->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -97,19 +97,19 @@ sfVector2f sfRectangleShape_GetPosition(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -float sfRectangleShape_GetRotation(const sfRectangleShape* shape) +float sfRectangleShape_getRotation(const sfRectangleShape* shape) { - CSFML_CALL_RETURN(shape, GetRotation(), 0.f); + CSFML_CALL_RETURN(shape, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfRectangleShape_GetScale(const sfRectangleShape* shape) +sfVector2f sfRectangleShape_getScale(const sfRectangleShape* shape) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(shape, scale); - sf::Vector2f sfmlScale = shape->This.GetScale(); + sf::Vector2f sfmlScale = shape->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -118,12 +118,12 @@ sfVector2f sfRectangleShape_GetScale(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -sfVector2f sfRectangleShape_GetOrigin(const sfRectangleShape* shape) +sfVector2f sfRectangleShape_getOrigin(const sfRectangleShape* shape) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(shape, origin); - sf::Vector2f sfmlOrigin = shape->This.GetOrigin(); + sf::Vector2f sfmlOrigin = shape->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -132,84 +132,84 @@ sfVector2f sfRectangleShape_GetOrigin(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -void sfRectangleShape_Move(sfRectangleShape* shape, sfVector2f offset) +void sfRectangleShape_move(sfRectangleShape* shape, sfVector2f offset) { - CSFML_CALL(shape, Move(offset.x, offset.y)); + CSFML_CALL(shape, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfRectangleShape_Rotate(sfRectangleShape* shape, float angle) +void sfRectangleShape_rotate(sfRectangleShape* shape, float angle) { - CSFML_CALL(shape, Rotate(angle)); + CSFML_CALL(shape, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfRectangleShape_Scale(sfRectangleShape* shape, sfVector2f factors) +void sfRectangleShape_scale(sfRectangleShape* shape, sfVector2f factors) { - CSFML_CALL(shape, Scale(factors.x, factors.y)); + CSFML_CALL(shape, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfRectangleShape_GetTransform(const sfRectangleShape* shape) +const sfTransform* sfRectangleShape_getTransform(const sfRectangleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->Transform.This = shape->This.GetTransform(); + shape->Transform.This = shape->This.getTransform(); return &shape->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfRectangleShape_GetInverseTransform(const sfRectangleShape* shape) +const sfTransform* sfRectangleShape_getInverseTransform(const sfRectangleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->InverseTransform.This = shape->This.GetInverseTransform(); + shape->InverseTransform.This = shape->This.getInverseTransform(); return &shape->InverseTransform; } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect) +void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect) { - CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue)); + CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue)); shape->Texture = texture; } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetTextureRect(sfRectangleShape* shape, sfIntRect rect) +void sfRectangleShape_setTextureRect(sfRectangleShape* shape, sfIntRect rect) { - CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height))); + CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height))); } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetFillColor(sfRectangleShape* shape, sfColor color) +void sfRectangleShape_setFillColor(sfRectangleShape* shape, sfColor color) { - CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetOutlineColor(sfRectangleShape* shape, sfColor color) +void sfRectangleShape_setOutlineColor(sfRectangleShape* shape, sfColor color) { - CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfRectangleShape_SetOutlineThickness(sfRectangleShape* shape, float thickness) +void sfRectangleShape_setOutlineThickness(sfRectangleShape* shape, float thickness) { - CSFML_CALL(shape, SetOutlineThickness(thickness)); + CSFML_CALL(shape, setOutlineThickness(thickness)); } //////////////////////////////////////////////////////////// -const sfTexture* sfRectangleShape_GetTexture(const sfRectangleShape* shape) +const sfTexture* sfRectangleShape_getTexture(const sfRectangleShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -218,28 +218,28 @@ const sfTexture* sfRectangleShape_GetTexture(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -sfIntRect sfRectangleShape_GetTextureRect(const sfRectangleShape* shape) +sfIntRect sfRectangleShape_getTextureRect(const sfRectangleShape* shape) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::IntRect sfmlRect = shape->This.GetTextureRect(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::IntRect sfmlRect = shape->This.getTextureRect(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfColor sfRectangleShape_GetFillColor(const sfRectangleShape* shape) +sfColor sfRectangleShape_getFillColor(const sfRectangleShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetFillColor(); + sf::Color sfmlColor = shape->This.getFillColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -250,12 +250,12 @@ sfColor sfRectangleShape_GetFillColor(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -sfColor sfRectangleShape_GetOutlineColor(const sfRectangleShape* shape) +sfColor sfRectangleShape_getOutlineColor(const sfRectangleShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetOutlineColor(); + sf::Color sfmlColor = shape->This.getOutlineColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -266,26 +266,26 @@ sfColor sfRectangleShape_GetOutlineColor(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -float sfRectangleShape_GetOutlineThickness(const sfRectangleShape* shape) +float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape) { - CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f); + CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f); } //////////////////////////////////////////////////////////// -unsigned int sfRectangleShape_GetPointCount(const sfRectangleShape* shape) +unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape) { - CSFML_CALL_RETURN(shape, GetPointCount(), 0); + CSFML_CALL_RETURN(shape, getPointCount(), 0); } //////////////////////////////////////////////////////////// -sfVector2f sfRectangleShape_GetPoint(const sfRectangleShape* shape, unsigned int index) +sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index) { sfVector2f point = {0, 0}; CSFML_CHECK_RETURN(shape, point); - sf::Vector2f sfmlPoint = shape->This.GetPoint(index); + sf::Vector2f sfmlPoint = shape->This.getPoint(index); point.x = sfmlPoint.x; point.y = sfmlPoint.y; @@ -294,19 +294,19 @@ sfVector2f sfRectangleShape_GetPoint(const sfRectangleShape* shape, unsigned int //////////////////////////////////////////////////////////// -void sfRectangleShape_SetSize(sfRectangleShape* shape, sfVector2f size) +void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size) { - CSFML_CALL(shape, SetSize(sf::Vector2f(size.x, size.y))); + CSFML_CALL(shape, setSize(sf::Vector2f(size.x, size.y))); } //////////////////////////////////////////////////////////// -sfVector2f sfRectangleShape_GetSize(const sfRectangleShape* shape) +sfVector2f sfRectangleShape_getSize(const sfRectangleShape* shape) { sfVector2f size = {0, 0}; CSFML_CHECK_RETURN(shape, size); - sf::Vector2f sfmlSize = shape->This.GetSize(); + sf::Vector2f sfmlSize = shape->This.getSize(); size.x = sfmlSize.x; size.y = sfmlSize.y; @@ -315,32 +315,32 @@ sfVector2f sfRectangleShape_GetSize(const sfRectangleShape* shape) //////////////////////////////////////////////////////////// -sfFloatRect sfRectangleShape_GetLocalBounds(const sfRectangleShape* shape) +sfFloatRect sfRectangleShape_getLocalBounds(const sfRectangleShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetLocalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getLocalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfFloatRect sfRectangleShape_GetGlobalBounds(const sfRectangleShape* shape) +sfFloatRect sfRectangleShape_getGlobalBounds(const sfRectangleShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetGlobalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getGlobalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } diff --git a/src/SFML/Graphics/RenderTexture.cpp b/src/SFML/Graphics/RenderTexture.cpp index 1400a26..42a8365 100644 --- a/src/SFML/Graphics/RenderTexture.cpp +++ b/src/SFML/Graphics/RenderTexture.cpp @@ -39,20 +39,20 @@ //////////////////////////////////////////////////////////// -sfRenderTexture* sfRenderTexture_Create(unsigned int width, unsigned int height, sfBool depthBuffer) +sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer) { sfRenderTexture* renderTexture = new sfRenderTexture; - renderTexture->This.Create(width, height, depthBuffer == sfTrue); - renderTexture->Target = new sfTexture(const_cast(&renderTexture->This.GetTexture())); - renderTexture->DefaultView.This = renderTexture->This.GetDefaultView(); - renderTexture->CurrentView.This = renderTexture->This.GetView(); + renderTexture->This.create(width, height, depthBuffer == sfTrue); + renderTexture->Target = new sfTexture(const_cast(&renderTexture->This.getTexture())); + renderTexture->DefaultView.This = renderTexture->This.getDefaultView(); + renderTexture->CurrentView.This = renderTexture->This.getView(); return renderTexture; } //////////////////////////////////////////////////////////// -void sfRenderTexture_Destroy(sfRenderTexture* renderTexture) +void sfRenderTexture_destroy(sfRenderTexture* renderTexture) { delete renderTexture->Target; delete renderTexture; @@ -60,12 +60,12 @@ void sfRenderTexture_Destroy(sfRenderTexture* renderTexture) //////////////////////////////////////////////////////////// -sfVector2u sfRenderTexture_GetSize(const sfRenderTexture* renderTexture) +sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture) { sfVector2u size = {0, 0}; CSFML_CHECK_RETURN(renderTexture, size); - sf::Vector2u sfmlSize = renderTexture->This.GetSize(); + sf::Vector2u sfmlSize = renderTexture->This.getSize(); size.x = sfmlSize.x; size.y = sfmlSize.y; @@ -74,39 +74,39 @@ sfVector2u sfRenderTexture_GetSize(const sfRenderTexture* renderTexture) //////////////////////////////////////////////////////////// -sfBool sfRenderTexture_SetActive(sfRenderTexture* renderTexture, sfBool active) +sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active) { - CSFML_CALL_RETURN(renderTexture, SetActive(active == sfTrue), sfFalse); + CSFML_CALL_RETURN(renderTexture, setActive(active == sfTrue), sfFalse); } //////////////////////////////////////////////////////////// -void sfRenderTexture_Display(sfRenderTexture* renderTexture) +void sfRenderTexture_display(sfRenderTexture* renderTexture) { - CSFML_CALL(renderTexture, Display()); + CSFML_CALL(renderTexture, display()); } //////////////////////////////////////////////////////////// -void sfRenderTexture_Clear(sfRenderTexture* renderTexture, sfColor color) +void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color) { sf::Color SFMLColor(color.r, color.g, color.b, color.a); - CSFML_CALL(renderTexture, Clear(SFMLColor)); + CSFML_CALL(renderTexture, clear(SFMLColor)); } //////////////////////////////////////////////////////////// -void sfRenderTexture_SetView(sfRenderTexture* renderTexture, const sfView* view) +void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view) { CSFML_CHECK(view); - CSFML_CALL(renderTexture, SetView(view->This)); + CSFML_CALL(renderTexture, setView(view->This)); renderTexture->CurrentView.This = view->This; } //////////////////////////////////////////////////////////// -const sfView* sfRenderTexture_GetView(const sfRenderTexture* renderTexture) +const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture) { CSFML_CHECK_RETURN(renderTexture, NULL); @@ -115,7 +115,7 @@ const sfView* sfRenderTexture_GetView(const sfRenderTexture* renderTexture) //////////////////////////////////////////////////////////// -const sfView* sfRenderTexture_GetDefaultView(const sfRenderTexture* renderTexture) +const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture) { CSFML_CHECK_RETURN(renderTexture, NULL); @@ -124,32 +124,32 @@ const sfView* sfRenderTexture_GetDefaultView(const sfRenderTexture* renderTextur //////////////////////////////////////////////////////////// -sfIntRect sfRenderTexture_GetViewport(const sfRenderTexture* renderTexture, const sfView* view) +sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(view, rect); CSFML_CHECK_RETURN(renderTexture, rect); - sf::IntRect SFMLrect = renderTexture->This.GetViewport(view->This); - rect.Left = SFMLrect.Left; - rect.Top = SFMLrect.Top; - rect.Width = SFMLrect.Width; - rect.Height = SFMLrect.Height; + sf::IntRect SFMLrect = renderTexture->This.getViewport(view->This); + rect.left = SFMLrect.left; + rect.top = SFMLrect.top; + rect.width = SFMLrect.width; + rect.height = SFMLrect.height; return rect; } //////////////////////////////////////////////////////////// -void sfRenderTexture_ConvertCoords(const sfRenderTexture* renderTexture, unsigned int textureX, unsigned int textureY, float* viewX, float* viewY, const sfView* targetView) +void sfRenderTexture_convertCoords(const sfRenderTexture* renderTexture, unsigned int textureX, unsigned int textureY, float* viewX, float* viewY, const sfView* targetView) { CSFML_CHECK(renderTexture); sf::Vector2f point; if (targetView) - point = renderTexture->This.ConvertCoords(textureX, textureY, targetView->This); + point = renderTexture->This.convertCoords(textureX, textureY, targetView->This); else - point = renderTexture->This.ConvertCoords(textureX, textureY); + point = renderTexture->This.convertCoords(textureX, textureY); if (viewX) *viewX = point.x; if (viewY) *viewY = point.y; @@ -157,76 +157,76 @@ void sfRenderTexture_ConvertCoords(const sfRenderTexture* renderTexture, unsigne //////////////////////////////////////////////////////////// -void sfRenderTexture_DrawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states) +void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } -void sfRenderTexture_DrawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states) +void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } -void sfRenderTexture_DrawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states) +void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } -void sfRenderTexture_DrawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states) +void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } -void sfRenderTexture_DrawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states) +void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } -void sfRenderTexture_DrawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states) +void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } -void sfRenderTexture_DrawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states) +void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderTexture, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(object->This, convertRenderStates(states))); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_DrawPrimitives(sfRenderTexture* renderTexture, - const sfVertex* vertices, unsigned int vertexCount, - sfPrimitiveType type, const sfRenderStates* states) +void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture, + const sfVertex* vertices, unsigned int vertexCount, + sfPrimitiveType type, const sfRenderStates* states) { - CSFML_CALL(renderTexture, Draw(reinterpret_cast(vertices), vertexCount, - static_cast(type), ConvertRenderStates(states))); + CSFML_CALL(renderTexture, draw(reinterpret_cast(vertices), vertexCount, + static_cast(type), convertRenderStates(states))); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_PushGLStates(sfRenderTexture* renderTexture) +void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture) { - CSFML_CALL(renderTexture, PushGLStates()); + CSFML_CALL(renderTexture, pushGLStates()); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_PopGLStates(sfRenderTexture* renderTexture) +void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture) { - CSFML_CALL(renderTexture, PopGLStates()); + CSFML_CALL(renderTexture, popGLStates()); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_ResetGLStates(sfRenderTexture* renderTexture) +void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture) { - CSFML_CALL(renderTexture, ResetGLStates()); + CSFML_CALL(renderTexture, resetGLStates()); } //////////////////////////////////////////////////////////// -const sfTexture* sfRenderTexture_GetTexture(const sfRenderTexture* renderTexture) +const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture) { CSFML_CHECK_RETURN(renderTexture, NULL); @@ -235,14 +235,14 @@ const sfTexture* sfRenderTexture_GetTexture(const sfRenderTexture* renderTexture //////////////////////////////////////////////////////////// -void sfRenderTexture_SetSmooth(sfRenderTexture* renderTexture, sfBool smooth) +void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth) { - CSFML_CALL(renderTexture, SetSmooth(smooth == sfTrue)); + CSFML_CALL(renderTexture, setSmooth(smooth == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfRenderTexture_IsSmooth(const sfRenderTexture* renderTexture) +sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture) { - CSFML_CALL_RETURN(renderTexture, IsSmooth(), sfFalse); + CSFML_CALL_RETURN(renderTexture, isSmooth(), sfFalse); } diff --git a/src/SFML/Graphics/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp index 32677df..e59be8d 100644 --- a/src/SFML/Graphics/RenderWindow.cpp +++ b/src/SFML/Graphics/RenderWindow.cpp @@ -41,141 +41,143 @@ //////////////////////////////////////////////////////////// -sfRenderWindow* sfRenderWindow_Create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings) +sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings) { // Convert video mode - sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel); + sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel); // Convert context settings sf::ContextSettings params; if (settings) { - params.DepthBits = settings->DepthBits; - params.StencilBits = settings->StencilBits; - params.AntialiasingLevel = settings->AntialiasingLevel; - params.MajorVersion = settings->MajorVersion; - params.MinorVersion = settings->MinorVersion; + params.depthBits = settings->depthBits; + params.stencilBits = settings->stencilBits; + params.antialiasingLevel = settings->antialiasingLevel; + params.majorVersion = settings->majorVersion; + params.minorVersion = settings->minorVersion; } // Create the window sfRenderWindow* renderWindow = new sfRenderWindow; - renderWindow->This.Create(videoMode, title, style, params); - renderWindow->DefaultView.This = renderWindow->This.GetDefaultView(); - renderWindow->CurrentView.This = renderWindow->This.GetView(); + renderWindow->This.create(videoMode, title, style, params); + renderWindow->DefaultView.This = renderWindow->This.getDefaultView(); + renderWindow->CurrentView.This = renderWindow->This.getView(); return renderWindow; } //////////////////////////////////////////////////////////// -sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings) +sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings) { // Convert context settings sf::ContextSettings params; if (settings) { - params.DepthBits = settings->DepthBits; - params.StencilBits = settings->StencilBits; - params.AntialiasingLevel = settings->AntialiasingLevel; - params.MajorVersion = settings->MajorVersion; - params.MinorVersion = settings->MinorVersion; + params.depthBits = settings->depthBits; + params.stencilBits = settings->stencilBits; + params.antialiasingLevel = settings->antialiasingLevel; + params.majorVersion = settings->majorVersion; + params.minorVersion = settings->minorVersion; } // Create the window sfRenderWindow* renderWindow = new sfRenderWindow; - renderWindow->This.Create(handle, params); - renderWindow->DefaultView.This = renderWindow->This.GetDefaultView(); - renderWindow->CurrentView.This = renderWindow->This.GetView(); + renderWindow->This.create(handle, params); + renderWindow->DefaultView.This = renderWindow->This.getDefaultView(); + renderWindow->CurrentView.This = renderWindow->This.getView(); return renderWindow; } //////////////////////////////////////////////////////////// -void sfRenderWindow_Destroy(sfRenderWindow* renderWindow) +void sfRenderWindow_destroy(sfRenderWindow* renderWindow) { delete renderWindow; } //////////////////////////////////////////////////////////// -void sfRenderWindow_Close(sfRenderWindow* renderWindow) +void sfRenderWindow_close(sfRenderWindow* renderWindow) { - CSFML_CALL(renderWindow, Close()); + CSFML_CALL(renderWindow, close()); } //////////////////////////////////////////////////////////// -sfBool sfRenderWindow_IsOpen(const sfRenderWindow* renderWindow) +sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow) { - CSFML_CALL_RETURN(renderWindow, IsOpen(), sfFalse); + CSFML_CALL_RETURN(renderWindow, isOpen(), sfFalse); } //////////////////////////////////////////////////////////// -sfContextSettings sfRenderWindow_GetSettings(const sfRenderWindow* renderWindow) +sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow) { sfContextSettings settings = {0, 0, 0, 2, 0}; CSFML_CHECK_RETURN(renderWindow, settings); - const sf::ContextSettings& params = renderWindow->This.GetSettings(); - settings.DepthBits = params.DepthBits; - settings.StencilBits = params.StencilBits; - settings.AntialiasingLevel = params.AntialiasingLevel; + const sf::ContextSettings& params = renderWindow->This.getSettings(); + settings.depthBits = params.depthBits; + settings.stencilBits = params.stencilBits; + settings.antialiasingLevel = params.antialiasingLevel; + settings.majorVersion = params.majorVersion; + settings.minorVersion = params.minorVersion; return settings; } //////////////////////////////////////////////////////////// -sfBool sfRenderWindow_PollEvent(sfRenderWindow* renderWindow, sfEvent* event) +sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event) { CSFML_CHECK_RETURN(renderWindow, sfFalse); CSFML_CHECK_RETURN(event, sfFalse); // Get the event sf::Event SFMLEvent; - sfBool ret = renderWindow->This.PollEvent(SFMLEvent); + sfBool ret = renderWindow->This.pollEvent(SFMLEvent); // No event, return if (!ret) return sfFalse; // Convert the sf::Event event to a sfEvent - ConvertEvent(SFMLEvent, event); + convertEvent(SFMLEvent, event); return sfTrue; } //////////////////////////////////////////////////////////// -sfBool sfRenderWindow_WaitEvent(sfRenderWindow* renderWindow, sfEvent* event) +sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event) { CSFML_CHECK_RETURN(renderWindow, sfFalse); CSFML_CHECK_RETURN(event, sfFalse); // Get the event sf::Event SFMLEvent; - sfBool ret = renderWindow->This.WaitEvent(SFMLEvent); + sfBool ret = renderWindow->This.waitEvent(SFMLEvent); // Error, return if (!ret) return sfFalse; // Convert the sf::Event event to a sfEvent - ConvertEvent(SFMLEvent, event); + convertEvent(SFMLEvent, event); return sfTrue; } //////////////////////////////////////////////////////////// -sfVector2i sfRenderWindow_GetPosition(const sfRenderWindow* renderWindow) +sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow) { sfVector2i position = {0, 0}; CSFML_CHECK_RETURN(renderWindow, position); - sf::Vector2i sfmlPos = renderWindow->This.GetPosition(); + sf::Vector2i sfmlPos = renderWindow->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -184,19 +186,19 @@ sfVector2i sfRenderWindow_GetPosition(const sfRenderWindow* renderWindow) //////////////////////////////////////////////////////////// -void sfRenderWindow_SetPosition(sfRenderWindow* renderWindow, sfVector2i position) +void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position) { - CSFML_CALL(renderWindow, SetPosition(sf::Vector2i(position.x, position.y))); + CSFML_CALL(renderWindow, setPosition(sf::Vector2i(position.x, position.y))); } //////////////////////////////////////////////////////////// -sfVector2u sfRenderWindow_GetSize(const sfRenderWindow* renderWindow) +sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow) { sfVector2u size = {0, 0}; CSFML_CHECK_RETURN(renderWindow, size); - sf::Vector2u sfmlSize = renderWindow->This.GetSize(); + sf::Vector2u sfmlSize = renderWindow->This.getSize(); size.x = sfmlSize.x; size.y = sfmlSize.y; @@ -205,111 +207,111 @@ sfVector2u sfRenderWindow_GetSize(const sfRenderWindow* renderWindow) //////////////////////////////////////////////////////////// -void sfRenderWindow_SetSize(sfRenderWindow* renderWindow, sfVector2u size) +void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size) { - CSFML_CALL(renderWindow, SetSize(sf::Vector2u(size.x, size.y))); + CSFML_CALL(renderWindow, setSize(sf::Vector2u(size.x, size.y))); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetTitle(sfRenderWindow* renderWindow, const char* title) +void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title) { - CSFML_CALL(renderWindow, SetTitle(title)); + CSFML_CALL(renderWindow, setTitle(title)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels) +void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels) { - CSFML_CALL(renderWindow, SetIcon(width, height, pixels)); + CSFML_CALL(renderWindow, setIcon(width, height, pixels)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetVisible(sfRenderWindow* renderWindow, sfBool visible) +void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible) { - CSFML_CALL(renderWindow, SetVisible(visible == sfTrue)); + CSFML_CALL(renderWindow, setVisible(visible == sfTrue)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetMouseCursorVisible(sfRenderWindow* renderWindow, sfBool visible) +void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool visible) { - CSFML_CALL(renderWindow, SetMouseCursorVisible(visible == sfTrue)); + CSFML_CALL(renderWindow, setMouseCursorVisible(visible == sfTrue)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled) +void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled) { - CSFML_CALL(renderWindow, SetVerticalSyncEnabled(enabled == sfTrue)); + CSFML_CALL(renderWindow, setVerticalSyncEnabled(enabled == sfTrue)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled) +void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled) { - CSFML_CALL(renderWindow, SetKeyRepeatEnabled(enabled == sfTrue)); + CSFML_CALL(renderWindow, setKeyRepeatEnabled(enabled == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfRenderWindow_SetActive(sfRenderWindow* renderWindow, sfBool active) +sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active) { - CSFML_CALL_RETURN(renderWindow, SetActive(active == sfTrue), sfFalse); + CSFML_CALL_RETURN(renderWindow, setActive(active == sfTrue), sfFalse); } //////////////////////////////////////////////////////////// -void sfRenderWindow_Display(sfRenderWindow* renderWindow) +void sfRenderWindow_display(sfRenderWindow* renderWindow) { - CSFML_CALL(renderWindow, Display()); + CSFML_CALL(renderWindow, display()); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit) +void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit) { - CSFML_CALL(renderWindow, SetFramerateLimit(limit)); + CSFML_CALL(renderWindow, setFramerateLimit(limit)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetJoystickThreshold(sfRenderWindow* renderWindow, float threshold) +void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold) { - CSFML_CALL(renderWindow, SetJoystickThreshold(threshold)); + CSFML_CALL(renderWindow, setJoystickThreshold(threshold)); } //////////////////////////////////////////////////////////// -sfWindowHandle sfRenderWindow_GetSystemHandle(const sfRenderWindow* renderWindow) +sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow) { CSFML_CHECK_RETURN(renderWindow, 0); - return (sfWindowHandle)renderWindow->This.GetSystemHandle(); + return (sfWindowHandle)renderWindow->This.getSystemHandle(); } //////////////////////////////////////////////////////////// -void sfRenderWindow_Clear(sfRenderWindow* renderWindow, sfColor color) +void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color) { sf::Color SFMLColor(color.r, color.g, color.b, color.a); - CSFML_CALL(renderWindow, Clear(SFMLColor)); + CSFML_CALL(renderWindow, clear(SFMLColor)); } //////////////////////////////////////////////////////////// -void sfRenderWindow_SetView(sfRenderWindow* renderWindow, const sfView* view) +void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view) { CSFML_CHECK(view); - CSFML_CALL(renderWindow, SetView(view->This)); + CSFML_CALL(renderWindow, setView(view->This)); renderWindow->CurrentView.This = view->This; } //////////////////////////////////////////////////////////// -const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow) +const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow) { CSFML_CHECK_RETURN(renderWindow, NULL); @@ -318,7 +320,7 @@ const sfView* sfRenderWindow_GetView(const sfRenderWindow* renderWindow) //////////////////////////////////////////////////////////// -const sfView* sfRenderWindow_GetDefaultView(const sfRenderWindow* renderWindow) +const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow) { CSFML_CHECK_RETURN(renderWindow, NULL); @@ -327,32 +329,32 @@ const sfView* sfRenderWindow_GetDefaultView(const sfRenderWindow* renderWindow) //////////////////////////////////////////////////////////// -sfIntRect sfRenderWindow_GetViewport(const sfRenderWindow* renderWindow, const sfView* view) +sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(view, rect); CSFML_CHECK_RETURN(renderWindow, rect); - sf::IntRect SFMLrect = renderWindow->This.GetViewport(view->This); - rect.Left = SFMLrect.Left; - rect.Top = SFMLrect.Top; - rect.Width = SFMLrect.Width; - rect.Height = SFMLrect.Height; + sf::IntRect SFMLrect = renderWindow->This.getViewport(view->This); + rect.left = SFMLrect.left; + rect.top = SFMLrect.top; + rect.width = SFMLrect.width; + rect.height = SFMLrect.height; return rect; } //////////////////////////////////////////////////////////// -void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView) +void sfRenderWindow_convertCoords(const sfRenderWindow* renderWindow, unsigned int windowX, unsigned int windowY, float* viewX, float* viewY, const sfView* targetView) { CSFML_CHECK(renderWindow); sf::Vector2f point; if (targetView) - point = renderWindow->This.ConvertCoords(windowX, windowY, targetView->This); + point = renderWindow->This.convertCoords(windowX, windowY, targetView->This); else - point = renderWindow->This.ConvertCoords(windowX, windowY); + point = renderWindow->This.convertCoords(windowX, windowY); if (viewX) *viewX = point.x; if (viewY) *viewY = point.y; @@ -360,83 +362,81 @@ void sfRenderWindow_ConvertCoords(const sfRenderWindow* renderWindow, unsigned i //////////////////////////////////////////////////////////// -void sfRenderWindow_DrawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states) +void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } -void sfRenderWindow_DrawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states) +void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } -void sfRenderWindow_DrawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states) +void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } -void sfRenderWindow_DrawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states) +void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } -void sfRenderWindow_DrawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states) +void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } -void sfRenderWindow_DrawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states) +void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } -void sfRenderWindow_DrawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states) +void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states) { CSFML_CHECK(object); - CSFML_CALL(renderWindow, Draw(object->This, ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(object->This, convertRenderStates(states))); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_DrawPrimitives(sfRenderWindow* renderWindow, - const sfVertex* vertices, unsigned int vertexCount, - sfPrimitiveType type, const sfRenderStates* states) +void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow, + const sfVertex* vertices, unsigned int vertexCount, + sfPrimitiveType type, const sfRenderStates* states) { - CSFML_CALL(renderWindow, Draw(reinterpret_cast(vertices), vertexCount, - static_cast(type), ConvertRenderStates(states))); + CSFML_CALL(renderWindow, draw(reinterpret_cast(vertices), vertexCount, + static_cast(type), convertRenderStates(states))); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_PushGLStates(sfRenderWindow* renderWindow) +void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow) { - CSFML_CALL(renderWindow, PushGLStates()); + CSFML_CALL(renderWindow, pushGLStates()); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_PopGLStates(sfRenderWindow* renderWindow) +void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow) { - CSFML_CALL(renderWindow, PopGLStates()); + CSFML_CALL(renderWindow, popGLStates()); } //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_ResetGLStates(sfRenderWindow* renderWindow) +void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow) { - CSFML_CALL(renderWindow, ResetGLStates()); + CSFML_CALL(renderWindow, resetGLStates()); } //////////////////////////////////////////////////////////// -/// Copy the current contents of a window to an image -//////////////////////////////////////////////////////////// -sfImage* sfRenderWindow_Capture(const sfRenderWindow* renderWindow) +sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow) { CSFML_CHECK_RETURN(renderWindow, NULL); sfImage* image = new sfImage; - image->This = renderWindow->This.Capture(); + image->This = renderWindow->This.capture(); return image; } diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index 202491c..e1723b4 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -34,7 +34,7 @@ //////////////////////////////////////////////////////////// -sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename) +sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename) { bool success = false; sfShader* shader = new sfShader; @@ -43,17 +43,17 @@ sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char* if (!vertexShaderFilename) { // fragment shader only - success = shader->This.LoadFromFile(fragmentShaderFilename, sf::Shader::Fragment); + success = shader->This.loadFromFile(fragmentShaderFilename, sf::Shader::Fragment); } else if (!fragmentShaderFilename) { // vertex shader only - success = shader->This.LoadFromFile(vertexShaderFilename, sf::Shader::Vertex); + success = shader->This.loadFromFile(vertexShaderFilename, sf::Shader::Vertex); } else { // vertex + fragment shaders - success = shader->This.LoadFromFile(vertexShaderFilename, fragmentShaderFilename); + success = shader->This.loadFromFile(vertexShaderFilename, fragmentShaderFilename); } } @@ -68,7 +68,7 @@ sfShader* sfShader_CreateFromFile(const char* vertexShaderFilename, const char* //////////////////////////////////////////////////////////// -sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragmentShader) +sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader) { bool success = false; sfShader* shader = new sfShader; @@ -77,17 +77,17 @@ sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragme if (!vertexShader) { // fragment shader only - success = shader->This.LoadFromMemory(fragmentShader, sf::Shader::Fragment); + success = shader->This.loadFromMemory(fragmentShader, sf::Shader::Fragment); } else if (!fragmentShader) { // vertex shader only - success = shader->This.LoadFromMemory(vertexShader, sf::Shader::Vertex); + success = shader->This.loadFromMemory(vertexShader, sf::Shader::Vertex); } else { // vertex + fragment shaders - success = shader->This.LoadFromMemory(vertexShader, fragmentShader); + success = shader->This.loadFromMemory(vertexShader, fragmentShader); } } @@ -102,7 +102,7 @@ sfShader* sfShader_CreateFromMemory(const char* vertexShader, const char* fragme //////////////////////////////////////////////////////////// -sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream) +sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream) { bool success = false; sfShader* shader = new sfShader; @@ -112,20 +112,20 @@ sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputSt { // fragment shader only CallbackStream stream(fragmentShaderStream); - success = shader->This.LoadFromStream(stream, sf::Shader::Fragment); + success = shader->This.loadFromStream(stream, sf::Shader::Fragment); } else if (!fragmentShaderStream) { // vertex shader only CallbackStream stream(vertexShaderStream); - success = shader->This.LoadFromStream(stream, sf::Shader::Vertex); + success = shader->This.loadFromStream(stream, sf::Shader::Vertex); } else { // vertex + fragment shaders CallbackStream vertexStream(vertexShaderStream); CallbackStream fragmentStream(fragmentShaderStream); - success = shader->This.LoadFromStream(vertexStream, fragmentStream); + success = shader->This.loadFromStream(vertexStream, fragmentStream); } } @@ -140,85 +140,99 @@ sfShader* sfShader_CreateFromStream(sfInputStream* vertexShaderStream, sfInputSt //////////////////////////////////////////////////////////// -void sfShader_Destroy(sfShader* shader) +void sfShader_destroy(sfShader* shader) { delete shader; } //////////////////////////////////////////////////////////// -void sfShader_SetFloatParameter(sfShader* shader, const char* name, float x) +void sfShader_setFloatParameter(sfShader* shader, const char* name, float x) { - CSFML_CALL(shader, SetParameter(name, x)); + CSFML_CALL(shader, setParameter(name, x)); } //////////////////////////////////////////////////////////// -void sfShader_SetFloat2Parameter(sfShader* shader, const char* name, float x, float y) +void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y) { - CSFML_CALL(shader, SetParameter(name, x, y)); + CSFML_CALL(shader, setParameter(name, x, y)); } //////////////////////////////////////////////////////////// -void sfShader_SetFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z) +void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z) { - CSFML_CALL(shader, SetParameter(name, x, y, z)); + CSFML_CALL(shader, setParameter(name, x, y, z)); } //////////////////////////////////////////////////////////// -void sfShader_SetFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w) +void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w) { - CSFML_CALL(shader, SetParameter(name, x, y, z, w)); + CSFML_CALL(shader, setParameter(name, x, y, z, w)); } //////////////////////////////////////////////////////////// -void sfShader_SetColorParameter(sfShader* shader, const char* name, sfColor color) +void sfShader_SetVector2Parameter(sfShader* shader, const char* name, sfVector2f vector) { - CSFML_CALL(shader, SetParameter(name, sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shader, setParameter(name, sf::Vector2f(vector.x, vector.y))); } //////////////////////////////////////////////////////////// -void sfShader_SetTransformParameter(sfShader* shader, const char* name, const sfTransform* transform) +void sfShader_SetVector3Parameter(sfShader* shader, const char* name, sfVector3f vector) { - CSFML_CALL(shader, SetParameter(name, transform ? transform->This : sf::Transform::Identity)); + CSFML_CALL(shader, setParameter(name, sf::Vector3f(vector.x, vector.y, vector.z))); } //////////////////////////////////////////////////////////// -void sfShader_SetTextureParameter(sfShader* shader, const char* name, const sfTexture* texture) +void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color) +{ + CSFML_CALL(shader, setParameter(name, sf::Color(color.r, color.g, color.b, color.a))); +} + + +//////////////////////////////////////////////////////////// +void sfShader_setTransformParameter(sfShader* shader, const char* name, const sfTransform* transform) +{ + CSFML_CALL(shader, setParameter(name, transform ? transform->This : sf::Transform::Identity)); +} + + +//////////////////////////////////////////////////////////// +void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture) { CSFML_CHECK(texture); - CSFML_CALL(shader, SetParameter(name, *texture->This)); + CSFML_CALL(shader, setParameter(name, *texture->This)); } //////////////////////////////////////////////////////////// -void sfShader_SetCurrentTextureParameter(sfShader* shader, const char* name) +void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name) { - CSFML_CALL(shader, SetParameter(name, sf::Shader::CurrentTexture)); + CSFML_CALL(shader, setParameter(name, sf::Shader::CurrentTexture)); } //////////////////////////////////////////////////////////// -void sfShader_Bind(const sfShader* shader) +void sfShader_bind(const sfShader* shader) { - CSFML_CALL(shader, Bind()); + CSFML_CALL(shader, bind()); } //////////////////////////////////////////////////////////// -void sfShader_Unbind(const sfShader* shader) +void sfShader_unbind(const sfShader* shader) { - CSFML_CALL(shader, Unbind()); + CSFML_CALL(shader, unbind()); } //////////////////////////////////////////////////////////// -sfBool sfShader_IsAvailable(void) +sfBool sfShader_isAvailable(void) { - return sf::Shader::IsAvailable() ? sfTrue : sfFalse; + return sf::Shader::isAvailable() ? sfTrue : sfFalse; } diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp index a4ae7ab..b85cc01 100644 --- a/src/SFML/Graphics/Shape.cpp +++ b/src/SFML/Graphics/Shape.cpp @@ -32,7 +32,7 @@ //////////////////////////////////////////////////////////// -sfShape* sfShape_Create(sfShapeGetPointCountCallback getPointCount, +sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount, sfShapeGetPointCallback getPoint, void* userData) { @@ -41,47 +41,47 @@ sfShape* sfShape_Create(sfShapeGetPointCountCallback getPointCount, //////////////////////////////////////////////////////////// -void sfShape_Destroy(sfShape* shape) +void sfShape_destroy(sfShape* shape) { delete shape; } //////////////////////////////////////////////////////////// -void sfShape_SetPosition(sfShape* shape, sfVector2f position) +void sfShape_setPosition(sfShape* shape, sfVector2f position) { - CSFML_CALL(shape, SetPosition(position.x, position.y)); + CSFML_CALL(shape, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfShape_SetRotation(sfShape* shape, float angle) +void sfShape_setRotation(sfShape* shape, float angle) { - CSFML_CALL(shape, SetRotation(angle)); + CSFML_CALL(shape, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfShape_SetScale(sfShape* shape, sfVector2f scale) +void sfShape_setScale(sfShape* shape, sfVector2f scale) { - CSFML_CALL(shape, SetScale(scale.x, scale.y)); + CSFML_CALL(shape, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfShape_SetOrigin(sfShape* shape, sfVector2f origin) +void sfShape_setOrigin(sfShape* shape, sfVector2f origin) { - CSFML_CALL(shape, SetOrigin(origin.x, origin.y)); + CSFML_CALL(shape, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfShape_GetPosition(const sfShape* shape) +sfVector2f sfShape_getPosition(const sfShape* shape) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(shape, position); - sf::Vector2f sfmlPos = shape->This.GetPosition(); + sf::Vector2f sfmlPos = shape->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -90,19 +90,19 @@ sfVector2f sfShape_GetPosition(const sfShape* shape) //////////////////////////////////////////////////////////// -float sfShape_GetRotation(const sfShape* shape) +float sfShape_getRotation(const sfShape* shape) { - CSFML_CALL_RETURN(shape, GetRotation(), 0.f); + CSFML_CALL_RETURN(shape, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfShape_GetScale(const sfShape* shape) +sfVector2f sfShape_getScale(const sfShape* shape) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(shape, scale); - sf::Vector2f sfmlScale = shape->This.GetScale(); + sf::Vector2f sfmlScale = shape->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -111,12 +111,12 @@ sfVector2f sfShape_GetScale(const sfShape* shape) //////////////////////////////////////////////////////////// -sfVector2f sfShape_GetOrigin(const sfShape* shape) +sfVector2f sfShape_getOrigin(const sfShape* shape) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(shape, origin); - sf::Vector2f sfmlOrigin = shape->This.GetOrigin(); + sf::Vector2f sfmlOrigin = shape->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -125,84 +125,84 @@ sfVector2f sfShape_GetOrigin(const sfShape* shape) //////////////////////////////////////////////////////////// -void sfShape_Move(sfShape* shape, sfVector2f offset) +void sfShape_move(sfShape* shape, sfVector2f offset) { - CSFML_CALL(shape, Move(offset.x, offset.y)); + CSFML_CALL(shape, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfShape_Rotate(sfShape* shape, float angle) +void sfShape_rotate(sfShape* shape, float angle) { - CSFML_CALL(shape, Rotate(angle)); + CSFML_CALL(shape, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfShape_Scale(sfShape* shape, sfVector2f factors) +void sfShape_scale(sfShape* shape, sfVector2f factors) { - CSFML_CALL(shape, Scale(factors.x, factors.y)); + CSFML_CALL(shape, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfShape_GetTransform(const sfShape* shape) +const sfTransform* sfShape_getTransform(const sfShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->Transform.This = shape->This.GetTransform(); + shape->Transform.This = shape->This.getTransform(); return &shape->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfShape_GetInverseTransform(const sfShape* shape) +const sfTransform* sfShape_getInverseTransform(const sfShape* shape) { CSFML_CHECK_RETURN(shape, NULL); - shape->InverseTransform.This = shape->This.GetInverseTransform(); + shape->InverseTransform.This = shape->This.getInverseTransform(); return &shape->InverseTransform; } //////////////////////////////////////////////////////////// -void sfShape_SetTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect) +void sfShape_setTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect) { - CSFML_CALL(shape, SetTexture(texture ? texture->This : NULL, resetRect == sfTrue)); + CSFML_CALL(shape, setTexture(texture ? texture->This : NULL, resetRect == sfTrue)); shape->Texture = texture; } //////////////////////////////////////////////////////////// -void sfShape_SetTextureRect(sfShape* shape, sfIntRect rect) +void sfShape_setTextureRect(sfShape* shape, sfIntRect rect) { - CSFML_CALL(shape, SetTextureRect(sf::IntRect(rect.Left, rect.Top, rect.Width, rect.Height))); + CSFML_CALL(shape, setTextureRect(sf::IntRect(rect.left, rect.top, rect.width, rect.height))); } //////////////////////////////////////////////////////////// -void sfShape_SetFillColor(sfShape* shape, sfColor color) +void sfShape_setFillColor(sfShape* shape, sfColor color) { - CSFML_CALL(shape, SetFillColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setFillColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfShape_SetOutlineColor(sfShape* shape, sfColor color) +void sfShape_setOutlineColor(sfShape* shape, sfColor color) { - CSFML_CALL(shape, SetOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(shape, setOutlineColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -void sfShape_SetOutlineThickness(sfShape* shape, float thickness) +void sfShape_setOutlineThickness(sfShape* shape, float thickness) { - CSFML_CALL(shape, SetOutlineThickness(thickness)); + CSFML_CALL(shape, setOutlineThickness(thickness)); } //////////////////////////////////////////////////////////// -const sfTexture* sfShape_GetTexture(const sfShape* shape) +const sfTexture* sfShape_getTexture(const sfShape* shape) { CSFML_CHECK_RETURN(shape, NULL); @@ -211,28 +211,28 @@ const sfTexture* sfShape_GetTexture(const sfShape* shape) //////////////////////////////////////////////////////////// -sfIntRect sfShape_GetTextureRect(const sfShape* shape) +sfIntRect sfShape_getTextureRect(const sfShape* shape) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::IntRect sfmlRect = shape->This.GetTextureRect(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::IntRect sfmlRect = shape->This.getTextureRect(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfColor sfShape_GetFillColor(const sfShape* shape) +sfColor sfShape_getFillColor(const sfShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetFillColor(); + sf::Color sfmlColor = shape->This.getFillColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -243,12 +243,12 @@ sfColor sfShape_GetFillColor(const sfShape* shape) //////////////////////////////////////////////////////////// -sfColor sfShape_GetOutlineColor(const sfShape* shape) +sfColor sfShape_getOutlineColor(const sfShape* shape) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, color); - sf::Color sfmlColor = shape->This.GetOutlineColor(); + sf::Color sfmlColor = shape->This.getOutlineColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -259,26 +259,26 @@ sfColor sfShape_GetOutlineColor(const sfShape* shape) //////////////////////////////////////////////////////////// -float sfShape_GetOutlineThickness(const sfShape* shape) +float sfShape_getOutlineThickness(const sfShape* shape) { - CSFML_CALL_RETURN(shape, GetOutlineThickness(), 0.f); + CSFML_CALL_RETURN(shape, getOutlineThickness(), 0.f); } //////////////////////////////////////////////////////////// -unsigned int sfShape_GetPointCount(const sfShape* shape) +unsigned int sfShape_getPointCount(const sfShape* shape) { - CSFML_CALL_RETURN(shape, GetPointCount(), 0); + CSFML_CALL_RETURN(shape, getPointCount(), 0); } //////////////////////////////////////////////////////////// -sfVector2f sfShape_GetPoint(const sfShape* shape, unsigned int index) +sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index) { sfVector2f point = {0, 0}; CSFML_CHECK_RETURN(shape, point); - sf::Vector2f sfmlPoint = shape->This.GetPoint(index); + sf::Vector2f sfmlPoint = shape->This.getPoint(index); point.x = sfmlPoint.x; point.y = sfmlPoint.y; @@ -287,39 +287,39 @@ sfVector2f sfShape_GetPoint(const sfShape* shape, unsigned int index) //////////////////////////////////////////////////////////// -sfFloatRect sfShape_GetLocalBounds(const sfShape* shape) +sfFloatRect sfShape_getLocalBounds(const sfShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetLocalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getLocalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfFloatRect sfShape_GetGlobalBounds(const sfShape* shape) +sfFloatRect sfShape_getGlobalBounds(const sfShape* shape) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(shape, rect); - sf::FloatRect sfmlRect = shape->This.GetGlobalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = shape->This.getGlobalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -void sfShape_Update(sfShape* shape) +void sfShape_update(sfShape* shape) { - CSFML_CALL(shape, Update()); + CSFML_CALL(shape, update()); } diff --git a/src/SFML/Graphics/ShapeStruct.h b/src/SFML/Graphics/ShapeStruct.h index 000bbd9..8ea8d4b 100644 --- a/src/SFML/Graphics/ShapeStruct.h +++ b/src/SFML/Graphics/ShapeStruct.h @@ -51,18 +51,18 @@ public : { } - virtual unsigned int GetPointCount() const + virtual unsigned int getPointCount() const { return myGetPointCountCallback(myUserData); } - virtual sf::Vector2f GetPoint(unsigned int index) const + virtual sf::Vector2f getPoint(unsigned int index) const { sfVector2f point = myGetPointCallback(index, myUserData); return sf::Vector2f(point.x, point.y); } - using sf::Shape::Update; + using sf::Shape::update; private: diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp index c6690ae..9559d4a 100644 --- a/src/SFML/Graphics/Sprite.cpp +++ b/src/SFML/Graphics/Sprite.cpp @@ -33,7 +33,7 @@ //////////////////////////////////////////////////////////// -sfSprite* sfSprite_Create(void) +sfSprite* sfSprite_create(void) { sfSprite* sprite = new sfSprite; sprite->Texture = NULL; @@ -43,7 +43,7 @@ sfSprite* sfSprite_Create(void) //////////////////////////////////////////////////////////// -sfSprite* sfSprite_Copy(sfSprite* sprite) +sfSprite* sfSprite_copy(sfSprite* sprite) { CSFML_CHECK_RETURN(sprite, NULL); @@ -52,47 +52,47 @@ sfSprite* sfSprite_Copy(sfSprite* sprite) //////////////////////////////////////////////////////////// -void sfSprite_Destroy(sfSprite* sprite) +void sfSprite_destroy(sfSprite* sprite) { delete sprite; } //////////////////////////////////////////////////////////// -void sfSprite_SetPosition(sfSprite* sprite, sfVector2f position) +void sfSprite_setPosition(sfSprite* sprite, sfVector2f position) { - CSFML_CALL(sprite, SetPosition(position.x, position.y)); + CSFML_CALL(sprite, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfSprite_SetRotation(sfSprite* sprite, float angle) +void sfSprite_setRotation(sfSprite* sprite, float angle) { - CSFML_CALL(sprite, SetRotation(angle)); + CSFML_CALL(sprite, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfSprite_SetScale(sfSprite* sprite, sfVector2f scale) +void sfSprite_setScale(sfSprite* sprite, sfVector2f scale) { - CSFML_CALL(sprite, SetScale(scale.x, scale.y)); + CSFML_CALL(sprite, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfSprite_SetOrigin(sfSprite* sprite, sfVector2f origin) +void sfSprite_setOrigin(sfSprite* sprite, sfVector2f origin) { - CSFML_CALL(sprite, SetOrigin(origin.x, origin.y)); + CSFML_CALL(sprite, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfSprite_GetPosition(const sfSprite* sprite) +sfVector2f sfSprite_getPosition(const sfSprite* sprite) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(sprite, position); - sf::Vector2f sfmlPos = sprite->This.GetPosition(); + sf::Vector2f sfmlPos = sprite->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -101,19 +101,19 @@ sfVector2f sfSprite_GetPosition(const sfSprite* sprite) //////////////////////////////////////////////////////////// -float sfSprite_GetRotation(const sfSprite* sprite) +float sfSprite_getRotation(const sfSprite* sprite) { - CSFML_CALL_RETURN(sprite, GetRotation(), 0.f); + CSFML_CALL_RETURN(sprite, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfSprite_GetScale(const sfSprite* sprite) +sfVector2f sfSprite_getScale(const sfSprite* sprite) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(sprite, scale); - sf::Vector2f sfmlScale = sprite->This.GetScale(); + sf::Vector2f sfmlScale = sprite->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -122,12 +122,12 @@ sfVector2f sfSprite_GetScale(const sfSprite* sprite) //////////////////////////////////////////////////////////// -sfVector2f sfSprite_GetOrigin(const sfSprite* sprite) +sfVector2f sfSprite_getOrigin(const sfSprite* sprite) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(sprite, origin); - sf::Vector2f sfmlOrigin = sprite->This.GetOrigin(); + sf::Vector2f sfmlOrigin = sprite->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -136,73 +136,73 @@ sfVector2f sfSprite_GetOrigin(const sfSprite* sprite) //////////////////////////////////////////////////////////// -void sfSprite_Move(sfSprite* sprite, sfVector2f offset) +void sfSprite_move(sfSprite* sprite, sfVector2f offset) { - CSFML_CALL(sprite, Move(offset.x, offset.y)); + CSFML_CALL(sprite, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfSprite_Rotate(sfSprite* sprite, float angle) +void sfSprite_rotate(sfSprite* sprite, float angle) { - CSFML_CALL(sprite, Rotate(angle)); + CSFML_CALL(sprite, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfSprite_Scale(sfSprite* sprite, sfVector2f factors) +void sfSprite_scale(sfSprite* sprite, sfVector2f factors) { - CSFML_CALL(sprite, Scale(factors.x, factors.y)); + CSFML_CALL(sprite, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfSprite_GetTransform(const sfSprite* sprite) +const sfTransform* sfSprite_getTransform(const sfSprite* sprite) { CSFML_CHECK_RETURN(sprite, NULL); - sprite->Transform.This = sprite->This.GetTransform(); + sprite->Transform.This = sprite->This.getTransform(); return &sprite->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfSprite_GetInverseTransform(const sfSprite* sprite) +const sfTransform* sfSprite_getInverseTransform(const sfSprite* sprite) { CSFML_CHECK_RETURN(sprite, NULL); - sprite->InverseTransform.This = sprite->This.GetInverseTransform(); + sprite->InverseTransform.This = sprite->This.getInverseTransform(); return &sprite->InverseTransform; } //////////////////////////////////////////////////////////// -void sfSprite_SetTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect) +void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect) { if (texture && texture->This) { - CSFML_CALL(sprite, SetTexture(*texture->This, resetRect == sfTrue)); + CSFML_CALL(sprite, setTexture(*texture->This, resetRect == sfTrue)); sprite->Texture = texture; } } //////////////////////////////////////////////////////////// -void sfSprite_SetTextureRect(sfSprite* sprite, sfIntRect rectangle) +void sfSprite_setTextureRect(sfSprite* sprite, sfIntRect rectangle) { - CSFML_CALL(sprite, SetTextureRect(sf::IntRect(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height))); + CSFML_CALL(sprite, setTextureRect(sf::IntRect(rectangle.left, rectangle.top, rectangle.width, rectangle.height))); } //////////////////////////////////////////////////////////// -void sfSprite_SetColor(sfSprite* sprite, sfColor color) +void sfSprite_setColor(sfSprite* sprite, sfColor color) { - CSFML_CALL(sprite, SetColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(sprite, setColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -const sfTexture* sfSprite_GetTexture(const sfSprite* sprite) +const sfTexture* sfSprite_getTexture(const sfSprite* sprite) { CSFML_CHECK_RETURN(sprite, NULL); @@ -211,28 +211,28 @@ const sfTexture* sfSprite_GetTexture(const sfSprite* sprite) //////////////////////////////////////////////////////////// -sfIntRect sfSprite_GetTextureRect(const sfSprite* sprite) +sfIntRect sfSprite_getTextureRect(const sfSprite* sprite) { sfIntRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(sprite, rect); - sf::IntRect sfmlRect = sprite->This.GetTextureRect(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::IntRect sfmlRect = sprite->This.getTextureRect(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfColor sfSprite_GetColor(const sfSprite* sprite) +sfColor sfSprite_getColor(const sfSprite* sprite) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(sprite, color); - sf::Color sfmlColor = sprite->This.GetColor(); + sf::Color sfmlColor = sprite->This.getColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -243,32 +243,32 @@ sfColor sfSprite_GetColor(const sfSprite* sprite) //////////////////////////////////////////////////////////// -sfFloatRect sfSprite_GetLocalBounds(const sfSprite* sprite) +sfFloatRect sfSprite_getLocalBounds(const sfSprite* sprite) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(sprite, rect); - sf::FloatRect sfmlRect = sprite->This.GetLocalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = sprite->This.getLocalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfFloatRect sfSprite_GetGlobalBounds(const sfSprite* sprite) +sfFloatRect sfSprite_getGlobalBounds(const sfSprite* sprite) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(sprite, rect); - sf::FloatRect sfmlRect = sprite->This.GetGlobalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = sprite->This.getGlobalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } diff --git a/src/SFML/Graphics/Text.cpp b/src/SFML/Graphics/Text.cpp index a6a4345..5943cf0 100644 --- a/src/SFML/Graphics/Text.cpp +++ b/src/SFML/Graphics/Text.cpp @@ -33,17 +33,17 @@ //////////////////////////////////////////////////////////// -sfText* sfText_Create(void) +sfText* sfText_create(void) { sfText* text = new sfText; - text->Font = sfFont_GetDefaultFont(); + text->Font = sfFont_getDefaultFont(); return text; } //////////////////////////////////////////////////////////// -sfText* sfText_Copy(sfText* text) +sfText* sfText_copy(sfText* text) { CSFML_CHECK_RETURN(text, NULL); @@ -52,47 +52,47 @@ sfText* sfText_Copy(sfText* text) //////////////////////////////////////////////////////////// -void sfText_Destroy(sfText* text) +void sfText_destroy(sfText* text) { delete text; } //////////////////////////////////////////////////////////// -void sfText_SetPosition(sfText* text, sfVector2f position) +void sfText_setPosition(sfText* text, sfVector2f position) { - CSFML_CALL(text, SetPosition(position.x, position.y)); + CSFML_CALL(text, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfText_SetRotation(sfText* text, float angle) +void sfText_setRotation(sfText* text, float angle) { - CSFML_CALL(text, SetRotation(angle)); + CSFML_CALL(text, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfText_SetScale(sfText* text, sfVector2f scale) +void sfText_setScale(sfText* text, sfVector2f scale) { - CSFML_CALL(text, SetScale(scale.x, scale.y)); + CSFML_CALL(text, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfText_SetOrigin(sfText* text, sfVector2f origin) +void sfText_setOrigin(sfText* text, sfVector2f origin) { - CSFML_CALL(text, SetOrigin(origin.x, origin.y)); + CSFML_CALL(text, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfText_GetPosition(const sfText* text) +sfVector2f sfText_getPosition(const sfText* text) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(text, position); - sf::Vector2f sfmlPos = text->This.GetPosition(); + sf::Vector2f sfmlPos = text->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -101,19 +101,19 @@ sfVector2f sfText_GetPosition(const sfText* text) //////////////////////////////////////////////////////////// -float sfText_GetRotation(const sfText* text) +float sfText_getRotation(const sfText* text) { - CSFML_CALL_RETURN(text, GetRotation(), 0.f); + CSFML_CALL_RETURN(text, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfText_GetScale(const sfText* text) +sfVector2f sfText_getScale(const sfText* text) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(text, scale); - sf::Vector2f sfmlScale = text->This.GetScale(); + sf::Vector2f sfmlScale = text->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -122,12 +122,12 @@ sfVector2f sfText_GetScale(const sfText* text) //////////////////////////////////////////////////////////// -sfVector2f sfText_GetOrigin(const sfText* text) +sfVector2f sfText_getOrigin(const sfText* text) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(text, origin); - sf::Vector2f sfmlOrigin = text->This.GetOrigin(); + sf::Vector2f sfmlOrigin = text->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -136,114 +136,114 @@ sfVector2f sfText_GetOrigin(const sfText* text) //////////////////////////////////////////////////////////// -void sfText_Move(sfText* text, sfVector2f offset) +void sfText_move(sfText* text, sfVector2f offset) { - CSFML_CALL(text, Move(offset.x, offset.y)); + CSFML_CALL(text, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfText_Rotate(sfText* text, float angle) +void sfText_rotate(sfText* text, float angle) { - CSFML_CALL(text, Rotate(angle)); + CSFML_CALL(text, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfText_Scale(sfText* text, sfVector2f factors) +void sfText_scale(sfText* text, sfVector2f factors) { - CSFML_CALL(text, Scale(factors.x, factors.y)); + CSFML_CALL(text, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfText_GetTransform(const sfText* text) +const sfTransform* sfText_getTransform(const sfText* text) { CSFML_CHECK_RETURN(text, NULL); - text->Transform.This = text->This.GetTransform(); + text->Transform.This = text->This.getTransform(); return &text->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfText_GetInverseTransform(const sfText* text) +const sfTransform* sfText_getInverseTransform(const sfText* text) { CSFML_CHECK_RETURN(text, NULL); - text->InverseTransform.This = text->This.GetInverseTransform(); + text->InverseTransform.This = text->This.getInverseTransform(); return &text->InverseTransform; } //////////////////////////////////////////////////////////// -void sfText_SetString(sfText* text, const char* string) +void sfText_setString(sfText* text, const char* string) { - CSFML_CALL(text, SetString(string)); + CSFML_CALL(text, setString(string)); } //////////////////////////////////////////////////////////// -void sfText_SetUnicodeString(sfText* text, const sfUint32* string) +void sfText_setUnicodeString(sfText* text, const sfUint32* string) { sf::String UTF32Text = string; - CSFML_CALL(text, SetString(UTF32Text)); + CSFML_CALL(text, setString(UTF32Text)); } //////////////////////////////////////////////////////////// -void sfText_SetFont(sfText* text, const sfFont* font) +void sfText_setFont(sfText* text, const sfFont* font) { CSFML_CHECK(font); - CSFML_CALL(text, SetFont(font->This)); + CSFML_CALL(text, setFont(font->This)); text->Font = font; } //////////////////////////////////////////////////////////// -void sfText_SetCharacterSize(sfText* text, unsigned int size) +void sfText_setCharacterSize(sfText* text, unsigned int size) { - CSFML_CALL(text, SetCharacterSize(size)); + CSFML_CALL(text, setCharacterSize(size)); } //////////////////////////////////////////////////////////// -void sfText_SetStyle(sfText* text, sfUint32 style) +void sfText_setStyle(sfText* text, sfUint32 style) { - CSFML_CALL(text, SetStyle(style)); + CSFML_CALL(text, setStyle(style)); } //////////////////////////////////////////////////////////// -void sfText_SetColor(sfText* text, sfColor color) +void sfText_setColor(sfText* text, sfColor color) { - CSFML_CALL(text, SetColor(sf::Color(color.r, color.g, color.b, color.a))); + CSFML_CALL(text, setColor(sf::Color(color.r, color.g, color.b, color.a))); } //////////////////////////////////////////////////////////// -const char* sfText_GetString(const sfText* text) +const char* sfText_getString(const sfText* text) { CSFML_CHECK_RETURN(text, NULL); - text->String = text->This.GetString().ToAnsiString(); + text->String = text->This.getString().toAnsiString(); return text->String.c_str(); } //////////////////////////////////////////////////////////// -const sfUint32* sfText_GetUnicodeString(const sfText* text) +const sfUint32* sfText_getUnicodeString(const sfText* text) { CSFML_CHECK_RETURN(text, NULL); - return text->This.GetString().GetData(); + return text->This.getString().getData(); } //////////////////////////////////////////////////////////// -const sfFont* sfText_GetFont(const sfText* text) +const sfFont* sfText_getFont(const sfText* text) { CSFML_CHECK_RETURN(text, NULL); @@ -252,26 +252,26 @@ const sfFont* sfText_GetFont(const sfText* text) //////////////////////////////////////////////////////////// -unsigned int sfText_GetCharacterSize(const sfText* text) +unsigned int sfText_getCharacterSize(const sfText* text) { - CSFML_CALL_RETURN(text, GetCharacterSize(), 0); + CSFML_CALL_RETURN(text, getCharacterSize(), 0); } //////////////////////////////////////////////////////////// -sfUint32 sfText_GetStyle(const sfText* text) +sfUint32 sfText_getStyle(const sfText* text) { - CSFML_CALL_RETURN(text, GetStyle(), 0); + CSFML_CALL_RETURN(text, getStyle(), 0); } //////////////////////////////////////////////////////////// -sfColor sfText_GetColor(const sfText* text) +sfColor sfText_getColor(const sfText* text) { sfColor color = {0, 0, 0, 0}; CSFML_CHECK_RETURN(text, color); - sf::Color sfmlColor = text->This.GetColor(); + sf::Color sfmlColor = text->This.getColor(); color.r = sfmlColor.r; color.g = sfmlColor.g; color.b = sfmlColor.b; @@ -282,12 +282,12 @@ sfColor sfText_GetColor(const sfText* text) //////////////////////////////////////////////////////////// -sfVector2f sfText_FindCharacterPos(const sfText* text, size_t index) +sfVector2f sfText_findCharacterPos(const sfText* text, size_t index) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(text, position); - sf::Vector2f sfmlPos = text->This.FindCharacterPos(index); + sf::Vector2f sfmlPos = text->This.findCharacterPos(index); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -296,32 +296,32 @@ sfVector2f sfText_FindCharacterPos(const sfText* text, size_t index) //////////////////////////////////////////////////////////// -sfFloatRect sfText_GetLocalBounds(const sfText* text) +sfFloatRect sfText_getLocalBounds(const sfText* text) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(text, rect); - sf::FloatRect sfmlRect = text->This.GetLocalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = text->This.getLocalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } //////////////////////////////////////////////////////////// -sfFloatRect sfText_GetGlobalBounds(const sfText* text) +sfFloatRect sfText_getGlobalBounds(const sfText* text) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(text, rect); - sf::FloatRect sfmlRect = text->This.GetGlobalBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = text->This.getGlobalBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index a9e5be0..71d6579 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -35,11 +35,11 @@ //////////////////////////////////////////////////////////// -sfTexture* sfTexture_Create(unsigned int width, unsigned int height) +sfTexture* sfTexture_create(unsigned int width, unsigned int height) { sfTexture* texture = new sfTexture; - if (!texture->This->Create(width, height)) + if (!texture->This->create(width, height)) { delete texture; texture = NULL; @@ -50,15 +50,15 @@ sfTexture* sfTexture_Create(unsigned int width, unsigned int height) //////////////////////////////////////////////////////////// -sfTexture* sfTexture_CreateFromFile(const char* filename, const sfIntRect* area) +sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area) { sfTexture* texture = new sfTexture; sf::IntRect rect; if (area) - rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height); + rect = sf::IntRect(area->left, area->top, area->width, area->height); - if (!texture->This->LoadFromFile(filename, rect)) + if (!texture->This->loadFromFile(filename, rect)) { delete texture; texture = NULL; @@ -69,15 +69,15 @@ sfTexture* sfTexture_CreateFromFile(const char* filename, const sfIntRect* area) //////////////////////////////////////////////////////////// -sfTexture* sfTexture_CreateFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area) +sfTexture* sfTexture_createFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area) { sfTexture* texture = new sfTexture; sf::IntRect rect; if (area) - rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height); + rect = sf::IntRect(area->left, area->top, area->width, area->height); - if (!texture->This->LoadFromMemory(data, sizeInBytes, rect)) + if (!texture->This->loadFromMemory(data, sizeInBytes, rect)) { delete texture; texture = NULL; @@ -88,7 +88,7 @@ sfTexture* sfTexture_CreateFromMemory(const void* data, size_t sizeInBytes, cons //////////////////////////////////////////////////////////// -sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* area) +sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area) { CSFML_CHECK_RETURN(stream, NULL); @@ -96,10 +96,10 @@ sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* ar sf::IntRect rect; if (area) - rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height); + rect = sf::IntRect(area->left, area->top, area->width, area->height); CallbackStream sfmlStream(stream); - if (!texture->This->LoadFromStream(sfmlStream, rect)) + if (!texture->This->loadFromStream(sfmlStream, rect)) { delete texture; texture = NULL; @@ -110,7 +110,7 @@ sfTexture* sfTexture_CreateFromStream(sfInputStream* stream, const sfIntRect* ar //////////////////////////////////////////////////////////// -sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area) +sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area) { CSFML_CHECK_RETURN(image, NULL); @@ -118,9 +118,9 @@ sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area sf::IntRect rect; if (area) - rect = sf::IntRect(area->Left, area->Top, area->Width, area->Height); + rect = sf::IntRect(area->left, area->top, area->width, area->height); - if (!texture->This->LoadFromImage(image->This, rect)) + if (!texture->This->loadFromImage(image->This, rect)) { delete texture; texture = NULL; @@ -131,7 +131,7 @@ sfTexture* sfTexture_CreateFromImage(const sfImage* image, const sfIntRect* area //////////////////////////////////////////////////////////// -sfTexture* sfTexture_Copy(sfTexture* texture) +sfTexture* sfTexture_copy(sfTexture* texture) { CSFML_CHECK_RETURN(texture, NULL); @@ -140,116 +140,116 @@ sfTexture* sfTexture_Copy(sfTexture* texture) //////////////////////////////////////////////////////////// -void sfTexture_Destroy(sfTexture* texture) +void sfTexture_destroy(sfTexture* texture) { delete texture; } //////////////////////////////////////////////////////////// -unsigned int sfTexture_GetWidth(const sfTexture* texture) +unsigned int sfTexture_getWidth(const sfTexture* texture) { - CSFML_CALL_PTR_RETURN(texture, GetWidth(), 0); + CSFML_CALL_PTR_RETURN(texture, getWidth(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfTexture_GetHeight(const sfTexture* texture) +unsigned int sfTexture_getHeight(const sfTexture* texture) { - CSFML_CALL_PTR_RETURN(texture, GetHeight(), 0); + CSFML_CALL_PTR_RETURN(texture, getHeight(), 0); } //////////////////////////////////////////////////////////// -sfImage* sfTexture_CopyToImage(const sfTexture* texture) +sfImage* sfTexture_copyToImage(const sfTexture* texture) { CSFML_CHECK_RETURN(texture, NULL); CSFML_CHECK_RETURN(texture->This, NULL); sfImage* image = new sfImage; - image->This = texture->This->CopyToImage(); + image->This = texture->This->copyToImage(); return image; } //////////////////////////////////////////////////////////// -void sfTexture_UpdateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y) +void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y) { - CSFML_CALL_PTR(texture, Update(pixels, width, height, x, y)); + CSFML_CALL_PTR(texture, update(pixels, width, height, x, y)); } //////////////////////////////////////////////////////////// -void sfTexture_UpdateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y) +void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y) { CSFML_CHECK(image); - CSFML_CALL_PTR(texture, Update(image->This, x, y)); + CSFML_CALL_PTR(texture, update(image->This, x, y)); } //////////////////////////////////////////////////////////// -void sfTexture_UpdateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y) +void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y) { CSFML_CHECK(window); - CSFML_CALL_PTR(texture, Update(window->This, x, y)); + CSFML_CALL_PTR(texture, update(window->This, x, y)); } //////////////////////////////////////////////////////////// -void sfTexture_UpdateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y) +void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y) { CSFML_CHECK(renderWindow); - CSFML_CALL_PTR(texture, Update(renderWindow->This, x, y)); + CSFML_CALL_PTR(texture, update(renderWindow->This, x, y)); } //////////////////////////////////////////////////////////// -void sfTexture_Bind(const sfTexture* texture) +void sfTexture_bind(const sfTexture* texture) { - CSFML_CALL_PTR(texture, Bind()); + CSFML_CALL_PTR(texture, bind()); } //////////////////////////////////////////////////////////// -void sfTexture_SetSmooth(sfTexture* texture, sfBool smooth) +void sfTexture_setSmooth(sfTexture* texture, sfBool smooth) { - CSFML_CALL_PTR(texture, SetSmooth(smooth == sfTrue)); + CSFML_CALL_PTR(texture, setSmooth(smooth == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfTexture_IsSmooth(const sfTexture* texture) +sfBool sfTexture_isSmooth(const sfTexture* texture) { CSFML_CHECK_RETURN(texture, sfFalse); CSFML_CHECK_RETURN(texture->This, sfFalse); - return texture->This->IsSmooth(); + return texture->This->isSmooth(); } //////////////////////////////////////////////////////////// -void sfTexture_SetRepeated(sfTexture* texture, sfBool repeated) +void sfTexture_setRepeated(sfTexture* texture, sfBool repeated) { - CSFML_CALL_PTR(texture, SetRepeated(repeated == sfTrue)); + CSFML_CALL_PTR(texture, setRepeated(repeated == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfTexture_IsRepeated(const sfTexture* texture) +sfBool sfTexture_isRepeated(const sfTexture* texture) { CSFML_CHECK_RETURN(texture, sfFalse); CSFML_CHECK_RETURN(texture->This, sfFalse); - return texture->This->IsRepeated(); + return texture->This->isRepeated(); } //////////////////////////////////////////////////////////// -unsigned int sfTexture_GetMaximumSize() +unsigned int sfTexture_getMaximumSize() { - return sf::Texture::GetMaximumSize(); + return sf::Texture::getMaximumSize(); } diff --git a/src/SFML/Graphics/Transform.cpp b/src/SFML/Graphics/Transform.cpp index b04d17f..9648977 100644 --- a/src/SFML/Graphics/Transform.cpp +++ b/src/SFML/Graphics/Transform.cpp @@ -31,14 +31,14 @@ //////////////////////////////////////////////////////////// -sfTransform* sfTransform_Create(void) +sfTransform* sfTransform_create(void) { return new sfTransform; } //////////////////////////////////////////////////////////// -sfTransform* sfTransform_CreateFromMatrix(float a00, float a01, float a02, +sfTransform* sfTransform_createFromMatrix(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22) { @@ -49,7 +49,7 @@ sfTransform* sfTransform_CreateFromMatrix(float a00, float a01, float a02, //////////////////////////////////////////////////////////// -sfTransform* sfTransform_Copy(sfTransform* transform) +sfTransform* sfTransform_copy(sfTransform* transform) { CSFML_CHECK_RETURN(transform, NULL); @@ -58,99 +58,100 @@ sfTransform* sfTransform_Copy(sfTransform* transform) //////////////////////////////////////////////////////////// -void sfTransform_Destroy(sfTransform* transform) +void sfTransform_destroy(sfTransform* transform) { delete transform; } //////////////////////////////////////////////////////////// -const float* sfTransform_GetMatrix(const sfTransform* transform) +const float* sfTransform_getMatrix(const sfTransform* transform) { - CSFML_CALL_RETURN(transform, GetMatrix(), NULL); + CSFML_CALL_RETURN(transform, getMatrix(), NULL); } //////////////////////////////////////////////////////////// -void sfTransform_GetInverse(const sfTransform* transform, sfTransform* result) +void sfTransform_getInverse(const sfTransform* transform, sfTransform* result) { CSFML_CHECK(transform); if (result) - result->This = transform->This.GetInverse(); + result->This = transform->This.getInverse(); } //////////////////////////////////////////////////////////// -void sfTransform_TransformPoint(const sfTransform* transform, float x, float y, float* transformedX, float* transformedY) +sfVector2f sfTransform_transformPoint(const sfTransform* transform, sfVector2f point) { - CSFML_CHECK(transform); + sfVector2f p = {0, 0}; + CSFML_CHECK_RETURN(transform, p); - sf::Vector2f point = transform->This.TransformPoint(x, y); + sf::Vector2f sfmlPoint = transform->This.transformPoint(point.x, point.y); - if (transformedX) - *transformedX = point.x; - if (transformedY) - *transformedY = point.y; + p.x = sfmlPoint.x; + p.y = sfmlPoint.y; + + return p; } //////////////////////////////////////////////////////////// -void sfTransform_TransformRect(const sfTransform* transform, sfFloatRect rectangle, sfFloatRect* transformedRectangle) +sfFloatRect sfTransform_transformRect(const sfTransform* transform, sfFloatRect rectangle) { - CSFML_CHECK(transform); + sfFloatRect rect = {0, 0, 0, 0}; + CSFML_CHECK_RETURN(transform, rect); - sf::FloatRect rect = transform->This.TransformRect(sf::FloatRect(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height)); + sf::FloatRect sfmlRect = transform->This.transformRect(sf::FloatRect(rectangle.left, rectangle.top, rectangle.width, rectangle.height)); - if (transformedRectangle) - { - transformedRectangle->Left = rect.Left; - transformedRectangle->Top = rect.Top; - transformedRectangle->Width = rect.Width; - transformedRectangle->Height = rect.Height; - } + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; + + return rect; } //////////////////////////////////////////////////////////// -void sfTransform_Combine(sfTransform* transform, const sfTransform* other) +void sfTransform_combine(sfTransform* transform, const sfTransform* other) { CSFML_CHECK(other); - CSFML_CALL(transform, Combine(other->This)); + CSFML_CALL(transform, combine(other->This)); } //////////////////////////////////////////////////////////// -void sfTransform_Translate(sfTransform* transform, float x, float y) +void sfTransform_translate(sfTransform* transform, float x, float y) { - CSFML_CALL(transform, Translate(x, y)); + CSFML_CALL(transform, translate(x, y)); } //////////////////////////////////////////////////////////// -void sfTransform_Rotate(sfTransform* transform, float angle) +void sfTransform_rotate(sfTransform* transform, float angle) { - CSFML_CALL(transform, Rotate(angle)); + CSFML_CALL(transform, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfTransform_RotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY) +void sfTransform_rotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY) { - CSFML_CALL(transform, Rotate(angle, centerX, centerY)); + CSFML_CALL(transform, rotate(angle, centerX, centerY)); } //////////////////////////////////////////////////////////// -void sfTransform_Scale(sfTransform* transform, float scaleX, float scaleY) +void sfTransform_scale(sfTransform* transform, float scaleX, float scaleY) { - CSFML_CALL(transform, Scale(scaleX, scaleY)); + CSFML_CALL(transform, scale(scaleX, scaleY)); } //////////////////////////////////////////////////////////// -void sfTransform_ScaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY) +void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY) { - CSFML_CALL(transform, Scale(scaleX, scaleY, centerX, centerY)); + CSFML_CALL(transform, scale(scaleX, scaleY, centerX, centerY)); } diff --git a/src/SFML/Graphics/Transformable.cpp b/src/SFML/Graphics/Transformable.cpp index 6a0b51d..c83c8b2 100644 --- a/src/SFML/Graphics/Transformable.cpp +++ b/src/SFML/Graphics/Transformable.cpp @@ -31,7 +31,7 @@ //////////////////////////////////////////////////////////// -sfTransformable* sfTransformable_Create(void) +sfTransformable* sfTransformable_create(void) { sfTransformable* transformable = new sfTransformable; @@ -40,7 +40,7 @@ sfTransformable* sfTransformable_Create(void) //////////////////////////////////////////////////////////// -sfTransformable* sfTransformable_Copy(sfTransformable* transformable) +sfTransformable* sfTransformable_copy(sfTransformable* transformable) { CSFML_CHECK_RETURN(transformable, NULL); @@ -49,47 +49,47 @@ sfTransformable* sfTransformable_Copy(sfTransformable* transformable) //////////////////////////////////////////////////////////// -void sfTransformable_Destroy(sfTransformable* transformable) +void sfTransformable_destroy(sfTransformable* transformable) { delete transformable; } //////////////////////////////////////////////////////////// -void sfTransformable_SetPosition(sfTransformable* transformable, sfVector2f position) +void sfTransformable_setPosition(sfTransformable* transformable, sfVector2f position) { - CSFML_CALL(transformable, SetPosition(position.x, position.y)); + CSFML_CALL(transformable, setPosition(position.x, position.y)); } //////////////////////////////////////////////////////////// -void sfTransformable_SetRotation(sfTransformable* transformable, float angle) +void sfTransformable_setRotation(sfTransformable* transformable, float angle) { - CSFML_CALL(transformable, SetRotation(angle)); + CSFML_CALL(transformable, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfTransformable_SetScale(sfTransformable* transformable, sfVector2f scale) +void sfTransformable_setScale(sfTransformable* transformable, sfVector2f scale) { - CSFML_CALL(transformable, SetScale(scale.x, scale.y)); + CSFML_CALL(transformable, setScale(scale.x, scale.y)); } //////////////////////////////////////////////////////////// -void sfTransformable_SetOrigin(sfTransformable* transformable, sfVector2f origin) +void sfTransformable_setOrigin(sfTransformable* transformable, sfVector2f origin) { - CSFML_CALL(transformable, SetOrigin(origin.x, origin.y)); + CSFML_CALL(transformable, setOrigin(origin.x, origin.y)); } //////////////////////////////////////////////////////////// -sfVector2f sfTransformable_GetPosition(const sfTransformable* transformable) +sfVector2f sfTransformable_getPosition(const sfTransformable* transformable) { sfVector2f position = {0, 0}; CSFML_CHECK_RETURN(transformable, position); - sf::Vector2f sfmlPos = transformable->This.GetPosition(); + sf::Vector2f sfmlPos = transformable->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -98,19 +98,19 @@ sfVector2f sfTransformable_GetPosition(const sfTransformable* transformable) //////////////////////////////////////////////////////////// -float sfTransformable_GetRotation(const sfTransformable* transformable) +float sfTransformable_getRotation(const sfTransformable* transformable) { - CSFML_CALL_RETURN(transformable, GetRotation(), 0.f); + CSFML_CALL_RETURN(transformable, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfVector2f sfTransformable_GetScale(const sfTransformable* transformable) +sfVector2f sfTransformable_getScale(const sfTransformable* transformable) { sfVector2f scale = {0, 0}; CSFML_CHECK_RETURN(transformable, scale); - sf::Vector2f sfmlScale = transformable->This.GetScale(); + sf::Vector2f sfmlScale = transformable->This.getScale(); scale.x = sfmlScale.x; scale.y = sfmlScale.y; @@ -119,12 +119,12 @@ sfVector2f sfTransformable_GetScale(const sfTransformable* transformable) //////////////////////////////////////////////////////////// -sfVector2f sfTransformable_GetOrigin(const sfTransformable* transformable) +sfVector2f sfTransformable_getOrigin(const sfTransformable* transformable) { sfVector2f origin = {0, 0}; CSFML_CHECK_RETURN(transformable, origin); - sf::Vector2f sfmlOrigin = transformable->This.GetOrigin(); + sf::Vector2f sfmlOrigin = transformable->This.getOrigin(); origin.x = sfmlOrigin.x; origin.y = sfmlOrigin.y; @@ -133,41 +133,41 @@ sfVector2f sfTransformable_GetOrigin(const sfTransformable* transformable) //////////////////////////////////////////////////////////// -void sfTransformable_Move(sfTransformable* transformable, sfVector2f offset) +void sfTransformable_move(sfTransformable* transformable, sfVector2f offset) { - CSFML_CALL(transformable, Move(offset.x, offset.y)); + CSFML_CALL(transformable, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfTransformable_Rotate(sfTransformable* transformable, float angle) +void sfTransformable_rotate(sfTransformable* transformable, float angle) { - CSFML_CALL(transformable, Rotate(angle)); + CSFML_CALL(transformable, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfTransformable_Scale(sfTransformable* transformable, sfVector2f factors) +void sfTransformable_scale(sfTransformable* transformable, sfVector2f factors) { - CSFML_CALL(transformable, Scale(factors.x, factors.y)); + CSFML_CALL(transformable, scale(factors.x, factors.y)); } //////////////////////////////////////////////////////////// -const sfTransform* sfTransformable_GetTransform(const sfTransformable* transformable) +const sfTransform* sfTransformable_getTransform(const sfTransformable* transformable) { CSFML_CHECK_RETURN(transformable, NULL); - transformable->Transform.This = transformable->This.GetTransform(); + transformable->Transform.This = transformable->This.getTransform(); return &transformable->Transform; } //////////////////////////////////////////////////////////// -const sfTransform* sfTransformable_GetInverseTransform(const sfTransformable* transformable) +const sfTransform* sfTransformable_getInverseTransform(const sfTransformable* transformable) { CSFML_CHECK_RETURN(transformable, NULL); - transformable->InverseTransform.This = transformable->This.GetInverseTransform(); + transformable->InverseTransform.This = transformable->This.getInverseTransform(); return &transformable->InverseTransform; } diff --git a/src/SFML/Graphics/VertexArray.cpp b/src/SFML/Graphics/VertexArray.cpp index 9767b40..be92d1d 100644 --- a/src/SFML/Graphics/VertexArray.cpp +++ b/src/SFML/Graphics/VertexArray.cpp @@ -31,14 +31,14 @@ //////////////////////////////////////////////////////////// -sfVertexArray* sfVertexArray_Create(void) +sfVertexArray* sfVertexArray_create(void) { return new sfVertexArray; } //////////////////////////////////////////////////////////// -sfVertexArray* sfVertexArray_Copy(sfVertexArray* vertexArray) +sfVertexArray* sfVertexArray_copy(sfVertexArray* vertexArray) { CSFML_CHECK_RETURN(vertexArray, NULL); @@ -47,21 +47,21 @@ sfVertexArray* sfVertexArray_Copy(sfVertexArray* vertexArray) //////////////////////////////////////////////////////////// -void sfVertexArray_Destroy(sfVertexArray* vertexArray) +void sfVertexArray_destroy(sfVertexArray* vertexArray) { delete vertexArray; } //////////////////////////////////////////////////////////// -unsigned int sfVertexArray_GetVertexCount(const sfVertexArray* vertexArray) +unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray) { - CSFML_CALL_RETURN(vertexArray, GetVertexCount(), 0); + CSFML_CALL_RETURN(vertexArray, getVertexCount(), 0); } //////////////////////////////////////////////////////////// -sfVertex* sfVertexArray_GetVertex(sfVertexArray* vertexArray, unsigned int index) +sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index) { CSFML_CHECK_RETURN(vertexArray, NULL); @@ -71,53 +71,53 @@ sfVertex* sfVertexArray_GetVertex(sfVertexArray* vertexArray, unsigned int index //////////////////////////////////////////////////////////// -void sfVertexArray_Clear(sfVertexArray* vertexArray) +void sfVertexArray_clear(sfVertexArray* vertexArray) { - CSFML_CALL(vertexArray, Clear()); + CSFML_CALL(vertexArray, clear()); } //////////////////////////////////////////////////////////// -void sfVertexArray_Resize(sfVertexArray* vertexArray, unsigned int vertexCount) +void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount) { - CSFML_CALL(vertexArray, Resize(vertexCount)); + CSFML_CALL(vertexArray, resize(vertexCount)); } //////////////////////////////////////////////////////////// -void sfVertexArray_Append(sfVertexArray* vertexArray, sfVertex vertex) +void sfVertexArray_append(sfVertexArray* vertexArray, sfVertex vertex) { // the cast is safe, sfVertex has to be binary compatible with sf::Vertex - CSFML_CALL(vertexArray, Append(reinterpret_cast(vertex))); + CSFML_CALL(vertexArray, append(reinterpret_cast(vertex))); } //////////////////////////////////////////////////////////// -void sfVertexArray_SetPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type) +void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type) { - CSFML_CALL(vertexArray, SetPrimitiveType(static_cast(type))); + CSFML_CALL(vertexArray, setPrimitiveType(static_cast(type))); } //////////////////////////////////////////////////////////// -sfPrimitiveType sfVertexArray_GetPrimitiveType(sfVertexArray* vertexArray) +sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray) { CSFML_CHECK_RETURN(vertexArray, sfPoints); - return static_cast(vertexArray->This.GetPrimitiveType()); + return static_cast(vertexArray->This.getPrimitiveType()); } //////////////////////////////////////////////////////////// -sfFloatRect sfVertexArray_GetBounds(sfVertexArray* vertexArray) +sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(vertexArray, rect); - sf::FloatRect sfmlRect = vertexArray->This.GetBounds(); - rect.Left = sfmlRect.Left; - rect.Top = sfmlRect.Top; - rect.Width = sfmlRect.Width; - rect.Height = sfmlRect.Height; + sf::FloatRect sfmlRect = vertexArray->This.getBounds(); + rect.left = sfmlRect.left; + rect.top = sfmlRect.top; + rect.width = sfmlRect.width; + rect.height = sfmlRect.height; return rect; } diff --git a/src/SFML/Graphics/View.cpp b/src/SFML/Graphics/View.cpp index 65af0ff..649e922 100644 --- a/src/SFML/Graphics/View.cpp +++ b/src/SFML/Graphics/View.cpp @@ -31,24 +31,24 @@ //////////////////////////////////////////////////////////// -sfView* sfView_Create(void) +sfView* sfView_create(void) { return new sfView; } //////////////////////////////////////////////////////////// -sfView* sfView_CreateFromRect(sfFloatRect rectangle) +sfView* sfView_createFromRect(sfFloatRect rectangle) { sfView* view = new sfView; - sfView_Reset(view, rectangle); + sfView_reset(view, rectangle); return view; } //////////////////////////////////////////////////////////// -sfView* sfView_Copy(sfView* view) +sfView* sfView_copy(sfView* view) { CSFML_CHECK_RETURN(view, NULL); @@ -57,54 +57,54 @@ sfView* sfView_Copy(sfView* view) //////////////////////////////////////////////////////////// -void sfView_Destroy(sfView* view) +void sfView_destroy(sfView* view) { delete view; } //////////////////////////////////////////////////////////// -void sfView_SetCenter(sfView* view, sfVector2f center) +void sfView_setCenter(sfView* view, sfVector2f center) { - CSFML_CALL(view, SetCenter(center.x, center.y)); + CSFML_CALL(view, setCenter(center.x, center.y)); } //////////////////////////////////////////////////////////// -void sfView_SetSize(sfView* view, sfVector2f size) +void sfView_setSize(sfView* view, sfVector2f size) { - CSFML_CALL(view, SetSize(size.x, size.y)); + CSFML_CALL(view, setSize(size.x, size.y)); } //////////////////////////////////////////////////////////// -void sfView_SetRotation(sfView* view, float angle) +void sfView_setRotation(sfView* view, float angle) { - CSFML_CALL(view, SetRotation(angle)); + CSFML_CALL(view, setRotation(angle)); } //////////////////////////////////////////////////////////// -void sfView_SetViewport(sfView* view, sfFloatRect viewport) +void sfView_setViewport(sfView* view, sfFloatRect viewport) { - CSFML_CALL(view, SetViewport(sf::FloatRect(viewport.Left, viewport.Top, viewport.Width, viewport.Height))); + CSFML_CALL(view, setViewport(sf::FloatRect(viewport.left, viewport.top, viewport.width, viewport.height))); } //////////////////////////////////////////////////////////// -void sfView_Reset(sfView* view, sfFloatRect rectangle) +void sfView_reset(sfView* view, sfFloatRect rectangle) { - CSFML_CALL(view, Reset(sf::FloatRect(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height))); + CSFML_CALL(view, reset(sf::FloatRect(rectangle.left, rectangle.top, rectangle.width, rectangle.height))); } //////////////////////////////////////////////////////////// -sfVector2f sfView_GetCenter(const sfView* view) +sfVector2f sfView_getCenter(const sfView* view) { sfVector2f center = {0, 0}; CSFML_CHECK_RETURN(view, center); - sf::Vector2f sfmlCenter = view->This.GetCenter(); + sf::Vector2f sfmlCenter = view->This.getCenter(); center.x = sfmlCenter.x; center.y = sfmlCenter.y; @@ -113,12 +113,12 @@ sfVector2f sfView_GetCenter(const sfView* view) //////////////////////////////////////////////////////////// -sfVector2f sfView_GetSize(const sfView* view) +sfVector2f sfView_getSize(const sfView* view) { sfVector2f size = {0, 0}; CSFML_CHECK_RETURN(view, size); - sf::Vector2f sfmlSize = view->This.GetSize(); + sf::Vector2f sfmlSize = view->This.getSize(); size.x = sfmlSize.x; size.y = sfmlSize.y; @@ -127,44 +127,44 @@ sfVector2f sfView_GetSize(const sfView* view) //////////////////////////////////////////////////////////// -float sfView_GetRotation(const sfView* view) +float sfView_getRotation(const sfView* view) { - CSFML_CALL_RETURN(view, GetRotation(), 0.f); + CSFML_CALL_RETURN(view, getRotation(), 0.f); } //////////////////////////////////////////////////////////// -sfFloatRect sfView_GetViewport(const sfView* view) +sfFloatRect sfView_getViewport(const sfView* view) { sfFloatRect rect = {0, 0, 0, 0}; CSFML_CHECK_RETURN(view, rect); - sf::FloatRect SFMLRect = view->This.GetViewport(); - rect.Left = SFMLRect.Left; - rect.Top = SFMLRect.Top; - rect.Width = SFMLRect.Width; - rect.Height = SFMLRect.Height; + sf::FloatRect SFMLRect = view->This.getViewport(); + rect.left = SFMLRect.left; + rect.top = SFMLRect.top; + rect.width = SFMLRect.width; + rect.height = SFMLRect.height; return rect; } //////////////////////////////////////////////////////////// -void sfView_Move(sfView* view, sfVector2f offset) +void sfView_move(sfView* view, sfVector2f offset) { - CSFML_CALL(view, Move(offset.x, offset.y)); + CSFML_CALL(view, move(offset.x, offset.y)); } //////////////////////////////////////////////////////////// -void sfView_Rotate(sfView* view, float angle) +void sfView_rotate(sfView* view, float angle) { - CSFML_CALL(view, Rotate(angle)); + CSFML_CALL(view, rotate(angle)); } //////////////////////////////////////////////////////////// -void sfView_Zoom(sfView* view, float factor) +void sfView_zoom(sfView* view, float factor) { - CSFML_CALL(view, Zoom(factor)); + CSFML_CALL(view, zoom(factor)); } diff --git a/src/SFML/Network/Ftp.cpp b/src/SFML/Network/Ftp.cpp index 71580b6..87a4bd7 100644 --- a/src/SFML/Network/Ftp.cpp +++ b/src/SFML/Network/Ftp.cpp @@ -32,278 +32,278 @@ //////////////////////////////////////////////////////////// -void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResponse) +void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse) { delete ftpListingResponse; } //////////////////////////////////////////////////////////// -sfBool sfFtpListingResponse_IsOk(const sfFtpListingResponse* ftpListingResponse) +sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse) { - CSFML_CALL_RETURN(ftpListingResponse, IsOk(), sfFalse); + CSFML_CALL_RETURN(ftpListingResponse, isOk(), sfFalse); } //////////////////////////////////////////////////////////// -sfFtpStatus sfFtpListingResponse_GetStatus(const sfFtpListingResponse* ftpListingResponse) +sfFtpStatus sfFtpListingResponse_getStatus(const sfFtpListingResponse* ftpListingResponse) { CSFML_CHECK_RETURN(ftpListingResponse, sfFtpInvalidResponse); - return static_cast(ftpListingResponse->This.GetStatus()); + return static_cast(ftpListingResponse->This.getStatus()); } //////////////////////////////////////////////////////////// -const char* sfFtpListingResponse_GetMessage(const sfFtpListingResponse* ftpListingResponse) +const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse) { CSFML_CHECK_RETURN(ftpListingResponse, NULL); - return ftpListingResponse->This.GetMessage().c_str(); + return ftpListingResponse->This.getMessage().c_str(); } //////////////////////////////////////////////////////////// -size_t sfFtpListingResponse_GetCount(const sfFtpListingResponse* ftpListingResponse) +size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse) { CSFML_CHECK_RETURN(ftpListingResponse, 0); - return ftpListingResponse->This.GetFilenames().size(); + return ftpListingResponse->This.getFilenames().size(); } //////////////////////////////////////////////////////////// -const char* sfFtpListingResponse_GetFilename(const sfFtpListingResponse* ftpListingResponse, size_t index) +const char* sfFtpListingResponse_getFilename(const sfFtpListingResponse* ftpListingResponse, size_t index) { CSFML_CHECK_RETURN(ftpListingResponse, NULL); - return ftpListingResponse->This.GetFilenames()[index].c_str(); + return ftpListingResponse->This.getFilenames()[index].c_str(); } //////////////////////////////////////////////////////////// -void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirectoryResponse) +void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse) { delete ftpDirectoryResponse; } //////////////////////////////////////////////////////////// -sfBool sfFtpDirectoryResponse_IsOk(const sfFtpDirectoryResponse* ftpDirectoryResponse) +sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse) { - CSFML_CALL_RETURN(ftpDirectoryResponse, IsOk(), sfFalse); + CSFML_CALL_RETURN(ftpDirectoryResponse, isOk(), sfFalse); } //////////////////////////////////////////////////////////// -sfFtpStatus sfFtpDirectoryResponse_GetStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse) +sfFtpStatus sfFtpDirectoryResponse_getStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse) { CSFML_CHECK_RETURN(ftpDirectoryResponse, sfFtpInvalidResponse); - return static_cast(ftpDirectoryResponse->This.GetStatus()); + return static_cast(ftpDirectoryResponse->This.getStatus()); } //////////////////////////////////////////////////////////// -const char* sfFtpDirectoryResponse_GetMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse) +const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse) { CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL); - return ftpDirectoryResponse->This.GetMessage().c_str(); + return ftpDirectoryResponse->This.getMessage().c_str(); } //////////////////////////////////////////////////////////// -const char* sfFtpDirectoryResponse_GetDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse) +const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse) { CSFML_CHECK_RETURN(ftpDirectoryResponse, NULL); - return ftpDirectoryResponse->This.GetDirectory().c_str(); + return ftpDirectoryResponse->This.getDirectory().c_str(); } //////////////////////////////////////////////////////////// -void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse) +void sfFtpResponse_destroy(sfFtpResponse* ftpResponse) { delete ftpResponse; } //////////////////////////////////////////////////////////// -sfBool sfFtpResponse_IsOk(const sfFtpResponse* ftpResponse) +sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse) { - CSFML_CALL_RETURN(ftpResponse, IsOk(), sfFalse); + CSFML_CALL_RETURN(ftpResponse, isOk(), sfFalse); } //////////////////////////////////////////////////////////// -sfFtpStatus sfFtpResponse_GetStatus(const sfFtpResponse* ftpResponse) +sfFtpStatus sfFtpResponse_getStatus(const sfFtpResponse* ftpResponse) { CSFML_CHECK_RETURN(ftpResponse, sfFtpInvalidResponse); - return static_cast(ftpResponse->This.GetStatus()); + return static_cast(ftpResponse->This.getStatus()); } //////////////////////////////////////////////////////////// -const char* sfFtpResponse_GetMessage(const sfFtpResponse* ftpResponse) +const char* sfFtpResponse_getMessage(const sfFtpResponse* ftpResponse) { CSFML_CHECK_RETURN(ftpResponse, NULL); - return ftpResponse->This.GetMessage().c_str(); + return ftpResponse->This.getMessage().c_str(); } //////////////////////////////////////////////////////////// -sfFtp* sfFtp_Create(void) +sfFtp* sfFtp_create(void) { return new sfFtp; } //////////////////////////////////////////////////////////// -void sfFtp_Destroy(sfFtp* ftp) +void sfFtp_destroy(sfFtp* ftp) { delete ftp; } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout) +sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout) { CSFML_CHECK_RETURN(ftp, NULL); - sf::IpAddress SFMLServer(server.Address); + sf::IpAddress SFMLServer(server.address); - return new sfFtpResponse(ftp->This.Connect(SFMLServer, port, sf::Microseconds(timeout.Microseconds))); + return new sfFtpResponse(ftp->This.connect(SFMLServer, port, sf::microseconds(timeout.microseconds))); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp) +sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.Login()); + return new sfFtpResponse(ftp->This.login()); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, const char* password) +sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.Login(userName ? userName : "", password ? password : "")); + return new sfFtpResponse(ftp->This.login(userName ? userName : "", password ? password : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp) +sfFtpResponse* sfFtp_disconnect(sfFtp* ftp) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.Disconnect()); + return new sfFtpResponse(ftp->This.disconnect()); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp) +sfFtpResponse* sfFtp_keepAlive(sfFtp* ftp) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.KeepAlive()); + return new sfFtpResponse(ftp->This.keepAlive()); } //////////////////////////////////////////////////////////// -sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp) +sfFtpDirectoryResponse* sfFtp_getWorkingDirectory(sfFtp* ftp) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpDirectoryResponse(ftp->This.GetWorkingDirectory()); + return new sfFtpDirectoryResponse(ftp->This.getWorkingDirectory()); } //////////////////////////////////////////////////////////// -sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, const char* directory) +sfFtpListingResponse* sfFtp_getDirectoryListing(sfFtp* ftp, const char* directory) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpListingResponse(ftp->This.GetDirectoryListing(directory ? directory : "")); + return new sfFtpListingResponse(ftp->This.getDirectoryListing(directory ? directory : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* directory) +sfFtpResponse* sfFtp_changeDirectory(sfFtp* ftp, const char* directory) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.ChangeDirectory(directory ? directory : "")); + return new sfFtpResponse(ftp->This.changeDirectory(directory ? directory : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp) +sfFtpResponse* sfFtp_parentDirectory(sfFtp* ftp) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.ParentDirectory()); + return new sfFtpResponse(ftp->This.parentDirectory()); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_CreateDirectory(sfFtp* ftp, const char* name) +sfFtpResponse* sfFtp_createDirectory(sfFtp* ftp, const char* name) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.CreateDirectory(name ? name : "")); + return new sfFtpResponse(ftp->This.createDirectory(name ? name : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* name) +sfFtpResponse* sfFtp_deleteDirectory(sfFtp* ftp, const char* name) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.DeleteDirectory(name ? name : "")); + return new sfFtpResponse(ftp->This.deleteDirectory(name ? name : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file, const char* newName) +sfFtpResponse* sfFtp_renameFile(sfFtp* ftp, const char* file, const char* newName) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.RenameFile(file ? file : "", newName ? newName : "")); + return new sfFtpResponse(ftp->This.renameFile(file ? file : "", newName ? newName : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name) +sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.DeleteFile(name ? name : "")); + return new sfFtpResponse(ftp->This.deleteFile(name ? name : "")); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode) +sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.Download(distantFile ? distantFile : "", + return new sfFtpResponse(ftp->This.download(distantFile ? distantFile : "", destPath ? destPath : "", static_cast(mode))); } //////////////////////////////////////////////////////////// -sfFtpResponse* sfFtp_Upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode) +sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode) { CSFML_CHECK_RETURN(ftp, NULL); - return new sfFtpResponse(ftp->This.Upload(localFile ? localFile : "", + return new sfFtpResponse(ftp->This.upload(localFile ? localFile : "", destPath ? destPath : "", static_cast(mode))); } diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index 1d5046b..634f8e7 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -31,135 +31,135 @@ //////////////////////////////////////////////////////////// -sfHttpRequest* sfHttpRequest_Create(void) +sfHttpRequest* sfHttpRequest_create(void) { return new sfHttpRequest; } //////////////////////////////////////////////////////////// -void sfHttpRequest_Destroy(sfHttpRequest* httpRequest) +void sfHttpRequest_destroy(sfHttpRequest* httpRequest) { delete httpRequest; } //////////////////////////////////////////////////////////// -void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const char* field, const char* value) +void sfHttpRequest_setField(sfHttpRequest* httpRequest, const char* field, const char* value) { CSFML_CHECK(httpRequest); if (field) - httpRequest->This.SetField(field, value); + httpRequest->This.setField(field, value); } //////////////////////////////////////////////////////////// -void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHttpMethod method) +void sfHttpRequest_setMethod(sfHttpRequest* httpRequest, sfHttpMethod method) { - CSFML_CALL(httpRequest, SetMethod(static_cast(method))); + CSFML_CALL(httpRequest, setMethod(static_cast(method))); } //////////////////////////////////////////////////////////// -void sfHttpRequest_SetUri(sfHttpRequest* httpRequest, const char* uri) +void sfHttpRequest_setUri(sfHttpRequest* httpRequest, const char* uri) { - CSFML_CALL(httpRequest, SetUri(uri ? uri : "")); + CSFML_CALL(httpRequest, setUri(uri ? uri : "")); } //////////////////////////////////////////////////////////// -void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor) +void sfHttpRequest_setHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor) { - CSFML_CALL(httpRequest, SetHttpVersion(major, minor)); + CSFML_CALL(httpRequest, setHttpVersion(major, minor)); } //////////////////////////////////////////////////////////// -void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const char* body) +void sfHttpRequest_setBody(sfHttpRequest* httpRequest, const char* body) { - CSFML_CALL(httpRequest, SetBody(body ? body : "")); + CSFML_CALL(httpRequest, setBody(body ? body : "")); } //////////////////////////////////////////////////////////// -void sfHttpResponse_Destroy(sfHttpResponse* httpResponse) +void sfHttpResponse_destroy(sfHttpResponse* httpResponse) { delete httpResponse; } //////////////////////////////////////////////////////////// -const char* sfHttpResponse_GetField(const sfHttpResponse* httpResponse, const char* field) +const char* sfHttpResponse_getField(const sfHttpResponse* httpResponse, const char* field) { CSFML_CHECK_RETURN(httpResponse, NULL); if (!field) return NULL; - return httpResponse->This.GetField(field).c_str(); + return httpResponse->This.getField(field).c_str(); } //////////////////////////////////////////////////////////// -sfHttpStatus sfHttpResponse_GetStatus(const sfHttpResponse* httpResponse) +sfHttpStatus sfHttpResponse_getStatus(const sfHttpResponse* httpResponse) { CSFML_CHECK_RETURN(httpResponse, sfHttpInvalidResponse); - return static_cast(httpResponse->This.GetStatus()); + return static_cast(httpResponse->This.getStatus()); } //////////////////////////////////////////////////////////// -unsigned int sfHttpResponse_GetMajorVersion(const sfHttpResponse* httpResponse) +unsigned int sfHttpResponse_getMajorVersion(const sfHttpResponse* httpResponse) { - CSFML_CALL_RETURN(httpResponse, GetMajorHttpVersion(), 0); + CSFML_CALL_RETURN(httpResponse, getMajorHttpVersion(), 0); } //////////////////////////////////////////////////////////// -unsigned int sfHttpResponse_GetMinorVersion(const sfHttpResponse* httpResponse) +unsigned int sfHttpResponse_getMinorVersion(const sfHttpResponse* httpResponse) { - CSFML_CALL_RETURN(httpResponse, GetMinorHttpVersion(), 0); + CSFML_CALL_RETURN(httpResponse, getMinorHttpVersion(), 0); } //////////////////////////////////////////////////////////// -const char* sfHttpResponse_GetBody(const sfHttpResponse* httpResponse) +const char* sfHttpResponse_getBody(const sfHttpResponse* httpResponse) { CSFML_CHECK_RETURN(httpResponse, NULL); - return httpResponse->This.GetBody().c_str(); + return httpResponse->This.getBody().c_str(); } //////////////////////////////////////////////////////////// -sfHttp* sfHttp_Create(void) +sfHttp* sfHttp_create(void) { return new sfHttp; } //////////////////////////////////////////////////////////// -void sfHttp_Destroy(sfHttp* http) +void sfHttp_destroy(sfHttp* http) { delete http; } //////////////////////////////////////////////////////////// -void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port) +void sfHttp_setHost(sfHttp* http, const char* host, unsigned short port) { - CSFML_CALL(http, SetHost(host ? host : "", port)); + CSFML_CALL(http, setHost(host ? host : "", port)); } //////////////////////////////////////////////////////////// -sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout) +sfHttpResponse* sfHttp_sendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout) { CSFML_CHECK_RETURN(http, NULL); CSFML_CHECK_RETURN(request, NULL); sfHttpResponse* response = new sfHttpResponse; - response->This = http->This.SendRequest(request->This, sf::Microseconds(timeout.Microseconds)); + response->This = http->This.sendRequest(request->This, sf::microseconds(timeout.microseconds)); return response; } diff --git a/src/SFML/Network/IpAddress.cpp b/src/SFML/Network/IpAddress.cpp index 1d55b23..0bac64e 100644 --- a/src/SFML/Network/IpAddress.cpp +++ b/src/SFML/Network/IpAddress.cpp @@ -33,88 +33,79 @@ namespace { // Helper function for converting a SFML address to a CSFML one - sfIpAddress FromSFMLAddress(sf::IpAddress address) + sfIpAddress fromSFMLAddress(sf::IpAddress address) { sfIpAddress result; - strncpy(result.Address, address.ToString().c_str(), 16); + strncpy(result.address, address.toString().c_str(), 16); return result; } // Helper function for converting a CSFML address to a SFML one - sf::IpAddress ToSFMLAddress(sfIpAddress address) + sf::IpAddress toSFMLAddress(sfIpAddress address) { - return sf::IpAddress(address.Address); + return sf::IpAddress(address.address); } } //////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_FromString(const char* address) +sfIpAddress sfIpAddress_None = sfIpAddress_fromBytes(0, 0, 0, 0); + + +//////////////////////////////////////////////////////////// +sfIpAddress sfIpAddress_LocalHost = sfIpAddress_fromBytes(127, 0, 0, 1); + + +//////////////////////////////////////////////////////////// +sfIpAddress sfIpAddress_Broadcast = sfIpAddress_fromBytes(255, 255, 255, 255); + + +//////////////////////////////////////////////////////////// +sfIpAddress sfIpAddress_fromString(const char* address) { - return FromSFMLAddress(sf::IpAddress(address)); + return fromSFMLAddress(sf::IpAddress(address)); } //////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3) +sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3) { - return FromSFMLAddress(sf::IpAddress(byte0, byte1, byte2, byte3)); + return fromSFMLAddress(sf::IpAddress(byte0, byte1, byte2, byte3)); } //////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_FromInteger(sfUint32 address) +sfIpAddress sfIpAddress_fromInteger(sfUint32 address) { - return FromSFMLAddress(sf::IpAddress(address)); + return fromSFMLAddress(sf::IpAddress(address)); } //////////////////////////////////////////////////////////// -void sfIpAddress_ToString(sfIpAddress address, char* string) +void sfIpAddress_toString(sfIpAddress address, char* string) { if (string) - strcpy(string, address.Address); + strcpy(string, address.address); } //////////////////////////////////////////////////////////// -sfUint32 sfIpAddress_ToInteger(sfIpAddress address) +sfUint32 sfIpAddress_toInteger(sfIpAddress address) { - return ToSFMLAddress(address).ToInteger(); + return toSFMLAddress(address).toInteger(); } //////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_GetLocalAddress(void) +sfIpAddress sfIpAddress_getLocalAddress(void) { - return FromSFMLAddress(sf::IpAddress::GetLocalAddress()); + return fromSFMLAddress(sf::IpAddress::getLocalAddress()); } //////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_GetPublicAddress(sfTime timeout) +sfIpAddress sfIpAddress_getPublicAddress(sfTime timeout) { - return FromSFMLAddress(sf::IpAddress::GetPublicAddress(sf::Microseconds(timeout.Microseconds))); -} - - -//////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_None(void) -{ - return FromSFMLAddress(sf::IpAddress::None); -} - - -//////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_LocalHost(void) -{ - return FromSFMLAddress(sf::IpAddress::LocalHost); -} - - -//////////////////////////////////////////////////////////// -sfIpAddress sfIpAddress_Broadcast(void) -{ - return FromSFMLAddress(sf::IpAddress::Broadcast); + return fromSFMLAddress(sf::IpAddress::getPublicAddress(sf::microseconds(timeout.microseconds))); } diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index a56ccd6..925f006 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -31,14 +31,14 @@ //////////////////////////////////////////////////////////// -sfPacket* sfPacket_Create(void) +sfPacket* sfPacket_create(void) { return new sfPacket; } //////////////////////////////////////////////////////////// -sfPacket* sfPacket_Copy(sfPacket* packet) +sfPacket* sfPacket_copy(sfPacket* packet) { CSFML_CHECK_RETURN(packet, NULL); @@ -47,49 +47,49 @@ sfPacket* sfPacket_Copy(sfPacket* packet) //////////////////////////////////////////////////////////// -void sfPacket_Destroy(sfPacket* packet) +void sfPacket_destroy(sfPacket* packet) { delete packet; } //////////////////////////////////////////////////////////// -void sfPacket_Append(sfPacket* packet, const void* data, size_t sizeInBytes) +void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes) { - CSFML_CALL(packet, Append(data, sizeInBytes)); + CSFML_CALL(packet, append(data, sizeInBytes)); } //////////////////////////////////////////////////////////// -void sfPacket_Clear(sfPacket* packet) +void sfPacket_clear(sfPacket* packet) { - CSFML_CALL(packet, Clear()); + CSFML_CALL(packet, clear()); } //////////////////////////////////////////////////////////// -const char* sfPacket_GetData(const sfPacket* packet) +const char* sfPacket_getData(const sfPacket* packet) { - CSFML_CALL_RETURN(packet, GetData(), NULL); + CSFML_CALL_RETURN(packet, getData(), NULL); } //////////////////////////////////////////////////////////// -size_t sfPacket_GetDataSize(const sfPacket* packet) +size_t sfPacket_getDataSize(const sfPacket* packet) { - CSFML_CALL_RETURN(packet, GetDataSize(), 0); + CSFML_CALL_RETURN(packet, getDataSize(), 0); } //////////////////////////////////////////////////////////// -sfBool sfPacket_EndOfPacket(const sfPacket* packet) +sfBool sfPacket_endOfPacket(const sfPacket* packet) { - CSFML_CALL_RETURN(packet, EndOfPacket(), sfFalse); + CSFML_CALL_RETURN(packet, endOfPacket(), sfFalse); } //////////////////////////////////////////////////////////// -sfBool sfPacket_CanRead(const sfPacket* packet) +sfBool sfPacket_canRead(const sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); return packet->This ? sfTrue : sfFalse; @@ -97,73 +97,73 @@ sfBool sfPacket_CanRead(const sfPacket* packet) //////////////////////////////////////////////////////////// -sfBool sfPacket_ReadBool(sfPacket* packet) +sfBool sfPacket_readBool(sfPacket* packet) { - return sfPacket_ReadUint8(packet); + return sfPacket_readUint8(packet); } -sfInt8 sfPacket_ReadInt8(sfPacket* packet) +sfInt8 sfPacket_readInt8(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); sfInt8 value; packet->This >> value; return value; } -sfUint8 sfPacket_ReadUint8(sfPacket* packet) +sfUint8 sfPacket_readUint8(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); sfUint8 value; packet->This >> value; return value; } -sfInt16 sfPacket_ReadInt16(sfPacket* packet) +sfInt16 sfPacket_readInt16(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); sfInt16 value; packet->This >> value; return value; } -sfUint16 sfPacket_ReadUint16(sfPacket* packet) +sfUint16 sfPacket_readUint16(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); sfUint16 value; packet->This >> value; return value; } -sfInt32 sfPacket_ReadInt32(sfPacket* packet) +sfInt32 sfPacket_readInt32(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); sfInt32 value; packet->This >> value; return value; } -sfUint32 sfPacket_ReadUint32(sfPacket* packet) +sfUint32 sfPacket_readUint32(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); sfUint32 value; packet->This >> value; return value; } -float sfPacket_ReadFloat(sfPacket* packet) +float sfPacket_readFloat(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); float value; packet->This >> value; return value; } -double sfPacket_ReadDouble(sfPacket* packet) +double sfPacket_readDouble(sfPacket* packet) { CSFML_CHECK_RETURN(packet, sfFalse); double value; packet->This >> value; return value; } -void sfPacket_ReadString(sfPacket* packet, char* string) +void sfPacket_readString(sfPacket* packet, char* string) { CSFML_CHECK(packet); if (string) packet->This >> string; } -void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string) +void sfPacket_readWideString(sfPacket* packet, wchar_t* string) { CSFML_CHECK(packet); if (string) @@ -172,58 +172,58 @@ void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string) //////////////////////////////////////////////////////////// -void sfPacket_WriteBool(sfPacket* packet, sfBool value) +void sfPacket_writeBool(sfPacket* packet, sfBool value) { - sfPacket_WriteUint8(packet, value ? 1 : 0); + sfPacket_writeUint8(packet, value ? 1 : 0); } -void sfPacket_WriteInt8(sfPacket* packet, sfInt8 value) +void sfPacket_writeInt8(sfPacket* packet, sfInt8 value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteUint8(sfPacket* packet, sfUint8 value) +void sfPacket_writeUint8(sfPacket* packet, sfUint8 value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteInt16(sfPacket* packet, sfInt16 value) +void sfPacket_writeInt16(sfPacket* packet, sfInt16 value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteUint16(sfPacket* packet, sfUint16 value) +void sfPacket_writeUint16(sfPacket* packet, sfUint16 value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteInt32(sfPacket* packet, sfInt32 value) +void sfPacket_writeInt32(sfPacket* packet, sfInt32 value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteUint32(sfPacket* packet, sfUint32 value) +void sfPacket_writeUint32(sfPacket* packet, sfUint32 value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteFloat(sfPacket* packet, float value) +void sfPacket_writeFloat(sfPacket* packet, float value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteDouble(sfPacket* packet, double value) +void sfPacket_writeDouble(sfPacket* packet, double value) { CSFML_CHECK(packet); packet->This << value; } -void sfPacket_WriteString(sfPacket* packet, const char* string) +void sfPacket_writeString(sfPacket* packet, const char* string) { CSFML_CHECK(packet); if (string) packet->This << string; } -void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string) +void sfPacket_writeWideString(sfPacket* packet, const wchar_t* string) { CSFML_CHECK(packet); diff --git a/src/SFML/Network/SocketSelector.cpp b/src/SFML/Network/SocketSelector.cpp index 23d8ccc..830cf24 100644 --- a/src/SFML/Network/SocketSelector.cpp +++ b/src/SFML/Network/SocketSelector.cpp @@ -34,14 +34,14 @@ //////////////////////////////////////////////////////////// -sfSocketSelector* sfSocketSelector_Create(void) +sfSocketSelector* sfSocketSelector_create(void) { return new sfSocketSelector; } //////////////////////////////////////////////////////////// -sfSocketSelector* sfSocketSelector_Copy(sfSocketSelector* selector) +sfSocketSelector* sfSocketSelector_copy(sfSocketSelector* selector) { CSFML_CHECK_RETURN(selector, NULL); @@ -50,75 +50,75 @@ sfSocketSelector* sfSocketSelector_Copy(sfSocketSelector* selector) //////////////////////////////////////////////////////////// -void sfSocketSelector_Destroy(sfSocketSelector* selector) +void sfSocketSelector_destroy(sfSocketSelector* selector) { delete selector; } //////////////////////////////////////////////////////////// -void sfSocketSelector_AddTcpListener(sfSocketSelector* selector, sfTcpListener* socket) +void sfSocketSelector_addTcpListener(sfSocketSelector* selector, sfTcpListener* socket) { CSFML_CHECK(socket); - CSFML_CALL(selector, Add(socket->This)); + CSFML_CALL(selector, add(socket->This)); } -void sfSocketSelector_AddTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket) +void sfSocketSelector_addTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket) { CSFML_CHECK(socket); - CSFML_CALL(selector, Add(socket->This)); + CSFML_CALL(selector, add(socket->This)); } -void sfSocketSelector_AddUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket) +void sfSocketSelector_addUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket) { CSFML_CHECK(socket); - CSFML_CALL(selector, Add(socket->This)); + CSFML_CALL(selector, add(socket->This)); } //////////////////////////////////////////////////////////// -void sfSocketSelector_RemoveTcpListener(sfSocketSelector* selector, sfTcpListener* socket) +void sfSocketSelector_removeTcpListener(sfSocketSelector* selector, sfTcpListener* socket) { CSFML_CHECK(socket); - CSFML_CALL(selector, Remove(socket->This)); + CSFML_CALL(selector, remove(socket->This)); } -void sfSocketSelector_RemoveTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket) +void sfSocketSelector_removeTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket) { CSFML_CHECK(socket); - CSFML_CALL(selector, Remove(socket->This)); + CSFML_CALL(selector, remove(socket->This)); } -void sfSocketSelector_RemoveUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket) +void sfSocketSelector_removeUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket) { CSFML_CHECK(socket); - CSFML_CALL(selector, Remove(socket->This)); + CSFML_CALL(selector, remove(socket->This)); } //////////////////////////////////////////////////////////// -void sfSocketSelector_Clear(sfSocketSelector* selector) +void sfSocketSelector_clear(sfSocketSelector* selector) { - CSFML_CALL(selector, Clear()); + CSFML_CALL(selector, clear()); } //////////////////////////////////////////////////////////// -sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfTime timeout) +sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout) { - CSFML_CALL_RETURN(selector, Wait(sf::Microseconds(timeout.Microseconds)), sfFalse); + CSFML_CALL_RETURN(selector, wait(sf::microseconds(timeout.microseconds)), sfFalse); } //////////////////////////////////////////////////////////// -sfBool sfSocketSelector_IsTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket) +sfBool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket) { CSFML_CHECK_RETURN(socket, sfFalse); - CSFML_CALL_RETURN(selector, IsReady(socket->This), sfFalse); + CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse); } -sfBool sfSocketSelector_IsTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket) +sfBool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket) { CSFML_CHECK_RETURN(socket, sfFalse); - CSFML_CALL_RETURN(selector, IsReady(socket->This), sfFalse); + CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse); } -sfBool sfSocketSelector_IsUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket) +sfBool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket) { CSFML_CHECK_RETURN(socket, sfFalse); - CSFML_CALL_RETURN(selector, IsReady(socket->This), sfFalse); + CSFML_CALL_RETURN(selector, isReady(socket->This), sfFalse); } diff --git a/src/SFML/Network/TcpListener.cpp b/src/SFML/Network/TcpListener.cpp index 5579b03..8db4efe 100644 --- a/src/SFML/Network/TcpListener.cpp +++ b/src/SFML/Network/TcpListener.cpp @@ -32,55 +32,55 @@ //////////////////////////////////////////////////////////// -sfTcpListener* sfTcpListener_Create(void) +sfTcpListener* sfTcpListener_create(void) { return new sfTcpListener; } //////////////////////////////////////////////////////////// -void sfTcpListener_Destroy(sfTcpListener* listener) +void sfTcpListener_destroy(sfTcpListener* listener) { delete listener; } //////////////////////////////////////////////////////////// -void sfTcpListener_SetBlocking(sfTcpListener* listener, sfBool blocking) +void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking) { - CSFML_CALL(listener, SetBlocking(blocking == sfTrue)); + CSFML_CALL(listener, setBlocking(blocking == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfTcpListener_IsBlocking(const sfTcpListener* listener) +sfBool sfTcpListener_isBlocking(const sfTcpListener* listener) { - CSFML_CALL_RETURN(listener, IsBlocking(), sfFalse); + CSFML_CALL_RETURN(listener, isBlocking(), sfFalse); } //////////////////////////////////////////////////////////// -unsigned short sfTcpListener_GetLocalPort(const sfTcpListener* listener) +unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener) { - CSFML_CALL_RETURN(listener, GetLocalPort(), 0); + CSFML_CALL_RETURN(listener, getLocalPort(), 0); } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpListener_Listen(sfTcpListener* listener, unsigned short port) +sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port) { CSFML_CHECK_RETURN(listener, sfSocketError); - return static_cast(listener->This.Listen(port)); + return static_cast(listener->This.listen(port)); } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpListener_Accept(sfTcpListener* listener, sfTcpSocket** connected) +sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** connected) { CSFML_CHECK_RETURN(listener, sfSocketError); CSFML_CHECK_RETURN(connected, sfSocketError); *connected = new sfTcpSocket; - return static_cast(listener->This.Accept((*connected)->This)); + return static_cast(listener->This.accept((*connected)->This)); } diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 36dec75..eb9f726 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -34,119 +34,119 @@ //////////////////////////////////////////////////////////// -sfTcpSocket* sfTcpSocket_Create(void) +sfTcpSocket* sfTcpSocket_create(void) { return new sfTcpSocket; } //////////////////////////////////////////////////////////// -void sfTcpSocket_Destroy(sfTcpSocket* socket) +void sfTcpSocket_destroy(sfTcpSocket* socket) { delete socket; } //////////////////////////////////////////////////////////// -void sfTcpSocket_SetBlocking(sfTcpSocket* socket, sfBool blocking) +void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking) { - CSFML_CALL(socket, SetBlocking(blocking == sfTrue)); + CSFML_CALL(socket, setBlocking(blocking == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfTcpSocket_IsBlocking(const sfTcpSocket* socket) +sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket) { - CSFML_CALL_RETURN(socket, IsBlocking(), sfFalse); + CSFML_CALL_RETURN(socket, isBlocking(), sfFalse); } //////////////////////////////////////////////////////////// -unsigned short sfTcpSocket_GetLocalPort(const sfTcpSocket* socket) +unsigned short sfTcpSocket_getLocalPort(const sfTcpSocket* socket) { - CSFML_CALL_RETURN(socket, GetLocalPort(), 0); + CSFML_CALL_RETURN(socket, getLocalPort(), 0); } //////////////////////////////////////////////////////////// -sfIpAddress sfTcpSocket_GetRemoteAddress(const sfTcpSocket* socket) +sfIpAddress sfTcpSocket_getRemoteAddress(const sfTcpSocket* socket) { - sfIpAddress result = sfIpAddress_None(); + sfIpAddress result = sfIpAddress_None; CSFML_CHECK_RETURN(socket, result); - sf::IpAddress address = socket->This.GetRemoteAddress(); - strncpy(result.Address, address.ToString().c_str(), 16); + sf::IpAddress address = socket->This.getRemoteAddress(); + strncpy(result.address, address.toString().c_str(), 16); return result; } //////////////////////////////////////////////////////////// -unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* socket) +unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket) { - CSFML_CALL_RETURN(socket, GetRemotePort(), 0); + CSFML_CALL_RETURN(socket, getRemotePort(), 0); } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout) +sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout) { - sf::IpAddress address(host.Address); + sf::IpAddress address(host.address); CSFML_CHECK_RETURN(socket, sfSocketError); - return static_cast(socket->This.Connect(address, port, sf::Microseconds(timeout.Microseconds))); + return static_cast(socket->This.connect(address, port, sf::microseconds(timeout.microseconds))); } //////////////////////////////////////////////////////////// -void sfTcpSocket_Disconnect(sfTcpSocket* socket) +void sfTcpSocket_disconnect(sfTcpSocket* socket) { - CSFML_CALL(socket, Disconnect()); + CSFML_CALL(socket, disconnect()); } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpSocket_Send(sfTcpSocket* socket, const char* data, size_t size) +sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const char* data, size_t size) { CSFML_CHECK_RETURN(socket, sfSocketError); - return static_cast(socket->This.Send(data, size)); + return static_cast(socket->This.send(data, size)); } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpSocket_Receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived) +sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived) { CSFML_CHECK_RETURN(socket, sfSocketError); if (sizeReceived) { - return static_cast(socket->This.Receive(data, maxSize, *sizeReceived)); + return static_cast(socket->This.receive(data, maxSize, *sizeReceived)); } else { std::size_t size = 0; - return static_cast(socket->This.Receive(data, maxSize, size)); + return static_cast(socket->This.receive(data, maxSize, size)); } } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpSocket_SendPacket(sfTcpSocket* socket, sfPacket* packet) +sfSocketStatus sfTcpSocket_sendPacket(sfTcpSocket* socket, sfPacket* packet) { CSFML_CHECK_RETURN(socket, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError); - return static_cast(socket->This.Send(packet->This)); + return static_cast(socket->This.send(packet->This)); } //////////////////////////////////////////////////////////// -sfSocketStatus sfTcpSocket_ReceivePacket(sfTcpSocket* socket, sfPacket* packet) +sfSocketStatus sfTcpSocket_receivePacket(sfTcpSocket* socket, sfPacket* packet) { CSFML_CHECK_RETURN(socket, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError); - return static_cast(socket->This.Receive(packet->This)); + return static_cast(socket->This.receive(packet->This)); } diff --git a/src/SFML/Network/UdpSocket.cpp b/src/SFML/Network/UdpSocket.cpp index ef4f307..7f8d615 100644 --- a/src/SFML/Network/UdpSocket.cpp +++ b/src/SFML/Network/UdpSocket.cpp @@ -34,69 +34,69 @@ //////////////////////////////////////////////////////////// -sfUdpSocket* sfUdpSocket_Create(void) +sfUdpSocket* sfUdpSocket_create(void) { return new sfUdpSocket; } //////////////////////////////////////////////////////////// -void sfUdpSocket_Destroy(sfUdpSocket* socket) +void sfUdpSocket_destroy(sfUdpSocket* socket) { delete socket; } //////////////////////////////////////////////////////////// -void sfUdpSocket_SetBlocking(sfUdpSocket* socket, sfBool blocking) +void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking) { - CSFML_CALL(socket, SetBlocking(blocking == sfTrue)); + CSFML_CALL(socket, setBlocking(blocking == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfUdpSocket_IsBlocking(const sfUdpSocket* socket) +sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket) { - CSFML_CALL_RETURN(socket, IsBlocking(), sfFalse); + CSFML_CALL_RETURN(socket, isBlocking(), sfFalse); } //////////////////////////////////////////////////////////// -unsigned short sfUdpSocket_GetLocalPort(const sfUdpSocket* socket) +unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket) { - CSFML_CALL_RETURN(socket, GetLocalPort(), 0); + CSFML_CALL_RETURN(socket, getLocalPort(), 0); } //////////////////////////////////////////////////////////// -sfSocketStatus sfUdpSocket_Bind(sfUdpSocket* socket, unsigned short port) +sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port) { CSFML_CHECK_RETURN(socket, sfSocketError); - return static_cast(socket->This.Bind(port)); + return static_cast(socket->This.bind(port)); } //////////////////////////////////////////////////////////// -void sfUdpSocket_Unbind(sfUdpSocket* socket) +void sfUdpSocket_unbind(sfUdpSocket* socket) { - CSFML_CALL(socket, Unbind()); + CSFML_CALL(socket, unbind()); } //////////////////////////////////////////////////////////// -sfSocketStatus sfUdpSocket_Send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port) +sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port) { CSFML_CHECK_RETURN(socket, sfSocketError); // Convert the address - sf::IpAddress receiver(address.Address); + sf::IpAddress receiver(address.address); - return static_cast(socket->This.Send(data, size, receiver, port)); + return static_cast(socket->This.send(data, size, receiver, port)); } //////////////////////////////////////////////////////////// -sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port) +sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port) { CSFML_CHECK_RETURN(socket, sfSocketError); @@ -105,7 +105,7 @@ sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSi unsigned short senderPort; std::size_t received; - sf::Socket::Status status = socket->This.Receive(data, maxSize, received, sender, senderPort); + sf::Socket::Status status = socket->This.receive(data, maxSize, received, sender, senderPort); if (status != sf::Socket::Done) return static_cast(status); @@ -113,7 +113,7 @@ sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSi *sizeReceived = received; if (address) - strncpy(address->Address, sender.ToString().c_str(), 16); + strncpy(address->address, sender.toString().c_str(), 16); if (port) *port = senderPort; @@ -123,32 +123,32 @@ sfSocketStatus sfUdpSocket_Receive(sfUdpSocket* socket, char* data, size_t maxSi //////////////////////////////////////////////////////////// -sfSocketStatus sfUdpSocket_SendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port) +sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port) { CSFML_CHECK_RETURN(socket, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError); // Convert the address - sf::IpAddress receiver(address.Address); + sf::IpAddress receiver(address.address); - return static_cast(socket->This.Send(packet->This, receiver, port)); + return static_cast(socket->This.send(packet->This, receiver, port)); } //////////////////////////////////////////////////////////// -sfSocketStatus sfUdpSocket_ReceivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port) +sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port) { CSFML_CHECK_RETURN(socket, sfSocketError); CSFML_CHECK_RETURN(packet, sfSocketError); sf::IpAddress sender; unsigned short senderPort; - sf::Socket::Status status = socket->This.Receive(packet->This, sender, senderPort); + sf::Socket::Status status = socket->This.receive(packet->This, sender, senderPort); if (status != sf::Socket::Done) return static_cast(status); if (address) - strncpy(address->Address, sender.ToString().c_str(), 16); + strncpy(address->address, sender.toString().c_str(), 16); if (port) *port = senderPort; @@ -158,7 +158,7 @@ sfSocketStatus sfUdpSocket_ReceivePacket(sfUdpSocket* socket, sfPacket* packet, //////////////////////////////////////////////////////////// -unsigned int sfUdpSocket_MaxDatagramSize() +unsigned int sfUdpSocket_maxDatagramSize() { return sf::UdpSocket::MaxDatagramSize; } diff --git a/src/SFML/System/Clock.cpp b/src/SFML/System/Clock.cpp index 327ffb2..71e2bda 100644 --- a/src/SFML/System/Clock.cpp +++ b/src/SFML/System/Clock.cpp @@ -31,14 +31,14 @@ //////////////////////////////////////////////////////////// -sfClock* sfClock_Create(void) +sfClock* sfClock_create(void) { return new sfClock; } //////////////////////////////////////////////////////////// -sfClock* sfClock_Copy(sfClock* clock) +sfClock* sfClock_copy(sfClock* clock) { CSFML_CHECK_RETURN(clock, NULL); @@ -47,27 +47,27 @@ sfClock* sfClock_Copy(sfClock* clock) //////////////////////////////////////////////////////////// -void sfClock_Destroy(sfClock* clock) +void sfClock_destroy(sfClock* clock) { delete clock; } //////////////////////////////////////////////////////////// -sfTime sfClock_GetElapsedTime(const sfClock* clock) +sfTime sfClock_getElapsedTime(const sfClock* clock) { - CSFML_CHECK_RETURN(clock, sfTimeZero); + CSFML_CHECK_RETURN(clock, sfTime_Zero); - sf::Time time = clock->This.GetElapsedTime(); - return sfMicroseconds(time.AsMicroseconds()); + sf::Time time = clock->This.getElapsedTime(); + return sfMicroseconds(time.asMicroseconds()); } //////////////////////////////////////////////////////////// -sfTime sfClock_Restart(sfClock* clock) +sfTime sfClock_restart(sfClock* clock) { - CSFML_CHECK_RETURN(clock, sfTimeZero); + CSFML_CHECK_RETURN(clock, sfTime_Zero); - sf::Time time = clock->This.Restart(); - return sfMicroseconds(time.AsMicroseconds()); + sf::Time time = clock->This.restart(); + return sfMicroseconds(time.asMicroseconds()); } diff --git a/src/SFML/System/Mutex.cpp b/src/SFML/System/Mutex.cpp index e4a9289..d51c78c 100644 --- a/src/SFML/System/Mutex.cpp +++ b/src/SFML/System/Mutex.cpp @@ -31,28 +31,28 @@ //////////////////////////////////////////////////////////// -sfMutex* sfMutex_Create(void) +sfMutex* sfMutex_create(void) { return new sfMutex; } //////////////////////////////////////////////////////////// -void sfMutex_Destroy(sfMutex* mutex) +void sfMutex_destroy(sfMutex* mutex) { delete mutex; } //////////////////////////////////////////////////////////// -void sfMutex_Lock(sfMutex* mutex) +void sfMutex_lock(sfMutex* mutex) { - CSFML_CALL(mutex, Lock()); + CSFML_CALL(mutex, lock()); } //////////////////////////////////////////////////////////// -void sfMutex_Unlock(sfMutex* mutex) +void sfMutex_unlock(sfMutex* mutex) { - CSFML_CALL(mutex, Unlock()); + CSFML_CALL(mutex, unlock()); } diff --git a/src/SFML/System/Sleep.cpp b/src/SFML/System/Sleep.cpp index ec42d87..fd22360 100644 --- a/src/SFML/System/Sleep.cpp +++ b/src/SFML/System/Sleep.cpp @@ -33,5 +33,5 @@ //////////////////////////////////////////////////////////// void sfSleep(sfTime duration) { - sf::Sleep(sf::Microseconds(duration.Microseconds)); + sf::sleep(sf::microseconds(duration.microseconds)); } diff --git a/src/SFML/System/Thread.cpp b/src/SFML/System/Thread.cpp index 5e18ee5..5389d70 100644 --- a/src/SFML/System/Thread.cpp +++ b/src/SFML/System/Thread.cpp @@ -31,35 +31,35 @@ //////////////////////////////////////////////////////////// -sfThread* sfThread_Create(void (*function)(void*), void* userData) +sfThread* sfThread_create(void (*function)(void*), void* userData) { return new sfThread(function, userData); } //////////////////////////////////////////////////////////// -void sfThread_Destroy(sfThread* thread) +void sfThread_destroy(sfThread* thread) { delete thread; } //////////////////////////////////////////////////////////// -void sfThread_Launch(sfThread* thread) +void sfThread_launch(sfThread* thread) { - CSFML_CALL(thread, Launch()); + CSFML_CALL(thread, launch()); } //////////////////////////////////////////////////////////// -void sfThread_Wait(sfThread* thread) +void sfThread_wait(sfThread* thread) { - CSFML_CALL(thread, Wait()); + CSFML_CALL(thread, wait()); } //////////////////////////////////////////////////////////// -void sfThread_Terminate(sfThread* thread) +void sfThread_terminate(sfThread* thread) { - CSFML_CALL(thread, Terminate()); + CSFML_CALL(thread, terminate()); } diff --git a/src/SFML/System/ThreadStruct.h b/src/SFML/System/ThreadStruct.h index 3f3630a..1809fe1 100644 --- a/src/SFML/System/ThreadStruct.h +++ b/src/SFML/System/ThreadStruct.h @@ -36,8 +36,8 @@ //////////////////////////////////////////////////////////// struct sfThread { - sfThread(void (*Function)(void*), void* UserData) : - This(Function, UserData) + sfThread(void (*function)(void*), void* userData) : + This(function, userData) { } diff --git a/src/SFML/System/Time.cpp b/src/SFML/System/Time.cpp index 059c4aa..0683f09 100644 --- a/src/SFML/System/Time.cpp +++ b/src/SFML/System/Time.cpp @@ -29,27 +29,27 @@ //////////////////////////////////////////////////////////// -sfTime sfTimeZero = {0}; +sfTime sfTime_Zero = {0}; //////////////////////////////////////////////////////////// -float sfTime_AsSeconds(sfTime time) +float sfTime_asSeconds(sfTime time) { - return time.Microseconds / 1000000.f; + return time.microseconds / 1000000.f; } //////////////////////////////////////////////////////////// -sfInt32 sfTime_AsMilliseconds(sfTime time) +sfInt32 sfTime_asMilliseconds(sfTime time) { - return static_cast(time.Microseconds / 1000); + return static_cast(time.microseconds / 1000); } //////////////////////////////////////////////////////////// -sfInt64 sfTime_AsMicroseconds(sfTime time) +sfInt64 sfTime_asMicroseconds(sfTime time) { - return time.Microseconds; + return time.microseconds; } @@ -57,7 +57,7 @@ sfInt64 sfTime_AsMicroseconds(sfTime time) sfTime sfSeconds(float amount) { sfTime time; - time.Microseconds = static_cast(amount * 1000000); + time.microseconds = static_cast(amount * 1000000); return time; } @@ -66,7 +66,7 @@ sfTime sfSeconds(float amount) sfTime sfMilliseconds(sfInt32 amount) { sfTime time; - time.Microseconds = static_cast(amount) * 1000; + time.microseconds = static_cast(amount) * 1000; return time; } @@ -75,6 +75,6 @@ sfTime sfMilliseconds(sfInt32 amount) sfTime sfMicroseconds(sfInt64 amount) { sfTime time; - time.Microseconds = amount; + time.microseconds = amount; return time; } diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp index cdb35f9..44fcf47 100644 --- a/src/SFML/Window/Context.cpp +++ b/src/SFML/Window/Context.cpp @@ -31,21 +31,21 @@ //////////////////////////////////////////////////////////// -sfContext* sfContext_Create(void) +sfContext* sfContext_create(void) { return new sfContext; } //////////////////////////////////////////////////////////// -void sfContext_Destroy(sfContext* context) +void sfContext_destroy(sfContext* context) { delete context; } //////////////////////////////////////////////////////////// -void sfContext_SetActive(sfContext* context, sfBool active) +void sfContext_setActive(sfContext* context, sfBool active) { - CSFML_CALL(context, SetActive(active == sfTrue)); + CSFML_CALL(context, setActive(active == sfTrue)); } diff --git a/src/SFML/Window/Joystick.cpp b/src/SFML/Window/Joystick.cpp index f774e2d..aa4cff4 100644 --- a/src/SFML/Window/Joystick.cpp +++ b/src/SFML/Window/Joystick.cpp @@ -31,42 +31,42 @@ //////////////////////////////////////////////////////////// -sfBool sfJoystick_IsConnected(unsigned int joystick) +sfBool sfJoystick_isConnected(unsigned int joystick) { - return sf::Joystick::IsConnected(joystick) ? sfTrue : sfFalse; + return sf::Joystick::isConnected(joystick) ? sfTrue : sfFalse; } //////////////////////////////////////////////////////////// -unsigned int sfJoystick_GetButtonCount(unsigned int joystick) +unsigned int sfJoystick_getButtonCount(unsigned int joystick) { - return sf::Joystick::GetButtonCount(joystick); + return sf::Joystick::getButtonCount(joystick); } //////////////////////////////////////////////////////////// -sfBool sfJoystick_HasAxis(unsigned int joystick, sfJoystickAxis axis) +sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis) { - return sf::Joystick::HasAxis(joystick, static_cast(axis)) ? sfTrue : sfFalse; + return sf::Joystick::hasAxis(joystick, static_cast(axis)) ? sfTrue : sfFalse; } //////////////////////////////////////////////////////////// -sfBool sfJoystick_IsButtonPressed(unsigned int joystick, unsigned int button) +sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button) { - return sf::Joystick::IsButtonPressed(joystick, button) ? sfTrue : sfFalse; + return sf::Joystick::isButtonPressed(joystick, button) ? sfTrue : sfFalse; } //////////////////////////////////////////////////////////// -float sfJoystick_GetAxisPosition(unsigned int joystick, sfJoystickAxis axis) +float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis) { - return sf::Joystick::GetAxisPosition(joystick, static_cast(axis)); + return sf::Joystick::getAxisPosition(joystick, static_cast(axis)); } //////////////////////////////////////////////////////////// -void sfJoystick_Update(void) +void sfJoystick_update(void) { - sf::Joystick::Update(); + sf::Joystick::update(); } diff --git a/src/SFML/Window/Keyboard.cpp b/src/SFML/Window/Keyboard.cpp index fb11a54..fd49179 100644 --- a/src/SFML/Window/Keyboard.cpp +++ b/src/SFML/Window/Keyboard.cpp @@ -31,7 +31,7 @@ //////////////////////////////////////////////////////////// -sfBool sfKeyboard_IsKeyPressed(sfKeyCode key) +sfBool sfKeyboard_isKeyPressed(sfKeyCode key) { - return sf::Keyboard::IsKeyPressed(static_cast(key)); + return sf::Keyboard::isKeyPressed(static_cast(key)); } diff --git a/src/SFML/Window/Mouse.cpp b/src/SFML/Window/Mouse.cpp index 77a02ec..4c22ab0 100644 --- a/src/SFML/Window/Mouse.cpp +++ b/src/SFML/Window/Mouse.cpp @@ -32,20 +32,20 @@ //////////////////////////////////////////////////////////// -sfBool sfMouse_IsButtonPressed(sfMouseButton button) +sfBool sfMouse_isButtonPressed(sfMouseButton button) { - return sf::Mouse::IsButtonPressed(static_cast(button)) ? sfTrue : sfFalse; + return sf::Mouse::isButtonPressed(static_cast(button)) ? sfTrue : sfFalse; } //////////////////////////////////////////////////////////// -sfVector2i sfMouse_GetPosition(const sfWindow* relativeTo) +sfVector2i sfMouse_getPosition(const sfWindow* relativeTo) { sf::Vector2i sfmlPos; if (relativeTo) - sfmlPos = sf::Mouse::GetPosition(relativeTo->This); + sfmlPos = sf::Mouse::getPosition(relativeTo->This); else - sfmlPos = sf::Mouse::GetPosition(); + sfmlPos = sf::Mouse::getPosition(); sfVector2i position = {sfmlPos.x, sfmlPos.y}; return position; @@ -53,10 +53,10 @@ sfVector2i sfMouse_GetPosition(const sfWindow* relativeTo) //////////////////////////////////////////////////////////// -void sfMouse_SetPosition(sfVector2i position, const sfWindow* relativeTo) +void sfMouse_setPosition(sfVector2i position, const sfWindow* relativeTo) { if (relativeTo) - sf::Mouse::SetPosition(sf::Vector2i(position.x, position.y), relativeTo->This); + sf::Mouse::setPosition(sf::Vector2i(position.x, position.y), relativeTo->This); else - sf::Mouse::SetPosition(sf::Vector2i(position.x, position.y)); + sf::Mouse::setPosition(sf::Vector2i(position.x, position.y)); } diff --git a/src/SFML/Window/VideoMode.cpp b/src/SFML/Window/VideoMode.cpp index 894c415..40e7002 100644 --- a/src/SFML/Window/VideoMode.cpp +++ b/src/SFML/Window/VideoMode.cpp @@ -31,33 +31,33 @@ //////////////////////////////////////////////////////////// -sfVideoMode sfVideoMode_GetDesktopMode(void) +sfVideoMode sfVideoMode_getDesktopMode(void) { - sf::VideoMode desktop = sf::VideoMode::GetDesktopMode(); + sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); sfVideoMode ret; - ret.Width = desktop.Width; - ret.Height = desktop.Height; - ret.BitsPerPixel = desktop.BitsPerPixel; + ret.width = desktop.width; + ret.height = desktop.height; + ret.bitsPerPixel = desktop.bitsPerPixel; return ret; } //////////////////////////////////////////////////////////// -const sfVideoMode* sfVideoMode_GetFullscreenModes(size_t* count) +const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count) { static std::vector modes; // Populate the array on first call if (modes.empty()) { - const std::vector& SFMLModes = sf::VideoMode::GetFullscreenModes(); + const std::vector& SFMLModes = sf::VideoMode::getFullscreenModes(); for (std::vector::const_iterator it = SFMLModes.begin(); it != SFMLModes.end(); ++it) { sfVideoMode mode; - mode.Width = it->Width; - mode.Height = it->Height; - mode.BitsPerPixel = it->BitsPerPixel; + mode.width = it->width; + mode.height = it->height; + mode.bitsPerPixel = it->bitsPerPixel; modes.push_back(mode); } } @@ -70,8 +70,8 @@ const sfVideoMode* sfVideoMode_GetFullscreenModes(size_t* count) //////////////////////////////////////////////////////////// -sfBool sfVideoMode_IsValid(sfVideoMode mode) +sfBool sfVideoMode_isValid(sfVideoMode mode) { - sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel); - return videoMode.IsValid() ? sfTrue : sfFalse; + sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel); + return videoMode.isValid() ? sfTrue : sfFalse; } diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 6565a91..cb6bcd7 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -32,138 +32,138 @@ //////////////////////////////////////////////////////////// -sfWindow* sfWindow_Create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings) +sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings) { // Convert video mode - sf::VideoMode videoMode(mode.Width, mode.Height, mode.BitsPerPixel); + sf::VideoMode videoMode(mode.width, mode.height, mode.bitsPerPixel); // Convert context settings sf::ContextSettings params; if (settings) { - params.DepthBits = settings->DepthBits; - params.StencilBits = settings->StencilBits; - params.AntialiasingLevel = settings->AntialiasingLevel; - params.MajorVersion = settings->MajorVersion; - params.MinorVersion = settings->MinorVersion; + params.depthBits = settings->depthBits; + params.stencilBits = settings->stencilBits; + params.antialiasingLevel = settings->antialiasingLevel; + params.majorVersion = settings->majorVersion; + params.minorVersion = settings->minorVersion; } // Create the window sfWindow* window = new sfWindow; - window->This.Create(videoMode, title, style, params); + window->This.create(videoMode, title, style, params); return window; } //////////////////////////////////////////////////////////// -sfWindow* sfWindow_CreateFromHandle(sfWindowHandle handle, const sfContextSettings* settings) +sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings) { // Convert context settings sf::ContextSettings params; if (settings) { - params.DepthBits = settings->DepthBits; - params.StencilBits = settings->StencilBits; - params.AntialiasingLevel = settings->AntialiasingLevel; - params.MajorVersion = settings->MajorVersion; - params.MinorVersion = settings->MinorVersion; + params.depthBits = settings->depthBits; + params.stencilBits = settings->stencilBits; + params.antialiasingLevel = settings->antialiasingLevel; + params.majorVersion = settings->majorVersion; + params.minorVersion = settings->minorVersion; } // Create the window sfWindow* window = new sfWindow; - window->This.Create(handle, params); + window->This.create(handle, params); return window; } //////////////////////////////////////////////////////////// -void sfWindow_Destroy(sfWindow* window) +void sfWindow_destroy(sfWindow* window) { delete window; } //////////////////////////////////////////////////////////// -void sfWindow_Close(sfWindow* window) +void sfWindow_close(sfWindow* window) { - CSFML_CALL(window, Close()); + CSFML_CALL(window, close()); } //////////////////////////////////////////////////////////// -sfBool sfWindow_IsOpen(const sfWindow* window) +sfBool sfWindow_isOpen(const sfWindow* window) { - CSFML_CALL_RETURN(window, IsOpen(), sfFalse); + CSFML_CALL_RETURN(window, isOpen(), sfFalse); } //////////////////////////////////////////////////////////// -sfContextSettings sfWindow_GetSettings(const sfWindow* window) +sfContextSettings sfWindow_getSettings(const sfWindow* window) { sfContextSettings settings = {0, 0, 0, 0, 0}; CSFML_CHECK_RETURN(window, settings); - const sf::ContextSettings& params = window->This.GetSettings(); - settings.DepthBits = params.DepthBits; - settings.StencilBits = params.StencilBits; - settings.AntialiasingLevel = params.AntialiasingLevel; - settings.MajorVersion = params.MajorVersion; - settings.MinorVersion = params.MinorVersion; + const sf::ContextSettings& params = window->This.getSettings(); + settings.depthBits = params.depthBits; + settings.stencilBits = params.stencilBits; + settings.antialiasingLevel = params.antialiasingLevel; + settings.majorVersion = params.majorVersion; + settings.minorVersion = params.minorVersion; return settings; } //////////////////////////////////////////////////////////// -sfBool sfWindow_PollEvent(sfWindow* window, sfEvent* event) +sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event) { CSFML_CHECK_RETURN(window, sfFalse); CSFML_CHECK_RETURN(event, sfFalse); // Get the event sf::Event SFMLEvent; - sfBool ret = window->This.PollEvent(SFMLEvent); + sfBool ret = window->This.pollEvent(SFMLEvent); // No event, return if (!ret) return sfFalse; // Convert the sf::Event event to a sfEvent - ConvertEvent(SFMLEvent, event); + convertEvent(SFMLEvent, event); return sfTrue; } //////////////////////////////////////////////////////////// -sfBool sfWindow_WaitEvent(sfWindow* window, sfEvent* event) +sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event) { CSFML_CHECK_RETURN(window, sfFalse); CSFML_CHECK_RETURN(event, sfFalse); // Get the event sf::Event SFMLEvent; - sfBool ret = window->This.WaitEvent(SFMLEvent); + sfBool ret = window->This.waitEvent(SFMLEvent); // Error, return if (!ret) return sfFalse; // Convert the sf::Event event to a sfEvent - ConvertEvent(SFMLEvent, event); + convertEvent(SFMLEvent, event); return sfTrue; } //////////////////////////////////////////////////////////// -sfVector2i sfWindow_GetPosition(const sfWindow* window) +sfVector2i sfWindow_getPosition(const sfWindow* window) { sfVector2i position = {0, 0}; CSFML_CHECK_RETURN(window, position); - sf::Vector2i sfmlPos = window->This.GetPosition(); + sf::Vector2i sfmlPos = window->This.getPosition(); position.x = sfmlPos.x; position.y = sfmlPos.y; @@ -172,19 +172,19 @@ sfVector2i sfWindow_GetPosition(const sfWindow* window) //////////////////////////////////////////////////////////// -void sfWindow_SetPosition(sfWindow* window, sfVector2i position) +void sfWindow_setPosition(sfWindow* window, sfVector2i position) { - CSFML_CALL(window, SetPosition(sf::Vector2i(position.x, position.y))); + CSFML_CALL(window, setPosition(sf::Vector2i(position.x, position.y))); } //////////////////////////////////////////////////////////// -sfVector2u sfWindow_GetSize(const sfWindow* window) +sfVector2u sfWindow_getSize(const sfWindow* window) { sfVector2u size = {0, 0}; CSFML_CHECK_RETURN(window, size); - sf::Vector2u sfmlSize = window->This.GetSize(); + sf::Vector2u sfmlSize = window->This.getSize(); size.x = sfmlSize.x; size.y = sfmlSize.y; @@ -195,84 +195,84 @@ sfVector2u sfWindow_GetSize(const sfWindow* window) //////////////////////////////////////////////////////////// void sfWindow_SetSize(sfWindow* window, sfVector2u size) { - CSFML_CALL(window, SetSize(sf::Vector2u(size.x, size.y))); + CSFML_CALL(window, setSize(sf::Vector2u(size.x, size.y))); } //////////////////////////////////////////////////////////// -void sfWindow_SetTitle(sfWindow* window, const char* title) +void sfWindow_setTitle(sfWindow* window, const char* title) { - CSFML_CALL(window, SetTitle(title)); + CSFML_CALL(window, setTitle(title)); } //////////////////////////////////////////////////////////// -void sfWindow_SetIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels) +void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels) { - CSFML_CALL(window, SetIcon(width, height, pixels)); + CSFML_CALL(window, setIcon(width, height, pixels)); } //////////////////////////////////////////////////////////// -void sfWindow_SetVisible(sfWindow* window, sfBool visible) +void sfWindow_setVisible(sfWindow* window, sfBool visible) { - CSFML_CALL(window, SetVisible(visible == sfTrue)); + CSFML_CALL(window, setVisible(visible == sfTrue)); } //////////////////////////////////////////////////////////// -void sfWindow_SetMouseCursorVisible(sfWindow* window, sfBool visible) +void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible) { - CSFML_CALL(window, SetMouseCursorVisible(visible == sfTrue)); + CSFML_CALL(window, setMouseCursorVisible(visible == sfTrue)); } //////////////////////////////////////////////////////////// -void sfWindow_SetVerticalSyncEnabled(sfWindow* window, sfBool enabled) +void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled) { - CSFML_CALL(window, SetVerticalSyncEnabled(enabled == sfTrue)); + CSFML_CALL(window, setVerticalSyncEnabled(enabled == sfTrue)); } //////////////////////////////////////////////////////////// -void sfWindow_SetKeyRepeatEnabled(sfWindow* window, sfBool enabled) +void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled) { - CSFML_CALL(window, SetKeyRepeatEnabled(enabled == sfTrue)); + CSFML_CALL(window, setKeyRepeatEnabled(enabled == sfTrue)); } //////////////////////////////////////////////////////////// -sfBool sfWindow_SetActive(sfWindow* window, sfBool active) +sfBool sfWindow_setActive(sfWindow* window, sfBool active) { - CSFML_CALL_RETURN(window, SetActive(active == sfTrue), sfFalse); + CSFML_CALL_RETURN(window, setActive(active == sfTrue), sfFalse); } //////////////////////////////////////////////////////////// -void sfWindow_Display(sfWindow* window) +void sfWindow_display(sfWindow* window) { - CSFML_CALL(window, Display()); + CSFML_CALL(window, display()); } //////////////////////////////////////////////////////////// -void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit) +void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit) { - CSFML_CALL(window, SetFramerateLimit(limit)); + CSFML_CALL(window, setFramerateLimit(limit)); } //////////////////////////////////////////////////////////// -void sfWindow_SetJoystickThreshold(sfWindow* window, float threshold) +void sfWindow_setJoystickThreshold(sfWindow* window, float threshold) { - CSFML_CALL(window, SetJoystickThreshold(threshold)); + CSFML_CALL(window, setJoystickThreshold(threshold)); } //////////////////////////////////////////////////////////// -sfWindowHandle sfWindow_GetSystemHandle(const sfWindow* window) +sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window) { CSFML_CHECK_RETURN(window, NULL); - return (sfWindowHandle)window->This.GetSystemHandle(); + return (sfWindowHandle)window->This.getSystemHandle(); }